Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void GenerateItemQuality(int conlevel)

this.Quality = Util.Random(minQuality, maxQuality);

this.Price = Money.SetAutoPrice(this.Level, this.Quality);
this.Price = WalletHelper.CalculateAutoPrice(this.Level, this.Quality);
this.Price /= 8;
if (this.Price <= 0)
this.Price = 2; // 2c as sell price is 50%
Expand Down
2 changes: 1 addition & 1 deletion GameServer/Metrics/Meters/CurrencyMeterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static bool IsPlayerActive(GameClient client)

static long GetPlayerMoney(GameClient client)
{
return client.Player.GetCurrentMoney();
return client.Player.Wallet.GetMoney();
}
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion GameServer/behaviour/Actions/GiveGoldAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public GiveGoldAction(GameNPC defaultNPC, long p)
public override void Perform(DOLEvent e, object sender, EventArgs args)
{
GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args);
player.AddMoney(P);
player.Wallet.AddMoney(P);
InventoryLogging.LogInventoryAction(NPC, player, eInventoryActionType.Quest, P);
}
}
Expand Down
2 changes: 1 addition & 1 deletion GameServer/behaviour/Actions/TakeGoldAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public TakeGoldAction(GameNPC defaultNPC, long p)
public override void Perform(DOLEvent e, object sender, EventArgs args)
{
GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args);
player.RemoveMoney(P);
player.Wallet.RemoveMoney(P);
InventoryLogging.LogInventoryAction(player, NPC, eInventoryActionType.Quest, P);
}
}
Expand Down
2 changes: 1 addition & 1 deletion GameServer/behaviour/Requirements/GoldRequirement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public override bool Check(DOLEvent e, object sender, EventArgs args)
bool result = true;
GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args);

result = compare(player.GetCurrentMoney(), N, Comparator);
result = compare(player.Wallet.GetMoney(), N, Comparator);

return result;
}
Expand Down
10 changes: 5 additions & 5 deletions GameServer/commands/gmcommands/GMinfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void OnCommand(GameClient client, string[] args)
info.Add(" - Model ID : " + target.Model);
info.Add(" - AFK Message: " + target.TempProperties.GetProperty<string>(GamePlayer.AFK_MESSAGE) + "");
info.Add(" ");
info.Add(" - Money : " + Money.GetString(target.GetCurrentMoney()) + "\n");
info.Add(" - Money : " + WalletHelper.ToString(target.Wallet.GetMoney()) + "\n");
info.Add(" - XPs : " + target.Experience);
info.Add(" - RPs : " + target.RealmPoints);
info.Add(" - BPs : " + target.BountyPoints);
Expand Down Expand Up @@ -355,7 +355,7 @@ public void OnCommand(GameClient client, string[] args)
info.Add(" --------------------------------------");
////////////// Inventaire /////////////
info.Add(" ----- Money:");
info.Add(Money.GetShortString(target.GetCurrentMoney()));
info.Add(WalletHelper.ToShortString(target.Wallet.GetMoney()));
info.Add(" ");

info.Add(" ----- Wearing:");
Expand Down Expand Up @@ -638,9 +638,9 @@ public void OnCommand(GameClient client, string[] args)
if (house.Rug4Color != 0)
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Rug4Color", Color(house.Rug4Color)));
info.Add(" ");
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Lockbox", Money.GetString(house.KeptMoney)));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RentalPrice", Money.GetString(HouseMgr.GetRentByModel(house.Model))));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.MaxLockbox", Money.GetString(HouseMgr.GetRentByModel(house.Model) * ServerProperties.Properties.RENT_LOCKBOX_PAYMENTS)));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.Lockbox", WalletHelper.ToString(house.KeptMoney)));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RentalPrice", WalletHelper.ToString(HouseMgr.GetRentByModel(house.Model))));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.MaxLockbox", WalletHelper.ToString(HouseMgr.GetRentByModel(house.Model) * ServerProperties.Properties.RENT_LOCKBOX_PAYMENTS)));
info.Add(LanguageMgr.GetTranslation(client.Account.Language, "House.SendHouseInfo.RentDueIn", due.Days, due.Hours));

#endregion House
Expand Down
14 changes: 7 additions & 7 deletions GameServer/commands/gmcommands/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public void OnCommand(GameClient client, string[] args)
case "copp":
{
long amount = long.Parse(args[3]);
player.AddMoney(amount);
player.Wallet.AddMoney(amount);
InventoryLogging.LogInventoryAction(client.Player, player, eInventoryActionType.Other, amount);
client.Out.SendMessage("You gave " + player.Name + " copper successfully!", eChatType.CT_Important,
eChatLoc.CL_SystemWindow);
Expand All @@ -656,7 +656,7 @@ public void OnCommand(GameClient client, string[] args)
case "silv":
{
long amount = long.Parse(args[3]) * 100;
player.AddMoney(amount);
player.Wallet.AddMoney(amount);
InventoryLogging.LogInventoryAction(client.Player, player, eInventoryActionType.Other, amount);
client.Out.SendMessage("You gave " + player.Name + " silver successfully!", eChatType.CT_Important,
eChatLoc.CL_SystemWindow);
Expand All @@ -669,7 +669,7 @@ public void OnCommand(GameClient client, string[] args)
case "gold":
{
long amount = long.Parse(args[3]) * 100 * 100;
player.AddMoney(amount);
player.Wallet.AddMoney(amount);
InventoryLogging.LogInventoryAction(client.Player, player, eInventoryActionType.Other, amount);
client.Out.SendMessage("You gave " + player.Name + " gold successfully!", eChatType.CT_Important,
eChatLoc.CL_SystemWindow);
Expand All @@ -682,7 +682,7 @@ public void OnCommand(GameClient client, string[] args)
case "plat":
{
long amount = long.Parse(args[3]) * 100 * 100 * 1000;
player.AddMoney(amount);
player.Wallet.AddMoney(amount);
InventoryLogging.LogInventoryAction(client.Player, player, eInventoryActionType.Other, amount);
client.Out.SendMessage("You gave " + player.Name + " platinum successfully!", eChatType.CT_Important,
eChatLoc.CL_SystemWindow);
Expand All @@ -695,7 +695,7 @@ public void OnCommand(GameClient client, string[] args)
case "mith":
{
long amount = long.Parse(args[3]) * 100 * 100 * 1000 * 1000;
player.AddMoney(amount);
player.Wallet.AddMoney(amount);
InventoryLogging.LogInventoryAction(client.Player, player, eInventoryActionType.Other, amount);
client.Out.SendMessage("You gave " + player.Name + " mithril successfully!", eChatType.CT_Important,
eChatLoc.CL_SystemWindow);
Expand Down Expand Up @@ -2229,7 +2229,7 @@ private void Show_Inventory(GamePlayer player, GameClient client, string limitTy
text.Add(" - Realm Level Class : " + GlobalConstants.RealmToName(player.Realm) + " " + player.Level + " " +
player.CharacterClass.Name);
text.Add(" ");
text.Add(Money.GetShortString(player.GetCurrentMoney()));
text.Add(WalletHelper.ToShortString(player.Wallet.GetMoney()));
text.Add(" ");

bool limitShown = false;
Expand Down Expand Up @@ -2382,7 +2382,7 @@ private void Show_Info(GamePlayer player, GameClient client)
text.Add(" - Master Levels : Not Started");
}
text.Add(" - Craftingskill : " + player.CraftingPrimarySkill + "");
text.Add(" - Money : " + Money.GetString(player.GetCurrentMoney()) + "");
text.Add(" - Money : " + WalletHelper.ToString(player.Wallet.GetMoney()) + "");
text.Add(" - Model ID : " + player.Model);
text.Add(" - Region OID : " + player.ObjectID);
text.Add(" - AFK Message: " + player.TempProperties.GetProperty<string>(GamePlayer.AFK_MESSAGE) + "");
Expand Down
2 changes: 1 addition & 1 deletion GameServer/commands/gmcommands/item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public void OnCommand(GameClient client, string[] args)
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Item.Count.NoItemInSlot", slot), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
item.Price = Money.GetMoney(0, (int)(Convert.ToInt16(args[2]) % 1000), (int)(Convert.ToInt16(args[3]) % 1000), (int)(Convert.ToByte(args[4]) % 100), (int)(Convert.ToByte(args[5]) % 100));
item.Price = WalletHelper.ToMoney(0, (int)(Convert.ToInt16(args[2]) % 1000), (int)(Convert.ToInt16(args[3]) % 1000), (int)(Convert.ToByte(args[4]) % 100), (int)(Convert.ToByte(args[5]) % 100));
client.Out.SendInventoryItemsUpdate(new DbInventoryItem[] { item });
break;
}
Expand Down
10 changes: 5 additions & 5 deletions GameServer/commands/playercommands/guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GuildCommandHandler : AbstractCommandHandler, ICommandHandler
{

private static readonly Logging.Logger log = Logging.LoggerManager.Create(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public long GuildFormCost = Money.GetMoney(0, 0, 1, 0, 0); //Cost to form guild : live = 1g : (mith/plat/gold/silver/copper)
public long GuildFormCost = WalletHelper.ToMoney(0, 0, 1, 0, 0); //Cost to form guild : live = 1g : (mith/plat/gold/silver/copper)
/// <summary>
/// Checks if a guildname has valid characters
/// </summary>
Expand Down Expand Up @@ -119,7 +119,7 @@ protected void CreateGuild(GamePlayer player, byte response)
ply.TempProperties.RemoveProperty("Guild_Consider");
}
player.Group.Leader.TempProperties.RemoveProperty("Guild_Name");
player.Group.Leader.RemoveMoney(GuildFormCost);
player.Group.Leader.Wallet.RemoveMoney(GuildFormCost);
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Player.Guild.GuildCreated", guildname, player.Group.Leader.Name), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);
}
}
Expand Down Expand Up @@ -567,7 +567,7 @@ public void OnCommand(GameClient client, string[] args)
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Player.Guild.InfoGuild", client.Player.Guild.Name), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Player.Guild.InfoRPBPMP", client.Player.Guild.RealmPoints, client.Player.Guild.BountyPoints, client.Player.Guild.MeritPoints), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Player.Guild.InfoGuildLevel", client.Player.Guild.GuildLevel), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Player.Guild.InfoGDuesBank", client.Player.Guild.GetGuildDuesPercent().ToString() + "%", Money.GetString(long.Parse(client.Player.Guild.GetGuildBank().ToString()))), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);
client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Player.Guild.InfoGDuesBank", client.Player.Guild.GetGuildDuesPercent().ToString() + "%", WalletHelper.ToString(long.Parse(client.Player.Guild.GetGuildBank().ToString()))), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);

client.Out.SendMessage(string.Format("Current Merit Bonus: {0}", Guild.BonusTypeToName(client.Player.Guild.BonusType)), eChatType.CT_Guild, eChatLoc.CL_SystemWindow);

Expand Down Expand Up @@ -1172,7 +1172,7 @@ public void OnCommand(GameClient client, string[] args)
}
#endregion
#region Enoguh money to form Check
if (client.Player.Group.Leader.GetCurrentMoney() < GuildFormCost)
if (client.Player.Group.Leader.Wallet.GetMoney() < GuildFormCost)
{
client.Out.SendMessage("It cost 1 gold piece to create a guild", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
Expand Down Expand Up @@ -2621,7 +2621,7 @@ public static void EmblemChange(GamePlayer player, byte reponse)
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Player.Guild.EmblemNeedNPC"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}
if (player.GetCurrentMoney() < GuildMgr.COST_RE_EMBLEM) //200 gold to re-emblem
if (player.Wallet.GetMoney() < GuildMgr.COST_RE_EMBLEM) //200 gold to re-emblem
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Player.Guild.EmblemNeedGold"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
Expand Down
10 changes: 5 additions & 5 deletions GameServer/commands/playercommands/lastname.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public void OnCommand(GameClient client, string[] args)
}

/* When you don't have a lastname, change is for free, otherwise you need money */
if (client.Player.LastName != string.Empty && client.Player.GetCurrentMoney() < Money.GetMoney(0, 0, LASTNAME_FEE, 0, 0))
if (client.Player.LastName != string.Empty && client.Player.Wallet.GetMoney() < WalletHelper.ToMoney(0, 0, LASTNAME_FEE, 0, 0))
{
client.Out.SendMessage("Changing your last name costs " + Money.GetString(Money.GetMoney(0, 0, LASTNAME_FEE, 0, 0)) + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
client.Out.SendMessage("Changing your last name costs " + WalletHelper.ToString(WalletHelper.ToMoney(0, 0, LASTNAME_FEE, 0, 0)) + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

Expand Down Expand Up @@ -131,9 +131,9 @@ protected void LastNameDialogResponse(GamePlayer player, byte response)
}

/* Check money only if your lastname is not blank */
if (player.LastName != string.Empty && player.GetCurrentMoney() < Money.GetMoney(0, 0, LASTNAME_FEE, 0, 0))
if (player.LastName != string.Empty && player.Wallet.GetMoney() < WalletHelper.ToMoney(0, 0, LASTNAME_FEE, 0, 0))
{
player.Out.SendMessage("Changing your last name costs " + Money.GetString(Money.GetMoney(0, 0, LASTNAME_FEE, 0, 0)) + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
player.Out.SendMessage("Changing your last name costs " + WalletHelper.ToString(WalletHelper.ToMoney(0, 0, LASTNAME_FEE, 0, 0)) + "!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return;
}

Expand All @@ -146,7 +146,7 @@ protected void LastNameDialogResponse(GamePlayer player, byte response)
/* Remove money only if your lastname is not blank and is different from the previous one */
if (player.LastName != string.Empty && player.LastName != NewLastName)
{
player.RemoveMoney(Money.GetMoney(0, 0, LASTNAME_FEE, 0, 0), null);
player.Wallet.RemoveMoney(WalletHelper.ToMoney(0, 0, LASTNAME_FEE, 0, 0), null);
InventoryLogging.LogInventoryAction(player, player.TargetObject, eInventoryActionType.Merchant, LASTNAME_FEE * 10000);
}

Expand Down
2 changes: 1 addition & 1 deletion GameServer/commands/playercommands/respec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected void RespecDialogResponse(GamePlayer player, byte response)
if (player.TempProperties.GetProperty<bool>(BUY_RESPEC))
{
player.TempProperties.RemoveProperty(BUY_RESPEC);
if (player.RespecCost >= 0 && player.RemoveMoney(player.RespecCost * 10000))
if (player.RespecCost >= 0 && player.Wallet.RemoveMoney(player.RespecCost * 10000))
{
InventoryLogging.LogInventoryAction(player, "(respec)", eInventoryActionType.Merchant, player.RespecCost * 10000);
player.RespecAmountSingleSkill++;
Expand Down
16 changes: 8 additions & 8 deletions GameServer/gameobjects/CustomNPC/Blacksmith.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public override bool ReceiveItem(GameLiving source, DbInventoryItem item)
// Message: It will cost {0} to repair {1}. Do you accept?
player.Client.Out.SendCustomDialog(LanguageMgr.GetTranslation(player.Client.Account.Language,
"GameNPC.Blacksmith.RepairCostAccept",
Money.GetString(item.RepairCost), item.GetName(0, false)), BlacksmithDialogResponse);
WalletHelper.ToString(item.RepairCost), item.GetName(0, false)), BlacksmithDialogResponse);
}
else
{
Expand Down Expand Up @@ -188,21 +188,21 @@ protected void BlacksmithDialogResponse(GamePlayer player, byte response)

var ToRecoverCond = item.MaxCondition - item.Condition;

if (!player.RemoveMoney(item.RepairCost))
if (!player.Wallet.RemoveMoney(item.RepairCost))
{
InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, item.RepairCost);
// Message: {0} says, "It costs {1} to repair {2}. You don't have that much."
ChatUtil.SendSayMessage(player, "GameNPC.Blacksmith.NotEnoughMoney",
GetName(0, true),
Money.GetString(item.RepairCost),
WalletHelper.ToString(item.RepairCost),
item.GetName(0, false));

return;
}

// Message: You pay {0} {1}.
ChatUtil.SendSystemMessage(player, "GameNPC.Blacksmith.YouPay", GetName(0, false),
Money.GetString(item.RepairCost));
WalletHelper.ToString(item.RepairCost));

// Items with IsNotLosingDur are not....losing DUR.
if (ToRecoverCond + 1 >= item.Durability)
Expand Down Expand Up @@ -240,7 +240,7 @@ private void AskRepairAll(GamePlayer player)

if (TotalCost > 0)
player.Client.Out.SendCustomDialog(
$"It will cost {Money.GetString(TotalCost)} to repair everything. Do you accept?", RepairAll);
$"It will cost {WalletHelper.ToString(TotalCost)} to repair everything. Do you accept?", RepairAll);
else
SayTo(player, eChatLoc.CL_PopupWindow,
"All items are fully repaired already.");
Expand Down Expand Up @@ -285,19 +285,19 @@ private void RepairAll(GamePlayer player, byte response)
cost += CalculateCost(inventoryItem);
}

if (!player.RemoveMoney(cost))
if (!player.Wallet.RemoveMoney(cost))
{
SayTo(player, eChatLoc.CL_PopupWindow,
LanguageMgr.GetTranslation(player.Client.Account.Language,
"GameNPC.Blacksmith.NotEnoughMoney", Money.GetString(cost), "everything"));
"GameNPC.Blacksmith.NotEnoughMoney", WalletHelper.ToString(cost), "everything"));
return;
}


InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, cost);

ChatUtil.SendSystemMessage(player, "GameNPC.Blacksmith.YouPay", GetName(0, false),
Money.GetString(cost));
WalletHelper.ToString(cost));


foreach (var inventoryItem in player.Inventory.AllItems)
Expand Down
Loading