ItemSpawn: balrog, once again :D

This commit is contained in:
zaCade 2018-08-04 17:30:59 +02:00
parent 75427ac376
commit 4c168bd651
4 changed files with 1809 additions and 1815 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,205 +0,0 @@
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <zombiereloaded>
#pragma semicolon 1
int g_iConsole;
int g_iCounter = 0;
#include "items\balrog.inc"
#include "items\doghuman.inc"
#include "items\tnt.inc"
#include "items\vortigaunt.inc"
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Plugin myinfo =
{
name = "ItemSpawn",
author = "Neon",
description = "",
version = "1.1",
url = "https://steamcommunity.com/id/n3ontm"
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnPluginStart()
{
HookEvent("round_start", OnRoundStart, EventHookMode_Post);
RegAdminCmd("sm_tnt", Command_TNT, ADMFLAG_KICK);
RegAdminCmd("sm_balrog", Command_Balrog, ADMFLAG_KICK);
RegAdminCmd("sm_humandog", Command_HumanDog, ADMFLAG_KICK);
RegAdminCmd("sm_vortigaunt", Command_Vortigaunt, ADMFLAG_KICK);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnMapStart()
{
// Physbox
PrecacheModel("models/props/cs_militia/crate_extrasmallmill.mdl");
// Vortigaunt
PrecacheModel("models/vortigaunt_slave.mdl");
// Balrog
PrecacheModel("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl");
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.dx80.vtx");
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.dx90.vtx");
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl");
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.sw.vtx");
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.vvd");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body.vmt");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body.vtf");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body_2.vmt");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_eyes.vmt");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon.vmt");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon.vtf");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon_blade.vmt");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon_bump.vtf");
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_wings.vmt");
AddFileToDownloadsTable("sound/unloze/balrog_scream.mp3");
// TNT
PrecacheModel("models/props/furnitures/humans/barrel01b.mdl");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.dx80.vtx");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.dx90.vtx");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.mdl");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.phy");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.sw.vtx");
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.vvd");
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b.vmt");
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b.vtf");
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b_broken.vmt");
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b_no_metal.vtf");
// Dog
PrecacheModel("models/player/pil/re1/dog/dog_pil.mdl");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.dx80.vtx");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.dx90.vtx");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.mdl");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.phy");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.sw.vtx");
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.vvd");
AddFileToDownloadsTable("materials/models/player/pil/re1/dog/0000a.vmt");
AddFileToDownloadsTable("materials/models/player/pil/re1/dog/0000a.vtf");
// Dog Poo
PrecacheModel("models/poo/curlygpoo.mdl");
AddFileToDownloadsTable("models/poo/curlygpoo.dx80.vtx");
AddFileToDownloadsTable("models/poo/curlygpoo.dx90.vtx");
AddFileToDownloadsTable("models/poo/curlygpoo.mdl");
AddFileToDownloadsTable("models/poo/curlygpoo.phy");
AddFileToDownloadsTable("models/poo/curlygpoo.sw.vtx");
AddFileToDownloadsTable("models/poo/curlygpoo.vvd");
AddFileToDownloadsTable("materials/models/poo/curlypoo.vmt");
AddFileToDownloadsTable("materials/models/poo/curlypoo.vtf");
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock int CreateEntityAtOrigin(const char[] classname, const float origin[3])
{
int entity = INVALID_ENT_REFERENCE;
if ((entity = CreateEntityByName(classname)) != INVALID_ENT_REFERENCE)
DispatchKeyValueVector(entity, "origin", origin);
return entity;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock bool DispatchKeyFormat(int entity, const char[] key, const char[] value, any ...)
{
char buffer[1024];
VFormat(buffer, sizeof(buffer), value, 4);
return DispatchKeyValue(entity, key, buffer);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock bool ActivateAndSpawn(int entity)
{
ActivateEntity(entity);
return DispatchSpawn(entity);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock bool ParentToEntity(int entity, int parent)
{
SetVariantString("!activator");
return AcceptEntityInput(entity, "SetParent", parent, parent);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock void SetEntityBBox(int entity, const float mins[3], const float maxs[3])
{
SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock void SetEntitySolid(int entity)
{
SetEntProp(entity, Prop_Send, "m_nSolidType", 3);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
stock void SetEntityNodraw(int entity)
{
SetEntProp(entity, Prop_Send, "m_fEffects", 32);
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
{
g_iCounter = 0;
// player_weaponstrip
int iPlayerStrip = CreateEntityByName("player_weaponstrip");
DispatchKeyFormat(iPlayerStrip, "targetname", "item_spawn_weaponstrip");
ActivateAndSpawn(iPlayerStrip);
// player_speedmod
int iPlayerSpeed = CreateEntityByName("player_speedmod");
DispatchKeyFormat(iPlayerSpeed, "targetname", "item_spawn_speedmod");
ActivateAndSpawn(iPlayerSpeed);
// filter_activator_team humans
int iHumanFilter = CreateEntityByName("filter_activator_team");
DispatchKeyFormat(iHumanFilter, "targetname", "item_spawn_human_filter");
DispatchKeyFormat(iHumanFilter, "Negated", "0");
DispatchKeyFormat(iHumanFilter, "filterteam", "3");
ActivateAndSpawn(iHumanFilter);
// filter_activator_team zombies
int iZombieFilter = CreateEntityByName("filter_activator_team");
DispatchKeyFormat(iZombieFilter, "targetname", "item_spawn_zombie_filter");
DispatchKeyFormat(iZombieFilter, "Negated", "0");
DispatchKeyFormat(iZombieFilter, "filterteam", "2");
ActivateAndSpawn(iZombieFilter);
}

File diff suppressed because it is too large Load Diff

View File

@ -66,7 +66,7 @@ public void SpawnBalrog(float fOrigin[3])
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);
SpawnAndActivate(iKnife);
HookSingleEntityOutput(iKnife, "OnPlayerPickup", BalrogPickup, true);
@ -83,7 +83,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iModel, "defaultanim", "crouch_walk_lower");
DispatchKeyFormat(iModel, "angles", "0 2 0");
DispatchKeyFormat(iModel, "solid", "0");
ActivateAndSpawn(iModel);
SpawnAndActivate(iModel);
ParentToEntity(iModel, iKnife);
// trigger_once strip.
@ -93,7 +93,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iTriggerStrip, "spawnflags", "1");
DispatchKeyFormat(iTriggerStrip, "startdisabled", "1");
DispatchKeyFormat(iTriggerStrip, "OnStartTouch", "item_spawn_weaponstrip,StripWeaponsAndSuit,,0,1");
ActivateAndSpawn(iTriggerStrip);
SpawnAndActivate(iTriggerStrip);
ParentToEntity(iTriggerStrip, iKnife);
// make the trigger work.
@ -112,7 +112,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iTriggerDeath, "damagemodel", "0");
DispatchKeyFormat(iTriggerDeath, "damagecap", "20");
DispatchKeyFormat(iTriggerDeath, "damage", "99999999");
ActivateAndSpawn(iTriggerDeath);
SpawnAndActivate(iTriggerDeath);
ParentToEntity(iTriggerDeath, iKnife);
// make the trigger work.
@ -136,7 +136,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iTriggerWalk, "damagemodel", "0");
DispatchKeyFormat(iTriggerWalk, "damagecap", "20");
DispatchKeyFormat(iTriggerWalk, "damage", "190");
ActivateAndSpawn(iTriggerWalk);
SpawnAndActivate(iTriggerWalk);
ParentToEntity(iTriggerWalk, iKnife);
// make the trigger work.
@ -166,7 +166,7 @@ public void SpawnBalrog(float fOrigin[3])
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);
SpawnAndActivate(iTriggerRoar);
ParentToEntity(iTriggerRoar, iKnife);
// make the trigger work.
@ -174,7 +174,7 @@ public void SpawnBalrog(float fOrigin[3])
SetEntityBBox(iTriggerRoar, view_as<float>({-736.0, -736.0, -560.0}), view_as<float>({736.0, 736.0, 560.0}));
SetEntitySolid(iTriggerRoar);
SetEntityNodraw(iTriggerRoar);
// attack origin.
fOriginTemp[0] = fOrigin[0] + 360.5;
fOriginTemp[1] = fOrigin[1] - 58.74;
@ -190,7 +190,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iTriggerAttack, "damagemodel", "0");
DispatchKeyFormat(iTriggerAttack, "damagecap", "20");
DispatchKeyFormat(iTriggerAttack, "damage", "500");
ActivateAndSpawn(iTriggerAttack);
SpawnAndActivate(iTriggerAttack);
ParentToEntity(iTriggerAttack, iKnife);
// make the trigger work.
@ -210,7 +210,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iSoundWalk, "health", "10");
DispatchKeyFormat(iSoundWalk, "pitch", "100");
DispatchKeyFormat(iSoundWalk, "pitchstart", "100");
ActivateAndSpawn(iSoundWalk);
SpawnAndActivate(iSoundWalk);
ParentToEntity(iSoundWalk, iKnife);
// ambient_generic roar.
@ -224,7 +224,7 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iSoundRoar, "health", "10");
DispatchKeyFormat(iSoundRoar, "pitch", "100");
DispatchKeyFormat(iSoundRoar, "pitchstart", "100");
ActivateAndSpawn(iSoundRoar);
SpawnAndActivate(iSoundRoar);
ParentToEntity(iSoundRoar, iKnife);
// ambient_generic attack.
@ -238,54 +238,48 @@ public void SpawnBalrog(float fOrigin[3])
DispatchKeyFormat(iSoundAttack, "health", "10");
DispatchKeyFormat(iSoundAttack, "pitch", "100");
DispatchKeyFormat(iSoundAttack, "pitchstart", "100");
ActivateAndSpawn(iSoundAttack);
SpawnAndActivate(iSoundAttack);
ParentToEntity(iSoundAttack, iKnife);
// logic_relay roar.
int iRelayRoar = CreateEntityAtOrigin("logic_relay", fOrigin);
DispatchKeyFormat(iRelayRoar, "targetname", "item_balrog_roar_relay_%d", g_iCounter);
// logic_compare roar.
int iRelayRoar = CreateEntityAtOrigin("logic_compare", fOrigin);
DispatchKeyFormat(iRelayRoar, "targetname", "item_balrog_roar_compare_%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);
DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,0,-1");
DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,1,-1");
DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,2,-1");
DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,3,-1");
DispatchKeyFormat(iRelayRoar, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0.8,4,-1");
ActivateAndSpawn(iRelayRoar);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "!self,SetValue,1,0,-1");
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "!self,SetValue,0,25,-1");
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_attack_compare_%d,SetCompareValue,-1,0,-1", g_iCounter);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_attack_compare_%d,SetCompareValue,0,4,-1", g_iCounter);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_spawn_speedmod,ModifySpeed,0,0,-1");
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_spawn_speedmod,ModifySpeed,0.8,4,-1");
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_model_%d,SetAnimation,balrog_groar,0,-1", g_iCounter);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_roar_sound_%d,PlaySound,,1,-1", g_iCounter);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_roar_%d,Enable,,0,-1", g_iCounter);
DispatchKeyFormat(iRelayRoar, "OnEqualTo", "item_balrog_roar_%d,Disable,,4,-1", g_iCounter);
SpawnAndActivate(iRelayRoar);
ParentToEntity(iRelayRoar, iKnife);
// logic_relay attack.
int iRelayAttack = CreateEntityAtOrigin("logic_relay", fOrigin);
DispatchKeyFormat(iRelayAttack, "targetname", "item_balrog_attack_relay_%d", g_iCounter);
// logic_compare attack.
int iRelayAttack = CreateEntityAtOrigin("logic_compare", fOrigin);
DispatchKeyFormat(iRelayAttack, "targetname", "item_balrog_attack_compare_%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);
DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,0,-1");
DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,1,-1");
DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,2,-1");
DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0,3,-1");
DispatchKeyFormat(iRelayAttack, "OnTrigger", "item_spawn_speedmod,ModifySpeed,0.8,4,-1");
ActivateAndSpawn(iRelayAttack);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "!self,SetValue,1,0,-1");
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "!self,SetValue,0,4,-1");
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_roar_compare_%d,SetCompareValue,-1,0,-1", g_iCounter);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_roar_compare_%d,SetCompareValue,0,4,-1", g_iCounter);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_spawn_speedmod,ModifySpeed,0,0,-1");
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_spawn_speedmod,ModifySpeed,0.8,4,-1");
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_model_%d,SetAnimation,balrog_attack1,0,-1", g_iCounter);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_attack_sound_%d,PlaySound,,1,-1", g_iCounter);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_attack_%d,Enable,,1.75,-1", g_iCounter);
DispatchKeyFormat(iRelayAttack, "OnEqualTo", "item_balrog_attack_%d,Disable,,2.2,-1", g_iCounter);
SpawnAndActivate(iRelayAttack);
ParentToEntity(iRelayAttack, iKnife);
// health origin.
fOriginTemp[0] = fOrigin[0] + 44.0;
fOriginTemp[1] = fOrigin[1] - 18.74;
fOriginTemp[2] = fOrigin[2] + 126.89;
/*
// func_physbox_multiplayer health.
int iHealth = CreateEntityAtOrigin("func_physbox_multiplayer", fOriginTemp);
DispatchKeyFormat(iHealth, "targetname", "item_balrog_health_%d", g_iCounter);
@ -321,14 +315,14 @@ public void SpawnBalrog(float fOrigin[3])
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_roar_compare_%d,Kill,,0,-1", g_iCounter);
DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_attack_compare_%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);
SpawnAndActivate(iHealth);
ParentToEntity(iHealth, iKnife);
// make the trigger work.
@ -338,14 +332,16 @@ public void SpawnBalrog(float fOrigin[3])
SetEntityNodraw(iHealth);
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, "PressedAttack2", "item_balrog_roar_relay_%d,Trigger,,0,-1", g_iCounter);
DispatchKeyFormat(iControls, "PressedAttack", "item_balrog_attack_compare_%d,Compare,,0,-1", g_iCounter);
DispatchKeyFormat(iControls, "PressedAttack2", "item_balrog_roar_compare_%d,Compare,,0,-1", g_iCounter);
SpawnAndActivate(iControls);
ParentToEntity(iControls, iKnife);
AcceptEntityInput(iTriggerStrip, "Enable");
g_iCounter++;