Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
artvin01 committed Oct 15, 2024
1 parent ffdf73f commit c1a6b26
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
17 changes: 13 additions & 4 deletions addons/sourcemod/scripting/rpg_fortress/actor.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,18 +1474,27 @@ void Actor_EditorMenu(int client)
FormatEx(buffer2, sizeof(buffer2), "Cosmetic 1: \"%s\"%s", buffer1, (!buffer1[0] || FileExists(buffer1, true)) ? "" : " {WARNING: Model does not exist}");
menu.AddItem("_wear1", buffer2);

FormatEx(buffer2, sizeof(buffer2), "Cosmetic 1 Scale: %f", ActorKv.GetFloat("wear1_size", 1.0));
menu.AddItem("_wear1_size", buffer2);

ActorKv.GetString("wear2", buffer1, sizeof(buffer1));
FormatEx(buffer2, sizeof(buffer2), "Cosmetic 2: \"\"%s\"%s", buffer1, (!buffer1[0] || FileExists(buffer1, true)) ? "" : " {WARNING: Model does not exist}");
FormatEx(buffer2, sizeof(buffer2), "Cosmetic 2: \"%s\"%s", buffer1, (!buffer1[0] || FileExists(buffer1, true)) ? "" : " {WARNING: Model does not exist}");
menu.AddItem("_wear2", buffer2);

FormatEx(buffer2, sizeof(buffer2), "Cosmetic 2 Scale: %f", ActorKv.GetFloat("wear2_size", 1.0));
menu.AddItem("_wear2_size", buffer2);

ActorKv.GetString("wear3", buffer1, sizeof(buffer1));
FormatEx(buffer2, sizeof(buffer2), "Cosmetic 3: \"%s\"%s", buffer1, (!buffer1[0] || FileExists(buffer1, true)) ? "" : " {WARNING: Model does not exist}");
menu.AddItem("_wear3", buffer2);

FormatEx(buffer2, sizeof(buffer2), "Bodygroup: %i", ActorKv.GetNum("bodygroup"));
FormatEx(buffer2, sizeof(buffer2), "Cosmetic 3 Scale: %f", ActorKv.GetFloat("wear3_size", 1.0));
menu.AddItem("_wear3_size", buffer2);

FormatEx(buffer2, sizeof(buffer2), "Bodygroup: %d", ActorKv.GetNum("bodygroup"));
menu.AddItem("_bodygroup", buffer2);

FormatEx(buffer2, sizeof(buffer2), "Skin: %i", ActorKv.GetNum("skin"));
FormatEx(buffer2, sizeof(buffer2), "Skin: %d", ActorKv.GetNum("skin"));
menu.AddItem("_skin", buffer2);
}

Expand Down Expand Up @@ -1999,7 +2008,7 @@ static void AdjustOptionsSection(int client, const char[] key)
if(StrEqual(key, "delete"))
{
ActorKv.DeleteThis();
CurrentSectionEditing[client][0] = 0;
CurrentSubSectionEditing[client][0] = 0;
}
else
{
Expand Down
12 changes: 9 additions & 3 deletions addons/sourcemod/scripting/rpg_fortress/npc/npc_actor.sp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ methodmap NPCActor < CClotBody
if(buffer1[0])
{
npc.m_iWearable1 = npc.EquipItem("head", buffer1);
SetVariantString("1.0");
SetVariantFloat(kv.GetFloat("wear1_size", 1.0));
AcceptEntityInput(npc.m_iWearable1, "SetModelScale");
SetEntProp(npc.m_iWearable1, Prop_Send, "m_nSkin", skin);
}
Expand All @@ -111,7 +111,7 @@ methodmap NPCActor < CClotBody
if(buffer1[0])
{
npc.m_iWearable2 = npc.EquipItem("head", buffer1);
SetVariantString("1.0");
SetVariantFloat(kv.GetFloat("wear2_size", 1.0));
AcceptEntityInput(npc.m_iWearable2, "SetModelScale");
SetEntProp(npc.m_iWearable2, Prop_Send, "m_nSkin", skin);
}
Expand All @@ -120,7 +120,7 @@ methodmap NPCActor < CClotBody
if(buffer1[0])
{
npc.m_iWearable3 = npc.EquipItem("head", buffer1);
SetVariantString("1.0");
SetVariantFloat(kv.GetFloat("wear3_size", 1.0));
AcceptEntityInput(npc.m_iWearable3, "SetModelScale");
SetEntProp(npc.m_iWearable3, Prop_Send, "m_nSkin", skin);
}
Expand All @@ -140,12 +140,18 @@ void NPCActor_TalkStart(int iNPC, int client, float time = 60.0)
NPCActor npc = view_as<NPCActor>(iNPC);
npc.m_iTargetAlly = client;
npc.m_flGetClosestTargetTime = GetGameTime(npc.index) + time;

if(TalkAnim[npc.index][0])
npc.SetActivity(TalkAnim[npc.index]);
}

void NPCActor_TalkEnd(int iNPC)
{
NPCActor npc = view_as<NPCActor>(iNPC);
npc.m_iTargetAlly = -1;

if(LeaveAnim[npc.index][0])
npc.SetActivity(LeaveAnim[npc.index]);

float gameTime = GetGameTime(npc.index);
if(npc.m_flNextMeleeAttack < gameTime)
Expand Down
11 changes: 10 additions & 1 deletion addons/sourcemod/scripting/rpg_fortress/quests.sp
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,19 @@ void Quests_EditorMenu(int client)
QuestKv.Rewind();
if(QuestKv.GotoFirstSubKey())
{
bool first = true;

do
{
QuestKv.GetSectionName(buffer1, sizeof(buffer1));
menu.AddItem(buffer1, buffer1);
if(first)
{
menu.InsertItem(1, buffer1, buffer1);
}
else
{
menu.AddItem(buffer1, buffer1);
}
}
while(QuestKv.GotoNextKey());
}
Expand Down
10 changes: 10 additions & 0 deletions addons/sourcemod/scripting/rpg_fortress/spawns.sp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum struct SpawnEnum

int LowLevelClientAreaCount;

char CustomName[64];
bool Boss;
int Level[2];
int Health[2];
Expand Down Expand Up @@ -54,6 +55,8 @@ enum struct SpawnEnum
this.LowLevelClientAreaCount = 0;

this.Index = NPC_GetByPlugin(this.Item1);

kv.GetString("custom_name", this.CustomName, 64);

this.Angle = kv.GetFloat("angle", -1.0);
this.Count = kv.GetNum("count", 1);
Expand Down Expand Up @@ -473,6 +476,9 @@ static void UpdateSpawn(int pos, SpawnEnum spawn, bool start)
fl_Extra_Speed[entity] = spawn.ExtraSpeed;
fl_Extra_Damage[entity] = spawn.ExtraDamage;

if(spawn.CustomName[0])
strcopy(c_NpcName[entity], sizeof(c_NpcName[]), spawn.CustomName);

if(spawn.ExtraSize != 1.0)
{
float scale = GetEntPropFloat(entity, Prop_Send, "m_flModelScale");
Expand Down Expand Up @@ -938,6 +944,10 @@ void Spawns_EditorMenu(int client)
FormatEx(buffer2, sizeof(buffer2), "Size Multi: %f", kv.GetFloat("extra_size", 1.0));
menu.AddItem("extra_size", buffer2);

kv.GetString("custom_name", buffer1, sizeof(buffer1));
FormatEx(buffer2, sizeof(buffer2), "Custom Name: \"%s\"", buffer1);
menu.AddItem("custom_name", buffer2);

kv.GetString("drop_name_1", buffer1, sizeof(buffer1));
valid = (!buffer1[0] || TextStore_IsValidName(buffer1));
FormatEx(buffer2, sizeof(buffer2), "Drop 1: \"%s\"%s", buffer1, valid ? "" : " {WARNING: Item does not exist}");
Expand Down

0 comments on commit c1a6b26

Please sign in to comment.