fix: Fixes missing inscription message (#1518)

This commit is contained in:
Kamron Batman 2023-09-29 21:38:06 -07:00 committed by GitHub
parent 0d21459e85
commit d6823309d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View file

@ -150,10 +150,16 @@ namespace Server.Engines.Craft
public int Mana { get; set; }
public TextDefinition NeedManaLabel { get; set; }
public int Hits { get; set; }
public TextDefinition NeedHitsLabel { get; set; }
public int Stam { get; set; }
public TextDefinition NeedStamLabel { get; set; }
public bool UseSubRes2 { get; set; }
public bool UseAllRes { get; set; }
@ -281,19 +287,19 @@ namespace Server.Engines.Craft
{
if (Hits > 0 && from.Hits < Hits)
{
message = "You lack the required hit points to make that.";
message = NeedHitsLabel;
return false;
}
if (Mana > 0 && from.Mana < Mana)
{
message = "You lack the required mana to make that.";
message = NeedManaLabel;
return false;
}
if (Stam > 0 && from.Stam < Stam)
{
message = "You lack the required stamina to make that.";
message = NeedStamLabel;
return false;
}

View file

@ -202,19 +202,22 @@ namespace Server.Engines.Craft
CraftItems[index].ItemHue = hue;
}
public void SetManaReq(int index, int mana)
public void SetManaReq(int index, int mana, int cliloc = 0)
{
CraftItems[index].Mana = mana;
CraftItems[index].NeedManaLabel = TextDefinition.Of(cliloc, "You lack the required mana to make that.");
}
public void SetStamReq(int index, int stam)
public void SetStamReq(int index, int stam, int cliloc = 0)
{
CraftItems[index].Stam = stam;
CraftItems[index].NeedStamLabel = TextDefinition.Of(cliloc, "You lack the required stamina to make that.");
}
public void SetHitsReq(int index, int hits)
public void SetHitsReq(int index, int hits, int cliloc = 0)
{
CraftItems[index].Hits = hits;
CraftItems[index].NeedHitsLabel = TextDefinition.Of(cliloc, "You lack the required hit points to make that.");
}
public void SetUseAllRes(int index, bool useAll)

View file

@ -196,7 +196,7 @@ public class DefInscription : CraftSystem
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, _mana);
SetManaReq(index, _mana, 1042403);
}
private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs)
@ -219,7 +219,7 @@ public class DefInscription : CraftSystem
}
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
SetManaReq(index, mana, 1042403);
}
private void AddMysticismSpell(int spell, int mana, double minSkill, double maxSkill, Type type, params Type[] regs)
@ -242,7 +242,7 @@ public class DefInscription : CraftSystem
}
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
SetManaReq(index, mana, 1042403);
}
public override void InitCraftList()