Danstuff submitted a new resource:

Gold Ledger - gold sweeper , gold autoloot from mob and check maker

Merged by Danstuff
Script Name: Alpha Gold Ledger
Author: Joeku AKA Demortris
Mods By:Callandor2k & Prplbeast
I proved the distro files that have the edits in them, in the archive so that you can see the changes in the entire script(s).
Place Goldledger.cs and LedgerGoldCommand.cs in your scripts/custom folder.
Tutorial for Servuo distro file edits​
[accordion=bright|100%]
{slide=BaseCreature.cs |center}
Open BaseCreature.cs and find this, it will be in the OnDeath method....[/accordion]

Read more about this resource...
 
really great working script set.
small issue is with buying in base vendor.
when buying anything it will function properly as in will take the money from ledger and wont sell item if ledger is empty but with it always pulls the term you canst afford this.
that is the only issue that is says you cant afford this.
in basevendor.cs.

we have this..

#region Alpha Gold Ledger #3
if( ledger != null )
{
if( (goldint + ledger.Gold) >= totalCost )
{
ledger.Gold -= (totalCost - goldint);
bought = true;
buyer.SendMessage(2125, "{0} gold has been withdrawn from your gold ledger.", (totalCost - goldint).ToString( "#,0" ));
cont.ConsumeTotal( typeof( Gold ), goldint);
}
else if( ledger.Gold >= totalCost )
{
ledger.Gold -= totalCost;
bought = true;
buyer.SendMessage(2125, "{0} gold has been withdrawn from your gold ledger.", totalCost.ToString( "#,0" ));
}
}
#endregion #3
if (cont.ConsumeTotal(typeof(Gold), totalCost))
{
bought = true;
}
else if (totalCost < 2000)
{
SayTo(buyer, 500192); //Begging thy pardon, but thou casnt afford that.
}
}

how would one go around always broadcasting you cant afford this.
 
How do you apply the changes to basevendor to the new basevendor format? Looks like the code was revampped a while back and its not a simple snip and paste.
 
To make this mostly drag and drop, just use the below. Still have to do the vendor changes. It still needs testing, but this should do the trick. I imagine if more than one person kills a creature, the finishing blow will determine who gets the gold.

BaseVendor Edits
if ( validBuy.Count == 0 ) return false; bought = ( buyer.AccessLevel >= AccessLevel.GameMaster ); cont = buyer.Backpack; if (!bought && cont != null) { /* Ledger Changes */ Item item = buyer.Backpack.FindItemByType(typeof(GoldLedger)); GoldLedger ledger = item as GoldLedger; Item[] item2 = buyer.Backpack.FindItemsByType(typeof(Gold)); int goldint = 0; foreach (Item item3 in item2) goldint += item3.Amount; if (cont.ConsumeTotal(typeof(Gold), totalCost)) { bought = true; } if( ledger != null ) { if( (goldint + ledger.Gold) >= totalCost ) { ledger.Gold -= (totalCost - goldint); bought = true; buyer.SendMessage(2125, "{0} gold has been withdrawn from your gold ledger.", (totalCost - goldint).ToString( "#,0" )); cont.ConsumeTotal( typeof( Gold ), goldint); } else if( ledger.Gold >= totalCost ) { ledger.Gold -= totalCost; bought = true; buyer.SendMessage(2125, "{0} gold has been withdrawn from your gold ledger.", totalCost.ToString( "#,0" )); } /* Ledger Changes */ } else if ( totalCost < 2000 ) SayTo( buyer, 500192 );//Begging thy pardon, but thou casnt afford that. }
 

Attachments

  • GoldledgeSink.cs
    1.6 KB · Views: 18
Last edited:
UPDATE:

I have played around with it, both with code and in general, and found out some stuff.

1, If you turn uncheck Gold Sweeper and turn Auto-loot Gold to Manual. and use command [Ledgegold. It will add the gold to the ledger from your backpack. Any gold.
2. to get the gold out, just choose "check" option, and enter the amount you want. give you a check for your gold. Puts it for some reason at the top left of your backpack. just drop your check in the back and it adds to your balance.

I should also note: That I am using the "current" classic and enhanced client. Works with both of them.

Good luck if that helps with the answers that some of you "veteran" coders maybe have.

-----
has anyone else had this error? Basically the same (I think) as the Overweight error?
GoldLedger error:
Server Crash Report
===================

ServUO Version 0.0, Build 0.0
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 11/7/2022 6:32:34 PM
Mobiles: 33626
Items: 155916
Exception:
System.NotImplementedException: The method or operation is not implemented.
   at Server.Misc.WeightOverloadingHelpers.GetMaxWeight(Mobile from) in C:\ServUO-master\Scripts\Misc\WeightOverloadingHelpers.cs:line 11
   at Server.Items.GiveGold.GoldSweep(Mobile m, Gold gold) in C:\ServUO-master\Scripts\Customs\GoldLedger\GoldLedger.cs:line 883
   at Server.Items.GoldledgeSink.EventSink_Movement(MovementEventArgs e) in C:\ServUO-master\Scripts\Customs\GoldLedger\GoldledgeSink.cs:line 56
   at Server.MovementEventHandler.Invoke(MovementEventArgs e)
I have tried with added gold to it, trying the sweeper action, and auto-loot options. Crashes each time.
 
Last edited:
Hello everyone, help me remake this script for runuo 2.7. (the server starts without errors) but the money from the corpse is not looted, all enable
 
Back