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); }
void WEAPON_TRIDENT_Precache (void) { Server_PrecacheModel("models/trident.md2"); Server_PrecacheSound("weapons/trident/tridentdraw.wav"); }
void Server_Spawn(ServerEntity_t *seEntity) { Server.eWorld = seEntity; // Set defaults. Server.dWaypointSpawnDelay = ((double)cvServerWaypointDelay.value); Server.round_started = Server.players_spawned = false; Server.iMonsters = 0; Server.skycam = false; // Set these to their defaults. bIsDeathmatch = false; bIsCooperative = false; bIsMultiplayer = false; if (cvServerGameMode.iValue != MODE_SINGLEPLAYER) { bIsMultiplayer = true; if (cvServerGameMode.iValue == MODE_DEATHMATCH) bIsDeathmatch = true; else if (cvServerGameMode.iValue == MODE_COOPERATIVE) bIsCooperative = true; } else // Round has always immediately started in single player. Server.round_started = true; // Initialize waypoints. Waypoint_Initialize(); Item_Precache(); Weapon_Precache(); Server_PrecacheSound("misc/deny.wav"); Server_PrecacheSound(BASE_SOUND_TALK0); Server_PrecacheSound(BASE_SOUND_TALK1); Server_PrecacheSound(BASE_SOUND_TALK2); Server_PrecacheSound("misc/gib1.wav"); #ifndef GAME_ADAMAS // Physics Server_PrecacheSound(PHYSICS_SOUND_SPLASH); Server_PrecacheSound(PHYSICS_SOUND_BODY); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET0); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET1); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET2); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET3); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET4); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET5); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET6); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET7); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET8); Server_PrecacheSound(PHYSICS_SOUND_RICOCHET9); Server_PrecacheSound("fx/explosion1.wav"); Server_PrecacheSound("fx/explosion2.wav"); Server_PrecacheSound("fx/explosion3.wav"); Server_PrecacheSound("fx/explosion4.wav"); Server_PrecacheSound("fx/explosion5.wav"); Server_PrecacheSound("fx/explosion6.wav"); Server_PrecacheSound(PHYSICS_SOUND_CONCRETESTEP0); Server_PrecacheSound(PHYSICS_SOUND_CONCRETESTEP1); Server_PrecacheSound(PHYSICS_SOUND_CONCRETESTEP2); Server_PrecacheSound(PHYSICS_SOUND_CONCRETESTEP3); Server_PrecacheModel(PHYSICS_MODEL_GIB0); Server_PrecacheModel(PHYSICS_MODEL_GIB1); Server_PrecacheModel(PHYSICS_MODEL_GIB2); Server_PrecacheModel(PHYSICS_MODEL_GIB3); // Effects Server_PrecacheSound(SOUND_EXPLODE_UNDERWATER0); Server_PrecacheSound(SOUND_EXPLODE0); Server_PrecacheSound(SOUND_EXPLODE1); Server_PrecacheSound(SOUND_EXPLODE2); #endif // Player Server_PrecacheModel(cvServerPlayerModel.string); #ifdef GAME_OPENKATANA // Player Server_PrecacheSound(PLAYER_SOUND_JUMP0); Server_PrecacheSound(PLAYER_SOUND_JUMP1); Server_PrecacheSound(PLAYER_SOUND_JUMP2); Server_PrecacheSound(PLAYER_SOUND_JUMP3); Server_PrecacheSound(PLAYER_SOUND_PAIN0); Server_PrecacheSound(PLAYER_SOUND_PAIN1); Server_PrecacheSound(PLAYER_SOUND_PAIN2); Server_PrecacheSound(PLAYER_SOUND_PAIN3); Server_PrecacheSound(PLAYER_SOUND_PAIN4); Server_PrecacheSound(PLAYER_SOUND_PAIN5); Server_PrecacheSound(PLAYER_SOUND_PAIN6); Server_PrecacheSound(PLAYER_SOUND_PAIN7); Server_PrecacheSound(PLAYER_SOUND_PAIN8); Server_PrecacheSound(PLAYER_SOUND_PAIN9); Server_PrecacheSound(PLAYER_SOUND_PAIN10); Server_PrecacheSound(PLAYER_SOUND_PAIN11); Server_PrecacheSound(PLAYER_SOUND_DEATH0); Server_PrecacheSound(PLAYER_SOUND_DEATH1); Server_PrecacheSound(PLAYER_SOUND_DEATH2); Server_PrecacheModel("models/blip.md2"); #endif #ifdef DEBUG_WAYPOINT Server_PrecacheModel(WAYPOINT_MODEL_BASE); Server_PrecacheModel(WAYPOINT_MODEL_CLIMB); Server_PrecacheModel(WAYPOINT_MODEL_ITEM); Server_PrecacheModel(WAYPOINT_MODEL_JUMP); Server_PrecacheModel(WAYPOINT_MODEL_SPAWN); Server_PrecacheModel(WAYPOINT_MODEL_SWIM); Server_PrecacheModel(WAYPOINT_MODEL_WEAPON); #endif // Precache any multiplayer content. if(bIsMultiplayer) { #ifdef GAME_OPENKATANA Server_PrecacheSound("items/respawn.wav"); #endif } Server_WorldLightStyle(0, "m"); Server_WorldLightStyle(1, "mmnmmommommnonmmonqnmmo"); Server_WorldLightStyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); Server_WorldLightStyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); Server_WorldLightStyle(4, "mamamamamama"); Server_WorldLightStyle(5, "jklmnopqrstuvwxyzyxwvutsrqponmlkj"); Server_WorldLightStyle(6, "nmonqnmomnmomomno"); Server_WorldLightStyle(7, "mmmaaaabcdefgmmmmaaaammmaamm"); Server_WorldLightStyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); Server_WorldLightStyle(9, "aaaaaaaazzzzzzzz"); Server_WorldLightStyle(10, "mmamammmmammamamaaamammma"); Server_WorldLightStyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); Server_WorldLightStyle(32, "a"); }
void Area_BreakableSpawn(ServerEntity_t *area) { if (area->v.health <= 0) { area->v.health = 1; } switch (area->local.style) { case BREAKABLE_GLASS: Server_PrecacheSound( PHYSICS_SOUND_GLASS0); Server_PrecacheSound( PHYSICS_SOUND_GLASS1); Server_PrecacheSound( PHYSICS_SOUND_GLASS2); Server_PrecacheModel(PHYSICS_MODEL_GLASS0); Server_PrecacheModel(PHYSICS_MODEL_GLASS1); Server_PrecacheModel(PHYSICS_MODEL_GLASS2); break; case BREAKABLE_WOOD: Server_PrecacheSound( PHYSICS_SOUND_WOOD0); Server_PrecacheSound( PHYSICS_SOUND_WOOD1); Server_PrecacheSound( PHYSICS_SOUND_WOOD2); Server_PrecacheModel(PHYSICS_MODEL_WOOD0); Server_PrecacheModel(PHYSICS_MODEL_WOOD1); Server_PrecacheModel(PHYSICS_MODEL_WOOD2); break; case BREAKABLE_ROCK: Server_PrecacheSound( PHYSICS_SOUND_ROCK0); Server_PrecacheSound( PHYSICS_SOUND_ROCK1); Server_PrecacheSound( PHYSICS_SOUND_ROCK2); Server_PrecacheModel(PHYSICS_MODEL_ROCK0); Server_PrecacheModel(PHYSICS_MODEL_ROCK1); Server_PrecacheModel(PHYSICS_MODEL_ROCK2); break; case BREAKABLE_METAL: Server_PrecacheSound( PHYSICS_SOUND_METAL0); Server_PrecacheSound( PHYSICS_SOUND_METAL1); Server_PrecacheSound( PHYSICS_SOUND_METAL2); Server_PrecacheModel(PHYSICS_MODEL_METAL0); Server_PrecacheModel(PHYSICS_MODEL_METAL1); Server_PrecacheModel(PHYSICS_MODEL_METAL2); break; default: g_engine->Con_Warning("area_breakable: Unknown style\n"); } // If we've been given a name, then set our use function. if (area->v.name) { area->v.use = Area_BreakableUse; } area->Physics.solid = SOLID_BSP; area->v.movetype = MOVETYPE_PUSH; area->v.takedamage = true; area->local.bleed = false; Entity_SetKilledFunction(area, Area_BreakableDie); Entity_SetModel(area, area->v.model); Entity_SetOrigin(area, area->v.origin); Entity_SetSizeVector(area, area->v.mins, area->v.maxs); area->v.oldorigin.x = (area->v.mins.x + area->v.maxs.x) * 0.5f; area->v.oldorigin.y = (area->v.mins.y + area->v.maxs.y) * 0.5f; area->v.oldorigin.z = (area->v.mins.z + area->v.maxs.z) * 0.5f; }
void Point_PropSpawn(ServerEntity_t *eEntity) { if(!eEntity->v.model) Entity_Remove(eEntity); eEntity->v.iHealth = 10; if(eEntity->v.iHealth) { switch(eEntity->local.style) { case BREAKABLE_GLASS: Server_PrecacheSound(PHYSICS_SOUND_GLASS0); Server_PrecacheSound(PHYSICS_SOUND_GLASS1); Server_PrecacheSound(PHYSICS_SOUND_GLASS2); Server_PrecacheModel(PHYSICS_MODEL_GLASS0); Server_PrecacheModel(PHYSICS_MODEL_GLASS1); Server_PrecacheModel(PHYSICS_MODEL_GLASS2); break; case BREAKABLE_WOOD: Server_PrecacheSound(PHYSICS_SOUND_WOOD0); Server_PrecacheSound(PHYSICS_SOUND_WOOD1); Server_PrecacheSound(PHYSICS_SOUND_WOOD2); Server_PrecacheModel(PHYSICS_MODEL_WOOD0); Server_PrecacheModel(PHYSICS_MODEL_WOOD1); Server_PrecacheModel(PHYSICS_MODEL_WOOD2); break; case BREAKABLE_ROCK: Server_PrecacheSound(PHYSICS_SOUND_ROCK0); Server_PrecacheSound(PHYSICS_SOUND_ROCK1); Server_PrecacheSound(PHYSICS_SOUND_ROCK2); Server_PrecacheModel("models/gibs/rock_gibs1.md2"); Server_PrecacheModel("models/gibs/rock_gibs2.md2"); Server_PrecacheModel("models/gibs/rock_gibs3.md2"); break; case BREAKABLE_METAL: Server_PrecacheSound(PHYSICS_SOUND_METAL0); Server_PrecacheSound(PHYSICS_SOUND_METAL1); Server_PrecacheSound(PHYSICS_SOUND_METAL2); Server_PrecacheModel(PHYSICS_MODEL_METAL0); Server_PrecacheModel(PHYSICS_MODEL_METAL1); Server_PrecacheModel(PHYSICS_MODEL_METAL2); break; default: Engine.Con_Warning("Prop with unknown style! (%i)\n",eEntity->local.style); } eEntity->v.bTakeDamage = true; eEntity->local.bBleed = false; Entity_SetKilledFunction(eEntity, Area_BreakableDie); } Server_PrecacheModel(eEntity->v.model); eEntity->v.movetype = MOVETYPE_BOUNCE; eEntity->v.TouchFunction = Point_PropTouch; eEntity->Physics.iSolid = SOLID_BBOX; eEntity->Physics.fGravity = cvServerGravity.value; eEntity->Physics.fMass = 0.5f; Entity_SetModel(eEntity,eEntity->v.model); Entity_SetOrigin(eEntity,eEntity->v.origin); Entity_SetSize(eEntity,-16.0f,-16.0f,-24.0f,16.0f,16.0f,32.0f); }