void SummonInfernal(const uint32 /*diff*/) { InfernalPoint *point = NULL; Position pos; if ((me->GetMapId() != 532) || positions.empty()) pos = me->GetRandomNearPosition(60); else { point = Trinity::Containers::SelectRandomContainerElement(positions); pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2))); } Creature* infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000); if (infernal) { infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); infernal->setFaction(me->getFaction()); if (point) ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->point = point; ENSURE_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->malchezaar = me->GetGUID(); infernals.push_back(infernal->GetGUID()); DoCast(infernal, SPELL_INFERNAL_RELAY); } Talk(SAY_SUMMON); }
void JustSummoned(Creature* summoned) override { m_skeletons.push_back(summoned->GetObjectGuid()); if (m_creature->getVictim()) summoned->AI()->AttackStart(m_creature->getVictim()); }
void JustSummoned(Creature* pSummoned) override { if (pSummoned->GetEntry() == NPC_SNOBOLD_VASSAL) { m_vSnoboldGuidsVector.push_back(pSummoned->GetObjectGuid()); ++m_uiSnoboldsBoarded; } }
void JustSummoned(Creature* pSummoned) override { switch (pSummoned->GetEntry()) { case NPC_HEARTHEN_GUARD: case NPC_SHARPSHOOTER_GUARD: case NPC_REAVER_GUARD: if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) { pSummoned->AI()->AttackStart(pTarget); } m_vAddGuids.push_back(pSummoned->GetObjectGuid()); break; case NPC_SHATTERED_ASSASSIN: m_vAssassinGuids.push_back(pSummoned->GetObjectGuid()); break; } }
void Summon() { m_uiLocNo = 0; for(uint8 i = 0; i < 16; i++) { switch(urand(0,3)) { case 0: switch(urand(1, 3)) { case 1: pSummon = NPC_DARK_1; break; case 2: pSummon = NPC_DARK_3; break; case 3: pSummon = NPC_DARK_6; break; } break; case 1: switch(urand(1, 3)) { case 1: pSummon = NPC_DARK_2; break; case 2: pSummon = NPC_DARK_3; break; case 3: pSummon = NPC_DARK_4; break; } break; case 2: switch(urand(1, 3)) { case 1: pSummon = NPC_DARK_2; break; case 2: pSummon = NPC_DARK_5; break; case 3: pSummon = NPC_DARK_6; break; } break; case 3: switch(urand(1, 3)) { case 1: pSummon = NPC_DARK_1; break; case 2: pSummon = NPC_DARK_5; break; case 3: pSummon = NPC_DARK_4; break; } break; } if(Creature* Summon = m_creature->SummonCreature(pSummon, SpawnLoc[m_uiLocNo].x, SpawnLoc[m_uiLocNo].y, SpawnLoc[m_uiLocNo].z, SpawnLoc[m_uiLocNo].o, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000)) { m_uiSummonGUID.push_back(Summon->GetObjectGuid()); Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Summon->setFaction(974); } m_uiLocNo++; } }
void EnterCombat(Unit* /*who*/) override { for (uint32 i = 0; i < POS_LIVE; ++i) if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) LiveTriggerGUID.push_back(trigger->GetGUID()); for (uint32 i = 0; i < POS_DEAD; ++i) if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) DeadTriggerGUID.push_back(trigger->GetGUID()); if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD) { TC_LOG_ERROR("scripts", "Script Gothik: cannot summon triggers!"); EnterEvadeMode(); return; } _EnterCombat(); waveCount = 0; events.ScheduleEvent(EVENT_SUMMON, 30000); DoTeleportTo(PosPlatform); Talk(SAY_SPEECH); instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY); }
void DoSetupAdds() { m_uiSetupAddsTimer = 0; if (!m_pInstance) return; GuidList lAddGuids; m_pInstance->GetKelidanAddList(lAddGuids); // Sort Adds to vector if not already done if (!lAddGuids.empty()) { m_vAddGuids.reserve(lAddGuids.size()); std::list<Creature*> lAdds; for (GuidList::const_iterator itr = lAddGuids.begin(); itr != lAddGuids.end(); ++itr) { if (Creature* pAdd = m_pInstance->instance->GetCreature(*itr)) lAdds.push_back(pAdd); } // Sort them by angle lAdds.sort(SortByAngle(m_creature)); for (std::list<Creature*>::const_iterator itr = lAdds.begin(); itr != lAdds.end(); ++itr) m_vAddGuids.push_back((*itr)->GetObjectGuid()); } // Respawn killed adds and reset counter m_uiKilledAdds = 0; for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr) { Creature* pAdd = m_pInstance->instance->GetCreature(*itr); if (pAdd && !pAdd->isAlive()) pAdd->Respawn(); } // Cast pentagram uint8 s = m_vAddGuids.size(); for (uint8 i = 0; i < s; ++i) { Creature* pCaster = m_pInstance->instance->GetCreature(m_vAddGuids[i]); Creature* pTarget = m_pInstance->instance->GetCreature(m_vAddGuids[(i + 2) % s]); if (pCaster && pTarget) pCaster->CastSpell(pTarget, SPELL_CHANNELING, TRIGGERED_NONE); } m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); }
void JustSummoned(Creature* pSummoned) override { if (pSummoned->GetEntry() == NPC_BIG_WILL) { m_bigWillGuid = pSummoned->GetObjectGuid(); pSummoned->setFaction(FACTION_FRIENDLY); pSummoned->SetWalk(false); pSummoned->GetMotionMaster()->MovePoint(1, aAffrayChallengerLoc[7][0], aAffrayChallengerLoc[7][1], aAffrayChallengerLoc[7][2]); } else { pSummoned->setFaction(FACTION_FRIENDLY); pSummoned->HandleEmote(EMOTE_ONESHOT_ROAR); m_vAffrayChallengerGuidsVector.push_back(pSummoned->GetObjectGuid()); } }
void JustSummoned(Creature* pSummoned) override { switch (pSummoned->GetEntry()) { case NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT: // Note: this should be moved to database pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pSummoned->CastSpell(pSummoned, SPELL_SPOTLIGHT, TRIGGERED_NONE); m_vSpotLightsGuidVector.push_back(pSummoned->GetObjectGuid()); break; case NPC_SOLARIUM_AGENT: case NPC_SOLARIUM_PRIEST: if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, nullptr, SELECT_FLAG_PLAYER)) { pSummoned->AI()->AttackStart(pTarget); pSummoned->AddThreat(pTarget, 100000.f); // explicitly used in script without spell } break; } }
void UpdateAI(const uint32 uiDiff) override { if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; if (m_creature->HasAura(SPELL_PLANAR_SHIFT)) return; if (m_creature->GetHealthPercent() < m_fHpPercent) { if (DoCastSpellIfCan(m_creature, SPELL_PLANAR_SHIFT) == CAST_OK) { // Get all the vehicle entries which are in combat with the boss m_vAnomalyTargets.clear(); m_uiAnomalyTargetIndex = 0; ThreatList const& threatList = m_creature->getThreatManager().getThreatList(); for (ThreatList::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) { if (Unit* pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid())) { if (pTarget->GetEntry() == NPC_RUBY_DRAKE || pTarget->GetEntry() == NPC_AMBER_DRAKE || pTarget->GetEntry() == NPC_EMERALD_DRAKE) m_vAnomalyTargets.push_back(pTarget->GetObjectGuid()); } } // This will summon an anomaly for each player (vehicle) DoCastSpellIfCan(m_creature, SPELL_PLANAR_ANOMALIES, CAST_TRIGGERED); switch (urand(0, 2)) { case 0: DoScriptText(SAY_ARCANE_SHIELD, m_creature); break; case 1: DoScriptText(SAY_FIRE_SHIELD, m_creature); break; case 2: DoScriptText(SAY_NATURE_SHIELD, m_creature); break; } DoScriptText(EMOTE_ASTRAL_PLANE, m_creature); // set next phase to 20% m_fHpPercent -= 40; } } if (m_uiArcaneBarrageTimer < uiDiff) { if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) { if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_ARCANE_BARRAGE : SPELL_ARCANE_BARRAGE_H) == CAST_OK) m_uiArcaneBarrageTimer = urand(2000, 3000); } } else m_uiArcaneBarrageTimer -= uiDiff; if (m_uiSummonWhelpsTimer < uiDiff) { // ToDo: the number of whelps summoned may be different based on difficulty. Needs research! for (uint8 i = 0; i < 4; ++i) { if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_LEY_WHELP, CAST_TRIGGERED) == CAST_OK) m_uiSummonWhelpsTimer = 20000; } } else m_uiSummonWhelpsTimer -= uiDiff; if (m_uiArcaneVolleyTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY_H) == CAST_OK) m_uiArcaneVolleyTimer = urand(10000, 15000); } else m_uiArcaneVolleyTimer -= uiDiff; if (m_uiEnrageTimer < uiDiff) { if (DoCastSpellIfCan(m_creature, SPELL_ENRAGED_ASSAULT) == CAST_OK) { DoScriptText(SAY_FRENZY, m_creature); m_uiEnrageTimer = urand(40000, 50000); } } else m_uiEnrageTimer -= uiDiff; }