//Set Monster Relationship Sven Co-op Zombie Edition //Code for our Custom Entities #include "npcs/npc_register" arrayEnemies = { "monster_apache", "monster_assassin_repel", //"monster_barney", //"monster_barney_dead", "monster_blkop_osprey", "monster_blkop_apache", "monster_bodyguard", //"monster_cleansuit_scientist", "monster_grunt_ally_repel", "monster_grunt_repel", "monster_hevsuit_dead", //"monster_hgrunt_dead", "monster_human_assassin", //"monster_human_grunt", "monster_male_assassin", //"monster_miniturret", "monster_osprey", //"monster_otis", //"monster_otis_dead", "monster_robogrunt", "monster_robogrunt_repel", //"monster_scientist", //"monster_scientist_dead", "monster_sentry", //"monster_sitting_scientist", "monster_tripmine", //"monster_turret", "monster_bullchicken" }; arrayAllies = { "monster_alien_babyvoltigore", "monster_alien_controller", "monster_alien_grunt", "monster_alien_slave", "monster_alien_tor", "monster_alien_voltigore", "monster_babycrab", "monster_babygarg", "monster_barnacle", "monster_bigmomma", "monster_chumtoad", "monster_flyer_flock", "monster_gargantua", "monster_gman", "monster_gonome", "monster_headcrab", "monster_houndeye", "monster_ichthyosaur", "monster_kingpin", "monster_leech", "monster_nihilanth", "monster_pitdrone", "monster_shockroach", "monster_shocktrooper", "monster_snark", "monster_sqknest", "monster_stukabat", "monster_tentacle", "monster_zombie", "monster_zombie_barney", "monster_zombie_soldier", "monster_hlze_zombie", //Our Custom NPC "monster_fast_zombie" //Our Custom NPC }; arrayTeam1 = { "monster_miniturret", "monster_turret", "monster_scientist", "monster_scientist_dead", "monster_barney", "monster_barney_dead", "monster_otis", "monster_otis_dead", "monster_cleansuit_scientist", "monster_sitting_scientist", "monster_hlze_barney", //Our Custom NPC "monster_hlze_scientist" //Our Custom NPC }; arrayTeam2 = { "monster_human_grunt", "monster_hgrunt_dead" }; void RelationshipProcess() { //Find all monsters arrayMonsters(1000); g_EntityFuncs.MonstersInSphere(Monsters, Vector(0,0,0), 999999.0); for(uint i=0;i(CastToScriptClass(replacedEnt)); g_EntityFuncs.Remove(ent_monster); replacedMonster.Setup_Zombie(-1,true); AS_Log("Replaced....["+ent_monster.pev.classname+"]with["+replacedMonster.pev.classname+"].\n",LOG_LEVEL_EXTREME); } else if(ent_monster.pev.classname == "monster_barney") { dictionary keys; keys["origin"] = ""+ent_monster.pev.origin.ToString(); keys["angles"] = ""+ent_monster.pev.angles.ToString(); keys["spawnflags"] = ""+ent_monster.pev.flags; keys["body"] = ""+ent_monster.pev.body; keys["skin"] = ""+ent_monster.pev.skin; keys["health"] = ""+ent_monster.pev.health; keys["targetname"] = ""+ent_monster.pev.targetname; keys["weapons"] = ""+ent_monster.pev.weapons; CBaseEntity@ replacedEnt = g_EntityFuncs.CreateEntity("monster_hlze_barney", keys); HLZE_Barney::CHLZE_Barney@ replacedMonster = cast(CastToScriptClass(replacedEnt)); g_EntityFuncs.Remove(ent_monster); AS_Log("Replaced....["+ent_monster.pev.classname+"]with["+replacedMonster.pev.classname+"].\n",LOG_LEVEL_EXTREME); } else if(ent_monster.pev.classname == "monster_scientist" && ent_monster.pev.weapons > 0) { dictionary keys; keys["origin"] = ""+ent_monster.pev.origin.ToString(); keys["angles"] = ""+ent_monster.pev.angles.ToString(); keys["spawnflags"] = ""+ent_monster.pev.flags; keys["body"] = ""+ent_monster.pev.body; keys["skin"] = ""+ent_monster.pev.skin; keys["health"] = ""+ent_monster.pev.health; keys["targetname"] = ""+ent_monster.pev.targetname; keys["weapons"] = ""+ent_monster.pev.weapons; int head_id = ent_monster.GetBodygroup(1); CBaseEntity@ replacedEnt = g_EntityFuncs.CreateEntity("monster_hlze_scientist", keys); HLZE_Scientist::CHLZE_Scientist@ replacedMonster = cast(CastToScriptClass(replacedEnt)); replacedEnt.MyMonsterPointer().SetBodygroup(1,head_id); g_EntityFuncs.Remove(ent_monster); AS_Log("Replaced....["+ent_monster.pev.classname+"]with["+replacedMonster.pev.classname+"].\n",LOG_LEVEL_EXTREME); } } Set_Team(ent); //if(ent_monster.IsPlayerAlly()) g_Log.PrintF(" is now : Ally!\n"); //else g_Log.PrintF(" is now : Enemy!\n"); } } } g_Scheduler.SetTimeout( "RelationshipProcess", 1.0); } void Set_Team(CBaseEntity@ ent) { //Check if the entity is not NULL if(ent !is null) { //Check if is Monster and not Player if(ent.IsMonster() && !ent.IsPlayer()) { //Get Monster Base from this Entity CBaseMonster@ ent_monster = ent.MyMonsterPointer(); for(uint i1=0;i1Ents(1000); Vector mins = Vector(-99999999.0,-99999999.0,-99999999.0); Vector maxs = Vector(99999999.0,99999999.0,99999999.0); g_EntityFuncs.EntitiesInBox(Ents, mins, maxs, 0); for(uint i=0;i