void HandleSpikes(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); if (Creature* marrowgar = GetCaster()->ToCreature()) { bool didHit = false; CreatureAI* marrowgarAI = marrowgar->AI(); uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1); for (uint8 i = 0; i < boneSpikeCount; ++i) { // select any unit but not the tank Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 150.0f, true, -SPELL_IMPALED); if (!target) break; if (target->HasAura(SPELL_TANK_MARKER)) target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 150.0f, true, -SPELL_IMPALED); else { didHit = true; target->CastCustomSpell(BoneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true); } } if (didHit) marrowgarAI->Talk(SAY_BONESPIKE); } }
void HandleSpikes(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); if (Creature* marrowgar = GetCaster()->ToCreature()) { CreatureAI* marrowgarAI = marrowgar->AI(); uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1); for (uint8 i = 0; i < boneSpikeCount; ++i) { // select any unit but not the tank Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_IMPALED); // try the tank only in first iteration if (!target && !i) target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_IMPALED); if (!target) return; target->CastCustomSpell(boneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true); } marrowgarAI->Talk(SAY_BONESPIKE); } }
void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); if (Creature* marrowgar = GetCaster()->ToCreature()) { CreatureAI* marrowgarAI = marrowgar->AI(); bool yell = false; uint8 boneSpikeCount = GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1; for (uint8 i = 0; i < boneSpikeCount; ++i) { // select any unit but not the tank Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_IMPALED); if (!target && !i) target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_IMPALED); if (!target) break; yell = true; target->CastCustomSpell(SPELL_IMPALE, SPELLVALUE_BASE_POINT0, 0, target, true); } if (yell) marrowgarAI->Talk(SAY_BONESPIKE); } }
void HandleScriptEffect(SpellEffIndex /*effIndex*/) { if (GetCaster()->GetTypeId() != TYPEID_UNIT) return; Unit* caster = GetCaster(); CreatureAI* ickAI = caster->ToCreature()->AI(); if (Unit* target = ickAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true)) { DoScriptText(SAY_ICK_CHASE_1, caster, target); caster->AddAura(GetSpellInfo()->Id, target); CAST_AI(boss_ick::boss_ickAI, ickAI)->SetTempThreat(caster->getThreatManager().getThreat(target)); caster->AddThreat(target, float(GetEffectValue())); target->AddThreat(caster, float(GetEffectValue())); } }