[FSOD] Gold Drops From Enemies
Final Product
1. In LootDefs.cs Paste This
Code:
public class GoldLoot : ILootDef
{
private static readonly ILog log = LogManager.GetLogger(typeof(LootState));
public string Lootstate { get; set; }
private readonly int maxGold;
private readonly int minGold;
public GoldLoot(int minGold, int maxGold)
{
this.maxGold = maxGold;
this.minGold = minGold;
}
public void Populate(RealmManager manager, Enemy enemy, Tuple<Player, int> playerDat,
Random rand, string lootState, IList<LootDef> lootDefs)
{
if (playerDat == null)
return;
for (int i = 0; i < 3; i++)
playerDat.Item1.Owner.BroadcastPacket(new ShowEffectPacket()
{
EffectType = EffectType.Flow,
Color = new ARGB(0xccac00),
TargetId = playerDat.Item1.Id,
PosA = new Position() { X = enemy.X, Y = enemy.Y }
}, null);
manager.Database.DoActionAsync(db =>
{
playerDat.Item1.Credits =
playerDat.Item1.Client.Account.Credits =
db.UpdateCredit(playerDat.Item1.Client.Account,
rand.Next(minGold, maxGold + 1));
});
playerDat.Item1.UpdateCount++;
}
}
replace regions with this
Code:
using System; using System.Collections.Generic; using System.Linq; using wServer.networking.svrPackets; using db.data; using wServer.realm; using wServer.realm.entities; using wServer.realm.entities.player; using log4net;
Code:
new GoldLoot(10, 50),
thanks to
@Wojtasowy1234
for the code, i just made it work for FSOD, since most nubs use it
and who ever he thanked
sidenote: his was for SD, so i thought why not for FSOD....




