From 9fe31326e7de7cc176f42e5e1284353758f654ff Mon Sep 17 00:00:00 2001 From: zaCade Date: Tue, 7 Aug 2018 18:18:46 +0200 Subject: [PATCH] ItemSpawn: Hopefully fix the balrog crash. Plus change some small things around. --- ItemSpawn/scripting/ItemSpawn.sp | 3 +++ ItemSpawn/scripting/items/balrog.inc | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ItemSpawn/scripting/ItemSpawn.sp b/ItemSpawn/scripting/ItemSpawn.sp index 6bd147fc..afc424a1 100644 --- a/ItemSpawn/scripting/ItemSpawn.sp +++ b/ItemSpawn/scripting/ItemSpawn.sp @@ -44,6 +44,9 @@ public void OnPluginStart() //---------------------------------------------------------------------------------------------------- public void OnMapStart() { + // Yeeaass (Physbox model) + PrecacheModel("models/props/cs_militia/crate_extrasmallmill.mdl"); + // Vortigaunt PrecacheModel("models/vortigaunt_slave.mdl"); diff --git a/ItemSpawn/scripting/items/balrog.inc b/ItemSpawn/scripting/items/balrog.inc index a77f94eb..c4bf799a 100644 --- a/ItemSpawn/scripting/items/balrog.inc +++ b/ItemSpawn/scripting/items/balrog.inc @@ -101,16 +101,16 @@ public void SpawnBalrog(float fOrigin[3]) SetEntitySolid(iTriggerStrip); SetEntityNodraw(iTriggerStrip); - // trigger_hurt death. - int iTriggerDeath = CreateEntityAtOrigin("trigger_hurt", fOrigin); + // trigger_once death. + int iTriggerDeath = CreateEntityAtOrigin("trigger_once", 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, "OnStartTouch", "!activator,SetDamageFilter,,0,-1"); + DispatchKeyFormat(iTriggerDeath, "OnStartTouch", "!activator,SetHealth,0,0.02,-1"); + DispatchKeyFormat(iTriggerDeath, "OnStartTouch", "!activator,AddOutput,rendermode 0,1,-1"); + DispatchKeyFormat(iTriggerDeath, "OnStartTouch", "!activator,AddOutput,renderfx 0,1,-1"); SpawnAndActivate(iTriggerDeath); ParentToEntity(iTriggerDeath, iKnife); @@ -278,7 +278,8 @@ public void SpawnBalrog(float fOrigin[3]) // func_physbox_multiplayer health. int iHealth = CreateEntityAtOrigin("func_physbox_multiplayer", fOriginTemp); DispatchKeyFormat(iHealth, "targetname", "item_balrog_health_%d", g_iCounter); - DispatchKeyFormat(iHealth, "spawnflags", "574464"); + DispatchKeyFormat(iHealth, "model", "models/props/cs_militia/crate_extrasmallmill.mdl"); + DispatchKeyFormat(iHealth, "spawnflags", "8713216"); DispatchKeyFormat(iHealth, "rendermode", "0"); DispatchKeyFormat(iHealth, "renderfx", "0"); DispatchKeyFormat(iHealth, "rendercolor", "255 255 255"); @@ -286,7 +287,7 @@ public void SpawnBalrog(float fOrigin[3]) DispatchKeyFormat(iHealth, "propdata", "0"); DispatchKeyFormat(iHealth, "pressuredelay", "0"); DispatchKeyFormat(iHealth, "preferredcarryangles", "0 0 0"); - DispatchKeyFormat(iHealth, "performancemode", "0"); + DispatchKeyFormat(iHealth, "performancemode", "1"); DispatchKeyFormat(iHealth, "notsolid", "0"); DispatchKeyFormat(iHealth, "nodamageforces", "0"); DispatchKeyFormat(iHealth, "material", "0"); @@ -303,7 +304,6 @@ public void SpawnBalrog(float fOrigin[3]) DispatchKeyFormat(iHealth, "damagetype", "0"); DispatchKeyFormat(iHealth, "damagetoenablemotion", "0"); DispatchKeyFormat(iHealth, "damagefilter", "item_spawn_human_filter"); - DispatchKeyFormat(iHealth, "model", "models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl"); DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_knife_%d,Kill,,0,-1", g_iCounter); DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_strip_%d,Kill,,0,-1", g_iCounter); DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_walk_%d,Kill,,0,-1", g_iCounter);