void DoAction(const int32 param) { if (!me->isAlive()) return; switch (param) { case ACTION_WATER_ELEMENT_HIT: me->ModifyHealth(int32(me->CountPctFromMaxHealth(1))); if (bIsExploded) DoExplodeCompleted(); dehydration = false; break; case ACTION_WATER_ELEMENT_KILLED: uint32 damage = me->CountPctFromMaxHealth(3); if (me->GetHealth() > damage) { me->ModifyHealth(-int32(damage)); me->LowerPlayerDamageReq(damage); } break; } }
void DoAction(int32 param) { if (!me->IsAlive()) return; switch(param) { case ACTION_WATER_ELEMENT_HIT: if (pInstance) pInstance->SetData(DATA_ACHIEV, 0); me->ModifyHealth(int32(me->CountPctFromMaxHealth(1))); if (bIsExploded) DoExplodeCompleted(); break; case ACTION_WATER_ELEMENT_KILLED: uint32 damage = me->CountPctFromMaxHealth(3); damage = std::min(damage, me->GetHealth()-1); me->ModifyHealth(-int32(damage)); me->LowerPlayerDamageReq(damage); break; } }
void UpdateAI(uint32 uiDiff) { if (!UpdateVictim()) return; if (!bIsFrenzy && !bIsExploded && HealthBelowPct(25)) { Talk(SAY_ENRAGE); me->CastSpell(me, SPELL_FRENZY, true); bIsFrenzy = true; } if (!bIsFrenzy) { if (!bIsExploded) { if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE)) { me->InterruptNonMeleeSpells(false); Talk(SAY_SHATTER); DoZoneInCombat(); IchoronDoCastToAllHostilePlayers(SPELL_WATER_BLAST, true); me->CastSpell(me, SPELL_DRAINED, true); bIsExploded = true; uiDrainedTimer = 15000; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(11686); for (uint8 i=0; i<MAX_SPAWN_LOC; ++i) { float angle = rand_norm()*2*M_PI; Position p1(SpawnLoc[i]), p2(SpawnLoc[i]); p1.m_positionX += 2.5f*cos(angle); p1.m_positionY += 2.5f*sin(angle); p2.m_positionX -= 2.5f*cos(angle); p2.m_positionY -= 2.5f*sin(angle); DoSummon(NPC_ICHOR_GLOBULE, p1, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN); DoSummon(NPC_ICHOR_GLOBULE, p2, 60000, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN); } } } else { if (uiDrainedTimer <= uiDiff) DoExplodeCompleted(); else { uiDrainedTimer -= uiDiff; bool bIsWaterElementsAlive = false; if (!globules.empty()) { for (std::list<uint64>::const_iterator itr = globules.begin(); itr != globules.end(); ++itr) if (Creature* pTemp = ObjectAccessor::GetCreature(*me, *itr)) if (pTemp->IsAlive()) { bIsWaterElementsAlive = true; break; } } if (!bIsWaterElementsAlive) DoExplodeCompleted(); } } } if (!bIsExploded) { if (uiWaterBoltVolleyTimer <= uiDiff) { me->CastSpell((Unit*)NULL, SPELL_WATER_BOLT_VOLLEY, false); uiWaterBoltVolleyTimer = urand(10000, 15000); } else uiWaterBoltVolleyTimer -= uiDiff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded) { DoScriptText(SAY_ENRAGE, me); DoCast(me, SPELL_FRENZY, true); bIsFrenzy = true; } if (!bIsFrenzy) { if (uiBubbleCheckerTimer <= uiDiff) { if (!bIsExploded) { if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0)) { DoScriptText(SAY_SHATTER, me); DoCast(me, SPELL_WATER_BLAST); DoCast(me, SPELL_DRAINED); bIsExploded = true; me->AttackStop(); me->SetVisible(false); for (uint8 i = 0; i < 10; i++) { int tmp = urand(0, MAX_SPAWN_LOC-1); me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN); } } } else { bool bIsWaterElementsAlive = false; if (!m_waterElements.empty()) { for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr) if (Creature* temp = Unit::GetCreature(*me, *itr)) if (temp->isAlive()) { bIsWaterElementsAlive = true; break; } } if (!bIsWaterElementsAlive) DoExplodeCompleted(); } uiBubbleCheckerTimer = 1000; } else uiBubbleCheckerTimer -= uiDiff; } if (!bIsExploded) { if (uiWaterBoltVolleyTimer <= uiDiff) { DoCast(me, SPELL_WATER_BOLT_VOLLEY); uiWaterBoltVolleyTimer = urand(10000, 15000); } else uiWaterBoltVolleyTimer -= uiDiff; DoMeleeAttackIfReady(); } }