Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class boss_paletress : public CreatureScript
- {
- public:
- boss_paletress() : CreatureScript("boss_paletress") { }
- struct boss_paletressAI : public ScriptedAI
- {
- boss_paletressAI(Creature* creature) : ScriptedAI(creature)
- {
- pInstance = creature->GetInstanceScript();
- MemoryGUID = 0;
- MyGUID 0;
- creature->RestoreFaction();
- creature->SetReactState(REACT_PASSIVE);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- InstanceScript* pInstance;
- Creature* pMemory;
- uint64 MemoryGUID;
- uint64 MyGUID;
- bool bHealth;
- bool bDone;
- uint32 uiHolyFireTimer;
- uint32 uiHolySmiteTimer;
- uint32 uiRenewTimer;
- uint32 uiResetTimer;
- void Reset()
- {
- me->RemoveAllAuras();
- uiHolyFireTimer = urand(9000,12000);
- uiHolySmiteTimer = urand(5000,7000);
- uiRenewTimer = urand(2000,5000);
- uiResetTimer = 7000;
- bHealth = false;
- bDone = false;
- Creature* pMemory = Unit::GetCreature(*me, MemoryGUID);
- if (pMemory && pMemory->isAlive())
- pMemory->RemoveFromWorld();
- }
- void SetData(uint32 uiId, uint32 /*uiValue*/)
- {
- if (uiId == 1)
- {
- me->RemoveAura(SPELL_SHIELD);
- DoScriptText(SAY_MEM_DIE, me);
- }
- }
- void DamageTaken(Unit* /*done_by*/, uint32 &damage)
- {
- if (damage >= me->GetHealth())
- {
- damage = 0;
- EnterEvadeMode();
- me->RestoreFaction();
- bDone = true;
- DoScriptText(SAY_DEATH_P, me);
- if (GameObject* GO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
- pInstance->HandleGameObject(GO->GetGUID(), true);
- if (GameObject* GO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1)))
- pInstance->HandleGameObject(GO->GetGUID(), true);
- pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
- // if (IsHeroic())
- // pInstance->DoCompleteAchievement(ACHIEV_CONF);
- }
- }
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_START_P, me);
- }
- void KilledUnit(Unit* /*pVictim*/)
- {
- DoScriptText(urand(0, 1) ? SAY_KILL1_P : SAY_KILL2_P, me);
- if (pInstance)
- pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, IN_PROGRESS);
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (bDone && uiResetTimer <= uiDiff)
- {
- me->GetMotionMaster()->MovePoint(0, 746.843f, 695.68f, 412.339f);
- pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
- me->DisappearAndDie();
- bDone = false;
- if (GameObject* GO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
- pInstance->HandleGameObject(GO->GetGUID(), true);
- }
- else
- uiResetTimer -= uiDiff;
- if (!UpdateVictim())
- return;
- // Holy Fire
- if (uiHolyFireTimer <= uiDiff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250, true);
- if (target && target->isAlive())
- DoCast(target, DUNGEON_MODE(SPELL_HOLY_FIRE,SPELL_HOLY_FIRE_H));
- if (me->HasAura(SPELL_SHIELD))
- uiHolyFireTimer = 13000;
- else
- uiHolyFireTimer = urand(9000,12000);
- }
- else
- uiHolyFireTimer -= uiDiff;
- // Holy Smite
- if (uiHolySmiteTimer <= uiDiff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250, true);
- if (target && target->isAlive())
- DoCast(target, DUNGEON_MODE(SPELL_SMITE,SPELL_SMITE_H));
- if (me->HasAura(SPELL_SHIELD))
- uiHolySmiteTimer = 9000;
- else
- uiHolySmiteTimer = urand(5000, 7000);
- }
- else
- uiHolySmiteTimer -= uiDiff;
- if (me->HasAura(SPELL_SHIELD))
- {
- // Renew
- if (uiRenewTimer <= uiDiff)
- {
- me->InterruptNonMeleeSpells(true);
- uint8 uiTarget = urand(0, 1);
- switch (uiTarget)
- {
- case 0:
- DoCast(me, DUNGEON_MODE(SPELL_RENEW,SPELL_RENEW_H));
- break;
- case 1:
- Creature *pMemory = Unit::GetCreature(*me, MemoryGUID);
- if (pMemory && pMemory->isAlive())
- DoCast(pMemory, DUNGEON_MODE(SPELL_RENEW,SPELL_RENEW_H));
- break;
- }
- uiRenewTimer = urand(15000,17000);
- }
- else
- uiRenewTimer -= uiDiff;
- }
- if (!bHealth && !HealthAbovePct(25))
- {
- bHealth = true;
- me->InterruptNonMeleeSpells(true);
- DoCastAOE(SPELL_HOLY_NOVA, false);
- DoCast(me, SPELL_SHIELD);
- DoCastAOE(SPELL_SUMMON_MEMORY, false);
- DoCastAOE(SPELL_CONFESS, false);
- uint8 memoryRand = urand(0, 24);
- sLog->outError("memory: %u", memoryRand);
- int16 memoryId;
- switch(memoryRand)
- {
- case 0:
- memoryId = MEMORY_ALGALON;
- break;
- case 1:
- memoryId = MEMORY_CHROMAGGUS;
- break;
- case 2:
- memoryId = MEMORY_CYANIGOSA;
- break;
- case 3:
- memoryId = MEMORY_DELRISSA;
- break;
- case 4:
- memoryId = MEMORY_ECK;
- break;
- case 5:
- memoryId = MEMORY_ENTROPIUS;
- break;
- case 6:
- memoryId = MEMORY_GRUUL;
- break;
- case 7:
- memoryId = MEMORY_HAKKAR;
- break;
- case 8:
- memoryId = MEMORY_HEIGAN;
- break;
- case 9:
- memoryId = MEMORY_HEROD;
- break;
- case 10:
- memoryId = MEMORY_HOGGER;
- break;
- case 11:
- memoryId = MEMORY_IGNIS;
- break;
- case 12:
- memoryId = MEMORY_ILLIDAN;
- break;
- case 13:
- memoryId = MEMORY_INGVAR;
- break;
- case 14:
- memoryId = MEMORY_KALITHRESH;
- break;
- case 15:
- memoryId = MEMORY_LUCIFRON;
- break;
- case 16:
- memoryId = MEMORY_MALCHEZAAR;
- break;
- case 17:
- memoryId = MEMORY_MUTANUS;
- break;
- case 18:
- memoryId = MEMORY_ONYXIA;
- break;
- case 19:
- memoryId = MEMORY_THUNDERAAN;
- break;
- case 20:
- memoryId = MEMORY_VANCLEEF;
- break;
- case 21:
- memoryId = MEMORY_VASHJ;
- break;
- case 22:
- memoryId = MEMORY_VEKNILASH;
- break;
- case 23:
- memoryId = MEMORY_VEZAX;
- break;
- case 24:
- memoryId = MEMORY_ARCHIMONDE;
- break;
- }
- sLog->outError("memory: %i", memoryId);
- me->SummonCreature(memoryId, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- }
- DoMeleeAttackIfReady();
- }
- void JustSummoned(Creature* summon)
- {
- MemoryGUID = summon->GetGUID();
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_paletressAI(creature);
- }
- };
- class npc_memory : public CreatureScript
- {
- public:
- npc_memory() : CreatureScript("npc_memory") { }
- struct npc_memoryAI : public ScriptedAI
- {
- npc_memoryAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 uiOldWoundsTimer;
- uint32 uiShadowPastTimer;
- uint32 uiWakingNightmare;
- void Reset()
- {
- uiOldWoundsTimer = 12000;
- uiShadowPastTimer = 5000;
- uiWakingNightmare = 7000;
- }
- void EnterCombat(Unit* /*who*/)
- {
- MyGUID = me->GetGUID;
- if (MyGUID != MemoryGUID)
- me->DespawnOrUnsummon;
- }
- void UpdateAI(const uint32 uiDiff)
- {
- if (!UpdateVictim())
- return;
- // Old Wounds
- if (uiOldWoundsTimer <= uiDiff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target && target->isAlive())
- DoCast(target, DUNGEON_MODE(SPELL_OLD_WOUNDS, SPELL_OLD_WOUNDS_H));
- uiOldWoundsTimer = 12000;
- }
- else
- uiOldWoundsTimer -= uiDiff;
- if (uiWakingNightmare <= uiDiff)
- {
- DoCast(me, DUNGEON_MODE(SPELL_WAKING_NIGHTMARE, SPELL_WAKING_NIGHTMARE_H));
- uiWakingNightmare = 7000;
- }
- else
- uiWakingNightmare -= uiDiff;
- // Shadows of the Past
- if (uiShadowPastTimer <= uiDiff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
- if (target && target->isAlive())
- DoCast(target, DUNGEON_MODE(SPELL_SHADOWS_PAST,SPELL_SHADOWS_PAST_H));
- uiShadowPastTimer = 5000;
- }
- else
- uiShadowPastTimer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- void JustDied(Unit* /*pKiller*/)
- {
- if (me->isSummon())
- {
- Unit* pSummoner = me->ToTempSummon()->GetSummoner();
- if (pSummoner && pSummoner->isAlive())
- pSummoner->GetAI()->SetData(1, 0);
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_memoryAI(creature);
- }
- };
Add Comment
Please, Sign In to add comment