void Inmater_Spawn(ServerEntity_t *eInmater) { Server_PrecacheModel(MODEL_INMATER_BODY); Entity_SetPhysics(eInmater, SOLID_SLIDEBOX, 3.0f, 4.5f); eInmater->Monster.type = MONSTER_INMATER; eInmater->Monster.Frame = Inmater_Think; eInmater->Monster.Pain = Inmater_Pain; Entity_SetKilledFunction(eInmater, Inmater_Die); eInmater->v.takedamage = true; eInmater->v.movetype = MOVETYPE_STEP; eInmater->v.health = INMATER_MAX_HEALTH; eInmater->v.netname = "Inmater"; eInmater->v.frame = 0; eInmater->local.maxhealth = INMATER_MAX_HEALTH; AI_SetState(eInmater, AI_STATE_AWAKE); AI_SetThink(eInmater, AI_THINK_IDLE); Entity_SetModel(eInmater, MODEL_INMATER_BODY); Entity_SetSize(eInmater, -16.0f, -16.0f, -24.0f, 16.0f, 16.0f, 32.0f); Entity_SetOrigin(eInmater, eInmater->v.origin); Entity_DropToFloor(eInmater); }
void Point_DecorationSpawn(ServerEntity_t *eDecoration) { if (eDecoration->v.model[0] == ' ') { Entity_Remove(eDecoration); return; } Server_PrecacheModel(eDecoration->v.model); Entity_SetModel(eDecoration,eDecoration->v.model); if(eDecoration->v.spawnflags & DECORATION_DROPTOFLOOR) Entity_DropToFloor(eDecoration); }
/* style 0 Mikiko 1 Superfly */ void Bot_Spawn(ServerEntity_t *eBot) { int iSpawnType; ServerEntity_t *eSpawnPoint; // Don't spawn bots unless it's allowed by admin. if(!cvServerBots.value) return; plClearVector3D(&eBot->v.velocity); switch(eBot->local.style) { case BOT_DEFAULT: iSpawnType = INFO_PLAYER_DEATHMATCH; eBot->v.model = cvServerPlayerModel.string; strncpy(eBot->v.netname, BotNames[(rand() % plArrayElements(BotNames))], 64); eBot->Monster.type = MONSTER_PLAYER; break; #ifdef GAME_OPENKATANA case BOT_COMPANION: iSpawnType = INFO_PLAYER_SUPERFLY; Server_PrecacheModel("models/sprfly.md2"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath1.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath2.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath3.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath4.wav"); // TODO: Placeholder! eBot->v.model = "models/sprfly.md2"; // TODO: Placeholder! eBot->v.netname = "Companion Bot"; // TODO: give a proper name?? eBot->Monster.type = MONSTER_SUPERFLY; break; #endif default: Engine.Con_Warning("Attempted to spawn unknown bot type! (%i) (%i %i %i)\n", eBot->local.style, (int)eBot->v.origin.x, (int)eBot->v.origin.y, (int)eBot->v.origin.z); Entity_Remove(eBot); return; } eBot->v.classname = "bot"; eBot->v.health = 100; eBot->local.maxhealth = cvServerMaxHealth.iValue; eBot->v.movetype = MOVETYPE_STEP; eBot->v.takedamage = true; Entity_SetPhysics(eBot, SOLID_SLIDEBOX, 1.4f, 4.0f); eBot->local.bleed = true; eBot->Monster.Frame = Bot_Frame; eBot->Monster.Pain = Bot_Pain; // Default bots are purely for MP, so they spawn at player spawns. if(eBot->local.style == BOT_DEFAULT) { // Must be set after teams are set up. eSpawnPoint = Player_GetSpawnEntity(eBot, iSpawnType); if(!eSpawnPoint) { Engine.Con_Warning("%s failed to find spawnpoint!\n",eBot->v.netname); Entity_Remove(eBot); return; } Entity_SetOrigin(eBot,eSpawnPoint->v.origin); SetAngle(eBot,eSpawnPoint->v.angles); } Entity_SetKilledFunction(eBot, Bot_Die); eBot->Monster.Pain = Bot_Pain; eBot->Monster.Frame = Bot_Frame; Entity_SetModel(eBot,eBot->v.model); Entity_SetSize(eBot,-16.0f,-16.0f,-24.0f,16.0f,16.0f,32.0f); AI_SetState(eBot, AI_STATE_AWAKE); AI_SetThink(eBot, AI_THINK_IDLE); // Make sure we're not in the air. Entity_DropToFloor(eBot); }