diff --git a/ItemSpawn/scripting/items/balrog.inc b/ItemSpawn/scripting/items/balrog.inc index a4898fbe..7c38e5a3 100644 --- a/ItemSpawn/scripting/items/balrog.inc +++ b/ItemSpawn/scripting/items/balrog.inc @@ -263,6 +263,7 @@ public void SpawnBalrog(float fOrigin[3]) // DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,AddOutput,gravity 1,0,1"); DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetDamageFilter,,0,1"); DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetHealth,0,0.02,-1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!self,Kill,,0,1"); SpawnAndActivate(iRelayDeath); ParentToEntity(iRelayDeath, iKnife); diff --git a/ItemSpawn/scripting/items/whiteknight.inc b/ItemSpawn/scripting/items/whiteknight.inc index b602fb2c..520a5246 100644 --- a/ItemSpawn/scripting/items/whiteknight.inc +++ b/ItemSpawn/scripting/items/whiteknight.inc @@ -48,17 +48,17 @@ public void SpawnWhiteKnight(float fOrigin[3]) // weapon_knife. int iKnife = CreateEntityAtOrigin("weapon_knife", fOrigin); - DispatchKeyFormat(iKnife, "targetname", "item_knight_knife_%d", g_iCounter); - DispatchKeyFormat(iKnife, "hammerid", "11051995%d", g_iCounter); - DispatchKeyFormat(iKnife, "spawnflags", "1"); - DispatchKeyFormat(iKnife, "angles", "0 0 0"); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "!self,AddOutput,renderfx 6,0,1"); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_model_%d,SetAnimation,dog_run,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_model_%d,SetDefaultAnimation,dog_run,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_health_%d,FireUser1,,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_health_%d,FireUser2,,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_controls_%d,Activate,,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "!activator,AddOutput,health 50000,0,1"); + DispatchKeyFormat(iKnife, "targetname", "item_knight_knife_%d", g_iCounter); + DispatchKeyFormat(iKnife, "hammerid", "11051995%d", g_iCounter); + DispatchKeyFormat(iKnife, "spawnflags", "1"); + DispatchKeyFormat(iKnife, "angles", "0 0 0"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "!self,AddOutput,renderfx 6,0,1"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_model_%d,SetAnimation,dog_run,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_model_%d,SetDefaultAnimation,dog_run,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_health_%d,FireUser1,,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_health_%d,FireUser2,,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_knight_controls_%d,Activate,,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "!activator,AddOutput,health 50000,0,1"); SpawnAndActivate(iKnife); HookSingleEntityOutput(iKnife, "OnPlayerPickup", WhiteKnightPickup, true); @@ -70,22 +70,22 @@ public void SpawnWhiteKnight(float fOrigin[3]) // prop_dynamic model. int iModel = CreateEntityAtOrigin("prop_dynamic", fOriginTemp); - DispatchKeyFormat(iModel, "targetname", "item_knight_model_%d", g_iCounter); - DispatchKeyFormat(iModel, "model", "models/dog_jugger.mdl"); - DispatchKeyFormat(iModel, "disablebonefollowers", "1"); - DispatchKeyFormat(iModel, "defaultanim", "ragdoll"); - DispatchKeyFormat(iModel, "angles", "0 0 0"); - DispatchKeyFormat(iModel, "solid", "0"); + DispatchKeyFormat(iModel, "targetname", "item_knight_model_%d", g_iCounter); + DispatchKeyFormat(iModel, "model", "models/dog_jugger.mdl"); + DispatchKeyFormat(iModel, "disablebonefollowers", "1"); + DispatchKeyFormat(iModel, "defaultanim", "ragdoll"); + DispatchKeyFormat(iModel, "angles", "0 0 0"); + DispatchKeyFormat(iModel, "solid", "0"); SpawnAndActivate(iModel); ParentToEntity(iModel, iKnife); // trigger_once strip. int iTriggerStrip = CreateEntityAtOrigin("trigger_once", fOrigin); - DispatchKeyFormat(iTriggerStrip, "targetname", "item_knight_strip_%d", g_iCounter); - DispatchKeyFormat(iTriggerStrip, "filtername", "item_spawn_human_filter"); - DispatchKeyFormat(iTriggerStrip, "spawnflags", "1"); - DispatchKeyFormat(iTriggerStrip, "startdisabled", "1"); - DispatchKeyFormat(iTriggerStrip, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); + DispatchKeyFormat(iTriggerStrip, "targetname", "item_knight_strip_%d", g_iCounter); + DispatchKeyFormat(iTriggerStrip, "filtername", "item_spawn_human_filter"); + DispatchKeyFormat(iTriggerStrip, "spawnflags", "1"); + DispatchKeyFormat(iTriggerStrip, "startdisabled", "1"); + DispatchKeyFormat(iTriggerStrip, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); SpawnAndActivate(iTriggerStrip); ParentToEntity(iTriggerStrip, iKnife); @@ -93,102 +93,184 @@ public void SpawnWhiteKnight(float fOrigin[3]) SetEntityBBox(iTriggerStrip, view_as({-8.0, -8.0, -8.0}), view_as({8.0, 8.0, 8.0})); SetEntityProps(iTriggerStrip); - // attack push origin. + // attack origin. fOriginTemp[0] = fOrigin[0] + 112.0; fOriginTemp[1] = fOrigin[1]; fOriginTemp[2] = fOrigin[2] + 4.0; - // trigger_push attack push. - int iTriggerPushOne = CreateEntityAtOrigin("trigger_push", fOriginTemp); - DispatchKeyFormat(iTriggerPushOne, "targetname", "item_knight_push_1_%d", g_iCounter); - DispatchKeyFormat(iTriggerPushOne, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerPushOne, "spawnflags", "1"); - DispatchKeyFormat(iTriggerPushOne, "startdisabled", "1"); - DispatchKeyFormat(iTriggerPushOne, "pushdir", "-45 0 0"); - DispatchKeyFormat(iTriggerPushOne, "speed", "600"); - SpawnAndActivate(iTriggerPushOne); - ParentToEntity(iTriggerPushOne, iKnife); + // trigger_push attack. + int iTriggerAttack1 = CreateEntityAtOrigin("trigger_push", fOriginTemp); + DispatchKeyFormat(iTriggerAttack1, "targetname", "item_knight_attack_1_%d", g_iCounter); + DispatchKeyFormat(iTriggerAttack1, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerAttack1, "spawnflags", "1"); + DispatchKeyFormat(iTriggerAttack1, "startdisabled", "1"); + DispatchKeyFormat(iTriggerAttack1, "pushdir", "-45 0 0"); + DispatchKeyFormat(iTriggerAttack1, "speed", "600"); + SpawnAndActivate(iTriggerAttack1); + ParentToEntity(iTriggerAttack1, iKnife); // make the trigger work. - SetEntityBBox(iTriggerPushOne, view_as({-70.0, -52.0, -36.0}), view_as({70.0, 52.0, 36.0})); - SetEntityProps(iTriggerPushOne); + SetEntityBBox(iTriggerAttack1, view_as({-70.0, -52.0, -36.0}), view_as({70.0, 52.0, 36.0})); + SetEntityProps(iTriggerAttack1); - // trigger_push attack push. - int iTriggerPushTwo = CreateEntityAtOrigin("trigger_push", fOriginTemp); - DispatchKeyFormat(iTriggerPushTwo, "targetname", "item_knight_push_2_%d", g_iCounter); - DispatchKeyFormat(iTriggerPushTwo, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerPushTwo, "spawnflags", "1"); - DispatchKeyFormat(iTriggerPushTwo, "startdisabled", "1"); - DispatchKeyFormat(iTriggerPushTwo, "pushdir", "-45 0 0"); - DispatchKeyFormat(iTriggerPushTwo, "speed", "1500"); - SpawnAndActivate(iTriggerPushTwo); - ParentToEntity(iTriggerPushTwo, iKnife); + // trigger_push attack. + int iTriggerAttack2 = CreateEntityAtOrigin("trigger_push", fOriginTemp); + DispatchKeyFormat(iTriggerAttack2, "targetname", "item_knight_attack_2_%d", g_iCounter); + DispatchKeyFormat(iTriggerAttack2, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerAttack2, "spawnflags", "1"); + DispatchKeyFormat(iTriggerAttack2, "startdisabled", "1"); + DispatchKeyFormat(iTriggerAttack2, "pushdir", "-45 0 0"); + DispatchKeyFormat(iTriggerAttack2, "speed", "1500"); + SpawnAndActivate(iTriggerAttack2); + ParentToEntity(iTriggerAttack2, iKnife); // make the trigger work. - SetEntityBBox(iTriggerPushTwo, view_as({-70.0, -52.0, -36.0}), view_as({70.0, 52.0, 36.0})); - SetEntityProps(iTriggerPushTwo); + SetEntityBBox(iTriggerAttack2, view_as({-70.0, -52.0, -36.0}), view_as({70.0, 52.0, 36.0})); + SetEntityProps(iTriggerAttack2); - // attack hurt origin. + // attack origin. fOriginTemp[0] = fOrigin[0] + 130.0; fOriginTemp[1] = fOrigin[1]; fOriginTemp[2] = fOrigin[2] + 4.0; - // trigger_hurt attack hurt. - int iTriggerHurtOne = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); - DispatchKeyFormat(iTriggerHurtOne, "targetname", "item_knight_hurt_1_%d", g_iCounter); - DispatchKeyFormat(iTriggerHurtOne, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerHurtOne, "spawnflags", "9"); - DispatchKeyFormat(iTriggerHurtOne, "startdisabled", "1"); - DispatchKeyFormat(iTriggerHurtOne, "damagetype", "512"); - DispatchKeyFormat(iTriggerHurtOne, "damagemodel", "0"); - DispatchKeyFormat(iTriggerHurtOne, "damagecap", "20"); - DispatchKeyFormat(iTriggerHurtOne, "damage", "800"); - SpawnAndActivate(iTriggerHurtOne); - ParentToEntity(iTriggerHurtOne, iKnife); + // trigger_hurt attack. + int iTriggerAttack3 = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); + DispatchKeyFormat(iTriggerAttack3, "targetname", "item_knight_attack_3_%d", g_iCounter); + DispatchKeyFormat(iTriggerAttack3, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerAttack3, "spawnflags", "9"); + DispatchKeyFormat(iTriggerAttack3, "startdisabled", "1"); + DispatchKeyFormat(iTriggerAttack3, "damagetype", "512"); + DispatchKeyFormat(iTriggerAttack3, "damagemodel", "0"); + DispatchKeyFormat(iTriggerAttack3, "damagecap", "20"); + DispatchKeyFormat(iTriggerAttack3, "damage", "800"); + SpawnAndActivate(iTriggerAttack3); + ParentToEntity(iTriggerAttack3, iKnife); // make the trigger work. - SetEntityBBox(iTriggerHurtOne, view_as({-52.0, -52.0, -36.0}), view_as({52.0, 52.0, 36.0})); - SetEntityProps(iTriggerHurtOne); + SetEntityBBox(iTriggerAttack3, view_as({-52.0, -52.0, -36.0}), view_as({52.0, 52.0, 36.0})); + SetEntityProps(iTriggerAttack3); - // nuke hurt origin. + // nuke origin. fOriginTemp[0] = fOrigin[0] + 6.0; fOriginTemp[1] = fOrigin[1]; fOriginTemp[2] = fOrigin[2] + 32.0; - int iTriggerHurtTwo = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); - DispatchKeyFormat(iTriggerHurtTwo, "targetname", "item_knight_hurt_2_%d", g_iCounter); - DispatchKeyFormat(iTriggerHurtTwo, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerHurtTwo, "spawnflags", "9"); - DispatchKeyFormat(iTriggerHurtTwo, "startdisabled", "1"); - DispatchKeyFormat(iTriggerHurtTwo, "damagetype", "512"); - DispatchKeyFormat(iTriggerHurtTwo, "damagemodel", "0"); - DispatchKeyFormat(iTriggerHurtTwo, "damagecap", "20"); - DispatchKeyFormat(iTriggerHurtTwo, "damage", "20000"); - SpawnAndActivate(iTriggerHurtTwo); - ParentToEntity(iTriggerHurtTwo, iKnife); + + // trigger_hurt nuke. + int iTriggerNuke = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); + DispatchKeyFormat(iTriggerNuke, "targetname", "item_knight_nuke_%d", g_iCounter); + DispatchKeyFormat(iTriggerNuke, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerNuke, "spawnflags", "9"); + DispatchKeyFormat(iTriggerNuke, "startdisabled", "1"); + DispatchKeyFormat(iTriggerNuke, "damagetype", "512"); + DispatchKeyFormat(iTriggerNuke, "damagemodel", "0"); + DispatchKeyFormat(iTriggerNuke, "damagecap", "20"); + DispatchKeyFormat(iTriggerNuke, "damage", "20000"); + SpawnAndActivate(iTriggerNuke); + ParentToEntity(iTriggerNuke, iKnife); // make the trigger work. - SetEntityBBox(iTriggerHurtTwo, view_as({-1024.0, -1024.0, -800.0}), view_as({1024.0, 1024.0, 800.0})); - SetEntityProps(iTriggerHurtTwo); + SetEntityBBox(iTriggerNuke, view_as({-1024.0, -1024.0, -800.0}), view_as({1024.0, 1024.0, 800.0})); + SetEntityProps(iTriggerNuke); + + // ambient_generic attack. + int iSoundAttack1 = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundAttack1, "targetname", "item_knight_attack_sound_1_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack1, "spawnflags", "48"); + DispatchKeyFormat(iSoundAttack1, "radius", "1250"); + DispatchKeyFormat(iSoundAttack1, "sourceentityname", "item_knight_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack1, "message", "npc/roller/blade_out.wav"); + DispatchKeyFormat(iSoundAttack1, "volume", "10"); + DispatchKeyFormat(iSoundAttack1, "health", "10"); + DispatchKeyFormat(iSoundAttack1, "pitch", "100"); + DispatchKeyFormat(iSoundAttack1, "pitchstart", "100"); + SpawnAndActivate(iSoundAttack1); + ParentToEntity(iSoundAttack1, iKnife); + + // ambient_generic attack. + int iSoundAttack2 = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundAttack2, "targetname", "item_knight_attack_sound_2_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack2, "spawnflags", "48"); + DispatchKeyFormat(iSoundAttack2, "radius", "1250"); + DispatchKeyFormat(iSoundAttack2, "sourceentityname", "item_knight_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack2, "message", "npc/strider/strider_skewer1.wav"); + DispatchKeyFormat(iSoundAttack2, "volume", "10"); + DispatchKeyFormat(iSoundAttack2, "health", "10"); + DispatchKeyFormat(iSoundAttack2, "pitch", "100"); + DispatchKeyFormat(iSoundAttack2, "pitchstart", "100"); + SpawnAndActivate(iSoundAttack2); + ParentToEntity(iSoundAttack2, iKnife); + + // ambient_generic attack. + int iSoundNuke1 = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundNuke1, "targetname", "item_knight_nuke_sound_1_%d", g_iCounter); + DispatchKeyFormat(iSoundNuke1, "spawnflags", "49"); + DispatchKeyFormat(iSoundNuke1, "radius", "1250"); + DispatchKeyFormat(iSoundNuke1, "sourceentityname", "item_knight_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundNuke1, "message", "ambient/levels/citadel/portal_beam_shoot4.wav"); + DispatchKeyFormat(iSoundNuke1, "volume", "10"); + DispatchKeyFormat(iSoundNuke1, "health", "10"); + DispatchKeyFormat(iSoundNuke1, "pitch", "100"); + DispatchKeyFormat(iSoundNuke1, "pitchstart", "100"); + SpawnAndActivate(iSoundNuke1); + ParentToEntity(iSoundNuke1, iKnife); + + // ambient_generic attack. + int iSoundNuke2 = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundNuke2, "targetname", "item_knight_nuke_sound_2_%d", g_iCounter); + DispatchKeyFormat(iSoundNuke2, "spawnflags", "49"); + DispatchKeyFormat(iSoundNuke2, "radius", "1250"); + DispatchKeyFormat(iSoundNuke2, "sourceentityname", "item_knight_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundNuke2, "message", "ambient/explosions/explode_6.wav"); + DispatchKeyFormat(iSoundNuke2, "volume", "10"); + DispatchKeyFormat(iSoundNuke2, "health", "10"); + DispatchKeyFormat(iSoundNuke2, "pitch", "100"); + DispatchKeyFormat(iSoundNuke2, "pitchstart", "100"); + DispatchKeyFormat(iSoundNuke2, "fadein", "0"); + DispatchKeyFormat(iSoundNuke2, "fadeout", "0"); + SpawnAndActivate(iSoundNuke2); + ParentToEntity(iSoundNuke2, iKnife); + // logic_relay walk. + int iRelayWalk = CreateEntityAtOrigin("logic_relay", fOrigin); + DispatchKeyFormat(iRelayWalk, "targetname", "item_knight_walk_%d", g_iCounter); + DispatchKeyFormat(iRelayWalk, "spawnflags", "0"); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_knight_model_%d,SetAnimation,dog_run,0,-1", g_iCounter); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_knight_model_%d,SetDefaultAnimation,dog_run,0,-1", g_iCounter); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_knight_attack_compare_%d,SetCompareValue,0,0,-1", g_iCounter); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_knight_shield_compare_%d,SetCompareValue,0,0,-1", g_iCounter); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_knight_nuke_compare_%d,SetCompareValue,0,0,-1", g_iCounter); + DispatchKeyFormat(iRelayWalk, "OnTrigger", "item_spawn_speedmod,ModifySpeed,1,0,-1"); + SpawnAndActivate(iRelayWalk); + ParentToEntity(iRelayWalk, iKnife); + // logic_relay death. int iRelayDeath = CreateEntityAtOrigin("logic_relay", fOrigin); - DispatchKeyFormat(iRelayDeath, "targetname", "item_knight_death_%d", g_iCounter); - DispatchKeyFormat(iRelayDeath, "spawnflags", "0"); - DispatchKeyFormat(iRelayDeath, "OnTrigger", "!self,FireUser1,,0.1,-1"); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_knife_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_strip_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_push_1_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_push_2_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_hurt_1_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_hurt_2_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,AddOutput,rendermode 0,0,1"); - DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,AddOutput,renderfx 0,0,1"); - DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetDamageFilter,,0,1"); - DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetHealth,0,0.02,-1"); + DispatchKeyFormat(iRelayDeath, "targetname", "item_knight_death_%d", g_iCounter); + DispatchKeyFormat(iRelayDeath, "spawnflags", "0"); + DispatchKeyFormat(iRelayDeath, "OnTrigger", "!self,FireUser1,,0.1,-1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_knife_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_strip_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_attack_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_attack_2_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_attack_3_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_nuke_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_attack_sound_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_attack_sound_2_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_nuke_sound_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_nuke_sound_2_%d,Kill,,0,1", g_iCounter); + + + + DispatchKeyFormat(iRelayDeath, "OnUser1", "item_knight_walk_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,AddOutput,rendermode 0,0,1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,AddOutput,renderfx 0,0,1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetDamageFilter,,0,1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!activator,SetHealth,0,0.02,-1"); + DispatchKeyFormat(iRelayDeath, "OnUser1", "!self,Kill,,0,1"); SpawnAndActivate(iRelayDeath); ParentToEntity(iRelayDeath, iKnife); @@ -199,51 +281,58 @@ public void SpawnWhiteKnight(float fOrigin[3]) // func_physbox_multiplayer health. int iHealth = CreateEntityAtOrigin("func_physbox_multiplayer", fOriginTemp); - DispatchKeyFormat(iHealth, "targetname", "item_knight_health_%d", g_iCounter); - DispatchKeyFormat(iHealth, "model", "models/props/cs_militia/crate_extrasmallmill.mdl"); - DispatchKeyFormat(iHealth, "spawnflags", "9237504"); - DispatchKeyFormat(iHealth, "rendermode", "0"); - DispatchKeyFormat(iHealth, "renderfx", "0"); - DispatchKeyFormat(iHealth, "rendercolor", "255 255 255"); - DispatchKeyFormat(iHealth, "renderamt", "255 255 255"); - DispatchKeyFormat(iHealth, "propdata", "0"); - DispatchKeyFormat(iHealth, "pressuredelay", "0"); - DispatchKeyFormat(iHealth, "preferredcarryangles", "0 0 0"); - DispatchKeyFormat(iHealth, "performancemode", "1"); - DispatchKeyFormat(iHealth, "notsolid", "0"); - DispatchKeyFormat(iHealth, "nodamageforces", "0"); - DispatchKeyFormat(iHealth, "material", "2"); - DispatchKeyFormat(iHealth, "massScale", "0"); - DispatchKeyFormat(iHealth, "health", "750"); - DispatchKeyFormat(iHealth, "gibdir", "0 0 0"); - DispatchKeyFormat(iHealth, "forcetoenablemotion", "0"); - DispatchKeyFormat(iHealth, "explosion", "0"); - DispatchKeyFormat(iHealth, "exploderadius", "0"); - DispatchKeyFormat(iHealth, "explodemagnitude", "0"); - DispatchKeyFormat(iHealth, "explodedamage", "0"); - DispatchKeyFormat(iHealth, "disableshadows", "1"); - DispatchKeyFormat(iHealth, "disablereceiveshadows", "1"); - DispatchKeyFormat(iHealth, "damagetype", "0"); - DispatchKeyFormat(iHealth, "damagetoenablemotion", "0"); - DispatchKeyFormat(iHealth, "damagefilter", "item_spawn_zombie_filter"); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_knife_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_strip_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_push_1_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_push_2_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_hurt_1_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_hurt_2_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "targetname", "item_knight_health_%d", g_iCounter); + DispatchKeyFormat(iHealth, "model", "models/props/cs_militia/crate_extrasmallmill.mdl"); + DispatchKeyFormat(iHealth, "spawnflags", "9237504"); + DispatchKeyFormat(iHealth, "rendermode", "0"); + DispatchKeyFormat(iHealth, "renderfx", "0"); + DispatchKeyFormat(iHealth, "rendercolor", "255 255 255"); + DispatchKeyFormat(iHealth, "renderamt", "255 255 255"); + DispatchKeyFormat(iHealth, "propdata", "0"); + DispatchKeyFormat(iHealth, "pressuredelay", "0"); + DispatchKeyFormat(iHealth, "preferredcarryangles", "0 0 0"); + DispatchKeyFormat(iHealth, "performancemode", "1"); + DispatchKeyFormat(iHealth, "notsolid", "0"); + DispatchKeyFormat(iHealth, "nodamageforces", "0"); + DispatchKeyFormat(iHealth, "material", "2"); + DispatchKeyFormat(iHealth, "massScale", "0"); + DispatchKeyFormat(iHealth, "health", "750"); + DispatchKeyFormat(iHealth, "gibdir", "0 0 0"); + DispatchKeyFormat(iHealth, "forcetoenablemotion", "0"); + DispatchKeyFormat(iHealth, "explosion", "0"); + DispatchKeyFormat(iHealth, "exploderadius", "0"); + DispatchKeyFormat(iHealth, "explodemagnitude", "0"); + DispatchKeyFormat(iHealth, "explodedamage", "0"); + DispatchKeyFormat(iHealth, "disableshadows", "1"); + DispatchKeyFormat(iHealth, "disablereceiveshadows", "1"); + DispatchKeyFormat(iHealth, "damagetype", "0"); + DispatchKeyFormat(iHealth, "damagetoenablemotion", "0"); + DispatchKeyFormat(iHealth, "damagefilter", "item_spawn_zombie_filter"); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_knife_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_strip_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_attack_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_attack_2_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_attack_3_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_nuke_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_attack_sound_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_attack_sound_2_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_nuke_sound_1_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_nuke_sound_2_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_controls_%d,Kill,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,ClearParent,,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,SetAnimation,dog_die,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,SetDefaultAnimation,dog_die_loop,0,1", g_iCounter); - DispatchKeyFormat(iHealth, "OnUser1", "!activator,SetDamageFilter,item_spawn_human_filter,0,-1"); - DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,rendermode 10,0,-1"); - DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,renderfx 6,0,-1"); - DispatchKeyFormat(iHealth, "OnUser1", "!self,FireUser1,,1,-1"); - DispatchKeyFormat(iHealth, "OnUser2", "item_knight_death_%d,CancelPending,,0,-1", g_iCounter); - DispatchKeyFormat(iHealth, "OnUser2", "item_knight_death_%d,Trigger,,0.05,-1", g_iCounter); - DispatchKeyFormat(iHealth, "OnUser2", "!self,FireUser2,,0.1,-1"); + + + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_walk_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_controls_%d,Kill,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,ClearParent,,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,SetAnimation,dog_die,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_knight_model_%d,SetDefaultAnimation,dog_die_loop,0,1", g_iCounter); + DispatchKeyFormat(iHealth, "OnUser1", "!activator,SetDamageFilter,item_spawn_human_filter,0,-1"); + DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,rendermode 10,0,-1"); + DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,renderfx 6,0,-1"); + DispatchKeyFormat(iHealth, "OnUser1", "!self,FireUser1,,1,-1"); + DispatchKeyFormat(iHealth, "OnUser2", "item_knight_death_%d,CancelPending,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnUser2", "item_knight_death_%d,Trigger,,0.05,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnUser2", "!self,FireUser2,,0.1,-1"); SpawnAndActivate(iHealth); ParentToEntity(iHealth, iKnife); @@ -255,11 +344,19 @@ public void SpawnWhiteKnight(float fOrigin[3]) // game_ui. int iControls = CreateEntityAtOrigin("game_ui", fOrigin); - DispatchKeyFormat(iControls, "targetname", "item_knight_controls_%d", g_iCounter); - DispatchKeyFormat(iControls, "spawnflags", "0"); - DispatchKeyFormat(iControls, "fieldofview", "-1.0"); - DispatchKeyFormat(iControls, "PressedAttack", "item_knight_attack_compare_%d,Compare,,0,-1", g_iCounter); - DispatchKeyFormat(iControls, "PressedAttack2", "item_knight_shield_compare_%d,Compare,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "targetname", "item_knight_controls_%d", g_iCounter); + DispatchKeyFormat(iControls, "spawnflags", "0"); + DispatchKeyFormat(iControls, "fieldofview", "-1.0"); + DispatchKeyFormat(iControls, "PressedAttack", "item_knight_attack_compare_%d,Compare,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_knight_shield_compare_%d,Compare,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedBack", "item_knight_combo_5_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedBack", "item_knight_combo_7_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedForward", "item_knight_combo_6_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedForward", "item_knight_combo_8_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedMoveLeft", "item_knight_combo_1_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedMoveLeft", "item_knight_combo_2_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedMoveRight", "item_knight_combo_3_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedMoveRight", "item_knight_combo_4_%d,Trigger,,0,-1", g_iCounter); SpawnAndActivate(iControls); ParentToEntity(iControls, iKnife);