Exemplo n.º 1
0
		void EnterCombat(Unit* /*who*/)
		{
			me->setActive(true);
			events.Reset();
			events.RescheduleEvent(EVENT_ENRAGE, 600000);
			events.RescheduleEvent(EVENT_SPELL_FREEZING_SLASH, urand(7000,15000));
			events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, urand(15000,20000));
			events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, urand(5000,8000));
			events.RescheduleEvent(EVENT_SUBMERGE, SUBMERGE_INTERVAL);
			if( !IsHeroic() )
				events.RescheduleEvent(EVENT_RESPAWN_SPHERE, 4000);

			for( std::list<uint64>::iterator itr = summons.begin(); itr != summons.end(); ++itr )
				if( Creature* c = pInstance->instance->GetCreature(*itr) )
				{
					c->GetMotionMaster()->MoveIdle();
					c->StopMoving();
					c->CastSpell(c, SPELL_SUBMERGE, false);
					c->AI()->DoAction(1);
				}
			summons.clear();
			for( uint8 i=0; i<4; ++i )
				if( Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i+1]) )
					BurrowGUID[i] = c->GetGUID();
			for( uint8 i=0; i<6; ++i )
				if( Creature* c = me->SummonCreature(NPC_FROST_SPHERE, AnubLocs[i+5]) )
					SphereGUID[i] = c->GetGUID();

			Talk(SAY_AGGRO);
			DoZoneInCombat();
			if( pInstance )
				pInstance->SetData(TYPE_ANUBARAK, IN_PROGRESS);
		}
Exemplo n.º 2
0
		void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
		{
			if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
			{
				damage = 0;
				return;
			}

			if( Phase < 3 && damage >= me->GetHealth() )
			{
				damage = 0;
				me->SetHealth(me->GetMaxHealth());
				events.Reset();
				me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
				me->RemoveAllAuras();
				me->SetControlled(true, UNIT_STATE_STUNNED);
				me->CastSpell(me, SPELL_BK_GHOUL_EXPLODE, true);
				summons.clear();

				me->CastSpell(me, SPELL_BK_FEIGN_DEATH, true);
				me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29);
				me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
				me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
				me->AddUnitState(UNIT_STATE_DIED);

			}
		}
Exemplo n.º 3
0
void InternalCreatureType::reset()
{
    experience = 0;

    defense = 0;
    armor = 0;

    canPushItems = false;
    canPushCreatures = false;
    staticAttackChance = 95;
    maxSummons = 0;
    targetDistance = 1;
    fleeHealth = 0;
    pushable = true;
    base_speed = 200;
    health = 100;
    health_max = 100;

    outfit.lookHead   = 130; // Default man
    outfit.lookBody   = 0;
    outfit.lookLegs   = 0;
    outfit.lookFeet   = 0;
    outfit.lookType   = 0;
    outfit.lookTypeEx = 0;
    outfit.lookAddons = 0;
    corpseId = 0;

    mechanicImmunities = MECHANIC_NONE;
    damageImmunities = COMBAT_NONE;
    race = RACE_BLOOD;
    isSummonable = false;
    isIllusionable = false;
    isConvinceable = false;
    isAttackable = true;
    isHostile = true;
    isLureable = false;

    lightLevel = 0;
    lightColor = 0;

    manaCost = 0;
    summonList.clear();
    lootItems.clear();
    elementMap.clear();

    spellAttackList.clear();
    spellDefenseList.clear();

    yellSpeedTicks = 0;
    yellChance = 0;
    voiceVector.clear();

    changeTargetSpeed = 0;
    changeTargetChance = 0;

    //scriptList.clear();
}