Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From d5aa34fa32b785c01a1e40848668ba6ff760a577 Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Fri, 13 Jul 2012 05:21:38 +0300
- Subject: [PATCH] Fix Shade of Akama
- ---
- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 142 +++++++++-----------
- 1 file changed, 63 insertions(+), 79 deletions(-)
- 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 630e444..adb728f 100644
- --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
- +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
- @@ -40,17 +40,17 @@ struct Location
- float x, y, o, z;
- };
- -/* Not used
- +
- static Location ChannelerLocations[]=
- {
- - {463.161285f, 401.219757f, 3.141592f, 0.0f},
- - {457.377625f, 391.227661f, 2.106461f, 0.0f},
- - {446.012421f, 391.227661f, 1.071904f, 0.0f},
- - {439.533783f, 401.219757f, 0.000000f, 0.0f},
- - {446.012421f, 411.211853f, 5.210546f, 0.0f},
- - {457.377625f, 411.211853f, 4.177494f, 0.0f}
- + {461.158600f, 403.238877f, 3.215190f, 118.537796f},
- + {456.694000f, 414.117004f, 4.258600f, 118.621002f},
- + {443.494995f, 413.972992f, 5.131270f, 118.621002f},
- + {438.278992f, 401.257996f, 0.017453f, 118.621002f},
- + {444.153015f, 389.213989f, 1.082100f, 118.621002f},
- + {458.346008f, 393.503998f, 2.283940f, 118.538002f}
- };
- -*/
- +
- static Location SpawnLocations[]=
- {
- @@ -261,7 +261,6 @@ public:
- DeathCount = 0;
- SummonTimer = 10000;
- - ReduceHealthTimer = 0;
- ResetTimer = 60000;
- DefenderTimer = 15000;
- @@ -279,6 +278,8 @@ public:
- instance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED);
- reseting = false;
- +
- + SummonChannelers();
- }
- void JustDied(Unit* /*killer*/)
- {
- @@ -295,35 +296,6 @@ public:
- summons.Despawn(summon);
- }
- - void MoveInLineOfSight(Unit* /*who*/)
- - {
- - if (!GridSearcherSucceeded)
- - {
- - FindChannelers();
- -
- - if (!Channelers.empty())
- - {
- - for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- - {
- - Creature* Channeler = (Unit::GetCreature(*me, *itr));
- - if (Channeler)
- - {
- - if (Channeler->isDead())
- - {
- - Channeler->RemoveCorpse();
- - Channeler->Respawn();
- - }
- -
- - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
- - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
- - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- - GridSearcherSucceeded = true;
- - }
- - }
- - } else sLog->outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
- - }
- - }
- -
- void AttackStart(Unit* who)
- {
- if (!who || IsBanished)
- @@ -385,23 +357,6 @@ public:
- }
- }
- - void FindChannelers()
- - {
- - std::list<Creature*> ChannelerList;
- - me->GetCreatureListWithEntryInGrid(ChannelerList, CREATURE_CHANNELER, 50.0f);
- -
- - if (!ChannelerList.empty())
- - {
- - for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
- - {
- - CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID();
- - Channelers.push_back((*itr)->GetGUID());
- - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID());
- - }
- - }
- - else sLog->outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy");
- - }
- -
- void SetSelectableChannelers()
- {
- if (Channelers.empty())
- @@ -415,6 +370,45 @@ public:
- Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
- + void SummonChannelers()
- + {
- + if(Channelers.empty())
- + {
- + for(int i = 0 ; i < 6; i++)
- + {
- + if(Creature* channeler = me->SummonCreature(CREATURE_CHANNELER,ChannelerLocations[i].x,ChannelerLocations[i].y,ChannelerLocations[i].z,ChannelerLocations[i].o))
- + {
- + CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, channeler->AI())->ShadeGUID = me->GetGUID();
- + Channelers.push_back(channeler->GetGUID());
- + ChannelersInit(channeler);
- + }
- + }
- + }
- + else
- + {
- + for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
- + {
- + if(Creature* Channeler = (Unit::GetCreature(*me,*itr)))
- + {
- + if (Channeler->isDead())
- + {
- + CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, Channeler->AI())->ShadeGUID = me->GetGUID();
- + Channeler->RemoveCorpse();
- + Channeler->Respawn();
- + }
- + ChannelersInit(Channeler);
- + }
- + }
- + }
- + }
- +
- + void ChannelersInit(Creature* Channeler)
- + {
- + Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
- + Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
- + Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- + }
- +
- void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; }
- void UpdateAI(const uint32 diff)
- @@ -424,8 +418,8 @@ public:
- if (IsBanished)
- {
- - // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
- - if (me->getThreatManager().getThreatList().size() < 2)
- + // Akama and channelers are set in the threatlist so when we reset, we make sure that he is not included in our check
- + if (me->getThreatManager().getThreatList().size() < 8)
- {
- EnterEvadeMode();
- return;
- @@ -487,20 +481,6 @@ public:
- }
- else // No longer banished, let's fight Akama now
- {
- - if (ReduceHealthTimer <= diff)
- - {
- - if (AkamaGUID)
- - {
- - Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
- - if (Akama && Akama->isAlive())
- - {
- - //10 % less health every few seconds.
- - me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- - ReduceHealthTimer = 12000;
- - }
- - }
- - } else ReduceHealthTimer -= diff;
- -
- if (HasKilledAkama)
- {
- if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug
- @@ -511,15 +491,18 @@ public:
- me->CombatStop();
- //me->SetFullHealth();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- - me->GetMotionMaster()->MoveTargetedHome();
- + EnterEvadeMode();
- }
- - if (ResetTimer <= diff)
- - {
- - EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama
- - return;
- - } else ResetTimer -= diff;
- }
- + if (ResetTimer <= diff)
- + {
- + Creature* Akama = Unit::GetCreature((*me), AkamaGUID);
- + me->Kill(Akama);
- + EnterEvadeMode(); //After 60 sec kill akama and reset event
- + return;
- + } else ResetTimer -= diff;
- +
- DoMeleeAttackIfReady();
- }
- }
- @@ -555,6 +538,7 @@ public:
- {
- player->CLOSE_GOSSIP_MENU();
- CAST_AI(npc_akama_shade::npc_akamaAI, creature->AI())->BeginEvent(player);
- +
- }
- return true;
- @@ -623,7 +607,7 @@ public:
- void Reset()
- {
- - DestructivePoisonTimer = 15000;
- + DestructivePoisonTimer = 5000;
- LightningBoltTimer = 10000;
- CheckTimer = 2000;
- @@ -876,7 +860,7 @@ public:
- Creature* Shade = Unit::GetCreature((*me), ShadeGUID);
- if (Shade && Shade->isAlive())
- DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
- - DestructivePoisonTimer = 15000;
- + DestructivePoisonTimer = 5000;
- } else DestructivePoisonTimer -= diff;
- if (LightningBoltTimer <= diff)
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment