PlayerMobile pm= ds.m_Mobile as PlayerMobile;
if (c != null && pm.Player && pm.FindItemOnLayer(Layer.Helm) is ItemToFind) // change layer and item
{
int mTotalgold = 0;
//PlayerMobile player = ds.m_Mobile as PlayerMobile;
if (c.Items.Count > 0)
{
var list2 = new List<Item>(c.Items);
foreach (Item item in list2)
{
if ( item is Gold )
{
mTotalgold += item.Amount;
}
}
int HalfGold = (mTotalgold / 2);
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
}
//player.SendMessage(49,"You gain {0} gold from defeating {1}", mTotalgold.ToString("#,0"), this.Name );
}
}
then depending on how you want to do it, if say each item counts for 50%
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
if (c != null)
int bonusgoldmultiplier = 0;
if ( pm.Player && pm.FindItemOnLayer(Layer.Ring) is Ava )
bonusgoldmultiplier +=1;
if ( pm.Player && pm.FindItemOnLayer(Layer.Gloves) is Avati )
bonusgoldmultiplier +=1;
int HalfGold = (mTotalgold / 4);
if( bonusgoldmultiplier > 0 )
HalfGold = ( HalfGold * bonusgoldmultiplier );
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
pm.SendMessage(49,"You gain {0} bonus gold", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
}
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
if (c != null)
{
int bonusgoldmultiplier = 0;
if ( pm.Player && pm.FindItemOnLayer(Layer.Ring) is Ava )
bonusgoldmultiplier +=1;
if ( pm.Player && pm.FindItemOnLayer(Layer.Gloves) is Avati )
bonusgoldmultiplier +=1;
int HalfGold = (mTotalgold / 4);
if( bonusgoldmultiplier > 0 )
HalfGold = ( HalfGold * bonusgoldmultiplier );
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
pm.SendMessage(49,"You gain {0} bonus gold", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
}
}
if (c != null)
{
PlayerMobile p = ds.m_Mobile as PlayerMobile;
int mTotalgold = 0;
if (c.Items.Count > 0)
{
var list2 = new List<Item>(c.Items);
foreach (Item item in list2)
{
if ( item is Gold )
mTotalgold += item.Amount;
}
int bonusgoldmultiplier = 0;
if ( p.Player && p.FindItemOnLayer(Layer.Ring) is Ava )
bonusgoldmultiplier +=1;
if ( p.Player && p.FindItemOnLayer(Layer.Gloves) is Avati )
bonusgoldmultiplier +=1;
int HalfGold = (mTotalgold / 4);
if( bonusgoldmultiplier > 0 )
HalfGold = ( HalfGold * bonusgoldmultiplier );
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
p.SendMessage(49,"You gain {0} bonus gold", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
}
}
}
you're very welcome
public override void OnDeath(Container c)
{
MeerMage.StopEffect(this, false);
if (IsBonded)
{
int sound = GetDeathSound();
if (sound >= 0)
Effects.PlaySound(this, Map, sound);
Warmode = false;
Poison = null;
Combatant = null;
Hits = 0;
Stam = 0;
Mana = 0;
IsDeadPet = true;
ControlTarget = ControlMaster;
ControlOrder = OrderType.Follow;
ProcessDeltaQueue();
SendIncomingPacket();
SendIncomingPacket();
List<AggressorInfo> aggressors = Aggressors;
for (int i = 0; i < aggressors.Count; ++i)
{
AggressorInfo info = aggressors[i];
if (info.Attacker.Combatant == this)
info.Attacker.Combatant = null;
}
List<AggressorInfo> aggressed = Aggressed;
for (int i = 0; i < aggressed.Count; ++i)
{
AggressorInfo info = aggressed[i];
if (info.Defender.Combatant == this)
info.Defender.Combatant = null;
}
Mobile owner = ControlMaster;
if (owner == null || owner.Deleted || owner.Map != Map || !owner.InRange(this, 12) || !CanSee(owner) || !InLOS(owner))
{
if (OwnerAbandonTime == DateTime.MinValue)
OwnerAbandonTime = DateTime.Now;
}
else
{
OwnerAbandonTime = DateTime.MinValue;
}
GiftOfLifeSpell.HandleDeath(this);
CheckStatTimers();
}
else
{
//When creatures are killed by guards the kill should not be counted towards the player and corpse should be deleted to prevent abuse
if (LastKiller is BaseGuard)
{
base.OnDeath(c);
c.Delete();
return;
}
if (!Summoned && !m_NoKillAwards)
{
int totalFame = Fame / 300;
int totalKarma = -Karma / 300;
/*
if (Map == Map.Felucca)
{
totalFame += ((totalFame / 10) * 3);
totalKarma += ((totalKarma / 10) * 3);
}
*/
List<DamageStore> list = GetLootingRights(DamageEntries, HitsMax);
List<Mobile> titles = new List<Mobile>();
List<int> fame = new List<int>();
List<int> karma = new List<int>();
//Maka - KillInfo
TrySaveKillInfo(c.Items);
bool givenQuestKill = false;
bool givenFactionKill = false;
bool givenToTKill = false;
for (int i = 0; i < list.Count; ++i)
{
DamageStore ds = list[i];
if (!ds.m_HasRight)
continue;
Party party = Engines.PartySystem.Party.Get(ds.m_Mobile);
if (party != null)
{
int divedFame = totalFame / party.Members.Count;
int divedKarma = totalKarma / party.Members.Count;
for (int j = 0; j < party.Members.Count; ++j)
{
PartyMemberInfo info = party.Members[j] as PartyMemberInfo;
if (info != null && info.Mobile != null)
{
int index = titles.IndexOf(info.Mobile);
if (index == -1)
{
titles.Add(info.Mobile);
fame.Add(divedFame);
karma.Add(divedKarma);
}
else
{
fame[index] += divedFame;
karma[index] += divedKarma;
}
}
}
}
else
{
titles.Add(ds.m_Mobile);
fame.Add(totalFame);
karma.Add(totalKarma);
}
// modification to support XmlQuest Killtasks
XmlQuest.RegisterKill(this, ds.m_Mobile);
OnKilledBy(ds.m_Mobile);
//////////////////Goldbonus2////////////////////
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
/////////////////Goldbonus3/////////////
if (c != null)
{
PlayerMobile p = ds.m_Mobile as PlayerMobile;
int mTotalgold = 0;
if (c.Items.Count > 0)
{
var list2 = new List<Item>(c.Items);
foreach (Item item in list2)
{
if ( item is Gold )
mTotalgold += item.Amount;
}
int bonusgoldmultiplier = 0;
if ( p.Player && p.FindItemOnLayer(Layer.Ring) is Codicia )
bonusgoldmultiplier +=1;
if ( p.Player && p.FindItemOnLayer(Layer.Gloves) is Guantescodicia )
bonusgoldmultiplier +=1;
int HalfGold = (mTotalgold / 4);
if( bonusgoldmultiplier > 0 )
HalfGold = ( HalfGold * bonusgoldmultiplier );
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
p.PlaySound ( 55 );
p.SendMessage(49,"You gain {0} extra gold", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
}
}
}
////////////////////////
/* if (c != null)
{
int bonusgoldmultiplier = 0;
if ( pm.Player && pm.FindItemOnLayer(Layer.Ring) is Codicia )
bonusgoldmultiplier +=1;
if ( pm.Player && pm.FindItemOnLayer(Layer.Gloves) is Guantescodicia )
bonusgoldmultiplier +=1;
int HalfGold = (mTotalgold / 4);
if( bonusgoldmultiplier > 0 )
HalfGold = ( HalfGold * bonusgoldmultiplier );
if( HalfGold > 0 )
{
c.DropItem(new Gold(HalfGold));
pm.SendMessage(49,"You gain {0} EXTRA gold!", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
}
}*/
/////////////////////////////
if (!givenFactionKill)
{
givenFactionKill = true;
Faction.HandleDeath(this, ds.m_Mobile);
}
if (!givenToTKill && Map == Map.Tokuno)
{
givenToTKill = true;
TreasuresOfTokuno.HandleKill(this, ds.m_Mobile);
}
if (givenQuestKill)
continue;
/////////////Gold bonus UNCOMENT ///////////
// PlayerMobile pm = ds.m_Mobile as PlayerMobile;
///////////////////////////////////////////////////////
if (pm != null)
{
QuestSystem qs = pm.Quest;
if (qs != null)
{
qs.OnKill(this, c);
givenQuestKill = true;
}
}
}
for (int i = 0; i < titles.Count; ++i)
{
Titles.AwardFame(titles[i], fame[i], true);
Titles.AwardKarma(titles[i], karma[i], true);
}
}
base.OnDeath(c);
if (IsInEvent && c is Corpse)
c.EventItem = true; //So that players in events can loot the body if configured that way
if (DeleteCorpseOnDeath)
c.Delete();
}
}
PlayerMobile pm = ds.m_Mobile as PlayerMobile;
/////////////////Goldbonus3/////////////
if (c != null)
{
PlayerMobile p = ds.m_Mobile as PlayerMobile;
int mTotalgold = 0;
/////////////Gold bonus uncomment///////////
// PlayerMobile pm = ds.m_Mobile as PlayerMobile;
///////////////////////////////////////////////////////
Item Rill = p.FindItemOnLayer(Layer.Ring);
if ( p.Player && Rill != null && Rill is Avat )
bonusgoldmultiplier +=1;
List<DamageEntry> rights = DamageEntries;
for (int i = 0; i < rights.Count; ++i)
{
DamageEntry de = rights[i];
if (de.HasExpired || !de.Damager.Player)
{
DamageEntries.RemoveAt(i);
continue;
}
if (de.DamageGiven > 200)
We use essential cookies to make this site work, and optional cookies to enhance your experience.