Ejemplo 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());
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static PlunderBeaconAddon GetPlunderBeacon(BaseCreature bc)
        {
            if (PlunderBeaconSpawner.Spawner != null)
            {
                foreach (System.Collections.Generic.List <PlunderBeaconAddon> list in PlunderBeaconSpawner.Spawner.PlunderBeacons.Values)
                {
                    PlunderBeaconAddon addon = null;

                    for (var index = 0; index < list.Count; index++)
                    {
                        var beacon = list[index];

                        if (beacon.Crew.Contains(bc) || beacon.Spawn.ContainsKey(bc) && beacon.Spawn[bc])
                        {
                            addon = beacon;
                            break;
                        }
                    }

                    if (addon != null)
                    {
                        return(addon);
                    }
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
        public static PlunderBeaconAddon GetPlunderBeacon(BaseCreature bc)
        {
            if (PlunderBeaconSpawner.Spawner != null)
            {
                foreach (System.Collections.Generic.List <PlunderBeaconAddon> list in PlunderBeaconSpawner.Spawner.PlunderBeacons.Values)
                {
                    PlunderBeaconAddon addon = list.FirstOrDefault(beacon => beacon.Crew.Contains(bc) || (beacon.Spawn.ContainsKey(bc) && beacon.Spawn[bc]));

                    if (addon != null)
                    {
                        return(addon);
                    }
                }
            }

            return(null);
        }