mitty2
Member
Hi guys a little messed up on this one. It compiles fine, and works fine, unless more than 1 person does damage to the creature. It is supposed to reward any player who does damage to it and helps kill it. It drops a reward token in their backpack. But if more than one player helps kill it (does damage to it) on death it crashes my test server. Here is the bit of code that i've messed up probably.
On Death...:
public override void OnDeath(Container c)
{
if (Map == Map.Ilshenar)
{
List<Mobile> toGive = new List<Mobile>();
List<DamageStore> rights = GetLootingRights();
for (int i = rights.Count - 1; i >= 0; --i)
{
DamageStore ds = rights[i];
if (ds.m_HasRight)
toGive.Add(ds.m_Mobile);
Mobile m = toGive[i % toGive.Count];
m.SendMessage("You have recieved a Dragon Reward Token for your efforts!");
m.AddToBackpack(new DragonRewardToken ());
if (toGive.Count == 0)
return;
base.OnDeath(c);
}
}
}