diff --git a/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vmt b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vmt new file mode 100644 index 0000000..d571024 --- /dev/null +++ b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vmt @@ -0,0 +1,22 @@ +"VertexLitGeneric" +{ + "$baseTexture" "Models/Dog_gondor/dog_sheet" + "$phong" "1" + "$phongboost" "5" + "$halflambert" "1" + + "$envmap" "env_cubemap" + "$envmaptint" "[.05 .05 .05]" + "$normalmapalphaenvmapmask" "1" + "$envmapfresnel" "1" + //"$phongexponent" "5" + "$phongexponenttexture" "Models/Dog_gondor/dog_sheet_phong" + "$phongalbedotint" "1" + "$phongfresnelranges" "[.1 .5 1.0]" + + + "$detail" "detail\metal_detail_01" + "$detailscale" "6.283" + "$detailblendfactor" "1.2" + "$detailblendmode" "0" +} diff --git a/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vtf b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vtf new file mode 100644 index 0000000..4c6be51 Binary files /dev/null and b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet.vtf differ diff --git a/ItemSpawn/content/materials/models/dog_gondor/dog_sheet_phong.vtf b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet_phong.vtf new file mode 100644 index 0000000..8d91b36 Binary files /dev/null and b/ItemSpawn/content/materials/models/dog_gondor/dog_sheet_phong.vtf differ diff --git a/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vmt b/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vmt new file mode 100644 index 0000000..cf2c389 --- /dev/null +++ b/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$baseTexture" "Models/Dog_gondor/eyeglass" + "$translucent" "1" + "$envmap" "env_cubemap" + "$envcontrast" "1" +} diff --git a/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vtf b/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vtf new file mode 100644 index 0000000..ed86528 Binary files /dev/null and b/ItemSpawn/content/materials/models/dog_gondor/eyeglass.vtf differ diff --git a/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vmt b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vmt new file mode 100644 index 0000000..546f951 --- /dev/null +++ b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vmt @@ -0,0 +1,13 @@ +"vertexlitgeneric" +{ + "$basetexture" "Models/Dog_gondor/weapon107_000_001" + "$bumpmap" "Models/Dog_gondor/weapon107_000_002" + "$translucent" "1" + "$envmap" "env_cubemap" + "$normalmapalphaenvmapmask" 1 + "$selfillum" "1" + "$phong" "1" + "$phongexponent" 35 + "$phongboost" "2" + "$phongfresnelranges" "[0.05 0.5 1]" +} \ No newline at end of file diff --git a/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vtf b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vtf new file mode 100644 index 0000000..821a693 Binary files /dev/null and b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_001.vtf differ diff --git a/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_002.vtf b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_002.vtf new file mode 100644 index 0000000..3ea1859 Binary files /dev/null and b/ItemSpawn/content/materials/models/dog_gondor/weapon107_000_002.vtf differ diff --git a/ItemSpawn/content/models/dog_jugger.dx80.vtx b/ItemSpawn/content/models/dog_jugger.dx80.vtx new file mode 100644 index 0000000..c1af383 Binary files /dev/null and b/ItemSpawn/content/models/dog_jugger.dx80.vtx differ diff --git a/ItemSpawn/content/models/dog_jugger.dx90.vtx b/ItemSpawn/content/models/dog_jugger.dx90.vtx new file mode 100644 index 0000000..a90d730 Binary files /dev/null and b/ItemSpawn/content/models/dog_jugger.dx90.vtx differ diff --git a/ItemSpawn/content/models/dog_jugger.mdl b/ItemSpawn/content/models/dog_jugger.mdl new file mode 100644 index 0000000..6af6334 Binary files /dev/null and b/ItemSpawn/content/models/dog_jugger.mdl differ diff --git a/ItemSpawn/content/models/dog_jugger.sw.vtx b/ItemSpawn/content/models/dog_jugger.sw.vtx new file mode 100644 index 0000000..41d3c52 Binary files /dev/null and b/ItemSpawn/content/models/dog_jugger.sw.vtx differ diff --git a/ItemSpawn/content/models/dog_jugger.vvd b/ItemSpawn/content/models/dog_jugger.vvd new file mode 100644 index 0000000..74e618a Binary files /dev/null and b/ItemSpawn/content/models/dog_jugger.vvd differ diff --git a/ItemSpawn/scripting/ItemSpawn.sp b/ItemSpawn/scripting/ItemSpawn.sp index afc424a..c5278ae 100644 --- a/ItemSpawn/scripting/ItemSpawn.sp +++ b/ItemSpawn/scripting/ItemSpawn.sp @@ -13,6 +13,7 @@ int g_iCounter = 0; #include "items\doghuman.inc" #include "items\tnt.inc" #include "items\vortigaunt.inc" +#include "items\whiteknight.inc" //---------------------------------------------------------------------------------------------------- // Purpose: @@ -37,6 +38,7 @@ public void OnPluginStart() RegAdminCmd("sm_balrog", Command_Balrog, ADMFLAG_KICK); RegAdminCmd("sm_humandog", Command_HumanDog, ADMFLAG_KICK); RegAdminCmd("sm_vortigaunt", Command_Vortigaunt, ADMFLAG_KICK); + RegAdminCmd("sm_whiteknight", Command_WhiteKnight, ADMFLAG_KICK); } //---------------------------------------------------------------------------------------------------- @@ -46,9 +48,6 @@ public void OnMapStart() { // Yeeaass (Physbox model) 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"); @@ -68,19 +67,6 @@ public void OnMapStart() 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"); @@ -102,6 +88,38 @@ public void OnMapStart() AddFileToDownloadsTable("models/poo/curlygpoo.vvd"); AddFileToDownloadsTable("materials/models/poo/curlypoo.vmt"); AddFileToDownloadsTable("materials/models/poo/curlypoo.vtf"); + + // 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"); + + // Vortigaunt + PrecacheModel("models/vortigaunt_slave.mdl"); + + // WhiteKnight + PrecacheModel("models/dog_jugger.mdl"); + AddFileToDownloadsTable("models/dog_jugger.dx80.vtx"); + AddFileToDownloadsTable("models/dog_jugger.dx90.vtx"); + AddFileToDownloadsTable("models/dog_jugger.mdl"); + AddFileToDownloadsTable("models/dog_jugger.sw.vtx"); + AddFileToDownloadsTable("models/dog_jugger.vvd"); + AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet.vmt"); + AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet.vtf"); + AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet_phong.vtf"); + AddFileToDownloadsTable("materials/models/dog_gondor/eyeglass.vmt"); + AddFileToDownloadsTable("materials/models/dog_gondor/eyeglass.vtf"); + AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_001.vmt"); + AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_001.vtf"); + AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_002.vtf"); } //---------------------------------------------------------------------------------------------------- @@ -109,9 +127,9 @@ public void OnMapStart() //---------------------------------------------------------------------------------------------------- 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); + int entity = CreateEntityByName(classname); + + TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR); return entity; } @@ -124,7 +142,7 @@ stock bool DispatchKeyFormat(int entity, const char[] key, const char[] value, a char buffer[1024]; VFormat(buffer, sizeof(buffer), value, 4); - return DispatchKeyValue(entity, key, buffer); + DispatchKeyValue(entity, key, buffer); } //---------------------------------------------------------------------------------------------------- @@ -157,16 +175,9 @@ stock void SetEntityBBox(int entity, const float mins[3], const float maxs[3]) //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- -stock void SetEntitySolid(int entity) +stock void SetEntityProps(int entity) { SetEntProp(entity, Prop_Send, "m_nSolidType", 3); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -stock void SetEntityNodraw(int entity) -{ SetEntProp(entity, Prop_Send, "m_fEffects", 32); } diff --git a/ItemSpawn/scripting/items/balrog.inc b/ItemSpawn/scripting/items/balrog.inc index 2ddc91a..51a13fa 100644 --- a/ItemSpawn/scripting/items/balrog.inc +++ b/ItemSpawn/scripting/items/balrog.inc @@ -92,8 +92,7 @@ public void SpawnBalrog(float fOrigin[3]) // make the trigger work. SetEntityBBox(iTriggerStrip, view_as({-8.0, -8.0, -8.0}), view_as({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({-32.0, -72.0, -84.0}), view_as({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({-736.0, -736.0, -560.0}), view_as({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({-152.0, -256.0, -71.5}), view_as({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({-124.0, -120.0, -188.2}), view_as({124.0, 120.0, 188.2})); - SetEntitySolid(iHealth); - SetEntityNodraw(iHealth); + SetEntityProps(iHealth); HookSingleEntityOutput(iHealth, "OnBreak", BalrogKill, true); diff --git a/ItemSpawn/scripting/items/whiteknight.inc b/ItemSpawn/scripting/items/whiteknight.inc new file mode 100644 index 0000000..1fb0db3 --- /dev/null +++ b/ItemSpawn/scripting/items/whiteknight.inc @@ -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({-8.0, -8.0, -8.0}), view_as({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."); +} \ No newline at end of file