Insert Coin
Member
Hello guys!
Im looking to do some drops doing in players backpack,not in corpse,so i ask here for the best way to do that,i see the script of the fleshrenderer on Doom as example,i see this code:
This is all i need to do that?Thank you!
Im looking to do some drops doing in players backpack,not in corpse,so i ask here for the best way to do that,i see the script of the fleshrenderer on Doom as example,i see this code:
Code:
public override void OnDeath(Container c)
{
List<DamageStore> rights = GetLootingRights();
int top = 0;
Item blood = null;
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct().Take(3))
{
if (top == 0)
blood = new BloodOfTheDarkFather(5);
else if (top == 1)
blood = new BloodOfTheDarkFather(3);
else if (top == 2)
blood = new BloodOfTheDarkFather(2);
top++;
if (m.Backpack == null || !m.Backpack.TryDropItem(m, blood, false))
{
m.BankBox.DropItem(blood);
}
}
base.OnDeath(c);
}
public static Mobile FindRandomPlayer(BaseCreature creature)
{
List<DamageStore> rights = creature.GetLootingRights();
for (int i = rights.Count - 1; i >= 0; --i)
{
DamageStore ds = rights[i];
if (!ds.m_HasRight)
rights.RemoveAt(i);
}
if (rights.Count > 0)
return rights[Utility.Random(rights.Count)].m_Mobile;
return null;
}
This is all i need to do that?Thank you!