void TeleportToMyBrother() { if (!m_pInstance) return; Teleport_Timer = TELEPORTTIME; if (IAmVeklor()) return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL); float other_x = pOtherBoss->GetPositionX(); float other_y = pOtherBoss->GetPositionY(); float other_z = pOtherBoss->GetPositionZ(); float other_o = pOtherBoss->GetOrientation(); pOtherBoss->RelocateCreature(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); pOtherBoss->GetMotionMaster()->MoveIdle(); m_creature->RelocateCreature(other_x, other_y, other_z, other_o); m_creature->GetMotionMaster()->MoveIdle(); SetAfterTeleport(); if (boss_twinemperorsAI* pOtherAI = dynamic_cast<boss_twinemperorsAI*>(pOtherBoss->AI())) pOtherAI->SetAfterTeleport(); } }
void TeleportToMyBrother() { if (!pInstance) return; Teleport_Timer = TELEPORTTIME; if (IAmVeklor()) return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); float other_x = pOtherBoss->GetPositionX(); float other_y = pOtherBoss->GetPositionY(); float other_z = pOtherBoss->GetPositionZ(); float other_o = pOtherBoss->GetOrientation(); Map *thismap = me->GetMap(); thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o); SetAfterTeleport(); CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); } }
Creature* GetOtherBoss() { if (instance) return Unit::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); else return NULL; }
Creature* GetOtherBoss() { if (pInstance) return (Creature*)Unit::GetUnit((*me), pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); else return (Creature*)0; }
Creature *GetOtherBoss() { if (pInstance) return Unit::GetCreature(*me, pInstance->GetData64(IAmVeklor() ? BOSS_VEKNILASH : BOSS_VEKLOR)); else return NULL; }
void TeleportToMyBrother() { if (!instance) return; Teleport_Timer = TELEPORTTIME; if (IAmVeklor()) return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates Creature* pOtherBoss = GetOtherBoss(); if (pOtherBoss) { //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); Position thisPos; thisPos.Relocate(me); Position otherPos; otherPos.Relocate(pOtherBoss); pOtherBoss->SetPosition(thisPos); me->SetPosition(otherPos); SetAfterTeleport(); CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); } }
Creature* GetOtherBoss() { if (m_pInstance) { return m_pInstance->GetSingleCreatureFromStorage(IAmVeklor() ? NPC_VEKNILASH : NPC_VEKLOR); } else { return NULL; } }
Creature *GetOtherBoss() { if (m_pInstance) { return (Creature *)Unit::GetUnit((*m_creature), m_pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); } else { return (Creature *)0; } }
void JustDied(Unit* /*Killer*/) { Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { pOtherBoss->SetHealth(0); pOtherBoss->setDeathState(JUST_DIED); pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; } if (!DontYellWhenDead) // I hope AI is not threaded DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); }
void TryHealBrother(uint32 diff) { if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it return; if (Heal_Timer <= diff) { Unit *pOtherBoss = GetOtherBoss(); if (pOtherBoss && pOtherBoss->IsWithinDist(me, 60)) { DoCast(pOtherBoss, SPELL_HEAL_BROTHER); Heal_Timer = 1000; } } else Heal_Timer -= diff; }
void EnterCombat(Unit * who) { DoZoneInCombat(); Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { // TODO: we should activate the other boss location so he can start attackning even if nobody // is near I dont know how to do that ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); if (!pOtherBoss->isInCombat()) { DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); otherAI->AttackStart(who); otherAI->DoZoneInCombat(); } } }
void TryHealBrother(uint32 diff) { if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it return; if (Heal_Timer < diff) { Unit *pOtherBoss = GetOtherBoss(); if (pOtherBoss && (pOtherBoss->GetDistance((const Creature *)m_creature) <= 60)) { DoCast(pOtherBoss, SPELL_HEAL_BROTHER); Heal_Timer = 1000; } } else Heal_Timer -= diff; }
void Aggro(Unit* pWho) { m_creature->SetInCombatWithZone(); Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { // TODO: we should activate the other boss location so he can start attackning even if nobody // is near I dont know how to do that if (!pOtherBoss->isInCombat()) { DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); pOtherBoss->AI()->AttackStart(pWho); } } }
void Aggro(Unit* pWho) { Creature *pOtherBoss = GetOtherBoss(); if (pOtherBoss) { // TODO: we should activate the other boss location so he can start attackning even if nobody // is near I dont know how to do that if (!pOtherBoss->isInCombat()) { DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); pOtherBoss->AI()->AttackStart(pWho); } } if (m_pInstance) m_pInstance->SetData(TYPE_TWINS, IN_PROGRESS); }
void JustDied(Unit* Killer) { if (Creature* pOtherBoss = GetOtherBoss()) { pOtherBoss->SetHealth(0); pOtherBoss->SetDeathState(JUST_DIED); pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); if (boss_twinemperorsAI* pOtherAI = dynamic_cast<boss_twinemperorsAI*>(pOtherBoss->AI())) pOtherAI->DontYellWhenDead = true; } if (!DontYellWhenDead) // I hope AI is not threaded DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); if (m_pInstance) m_pInstance->SetData(TYPE_TWINS, DONE); }
void HandleBugs(uint32 diff) { if (BugsTimer < diff || Abuse_Bug_Timer < diff) { Creature *c = RespawnNearbyBugsAndGetOne(IAmVeklor() ? 15316 : 15317); if (Abuse_Bug_Timer < diff) { if (c) { CastSpellOnBug(c); if (m_creature->getVictim()) { c->Attack(m_creature->getVictim(), false); c->GetMotionMaster()->MoveChase(m_creature->getVictim()); } Abuse_Bug_Timer = urand(10000, 17000); } else { Abuse_Bug_Timer = 1000; } } else { Abuse_Bug_Timer -= diff; } BugsTimer = 2000; } else { BugsTimer -= diff; Abuse_Bug_Timer -= diff; } }
void KilledUnit(Unit* /*victim*/) { DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); }
Creature* GetOtherBoss() { return ObjectAccessor::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); }
void KilledUnit(Unit* victim) { DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); }