void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; /*START ACID-AI*/ if (uiThrashTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_THRASH); uiThrashTimer = urand(6000, 15500); } else uiThrashTimer -= uiDiff; if (uiSlamTimer <= uiDiff) { if (bCheckChances()) DoCast(me->getVictim(), SPELL_SMITE_SLAM); uiSlamTimer = 11000; } else uiSlamTimer -= uiDiff; if (uiNimbleReflexesTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_NIMBLE_REFLEXES); uiNimbleReflexesTimer = urand(27300, 60100); } else uiNimbleReflexesTimer -= uiDiff; /*END ACID-AI*/ if ((uiHealth == 0 && !HealthAbovePct(66)) || (uiHealth == 1 && !HealthAbovePct(33))) { ++uiHealth; if(uiHealth == 1) DoScriptText(SAY_PHASE_2, me); if(uiHealth == 2) DoScriptText(SAY_PHASE_3, me); DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (instance) if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, 1.1508f, -780.1147f, go->GetPositionZ()); } } if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: me->AttackStop(); me->SetStandState(UNIT_STAND_STATE_KNEEL); uiTimer = 1500; uiPhase = 2; uiThrashTimer = urand(5000, 9000); uiSlamTimer = 9000; uiNimbleReflexesTimer = urand(15500, 31600); break; case 2: if (uiHealth == 1) SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); else SetEquipmentSlots(false, EQUIP_ID_HAMMER, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); uiTimer = 1500; uiPhase = 3; break; case 3: me->SetStandState(UNIT_STAND_STATE_STAND); SetCombatMovement(true); me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); uiPhase = 0; break; } } else uiTimer -= uiDiff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 Diff) { if (!UpdateVictim()) return; /* Start DarkCore AI */ if (TrashTimer <= Diff) { if (bCheckChances()) DoCast(me, SPELL_TRASH); TrashTimer = urand(6000, 15500); } else TrashTimer -= Diff; if (SlamTimer <= Diff) { if (bCheckChances()) DoCast(me->getVictim(), SPELL_SMITE_SLAM); SlamTimer = 11000; } else SlamTimer -= Diff; if (NimbleReflexesTimer <= Diff) { if (bCheckChances()) DoCast(me, SPELL_NIMBLE_REFLEXES); NimbleReflexesTimer = urand(27300, 60100); } else NimbleReflexesTimer -= Diff; /*END DarkCore AI*/ if ((Health == 0 && !HealthAbovePct(66)) || (Health == 1 && !HealthAbovePct(33))) { ++Health; DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (instance) if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); } } if (Phase) { if (Timer <= Diff) { switch (Phase) { case 1: me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //doesn't work? Timer = 1000; Phase = 2; break; case 2: if (Health == 1) SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); else SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); Timer = 500; Phase = 3; break; case 3: SetCombatMovement(true); me->GetMotionMaster()->MoveChase(me->getVictim(), me->_CombatDistance); Phase = 0; break; } } else Timer -= Diff; } DoMeleeAttackIfReady(); }
void UpdateAI(uint32 uiDiff) override { if (!UpdateVictim()) return; /*START ACID-AI*/ if (uiTrashTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_TRASH); uiTrashTimer = urand(6000, 15500); } else uiTrashTimer -= uiDiff; if (uiSlamTimer <= uiDiff) { if (bCheckChances()) DoCastVictim(SPELL_SMITE_SLAM); uiSlamTimer = 11000; } else uiSlamTimer -= uiDiff; if (uiNimbleReflexesTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_NIMBLE_REFLEXES); uiNimbleReflexesTimer = urand(27300, 60100); } else uiNimbleReflexesTimer -= uiDiff; /*END ACID-AI*/ if ((uiHealth == 0 && !HealthAbovePct(66)) || (uiHealth == 1 && !HealthAbovePct(33))) { ++uiHealth; DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); } } if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work? uiTimer = 1000; uiPhase = 2; break; case 2: if (uiHealth == 1) SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); else SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); uiTimer = 500; uiPhase = 3; break; case 3: SetCombatMovement(true); me->GetMotionMaster()->MoveChase(me->GetVictim(), me->m_CombatDistance); uiPhase = 0; break; } } else uiTimer -= uiDiff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; if (!uiIsMoving) // halt abilities in between phases { if (uiTrashTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_TRASH); uiTrashTimer = urand(6000, 15500); } else uiTrashTimer -= uiDiff; if (uiSlamTimer <= uiDiff) { if (bCheckChances()) DoCastVictim(SPELL_SMITE_SLAM); uiSlamTimer = 11000; } else uiSlamTimer -= uiDiff; if (uiNimbleReflexesTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_NIMBLE_REFLEXES); uiNimbleReflexesTimer = urand(27300, 60100); } else uiNimbleReflexesTimer -= uiDiff; } if ((uiHealth == 0 && HealthBelowPct(66)) || (uiHealth == 1 && HealthBelowPct(33))) { ++uiHealth; DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); me->AttackStop(); me->InterruptNonMeleeSpells(false); me->SetReactState(REACT_PASSIVE); uiTimer = 2500; uiPhase = 1; switch (uiHealth) { case 1: DoScriptText(SAY_PHASE_1, me); break; case 2: DoScriptText(SAY_PHASE_2, me); break; } } if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: { if (uiIsMoving) break; me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, 1.37994f, -780.29f, 9.81929f); uiIsMoving = true; break; } case 2: if (uiHealth == 1) { me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, EQUIP_AXE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, EQUIP_AXE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO + 2, AXE_EQUIP_INFO); } else { me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, EQUIP_MACE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, MACE_EQUIP_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + 1, 0); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO + 2, 0); } uiTimer = 500; uiPhase = 3; break; case 3: me->SetStandState(UNIT_STAND_STATE_STAND); uiTimer = 750; uiPhase = 4; break; case 4: me->SetReactState(REACT_AGGRESSIVE); SetCombatMovement(true); me->GetMotionMaster()->MoveChase(me->GetVictim(), me->m_CombatDistance); uiIsMoving = false; uiPhase = 0; break; } } else uiTimer -= uiDiff; } DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: me->GetMotionMaster()->MovePoint(1,1.37994,-780.29,9.81929); uiPhase = 2; break; case 3: me->SetStandState(UNIT_STAND_STATE_KNEEL); uiTimer = 2000; uiPhase = 4; break; case 4: if (uiHealth == 1) { me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, EQUIP_AXE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, AXE_EQUIP_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, EQUIP_AXE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, AXE_EQUIP_INFO); } else { me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, EQUIP_MACE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, MACE_EQUIP_INFO); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY+1, 0); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, 0); } me->SetStandState(UNIT_STAND_STATE_STAND); uiTimer = 1000; uiPhase = 5; break; case 5: SetCombatMovement(true); me->AI()->AttackStart(me->getVictim()); me->SetReactState(REACT_AGGRESSIVE); me->SetStandState(UNIT_STAND_STATE_STAND); me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); uiPhase = 0; break; } } else uiTimer -= uiDiff; } if (uiPhase) return; /*START ACID-AI*/ if (uiTrashTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_TRASH); uiTrashTimer = urand(6000,15500); } else uiTrashTimer -= uiDiff; if (uiSlamTimer <= uiDiff) { if (bCheckChances()) DoCast(me->getVictim(), SPELL_SMITE_SLAM); uiSlamTimer = 11000; } else uiSlamTimer -= uiDiff; if (uiNimbleReflexesTimer <= uiDiff) { if (bCheckChances()) DoCast(me, SPELL_NIMBLE_REFLEXES); uiNimbleReflexesTimer = urand(27300,60100); } else uiNimbleReflexesTimer -= uiDiff; /*END ACID-AI*/ if ((uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66) || (uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33)) { DoCastAOE(SPELL_SMITE_STOMP, false); if (uiHealth == 0) DoScriptText(SAY_PHASE_1, me); else DoScriptText(SAY_PHASE_2, me); ++uiHealth; SetCombatMovement(false); me->GetMotionMaster()->Clear(); me->AttackStop(); me->SetReactState(REACT_PASSIVE); uiPhase = 1; uiTimer = 2500; } else DoMeleeAttackIfReady(); }
void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; /*START ACID-AI*/ if (uiTrashTimer <= uiDiff) { if (bCheckChances()) DoCast(m_creature, SPELL_TRASH); uiTrashTimer = urand(6000,15500); } else uiTrashTimer -= uiDiff; if (uiSlamTimer <= uiDiff) { if (bCheckChances()) DoCast(m_creature->getVictim(), SPELL_SMITE_SLAM); uiSlamTimer = 11000; } else uiSlamTimer -= uiDiff; if (uiNimbleReflexesTimer <= uiDiff) { if (bCheckChances()) DoCast(m_creature, SPELL_NIMBLE_REFLEXES); uiNimbleReflexesTimer = urand(27300,60100); } else uiNimbleReflexesTimer -= uiDiff; /*END ACID-AI*/ if (uiHealth == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66 || uiHealth == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33) { ++uiHealth; DoCastAOE(SPELL_SMITE_STOMP,false); SetCombatMovement(false); if (pInstance) if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_SMITE_CHEST))) { m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ()); } } if (uiPhase) { if (uiTimer <= uiDiff) { switch (uiPhase) { case 1: m_creature->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work? uiTimer = 1000; uiPhase = 2; break; case 2: if (uiHealth == 1) SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); else SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); uiTimer = 500; uiPhase = 3; break; case 3: SetCombatMovement(true); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), me->m_CombatDistance); uiPhase = 0; break; } } else uiTimer -= uiDiff; } DoMeleeAttackIfReady(); }