100 float dPercent = ((float)damage) / ((
float)
me->GetMaxHealth());
101 int odmg = (int)(dPercent * ((
float)pOtherBoss->
GetMaxHealth()));
102 int ohealth = pOtherBoss->
GetHealth()-odmg;
103 pOtherBoss->
SetHealth(ohealth > 0 ? ohealth : 0);
160 float mult = ((float)mytotal) / ((
float)histotal);
163 #define HEAL_BROTHER_AMOUNT 30000.0f
166 if (mytotal > histotal)
168 uint32 h =
me->GetHealth()+largerAmount;
169 me->SetHealth(std::min(mytotal, h));
174 pOtherBoss->
SetHealth(std::min(histotal, h));
213 me->SetPosition(otherPos);
222 me->InterruptNonMeleeSpells(
false);
249 if (
Unit* nearu =
me->SelectNearestTarget(100))
253 me->AddThreat(nearu, 10000);
281 if (!who ||
me->GetVictim())
284 if (
me->CanCreatureAttack(who))
286 float attackRadius =
me->GetAttackDistance(who);
287 if (attackRadius < 50.0f)
288 attackRadius = 50.0f;
289 if (
me->IsWithinDistInMap(who, attackRadius) &&
me->GetDistanceZ(who) <= 7 )
300 std::list<Creature*> lUnitList;
301 me->GetCreatureListWithEntryInGrid(lUnitList, 15316, 150.0f);
302 me->GetCreatureListWithEntryInGrid(lUnitList, 15317, 150.0f);
304 if (lUnitList.empty())
309 for (std::list<Creature*>::const_iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter)
322 if (!nearb || (rand()%4) == 0)
364 if (!
me->IsNonMeleeSpellCasted(
true))
417 target->setFaction(14);
418 target->AI()->AttackStart(
me->getThreatManager().getHostilTarget());
420 target->SetFullHealth();
515 target->setFaction(14);
517 target->SetFullHealth();
537 if (!
me->IsWithinDist(
me->GetVictim(), 45.0f))
586 if (who->isTargetableForAttack())
589 if (
me->Attack(who,
false))
592 me->AddThreat(who, 0.0f);
#define NOMINAL_MELEE_RANGE
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_MAGIC
@ OBJECT_FIELD_DYNAMIC_FLAGS
#define HEAL_BROTHER_AMOUNT
@ SPELL_UNBALANCING_STRIKE
@ SPELL_TWIN_TELEPORT_VISUAL
void AddSC_boss_twinemperors()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
void Respawn(bool force=false)
void SetPosition(float x, float y, float z, float o)
void setDeathState(DeathState s) OVERRIDE
CreatureScript(const char *name)
void SetFlag(uint16 index, uint32 newFlag)
void DoMeleeAttackIfReady()
void DoCast(uint32 spellId)
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
void DoCastVictim(uint32 spellId, bool triggered=false)
void setFaction(uint32 faction)
uint32 GetMaxHealth() const
void SetHealth(uint32 val)
static Creature * GetCreature(WorldObject &object, uint64 guid)
virtual void setDeathState(DeathState s)
InstanceScript * GetInstanceScript()
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
void Relocate(float x, float y)
ScriptedAI(Creature *creature)
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
void AttackStart(Unit *) OVERRIDE
void HandleBugs(uint32 diff)
bool TryActivateAfterTTelep(uint32 diff)
void MoveInLineOfSight(Unit *who) OVERRIDE
InstanceScript * instance
void EnterCombat(Unit *who) OVERRIDE
void CheckEnrage(uint32 diff)
Creature * RespawnNearbyBugsAndGetOne()
virtual void CastSpellOnBug(Creature *target)=0
uint32 AfterTeleportTimer
void TryHealBrother(uint32 diff)
Creature * GetOtherBoss()
void KilledUnit(Unit *) OVERRIDE
void JustDied(Unit *) OVERRIDE
void SpellHit(Unit *caster, const SpellInfo *entry) OVERRIDE
virtual bool IAmVeklor()=0
void TeleportToMyBrother()
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
boss_twinemperorsAI(Creature *creature)
void CastSpellOnBug(Creature *target) OVERRIDE
boss_veklorAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void AttackStart(Unit *who) OVERRIDE
bool IAmVeklor() OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void CastSpellOnBug(Creature *target) OVERRIDE
uint32 UnbalancingStrike_Timer
boss_veknilashAI(Creature *creature)
bool IAmVeklor() OVERRIDE