From 09bce80a3d8466433bdbcebb5cc4ecba695282a4 Mon Sep 17 00:00:00 2001 From: zaCade Date: Fri, 3 Aug 2018 20:39:07 +0200 Subject: [PATCH] ItemSpawn: More balrog progress. --- ItemSpawn/scripting/items/balrog.inc | 625 +++++++++++---------------- 1 file changed, 256 insertions(+), 369 deletions(-) diff --git a/ItemSpawn/scripting/items/balrog.inc b/ItemSpawn/scripting/items/balrog.inc index cb496df4..36efc8e4 100644 --- a/ItemSpawn/scripting/items/balrog.inc +++ b/ItemSpawn/scripting/items/balrog.inc @@ -48,427 +48,314 @@ public void SpawnBalrog(float fOrigin[3]) // weapon_knife. int iKnife = CreateEntityAtOrigin("weapon_knife", fOrigin); - DispatchKeyFormat(iKnife, "targetname", "balrog_knife_%d", g_iCounter); - DispatchKeyFormat(iKnife, "hammerid", "11051995%d", g_iCounter); - DispatchKeyFormat(iKnife, "spawnflags", "1"); - DispatchKeyFormat(iKnife, "angles", "0 0 0"); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "balrog_knife_%d,AddOutput,renderfx 6,0.02,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "balrog_model_%d,SetAnimation,balrog_attack1,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "balrog_timer_%d,Enable,,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "balrog_ui_%d,Activate,,0,1", g_iCounter); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_spawn_speedmod,ModifySpeed,0.8,0,1"); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "!activator,AddOutput,health 50000,0,1"); - DispatchKeyFormat(iKnife, "OnPlayerPickup", "!self,FireUser1,,0,1"); - DispatchKeyFormat(iKnife, "OnUser1", "!activator,AddOutput,rendermode 10,0,-1"); - DispatchKeyFormat(iKnife, "OnUser1", "!activator,AddOutput,renderfx 6,0,-1"); - DispatchKeyFormat(iKnife, "OnUser1", "!self,FireUser1,,1,-1"); + DispatchKeyFormat(iKnife, "targetname", "item_balrog_knife_%d", g_iCounter); + DispatchKeyFormat(iKnife, "hammerid", "11051995%d", g_iCounter); + DispatchKeyFormat(iKnife, "spawnflags", "1"); + DispatchKeyFormat(iKnife, "angles", "0 0 0"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_balrog_knife_%d,AddOutput,renderfx 6,0.02,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_balrog_model_%d,SetAnimation,balrog_attack1,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_balrog_ui_%d,Activate,,0,1", g_iCounter); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "item_spawn_speedmod,ModifySpeed,0.8,0,1"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "!activator,AddOutput,health 50000,0,1"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "!self,FireUser1,,0,1"); + DispatchKeyFormat(iKnife, "OnPlayerPickup", "!self,FireUser2,,0,1"); + DispatchKeyFormat(iKnife, "OnUser1", "!activator,AddOutput,rendermode 10,0,-1"); + DispatchKeyFormat(iKnife, "OnUser1", "!activator,AddOutput,renderfx 6,0,-1"); + DispatchKeyFormat(iKnife, "OnUser1", "!self,FireUser1,,1,-1"); + DispatchKeyFormat(iKnife, "OnUser2", "item_balrog_walk_%d,Disable,,0,-1", g_iCounter); + DispatchKeyFormat(iKnife, "OnUser2", "item_balrog_walk_%d,Enable,,0.1,-1", g_iCounter); + DispatchKeyFormat(iKnife, "OnUser2", "item_balrog_walk_sound_%d,PlaySound,,0,-1", g_iCounter); + DispatchKeyFormat(iKnife, "OnUser2", "!self,FireUser2,,0.95,-1"); ActivateAndSpawn(iKnife); HookSingleEntityOutput(iKnife, "OnPlayerPickup", BalrogPickup, true); + // model origin. fOriginTemp[0] = fOrigin[0] + 4.5; fOriginTemp[1] = fOrigin[1] + 1.26; fOriginTemp[2] = fOrigin[2] - 28.9; // prop_dynamic model. int iModel = CreateEntityAtOrigin("prop_dynamic", fOriginTemp); - DispatchKeyFormat(iModel, "targetname", "item_balrog_model_%d", g_iCounter); - DispatchKeyFormat(iModel, "model", "models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl"); - DispatchKeyFormat(iModel, "disablebonefollowers", "1"); - DispatchKeyFormat(iModel, "defaultanim", "crouch_walk_lower"); - DispatchKeyFormat(iModel, "angles", "0 2 0"); - DispatchKeyFormat(iModel, "solid", "0"); + DispatchKeyFormat(iModel, "targetname", "item_balrog_model_%d", g_iCounter); + DispatchKeyFormat(iModel, "model", "models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl"); + DispatchKeyFormat(iModel, "disablebonefollowers", "1"); + DispatchKeyFormat(iModel, "defaultanim", "crouch_walk_lower"); + DispatchKeyFormat(iModel, "angles", "0 2 0"); + DispatchKeyFormat(iModel, "solid", "0"); ActivateAndSpawn(iModel); ParentToEntity(iModel, iKnife); // trigger_once strip. - int iTriggerOnce = CreateEntityAtOrigin("trigger_once", fOrigin); - DispatchKeyFormat(iTriggerOnce, "targetname", "item_balrog_trigger_%d", g_iCounter); - DispatchKeyFormat(iTriggerOnce, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerOnce, "spawnflags", "1"); - DispatchKeyFormat(iTriggerOnce, "startdisabled", "1"); - DispatchKeyFormat(iTriggerOnce, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); - ActivateAndSpawn(iTriggerOnce); - ParentToEntity(iTriggerOnce, iKnife); + int iTriggerStrip = CreateEntityAtOrigin("trigger_once", fOrigin); + DispatchKeyFormat(iTriggerStrip, "targetname", "item_balrog_stripper_%d", g_iCounter); + DispatchKeyFormat(iTriggerStrip, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerStrip, "spawnflags", "1"); + DispatchKeyFormat(iTriggerStrip, "startdisabled", "1"); + DispatchKeyFormat(iTriggerStrip, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1"); + ActivateAndSpawn(iTriggerStrip); + ParentToEntity(iTriggerStrip, iKnife); - SetEntityModel(iTriggerOnce, "models/vortigaunt_slave.mdl"); + SetEntityModel(iTriggerStrip, "models/vortigaunt_slave.mdl"); - SetEntPropVector(iTriggerOnce, Prop_Send, "m_vecMins", {-8.0, -8.0, -8.0}); - SetEntPropVector(iTriggerOnce, Prop_Send, "m_vecMaxs", { 8.0, 8.0, 8.0}); +// SetEntPropVector(iTriggerStrip, Prop_Send, "m_vecMins", {-8.0, -8.0, -8.0}); +// SetEntPropVector(iTriggerStrip, Prop_Send, "m_vecMaxs", { 8.0, 8.0, 8.0}); - SetEntProp(iTriggerOnce, Prop_Send, "m_fEffects", GetEntProp(iTriggerOnce, Prop_Send, "m_fEffects") |= 32); - SetEntProp(iTriggerOnce, Prop_Send, "m_nSolidType", 2); +// SetEntProp(iTriggerStrip, Prop_Send, "m_fEffects", GetEntProp(iTriggerStrip, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iTriggerStrip, Prop_Send, "m_nSolidType", 2); // trigger_hurt death. int iTriggerDeath = CreateEntityAtOrigin("trigger_hurt", fOrigin); - DispatchKeyFormat(iTriggerDeath, "targetname", "item_balrog_death_%d", g_iCounter); - DispatchKeyFormat(iTriggerDeath, "filtername", "item_spawn_zombie_filter"); - DispatchKeyFormat(iTriggerDeath, "spawnflags", "1"); - DispatchKeyFormat(iTriggerDeath, "startdisabled", "1"); - DispatchKeyFormat(iTriggerDeath, "damagetype", "0"); - DispatchKeyFormat(iTriggerDeath, "damagemodel", "0"); - DispatchKeyFormat(iTriggerDeath, "damagecap", "20"); - DispatchKeyFormat(iTriggerDeath, "damage", "99999999"); + DispatchKeyFormat(iTriggerDeath, "targetname", "item_balrog_death_%d", g_iCounter); + DispatchKeyFormat(iTriggerDeath, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerDeath, "spawnflags", "1"); + DispatchKeyFormat(iTriggerDeath, "startdisabled", "1"); + DispatchKeyFormat(iTriggerDeath, "damagetype", "0"); + DispatchKeyFormat(iTriggerDeath, "damagemodel", "0"); + DispatchKeyFormat(iTriggerDeath, "damagecap", "20"); + DispatchKeyFormat(iTriggerDeath, "damage", "99999999"); ActivateAndSpawn(iTriggerDeath); ParentToEntity(iTriggerDeath, iKnife); SetEntityModel(iTriggerDeath, "models/vortigaunt_slave.mdl"); - SetEntPropVector(iTriggerDeath, Prop_Send, "m_vecMins", {-8.0, -8.0, -8.0}); - SetEntPropVector(iTriggerDeath, Prop_Send, "m_vecMaxs", { 8.0, 8.0, 8.0}); +// SetEntPropVector(iTriggerDeath, Prop_Send, "m_vecMins", {-8.0, -8.0, -8.0}); +// SetEntPropVector(iTriggerDeath, Prop_Send, "m_vecMaxs", { 8.0, 8.0, 8.0}); - SetEntProp(iTriggerDeath, Prop_Send, "m_fEffects", GetEntProp(iTriggerOnce, Prop_Send, "m_fEffects") |= 32); - SetEntProp(iTriggerDeath, Prop_Send, "m_nSolidType", 2); +// SetEntProp(iTriggerDeath, Prop_Send, "m_fEffects", GetEntProp(iTriggerOnce, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iTriggerDeath, Prop_Send, "m_nSolidType", 2); - - - - - // trigger_hurt walking - int iKillTriggerWalking = CreateEntityByName("trigger_hurt"); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_walking_%d", g_iCounter); - DispatchKeyValue(iKillTriggerWalking, "targetname", sBuffer); - DispatchKeyValue(iKillTriggerWalking, "spawnflags", "9"); - DispatchKeyValue(iKillTriggerWalking, "startdisabled", "0"); - DispatchKeyValue(iKillTriggerWalking, "filtername", "item_spawn_human_filter"); - DispatchKeyValue(iKillTriggerWalking, "damagetype", "128"); - DispatchKeyValue(iKillTriggerWalking, "damagemodel", "0"); - DispatchKeyValue(iKillTriggerWalking, "damagecap", "20"); - DispatchKeyValue(iKillTriggerWalking, "damage", "190"); + // walk origin. fOriginTemp[0] = fOrigin[0] + 28.5; fOriginTemp[1] = fOrigin[1] - 2.74; fOriginTemp[2] = fOrigin[2] - 4.9; - DispatchKeyValueVector(iKillTriggerWalking, "origin", fOriginTemp); - DispatchSpawn(iKillTriggerWalking); - ActivateEntity(iKillTriggerWalking); - SetEntityModel(iKillTriggerWalking, "models/vortigaunt_slave.mdl"); - float fMinbounds5[3] = {-32.0, -72.0, -84.0}; - float fMaxbounds5[3] = {32.0, 72.0, 84.0}; - SetEntPropVector(iKillTriggerWalking, Prop_Send, "m_vecMins", fMinbounds5); - SetEntPropVector(iKillTriggerWalking, Prop_Send, "m_vecMaxs", fMaxbounds5); - SetEntProp(iKillTriggerWalking, Prop_Send, "m_nSolidType", 3); - int enteffects5 = GetEntProp(iKillTriggerWalking, Prop_Send, "m_fEffects"); - enteffects5 |= 32; - SetEntProp(iKillTriggerWalking, Prop_Send, "m_fEffects", enteffects5); - SetVariantString("!activator"); - AcceptEntityInput(iKillTriggerWalking, "SetParent", iKnife); - // trigger roar 1 - int iTriggerRoar = CreateEntityByName("trigger_multiple"); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d", g_iCounter); - DispatchKeyValue(iTriggerRoar, "targetname", sBuffer); - DispatchKeyValue(iTriggerRoar, "spawnflags", "1"); - DispatchKeyValue(iTriggerRoar, "startdisabled", "1"); - DispatchKeyValue(iTriggerRoar, "filtername", "item_spawn_zombie_filter"); - DispatchKeyValue(iTriggerRoar, "wait", "1"); - DispatchKeyValue(iTriggerRoar, "OnStartTouch", "item_spawn_speedmod,ModifySpeed,0,0,-1"); - DispatchKeyValue(iTriggerRoar, "OnStartTouch", "item_spawn_speedmod,speed,ModifySpeed,0.8,3,-1"); - fOriginTemp[0] = fOrigin[0] + 5.0; - fOriginTemp[1] = fOrigin[1] - 0.0; - fOriginTemp[2] = fOrigin[2] - 0.0; - DispatchKeyValueVector(iTriggerRoar, "origin", fOriginTemp); - DispatchSpawn(iTriggerRoar); - ActivateEntity(iTriggerRoar); - SetEntityModel(iTriggerRoar, "models/vortigaunt_slave.mdl"); - float fMinbounds6[3] = {-0.5, -0.5, -36.0}; - float fMaxbounds6[3] = {0.5, 0.5, 36.0}; - SetEntPropVector(iTriggerRoar, Prop_Send, "m_vecMins", fMinbounds6); - SetEntPropVector(iTriggerRoar, Prop_Send, "m_vecMaxs", fMaxbounds6); - SetEntProp(iTriggerRoar, Prop_Send, "m_nSolidType", 3); - int enteffects6 = GetEntProp(iTriggerRoar, Prop_Send, "m_fEffects"); - enteffects6 |= 32; - SetEntProp(iTriggerRoar, Prop_Send, "m_fEffects", enteffects6); - SetVariantString("!activator"); - AcceptEntityInput(iTriggerRoar, "SetParent", iKnife); + // trigger_hurt walk. + int iTriggerWalk = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); + DispatchKeyFormat(iTriggerWalk, "targetname", "item_balrog_walk_%d", g_iCounter); + DispatchKeyFormat(iTriggerWalk, "filtername", "item_spawn_human_filter"); + DispatchKeyFormat(iTriggerWalk, "spawnflags", "9"); + DispatchKeyFormat(iTriggerWalk, "startdisabled", "0"); + DispatchKeyFormat(iTriggerWalk, "damagetype", "128"); + DispatchKeyFormat(iTriggerWalk, "damagemodel", "0"); + DispatchKeyFormat(iTriggerWalk, "damagecap", "20"); + DispatchKeyFormat(iTriggerWalk, "damage", "190"); + ActivateAndSpawn(iTriggerWalk); + ParentToEntity(iTriggerWalk, iKnife); - // trigger roar 2 - int iTriggerRoar2 = CreateEntityByName("trigger_multiple"); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar2_%d", g_iCounter); - DispatchKeyValue(iTriggerRoar2, "targetname", sBuffer); - DispatchKeyValue(iTriggerRoar2, "spawnflags", "1"); - DispatchKeyValue(iTriggerRoar2, "startdisabled", "1"); - DispatchKeyValue(iTriggerRoar2, "filtername", "item_spawn_zombie_filter"); - DispatchKeyValue(iTriggerRoar2, "wait", "1"); - DispatchKeyValue(iTriggerRoar2, "OnStartTouch", "!activator,AddOutput,health 10000,0,-1"); - DispatchKeyValue(iTriggerRoar2, "OnStartTouch", "item_spawn_speedmod,ModifySpeed,1.5,0,-1"); - DispatchKeyValue(iTriggerRoar2, "OnStartTouch", "item_spawn_speedmod,ModifySpeed,1.0,10,-1"); - DispatchKeyValue(iTriggerRoar2, "OnStartTouch", "!activator,AddOutput,color 255 0 0,0,-1"); - DispatchKeyValue(iTriggerRoar2, "OnStartTouch", "!activator,AddOutput,color 255 255 255,10,-1"); + SetEntityModel(iTriggerWalk, "models/vortigaunt_slave.mdl"); + +// SetEntPropVector(iTriggerWalk, Prop_Send, "m_vecMins", {-32.0, -72.0, -84.0}); +// SetEntPropVector(iTriggerWalk, Prop_Send, "m_vecMaxs", { 32.0, 72.0, 84.0}); + +// SetEntProp(iTriggerWalk, Prop_Send, "m_fEffects", GetEntProp(iTriggerOnce, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iTriggerWalk, Prop_Send, "m_nSolidType", 2); + + // roar origin. fOriginTemp[0] = fOrigin[0] - 15.5; fOriginTemp[1] = fOrigin[1] + 5.0; fOriginTemp[2] = fOrigin[2] + 31.0; - DispatchKeyValueVector(iTriggerRoar2, "origin", fOriginTemp); - DispatchSpawn(iTriggerRoar2); - ActivateEntity(iTriggerRoar2); - SetEntityModel(iTriggerRoar2, "models/vortigaunt_slave.mdl"); - float fMinbounds7[3] = {-736.0, -736.0, -560.0}; - float fMaxbounds7[3] = {736.0, 736.0, 560.0}; - SetEntPropVector(iTriggerRoar2, Prop_Send, "m_vecMins", fMinbounds7); - SetEntPropVector(iTriggerRoar2, Prop_Send, "m_vecMaxs", fMaxbounds7); - SetEntProp(iTriggerRoar2, Prop_Send, "m_nSolidType", 3); - int enteffects7 = GetEntProp(iTriggerRoar2, Prop_Send, "m_fEffects"); - enteffects7 |= 32; - SetEntProp(iTriggerRoar2, Prop_Send, "m_fEffects", enteffects7); - SetVariantString("!activator"); - AcceptEntityInput(iTriggerRoar2, "SetParent", iKnife); - // trigger_hurt attack - int iKillTriggerAttack = CreateEntityByName("trigger_hurt"); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_attack_%d", g_iCounter); - DispatchKeyValue(iKillTriggerAttack, "targetname", sBuffer); - DispatchKeyValue(iKillTriggerAttack, "spawnflags", "9"); - DispatchKeyValue(iKillTriggerAttack, "startdisabled", "1"); - DispatchKeyValue(iKillTriggerAttack, "filtername", "item_spawn_human_filter"); - DispatchKeyValue(iKillTriggerAttack, "damagetype", "128"); - DispatchKeyValue(iKillTriggerAttack, "damagemodel", "0"); - DispatchKeyValue(iKillTriggerAttack, "damagecap", "20"); - DispatchKeyValue(iKillTriggerAttack, "damage", "500"); + // trigger_hurt roar. + int iTriggerRoar = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); + DispatchKeyFormat(iTriggerRoar, "targetname", "item_balrog_roar_%d", g_iCounter); + DispatchKeyFormat(iTriggerRoar, "filtername", "item_spawn_zombie_filter"); + DispatchKeyFormat(iTriggerRoar, "spawnflags", "1"); + DispatchKeyFormat(iTriggerRoar, "startdisabled", "1"); + DispatchKeyFormat(iTriggerRoar, "damagetype", "0"); + DispatchKeyFormat(iTriggerRoar, "damagemodel", "0"); + DispatchKeyFormat(iTriggerRoar, "damagecap", "20"); + DispatchKeyFormat(iTriggerRoar, "damage", "-20000"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "!activator,AddOutput,max_health 10000,0,-1"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "!activator,AddOutput,max_health 100,0.01,-1"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "!activator,AddOutput,color 255 0 0,0,-1"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "!activator,AddOutput,color 255 255 255,10,-1"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "item_spawn_speedmod,ModifySpeed,1.5,0,-1"); + DispatchKeyFormat(iTriggerRoar, "OnStartTouch", "item_spawn_speedmod,ModifySpeed,1.0,10,-1"); + ActivateAndSpawn(iTriggerRoar); + ParentToEntity(iTriggerRoar, iKnife); + + SetEntityModel(iTriggerRoar, "models/vortigaunt_slave.mdl"); + +// SetEntPropVector(iTriggerRoar, Prop_Send, "m_vecMins", {-736.0, -736.0, -560.0}); +// SetEntPropVector(iTriggerRoar, Prop_Send, "m_vecMaxs", { 736.0, 736.0, 560.0}); + +// SetEntProp(iTriggerRoar, Prop_Send, "m_fEffects", GetEntProp(iTriggerRoar, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iTriggerRoar, Prop_Send, "m_nSolidType", 2); + + // attack origin. fOriginTemp[0] = fOrigin[0] + 360.5; fOriginTemp[1] = fOrigin[1] - 58.74; fOriginTemp[2] = fOrigin[2] + 35.6; - DispatchKeyValueVector(iKillTriggerAttack, "origin", fOriginTemp); - DispatchSpawn(iKillTriggerAttack); - ActivateEntity(iKillTriggerAttack); - SetEntityModel(iKillTriggerAttack, "models/vortigaunt_slave.mdl"); - float fMinbounds8[3] = {-152.0, -256.0, -71.5}; - float fMaxbounds8[3] = {152.0, 256.0, 71.5}; - SetEntPropVector(iKillTriggerAttack, Prop_Send, "m_vecMins", fMinbounds8); - SetEntPropVector(iKillTriggerAttack, Prop_Send, "m_vecMaxs", fMaxbounds8); - SetEntProp(iKillTriggerAttack, Prop_Send, "m_nSolidType", 3); - int enteffects8 = GetEntProp(iKillTriggerAttack, Prop_Send, "m_fEffects"); - enteffects8 |= 32; - SetEntProp(iKillTriggerAttack, Prop_Send, "m_fEffects", enteffects8); - SetVariantString("!activator"); - AcceptEntityInput(iKillTriggerAttack, "SetParent", iKnife); - // Sound 1 - int iSound1 = CreateEntityByName("ambient_generic"); - Format(sBuffer, sizeof(sBuffer), "balrog_sound1_%d", g_iCounter); - DispatchKeyValue(iSound1, "targetname", sBuffer); - DispatchKeyValue(iSound1, "spawnflags", "49"); - DispatchKeyValue(iSound1, "radius", "8250"); - Format(sBuffer, sizeof(sBuffer), "balrog_knife_%d", g_iCounter); - DispatchKeyValue(iSound1, "SourceEntityName", sBuffer); - DispatchKeyValue(iSound1, "message", "unloze/balrog_scream.mp3"); - DispatchKeyValue(iSound1, "volume", "10"); - DispatchKeyValue(iSound1, "health", "10"); - DispatchKeyValue(iSound1, "pitch", "100"); - DispatchKeyValue(iSound1, "pitchstart", "100"); - DispatchSpawn(iSound1); - ActivateEntity(iSound1); - SetVariantString("!activator"); - AcceptEntityInput(iSound1, "SetParent", iKnife); + // trigger_hurt attack. + int iTriggerAttack = CreateEntityAtOrigin("trigger_hurt", fOriginTemp); + DispatchKeyFormat(iTriggerAttack, "targetname", "item_balrog_attack_%d", g_iCounter); + DispatchKeyFormat(iTriggerAttack, "filtername", "item_spawn_human_filter"); + DispatchKeyFormat(iTriggerAttack, "spawnflags", "9"); + DispatchKeyFormat(iTriggerAttack, "startdisabled", "1"); + DispatchKeyFormat(iTriggerAttack, "damagetype", "128"); + DispatchKeyFormat(iTriggerAttack, "damagemodel", "0"); + DispatchKeyFormat(iTriggerAttack, "damagecap", "20"); + DispatchKeyFormat(iTriggerAttack, "damage", "500"); + ActivateAndSpawn(iTriggerAttack); + ParentToEntity(iTriggerAttack, iKnife); - // Sound 2 - int iSound2 = CreateEntityByName("ambient_generic"); - Format(sBuffer, sizeof(sBuffer), "balrog_sound2_%d", g_iCounter); - DispatchKeyValue(iSound2, "targetname", sBuffer); - DispatchKeyValue(iSound2, "spawnflags", "48"); - DispatchKeyValue(iSound2, "radius", "8250"); - Format(sBuffer, sizeof(sBuffer), "balrog_knife_%d", g_iCounter); - DispatchKeyValue(iSound2, "SourceEntityName", sBuffer); - DispatchKeyValue(iSound2, "message", "npc/strider/strider_step2.wav"); - DispatchKeyValue(iSound2, "volume", "10"); - DispatchKeyValue(iSound2, "health", "10"); - DispatchKeyValue(iSound2, "pitch", "100"); - DispatchKeyValue(iSound2, "pitchstart", "100"); - DispatchSpawn(iSound2); - ActivateEntity(iSound2); - SetVariantString("!activator"); - AcceptEntityInput(iSound2, "SetParent", iKnife); + SetEntityModel(iTriggerAttack, "models/vortigaunt_slave.mdl"); - // Sound 3 - int iSound3 = CreateEntityByName("ambient_generic"); - Format(sBuffer, sizeof(sBuffer), "balrog_sound3_%d", g_iCounter); - DispatchKeyValue(iSound3, "targetname", sBuffer); - DispatchKeyValue(iSound3, "spawnflags", "48"); - DispatchKeyValue(iSound3, "radius", "8250"); - Format(sBuffer, sizeof(sBuffer), "balrog_knife_%d", g_iCounter); - DispatchKeyValue(iSound3, "SourceEntityName", sBuffer); - DispatchKeyValue(iSound3, "message", "npc/strider/strider_skewer1.wav"); - DispatchKeyValue(iSound3, "volume", "10"); - DispatchKeyValue(iSound3, "health", "10"); - DispatchKeyValue(iSound3, "pitch", "100"); - DispatchKeyValue(iSound3, "pitchstart", "100"); - DispatchSpawn(iSound3); - ActivateEntity(iSound3); - SetVariantString("!activator"); - AcceptEntityInput(iSound3, "SetParent", iKnife); +// SetEntPropVector(iTriggerAttack, Prop_Send, "m_vecMins", {-152.0, -256.0, -71.5}); +// SetEntPropVector(iTriggerAttack, Prop_Send, "m_vecMaxs", { 152.0, 256.0, 71.5}); - // Timer - int iTimer = CreateEntityByName("logic_timer"); - Format(sBuffer, sizeof(sBuffer), "balrog_timer_%d", g_iCounter); - DispatchKeyValue(iTimer, "targetname", sBuffer); - DispatchKeyValue(iTimer, "spawnflags", "0"); - DispatchKeyValue(iTimer, "startdisabled", "1"); - DispatchKeyValue(iTimer, "UseRandomTime", "0"); - DispatchKeyValue(iTimer, "RefireTime", "0.95"); - Format(sBuffer, sizeof(sBuffer), "balrog_sound2_%d,PlaySound,,0,-1", g_iCounter); - DispatchKeyValue(iTimer, "OnTimer", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_walking_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iTimer, "OnTimer", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_walking_%d,Enable,,0.1,-1", g_iCounter); - DispatchKeyValue(iTimer, "OnTimer", sBuffer); - DispatchSpawn(iTimer); - ActivateEntity(iTimer); - SetVariantString("!activator"); - AcceptEntityInput(iTimer, "SetParent", iKnife); +// SetEntProp(iTriggerAttack, Prop_Send, "m_fEffects", GetEntProp(iTriggerAttack, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iTriggerAttack, Prop_Send, "m_nSolidType", 2); - // Roar - int iRoar = CreateEntityByName("logic_relay"); - Format(sBuffer, sizeof(sBuffer), "balrog_relay1_%d", g_iCounter); - DispatchKeyValue(iRoar, "targetname", sBuffer); - DispatchKeyValue(iRoar, "spawnflags", "0"); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar2_%d,Enable,,0,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar2_%d,Disable,,4,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,SetAnimation,balrog_groar,0,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Enable,,0,-1", g_iCounter); - //DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Disable,,3.05,-1", g_iCounter); - //DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Disable,,0.1,-1", g_iCounter); - //DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Disable,,3.01,-1", g_iCounter); - //DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay2_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay2_%d,Enable,,4,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_sound1_%d,PlaySound,,1,-1", g_iCounter); - DispatchKeyValue(iRoar, "OnTrigger", sBuffer); - //DispatchKeyValue(iRoar, "OnTrigger", "!activator,AddOutput,gravity 2,0,-1"); - DispatchKeyValue(iRoar, "OnTrigger", "!self,Disable,,0,-1"); - DispatchKeyValue(iRoar, "OnTrigger", "!self,Enable,,25,-1"); - DispatchSpawn(iRoar); - ActivateEntity(iRoar); - SetVariantString("!activator"); - AcceptEntityInput(iRoar, "SetParent", iKnife); + // ambient_generic walk. + int iSoundWalk = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundWalk, "targetname", "item_balrog_walk_sound_%d", g_iCounter); + DispatchKeyFormat(iSoundWalk, "spawnflags", "48"); + DispatchKeyFormat(iSoundWalk, "radius", "8250"); + DispatchKeyFormat(iSoundWalk, "sourceentityname", "item_balrog_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundWalk, "message", "npc/strider/strider_step2.wav"); + DispatchKeyFormat(iSoundWalk, "volume", "10"); + DispatchKeyFormat(iSoundWalk, "health", "10"); + DispatchKeyFormat(iSoundWalk, "pitch", "100"); + DispatchKeyFormat(iSoundWalk, "pitchstart", "100"); + ActivateAndSpawn(iSoundWalk); + ParentToEntity(iSoundWalk, iKnife); - // Attack - int iAttack = CreateEntityByName("logic_relay"); - Format(sBuffer, sizeof(sBuffer), "balrog_relay2_%d", g_iCounter); - DispatchKeyValue(iAttack, "targetname", sBuffer); - DispatchKeyValue(iAttack, "spawnflags", "0"); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,SetAnimation,balrog_attack1,0,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_sound3_%d,PlaySound,,1,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Enable,,0,-1", g_iCounter); - //DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_trigger_roar1_%d,Disable,,0.1,-1", g_iCounter); - //DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_attack_%d,Enable,,1.75,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_attack_%d,Disable,,2.2,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay1_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay1_%d,Enable,,4,-1", g_iCounter); - DispatchKeyValue(iAttack, "OnTrigger", sBuffer); - //DispatchKeyValue(iAttack, "OnTrigger", "!activator,AddOutput,gravity 2,0,-1"); - DispatchKeyValue(iAttack, "OnTrigger", "!self,Disable,,0,-1"); - DispatchKeyValue(iAttack, "OnTrigger", "!self,Enable,,4.1,-1"); - DispatchSpawn(iAttack); - ActivateEntity(iAttack); - SetVariantString("!activator"); - AcceptEntityInput(iAttack, "SetParent", iKnife); + // ambient_generic roar. + int iSoundRoar = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundRoar, "targetname", "item_balrog_roar_sound_%d", g_iCounter); + DispatchKeyFormat(iSoundRoar, "spawnflags", "49"); + DispatchKeyFormat(iSoundRoar, "radius", "8250"); + DispatchKeyFormat(iSoundRoar, "sourceentityname", "item_balrog_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundRoar, "message", "unloze/balrog_scream.mp3"); + DispatchKeyFormat(iSoundRoar, "volume", "10"); + DispatchKeyFormat(iSoundRoar, "health", "10"); + DispatchKeyFormat(iSoundRoar, "pitch", "100"); + DispatchKeyFormat(iSoundRoar, "pitchstart", "100"); + ActivateAndSpawn(iSoundRoar); + ParentToEntity(iSoundRoar, iKnife); - // Physbox - int iPhysbox = CreateEntityByName("func_physbox_multiplayer"); - Format(sBuffer, sizeof(sBuffer), "balrog_physbox_%d", g_iCounter); - DispatchKeyValue(iPhysbox, "targetname", sBuffer); - DispatchKeyValue(iPhysbox, "spawnflags", "574464"); - DispatchKeyValue(iPhysbox, "rendermode", "0"); - DispatchKeyValue(iPhysbox, "renderfx", "0"); - DispatchKeyValue(iPhysbox, "rendercolor", "255 255 255"); - DispatchKeyValue(iPhysbox, "renderamt", "255 255 255"); - DispatchKeyValue(iPhysbox, "propdata", "0"); - DispatchKeyValue(iPhysbox, "pressuredelay", "0"); - DispatchKeyValue(iPhysbox, "preferredcarryangles", "0 0 0"); - DispatchKeyValue(iPhysbox, "PerformanceMode", "0"); - DispatchKeyValue(iPhysbox, "notsolid", "0"); - DispatchKeyValue(iPhysbox, "nodamageforces", "0"); - DispatchKeyValue(iPhysbox, "material", "0"); - DispatchKeyValue(iPhysbox, "massScale", "0"); - DispatchKeyValue(iPhysbox, "health", "32500"); - DispatchKeyValue(iPhysbox, "gibdir", "0 0 0"); - DispatchKeyValue(iPhysbox, "forcetoenablemotion", "0"); - DispatchKeyValue(iPhysbox, "explosion", "0"); - DispatchKeyValue(iPhysbox, "ExplodeRadius", "0"); - DispatchKeyValue(iPhysbox, "explodemagnitude", "0"); - DispatchKeyValue(iPhysbox, "ExplodeDamage", "0"); - DispatchKeyValue(iPhysbox, "disableshadows", "1"); - DispatchKeyValue(iPhysbox, "disablereceiveshadows", "0"); - DispatchKeyValue(iPhysbox, "Damagetype", "0"); - DispatchKeyValue(iPhysbox, "damagetoenablemotion", "0"); - DispatchKeyValue(iPhysbox, "damagefilter", "item_spawn_human_filter"); - DispatchKeyValue(iPhysbox, "model", "models/props/cs_militia/crate_extrasmallmill.mdl"); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,EmitBlood,,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnDamaged", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,ClearParent,,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,SetAnimation,balrog_death,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_model_%d,SetDefaultAnimation,balrog_death_idle,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_%d,Enable,,1,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_%d,Disable,,2,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay1_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay2_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_timer_%d,Disable,,0,-1", g_iCounter); - DispatchKeyValue(iPhysbox, "OnBreak", sBuffer); + // ambient_generic attack. + int iSoundAttack = CreateEntityAtOrigin("ambient_generic", fOrigin); + DispatchKeyFormat(iSoundAttack, "targetname", "item_balrog_attack_sound_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack, "spawnflags", "48"); + DispatchKeyFormat(iSoundAttack, "radius", "8250"); + DispatchKeyFormat(iSoundAttack, "sourceentityname", "item_balrog_knife_%d", g_iCounter); + DispatchKeyFormat(iSoundAttack, "message", "npc/strider/strider_skewer1.wav"); + DispatchKeyFormat(iSoundAttack, "volume", "10"); + DispatchKeyFormat(iSoundAttack, "health", "10"); + DispatchKeyFormat(iSoundAttack, "pitch", "100"); + DispatchKeyFormat(iSoundAttack, "pitchstart", "100"); + ActivateAndSpawn(iSoundAttack); + ParentToEntity(iSoundAttack, iKnife); + + int iRelayRoar = CreateEntityAtOrigin("logic_relay", fOrigin); + DispatchKeyFormat(iRelayRoar, "targetname", "item_balrog_roar_relay_%d", g_iCounter); + DispatchKeyFormat(iRelayRoar, "spawnflags", "0"); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_roar_relay_%d,Disable,,0,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_attack_relay_%d,Disable,,0,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_model_%d,SetAnimation,balrog_groar,0,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_roar_%d,Enable,,0,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_roar_%d,Disable,,4,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_roar_sound_%d,PlaySound,,1,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_roar_relay_%d,Enable,,25,-1", g_iCounter); + DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_balrog_attack_relay_%d,Enable,,4,-1", g_iCounter); + ActivateAndSpawn(iRelayRoar); + ParentToEntity(iRelayRoar, iKnife); + + int iRelayAttack = CreateEntityAtOrigin("logic_relay", fOrigin); + DispatchKeyFormat(iRelayAttack, "targetname", "item_balrog_attack_relay_%d", g_iCounter); + DispatchKeyFormat(iRelayAttack, "spawnflags", "0"); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_roar_relay_%d,Disable,,0,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_attack_relay_%d,Disable,,0,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_model_%d,SetAnimation,balrog_attack1,0,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_attack_%d,Enable,,1.75,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_attack_%d,Disable,,2.2,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_attack_sound_%d,PlaySound,,1,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_roar_relay_%d,Enable,,4,-1", g_iCounter); + DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_balrog_attack_relay_%d,Enable,,4,-1", g_iCounter); + ActivateAndSpawn(iRelayAttack); + ParentToEntity(iRelayAttack, iKnife); + + // health origin. fOriginTemp[0] = fOrigin[0] + 44.0; fOriginTemp[1] = fOrigin[1] - 18.74; fOriginTemp[2] = fOrigin[2] + 126.89; - DispatchKeyValueVector(iPhysbox, "origin", fOriginTemp); - DispatchSpawn(iPhysbox); - ActivateEntity(iPhysbox); - float fMinbounds3[3] = {-124.0, -120.0, -188.2}; - float fMaxbounds3[3] = {124.0, 120.0, 188.2}; - SetEntPropVector(iPhysbox, Prop_Send, "m_vecMins", fMinbounds3); - SetEntPropVector(iPhysbox, Prop_Send, "m_vecMaxs", fMaxbounds3); - SetEntProp(iPhysbox, Prop_Send, "m_nSolidType", 3); - int enteffects3 = GetEntProp(iPhysbox, Prop_Send, "m_fEffects"); - enteffects3 |= 32; - SetEntProp(iPhysbox, Prop_Send, "m_fEffects", enteffects3); - SetVariantString("!activator"); - AcceptEntityInput(iPhysbox, "SetParent", iKnife); - HookSingleEntityOutput(iPhysbox, "OnBreak", BalrogKill, true); - // Game UI - int iUI = CreateEntityByName("game_ui"); - Format(sBuffer, sizeof(sBuffer), "balrog_ui_%d", g_iCounter); - DispatchKeyValue(iUI, "targetname", sBuffer); - DispatchKeyValue(iUI, "spawnflags", "0"); - DispatchKeyValue(iUI, "FieldOfView", "-1.0"); - Format(sBuffer, sizeof(sBuffer), "balrog_relay2_%d,Trigger,,0,-1", g_iCounter); - DispatchKeyValue(iUI, "PressedAttack", sBuffer); - Format(sBuffer, sizeof(sBuffer), "balrog_relay1_%d,Trigger,,0,-1", g_iCounter); - DispatchKeyValue(iUI, "PressedAttack2", sBuffer); - DispatchKeyValue(iUI, "PressedAttack2", "item_spawn_speedmod,ModifySpeed,0,0,-1"); - DispatchKeyValue(iUI, "PressedAttack2", "item_spawn_speedmod,ModifySpeed,0,0.1,-1"); - DispatchKeyValue(iUI, "PressedAttack2", "item_spawn_speedmod,ModifySpeed,0,0.2,-1"); - DispatchKeyValue(iUI, "PressedAttack2", "item_spawn_speedmod,ModifySpeed,0,0.3,-1"); - DispatchKeyValue(iUI, "PressedAttack2", "item_spawn_speedmod,ModifySpeed,0.8,3.0,-1"); - DispatchKeyValue(iUI, "PressedAttack", "item_spawn_speedmod,ModifySpeed,0,0,-1"); - DispatchKeyValue(iUI, "PressedAttack", "item_spawn_speedmod,ModifySpeed,0.8,3.0,-1"); - DispatchSpawn(iUI); - ActivateEntity(iUI); - SetVariantString("!activator"); - AcceptEntityInput(iUI, "SetParent", iKnife); + int iHealth = CreateEntityAtOrigin("func_physbox_multiplayer", fOriginTemp); + DispatchKeyFormat(iHealth, "targetname", "item_balrog_health_%d", g_iCounter); + DispatchKeyFormat(iHealth, "spawnflags", "574464"); + 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", "0"); + DispatchKeyFormat(iHealth, "notsolid", "0"); + DispatchKeyFormat(iHealth, "nodamageforces", "0"); + DispatchKeyFormat(iHealth, "material", "0"); + DispatchKeyFormat(iHealth, "massScale", "0"); + DispatchKeyFormat(iHealth, "health", "32500"); + 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", "0"); + DispatchKeyFormat(iHealth, "damagetype", "0"); + DispatchKeyFormat(iHealth, "damagetoenablemotion", "0"); + DispatchKeyFormat(iHealth, "damagefilter", "item_spawn_human_filter"); + DispatchKeyFormat(iHealth, "model", "models/props/cs_militia/crate_extrasmallmill.mdl"); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_walk_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_roar_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_attack_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_walk_sound_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_roar_sound_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_attack_sound_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_roar_relay_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_attack_relay_%d,Kill,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_model_%d,ClearParent,,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_model_%d,SetAnimation,balrog_death,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_model_%d,SetDefaultAnimation,balrog_death_idle,0,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_death_%d,Enable,,1,-1", g_iCounter); + DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_death_%d,Kill,,2,-1", g_iCounter); + ActivateAndSpawn(iHealth); + ParentToEntity(iHealth, iKnife); - // enable pickup trigger - SetVariantString("!activator"); - AcceptEntityInput(iTrigger, "Enable"); +// SetEntPropVector(iHealth, Prop_Send, "m_vecMins", {-124.0, -120.0, -188.2}); +// SetEntPropVector(iHealth, Prop_Send, "m_vecMaxs", { 124.0, 120.0, 188.2}); - g_iCounter ++; +// SetEntProp(iHealth, Prop_Send, "m_fEffects", GetEntProp(iHealth, Prop_Send, "m_fEffects") |= 32); +// SetEntProp(iHealth, Prop_Send, "m_nSolidType", 2); + + HookSingleEntityOutput(iHealth, "OnBreak", BalrogKill, true); + + // game_ui. + int iControls = CreateEntityAtOrigin("game_ui", fOrigin); + DispatchKeyFormat(iControls, "targetname", "item_balrog_ui_%d", g_iCounter); + DispatchKeyFormat(iControls, "spawnflags", "0"); + DispatchKeyFormat(iControls, "fieldofview", "-1.0"); + DispatchKeyFormat(iControls, "PressedAttack", "item_balrog_attack_relay_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack", "item_spawn_speedmod_%d,ModifySpeed,0,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack", "item_spawn_speedmod_%d,ModifySpeed,0,1,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack", "item_spawn_speedmod_%d,ModifySpeed,0,2,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack", "item_spawn_speedmod_%d,ModifySpeed,0,3,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack", "item_spawn_speedmod_%d,ModifySpeed,0.8,4,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_balrog_roar_relay_%d,Trigger,,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_spawn_speedmod_%d,ModifySpeed,0,0,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_spawn_speedmod_%d,ModifySpeed,0,1,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_spawn_speedmod_%d,ModifySpeed,0,2,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_spawn_speedmod_%d,ModifySpeed,0,3,-1", g_iCounter); + DispatchKeyFormat(iControls, "PressedAttack2", "item_spawn_speedmod_%d,ModifySpeed,0.8,4,-1", g_iCounter); + + AcceptEntityInput(iTriggerStrip, "Enable"); + g_iCounter++; } //----------------------------------------------------------------------------------------------------