ItemSpawn: More balrog progress.

This commit is contained in:
zaCade 2018-08-03 17:58:30 +02:00
parent 2c15a570a7
commit 68892b7144

View File

@ -100,56 +100,30 @@ public void SpawnBalrog(float fOrigin[3])
SetEntProp(iTriggerOnce, Prop_Send, "m_nSolidType", 2);
// trigger_hurt death.
int iTriggerHurt1 = CreateEntityAtOrigin("trigger_hurt", fOrigin);
DispatchKeyFormat(iTriggerHurt1, "targetname", "item_balrog_death_%d", g_iCounter);
DispatchKeyFormat(iTriggerHurt1, "filtername", "item_spawn_zombie_filter");
DispatchKeyFormat(iTriggerHurt1, "spawnflags", "1");
DispatchKeyFormat(iTriggerHurt1, "startdisabled", "1");
DispatchKeyFormat(iTriggerHurt1, "damagetype", "0");
DispatchKeyFormat(iTriggerHurt1, "damagemodel", "0");
DispatchKeyFormat(iTriggerHurt1, "damagecap", "20");
DispatchKeyFormat(iTriggerHurt1, "damage", "99999999");
ActivateAndSpawn(iTriggerHurt1);
ParentToEntity(iTriggerHurt1, iKnife);
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");
ActivateAndSpawn(iTriggerDeath);
ParentToEntity(iTriggerDeath, iKnife);
SetEntityModel(iTriggerHurt1, "models/vortigaunt_slave.mdl");
SetEntityModel(iTriggerDeath, "models/vortigaunt_slave.mdl");
SetEntPropVector(iTriggerHurt1, Prop_Send, "m_vecMins", {-8.0, -8.0, -8.0});
SetEntPropVector(iTriggerHurt1, 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(iTriggerHurt1, Prop_Send, "m_fEffects", GetEntProp(iTriggerOnce, Prop_Send, "m_fEffects") |= 32);
SetEntProp(iTriggerHurt1, 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);
// kill trigger_once
int iKillTrigger = CreateEntityByName("trigger_hurt");
Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_%d", g_iCounter);
DispatchKeyValue(iKillTrigger, "targetname", sBuffer);
DispatchKeyValue(iKillTrigger, "spawnflags", "1");
DispatchKeyValue(iKillTrigger, "startdisabled", "1");
DispatchKeyValue(iKillTrigger, "filtername", "item_spawn_zombie_filter");
DispatchKeyValue(iKillTrigger, "damagetype", "0");
DispatchKeyValue(iKillTrigger, "damagemodel", "0");
DispatchKeyValue(iKillTrigger, "damagecap", "20");
DispatchKeyValue(iKillTrigger, "damage", "200000");
DispatchKeyValueVector(iKillTrigger, "origin", fOrigin);
DispatchSpawn(iKillTrigger);
ActivateEntity(iKillTrigger);
SetEntityModel(iKillTrigger, "models/vortigaunt_slave.mdl");
float fMinbounds4[3] = {-10.0, -10.0, -36.0};
float fMaxbounds4[3] = {10.0, 10.0, 36.0};
SetEntPropVector(iKillTrigger, Prop_Send, "m_vecMins", fMinbounds4);
SetEntPropVector(iKillTrigger, Prop_Send, "m_vecMaxs", fMaxbounds4);
SetEntProp(iKillTrigger, Prop_Send, "m_nSolidType", 3);
int enteffects4 = GetEntProp(iKillTrigger, Prop_Send, "m_fEffects");
enteffects4 |= 32;
SetEntProp(iKillTrigger, Prop_Send, "m_fEffects", enteffects4);
SetVariantString("!activator");
AcceptEntityInput(iKillTrigger, "SetParent", iKnife);
// trigger_hurt walking
int iKillTriggerWalking = CreateEntityByName("trigger_hurt");
Format(sBuffer, sizeof(sBuffer), "balrog_kill_trigger_walking_%d", g_iCounter);