Esempio n. 1
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            if (RisingTideEvent.Instance.Running && victim is BaseCreature bc && damager is PlayerMobile)
            {
                PlunderBeaconAddon beacon = GetPlunderBeacon(bc);

                if (beacon != null)
                {
                    if (CargoChance > Utility.RandomDouble())
                    {
                        damager.AddToBackpack(new MaritimeCargo());
                        damager.SendLocalizedMessage(1158907); // You recover maritime trade cargo!
                    }
                }
                else if (CargoDropsTypes.Any(type => type == bc.GetType()))
                {
                    double chance = CargoChance;

                    if (bc is BaseShipCaptain)
                    {
                        chance = 0.33;
                    }

                    if (chance > Utility.RandomDouble())
                    {
                        Container corpse = bc.Corpse;

                        if (corpse != null)
                        {
                            corpse.DropItem(new MaritimeCargo());
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public override void ProcessKill(Mobile victim, Mobile damager)
        {
            if (Enabled && victim is BaseCreature && damager is PlayerMobile)
            {
                var bc     = victim as BaseCreature;
                var beacon = GetPlunderBeaconAt(bc);

                if (beacon != null)
                {
                    if (CargoChance > Utility.RandomDouble())
                    {
                        damager.AddToBackpack(new MaritimeCargo());
                        damager.SendLocalizedMessage(1158907); // You recover maritime trade cargo!
                    }
                }
                else if (CargoDropsTypes.Any(type => type == bc.GetType()))
                {
                    double chance = 0.1;

                    if (bc is BaseShipCaptain)
                    {
                        chance = 0.33;
                    }

                    if (chance > Utility.RandomDouble())
                    {
                        var corpse = victim.Corpse;

                        if (corpse != null)
                        {
                            corpse.DropItem(new MaritimeCargo());
                        }
                    }
                }
            }
        }