Esempio n. 1
0
void TotemSummon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot)
{
	Summon::Load(proto, owner, position, spellid, summonslot);

	TotemDisplayIdEntry* totemdisplay = TotemDisplayIdStorage.LookupEntry(creature_info->Male_DisplayID);
	uint32 displayID = 0;

	if(totemdisplay != NULL)
	{
		switch(owner->getRace())
		{
			case RACE_DRAENEI:
				displayID = totemdisplay->DraeneiId;
				break;

			case RACE_TROLL:
				displayID = totemdisplay->TrollId;
				break;

			case RACE_ORC:
				displayID = totemdisplay->OrcId;
				break;
		}
	}

	if(displayID == 0)
		displayID = creature_info->Male_DisplayID;

	// Set up the creature.
	SetMaxPower(POWER_TYPE_FOCUS, owner->getLevel() * 30);
	SetPower(POWER_TYPE_FOCUS, owner->getLevel() * 30);
	setLevel(owner->getLevel());
	setRace(0);
	setClass(1);
	setGender(2);
	SetPowerType(1);
	SetBaseAttackTime(MELEE, 2000);
	SetBaseAttackTime(OFFHAND, 2000);
	SetBoundingRadius(1.0f);
	SetCombatReach(1.0f);
	SetDisplayId(displayID);
	SetNativeDisplayId(creature_info->Male_DisplayID);
	SetCastSpeedMod(1.0f);
	SetUInt32Value(OBJECT_FIELD_DYNAMIC_FLAGS, 0);

	InheritSMMods(owner);

	for(uint8 school = 0; school < SCHOOL_COUNT; school++)
	{
		ModDamageDone[ school ] = owner->GetDamageDoneMod(school);
		HealDoneMod[ school ] = owner->HealDoneMod[ school ];
	}

	m_aiInterface->Init(this, AITYPE_TOTEM, MOVEMENTTYPE_NONE, owner);
	DisableAI();
}
Esempio n. 2
0
void CC_AI_Disable( void )
{
	if (CAI_BaseNPC::m_nDebugBits & bits_debugDisableAI)
	{
		EnableAI();
	}
	else
	{
		DisableAI();
	}

	CBaseEntity::m_nDebugPlayer = UTIL_GetCommandClientIndex();
}
Esempio n. 3
0
void Vehicle::InitSeats(uint32 vehicleEntry, Player* pRider)
{
	DisableAI();
	m_maxPassengers = 0;
	m_seatSlotMax = 0;
	SetVehicleEntry(vehicleEntry);
	VehicleEntry * ve = dbcVehicle.LookupEntry( vehicleEntry );
	if(!ve)
	{
		if(sLog.IsOutDevelopement())
			printf("Attempted to create non-existant vehicle %u.\n", vehicleEntry);
		else
			OUT_DEBUG("Attempted to create non-existant vehicle %u.", vehicleEntry);
		return;
	}

	for( uint32 i = 0; i < 8; i++ )
	{
		if( ve->m_seatID[i] )
		{
			m_vehicleSeats[i] = dbcVehicleSeat.LookupEntry( ve->m_seatID[i] );
			m_seatSlotMax = i + 1;

			if(m_vehicleSeats[i]->IsUsable())
			{
				seatisusable[i] = true;
				++m_maxPassengers;
			}
		}
	}

	Initialised = true;

	if(!m_maxPassengers || !m_seatSlotMax)
		return;

	if( pRider != NULL)
		AddPassenger( pRider );

	CreatureProtoVehicle* veh = CreatureProtoVehicleStorage.LookupEntry(GetEntry());
	if(veh != NULL && veh->MovementFlags)
		m_movementflags = (uint16)veh->MovementFlags;

	SetSpeed(TURN,ve->m_turnSpeed);
	SetSpeed(PITCH_RATE,ve->m_pitchSpeed);

}