ItemSpawn: Start with whiteknight. :P
This commit is contained in:
@@ -92,8 +92,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
|
||||
// make the trigger work.
|
||||
SetEntityBBox(iTriggerStrip, view_as<float>({-8.0, -8.0, -8.0}), view_as<float>({8.0, 8.0, 8.0}));
|
||||
SetEntitySolid(iTriggerStrip);
|
||||
SetEntityNodraw(iTriggerStrip);
|
||||
SetEntityProps(iTriggerStrip);
|
||||
|
||||
// walk origin.
|
||||
fOriginTemp[0] = fOrigin[0] + 28.5;
|
||||
@@ -115,8 +114,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
|
||||
// make the trigger work.
|
||||
SetEntityBBox(iTriggerWalk, view_as<float>({-32.0, -72.0, -84.0}), view_as<float>({32.0, 72.0, 84.0}));
|
||||
SetEntitySolid(iTriggerWalk);
|
||||
SetEntityNodraw(iTriggerWalk);
|
||||
SetEntityProps(iTriggerWalk);
|
||||
|
||||
// roar origin.
|
||||
fOriginTemp[0] = fOrigin[0] - 15.5;
|
||||
@@ -144,8 +142,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
|
||||
// make the trigger work.
|
||||
SetEntityBBox(iTriggerRoar, view_as<float>({-736.0, -736.0, -560.0}), view_as<float>({736.0, 736.0, 560.0}));
|
||||
SetEntitySolid(iTriggerRoar);
|
||||
SetEntityNodraw(iTriggerRoar);
|
||||
SetEntityProps(iTriggerRoar);
|
||||
|
||||
// attack origin.
|
||||
fOriginTemp[0] = fOrigin[0] + 360.5;
|
||||
@@ -167,8 +164,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
|
||||
// make the trigger work.
|
||||
SetEntityBBox(iTriggerAttack, view_as<float>({-152.0, -256.0, -71.5}), view_as<float>({152.0, 256.0, 71.5}));
|
||||
SetEntitySolid(iTriggerAttack);
|
||||
SetEntityNodraw(iTriggerAttack);
|
||||
SetEntityProps(iTriggerAttack);
|
||||
|
||||
// ambient_generic walk.
|
||||
int iSoundWalk = CreateEntityAtOrigin("ambient_generic", fOrigin);
|
||||
@@ -263,7 +259,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
DispatchKeyFormat(iRelayDeath, "OnUser1", "item_balrog_attack_compare_%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,AddOutput,gravity 1,0,1");
|
||||
// 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");
|
||||
SpawnAndActivate(iRelayDeath);
|
||||
@@ -318,7 +314,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
DispatchKeyFormat(iHealth, "OnBreak", "item_balrog_model_%d,SetDefaultAnimation,balrog_death_idle,0,-1", g_iCounter);
|
||||
DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,rendermode 10,0,-1");
|
||||
DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,renderfx 6,0,-1");
|
||||
DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,gravity 2,0,-1");
|
||||
// DispatchKeyFormat(iHealth, "OnUser1", "!activator,AddOutput,gravity 2,0,-1");
|
||||
DispatchKeyFormat(iHealth, "OnUser1", "!self,FireUser1,,1,-1");
|
||||
DispatchKeyFormat(iHealth, "OnUser2", "item_balrog_walk_sound_%d,PlaySound,,0,-1", g_iCounter);
|
||||
DispatchKeyFormat(iHealth, "OnUser2", "item_balrog_walk_%d,Disable,,0,-1", g_iCounter);
|
||||
@@ -332,8 +328,7 @@ public void SpawnBalrog(float fOrigin[3])
|
||||
|
||||
// make the physbox work.
|
||||
SetEntityBBox(iHealth, view_as<float>({-124.0, -120.0, -188.2}), view_as<float>({124.0, 120.0, 188.2}));
|
||||
SetEntitySolid(iHealth);
|
||||
SetEntityNodraw(iHealth);
|
||||
SetEntityProps(iHealth);
|
||||
|
||||
HookSingleEntityOutput(iHealth, "OnBreak", BalrogKill, true);
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Action Command_WhiteKnight(int client, int argc)
|
||||
{
|
||||
float fOrigin[3];
|
||||
|
||||
if (argc < 1)
|
||||
{
|
||||
GetClientEyePosition(client, fOrigin);
|
||||
SpawnWhiteKnight(fOrigin);
|
||||
LogAction(client, -1, "\"%L\" spawned WhiteKnight at <%f><%f><%f>.", client, fOrigin[0], fOrigin[1], fOrigin[2]);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
char sArgs[64];
|
||||
char sTargetName[MAX_TARGET_LENGTH];
|
||||
int iTargets[MAXPLAYERS];
|
||||
int iTargetCount;
|
||||
bool bIsML;
|
||||
|
||||
GetCmdArg(1, sArgs, sizeof(sArgs));
|
||||
|
||||
if ((iTargetCount = ProcessTargetString(sArgs, client, iTargets, MAXPLAYERS, COMMAND_FILTER_CONNECTED, sTargetName, sizeof(sTargetName), bIsML)) <= 0)
|
||||
{
|
||||
ReplyToTargetError(client, iTargetCount);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
for (int i = 0; i < iTargetCount; i++)
|
||||
{
|
||||
if(IsClientInGame(iTargets[i]) && IsPlayerAlive(iTargets[i]) && (ZR_IsClientZombie(iTargets[i])))
|
||||
{
|
||||
GetClientEyePosition(iTargets[i], fOrigin);
|
||||
SpawnWhiteKnight(fOrigin);
|
||||
LogAction(client, -1, "\"%L\" gave WhiteKnight to \"%L\".", client, iTargets[i]);
|
||||
}
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void SpawnWhiteKnight(float fOrigin[3])
|
||||
{
|
||||
float fOriginTemp[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");
|
||||
|
||||
SpawnAndActivate(iKnife);
|
||||
|
||||
HookSingleEntityOutput(iKnife, "OnPlayerPickup", WhiteKnightPickup, true);
|
||||
|
||||
// model origin.
|
||||
fOriginTemp[0] = fOrigin[0] + 6.0;
|
||||
fOriginTemp[1] = fOrigin[1] + 0.0;
|
||||
fOriginTemp[2] = fOrigin[2] - 30.0;
|
||||
|
||||
// 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", "dog_run");
|
||||
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");
|
||||
SpawnAndActivate(iTriggerStrip);
|
||||
ParentToEntity(iTriggerStrip, iKnife);
|
||||
|
||||
// make the trigger work.
|
||||
SetEntityBBox(iTriggerStrip, view_as<float>({-8.0, -8.0, -8.0}), view_as<float>({8.0, 8.0, 8.0}));
|
||||
SetEntityProps(iTriggerStrip);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AcceptEntityInput(iTriggerStrip, "Enable");
|
||||
g_iCounter++;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void WhiteKnightPickup(const char[] output, int caller, int activator, float delay)
|
||||
{
|
||||
ServerCommand("say ** %N has picked up the White Knight **", activator);
|
||||
|
||||
PrintToChat(activator, " LEFT CLICK = ATTACK and RIGHT CLICK = SHIELD.");
|
||||
}
|
||||
Reference in New Issue
Block a user