Danstuff

Citizen
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...
 

jase giffin

Rookie
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.
 

Hands Of God

Citizen
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.
 

Joshua

Squire
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: 4
Last edited: