Nabolas
Member
- ServUO Version
- Publish 57
- Ultima Expansion
- Endless Journey
I am trying to utilize both the daat99's Master Looter + Ledger system Upgraded and Heritage Achievement System
Both systems are working great except for the [loot command with the master looter. The achievement system doesn't recognize loot/gold when using the [loot command. When manually looting corpses the player gets credit towards the achievement, just not when they loot using [loot command.
I think I have narrowed it down to the MasterLooterUtils.cs
I do think this is the section that handles the gold part of the [loot command.
Both systems are working great except for the [loot command with the master looter. The achievement system doesn't recognize loot/gold when using the [loot command. When manually looting corpses the player gets credit towards the achievement, just not when they loot using [loot command.
I think I have narrowed it down to the MasterLooterUtils.cs
I do think this is the section that handles the gold part of the [loot command.
MasterLooterUtils.cs:
public static bool GivePlayerGold( PlayerMobile player, int amount )
{
return GivePlayerGold(player, amount, true);
}
public static bool GivePlayerGold(PlayerMobile player, int amount, bool informPlayer)
{
if (amount < 0 || player == null)
return false;
MasterLooterBackpack masterLooterBackpack = GetMasterLooter(player);
if (masterLooterBackpack != null)
{
// Deposit the entire amount into the player's MasterLooterBackpack account
//masterLooterBackpack.AddGoldAmount((ulong)amount, player);
// Create a new Gold item with the reward amount
Gold goldReward = new Gold(amount);
// Use TryDropItem to add the gold to the backpack, triggering AddCurrency
masterLooterBackpack.TryDropItem(player, goldReward, false);
}
else
{
// If the player doesn't have a MasterLooterBackpack, add the gold to their regular backpack
Container backpack = player.Backpack;
if (backpack != null)
{
Gold gold = new Gold(amount);
if (!backpack.TryDropItem(player, gold, false))
{
gold.Delete(); // Clean up if unable to add to backpack
return false;
}
}
else
{
// Handle case where the player doesn't have a backpack
// This might involve creating one or handling the gold differently
return false;
}
}
//if (informPlayer)
// player.SendMessage(1173, "You received " + amount + " gold.");
return true;
}
Attachments
-
MasterLooterBackpack.cs21 KB · Views: 0
-
MasterLooterContextMenus.cs1.6 KB · Views: 0
-
MasterLooterGoldLedgerDeed.cs1.6 KB · Views: 0
-
MasterLooterGumps.cs11.3 KB · Views: 0
-
MasterLooterTargets.cs3.7 KB · Views: 1
-
MasterLooterTokenLedgerDeed.cs1.6 KB · Views: 0
-
MasterLooterUtils.cs8 KB · Views: 1