Пример #1
0
        public Leap(Actor self, Actor target, Armament a, WDist speed, WAngle angle)
        {
            var targetMobile = target.TraitOrDefault<Mobile>();
            if (targetMobile == null)
                throw new InvalidOperationException("Leap requires a target actor with the Mobile trait");

            this.weapon = a.Weapon;
            this.angle = angle;
            mobile = self.Trait<Mobile>();
            mobile.SetLocation(mobile.FromCell, mobile.FromSubCell, targetMobile.FromCell, targetMobile.FromSubCell);
            mobile.IsMoving = true;

            from = self.CenterPosition;
            to = self.World.Map.CenterOfSubCell(targetMobile.FromCell, targetMobile.FromSubCell);
            length = Math.Max((to - from).Length / speed.Length, 1);

            // HACK: why isn't this using the interface?
            self.Trait<WithInfantryBody>().Attacking(self, Target.FromActor(target), a);

            if (weapon.Report != null && weapon.Report.Any())
                Game.Sound.Play(SoundType.World, weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
        }
Пример #2
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     Unvariety();
 }
Пример #3
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     TakeAmmo();
 }
Пример #4
0
        public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
        {
            if (IsTraitDisabled || IsTraitPaused)
            {
                return;
            }

            if (info.Name != a.Info.Name)
            {
                return;
            }

            if (target.Actor == null || !target.IsValidFor(self))
            {
                return;
            }

            if (self.Owner.Stances[target.Actor.Owner] == Stance.Ally)
            {
                return;
            }

            var mindControllable = target.Actor.TraitOrDefault <MindControllable>();

            if (mindControllable == null)
            {
                throw new InvalidOperationException(
                          "`{0}` tried to mindcontrol `{1}`, but the latter does not have the necessary trait!"
                          .F(self.Info.Name, target.Actor.Info.Name));
            }

            if (mindControllable.IsTraitDisabled || mindControllable.IsTraitPaused)
            {
                return;
            }

            if (info.Capacity > 0 && !info.DiscardOldest && slaves.Count() >= info.Capacity && !info.Overload)
            {
                return;
            }

            slaves.Add(target.Actor);
            StackControllingCondition(self, info.ControllingCondition);
            mindControllable.LinkMaster(target.Actor, self);

            if (info.Sounds.Any())
            {
                Game.Sound.Play(SoundType.World, info.Sounds.Random(self.World.SharedRandom), self.CenterPosition);
            }

            if (info.Capacity > 0 && info.DiscardOldest && slaves.Count() > info.Capacity)
            {
                slaves[0].Trait <MindControllable>().RevokeMindControl(slaves[0]);
            }


            if (info.Capacity > 0 && info.Overload && slaves.Count() > info.Capacity && mindControlOverloadConditionToken == ConditionManager.InvalidConditionToken)
            {
                mindControlOverloadConditionToken = conditionManager.GrantCondition(self, info.OverloadCondition); //Overload!
            }
        }
Пример #5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        m_Armaments = (Armament)reader.ReadInt();
                        m_PayRate = reader.ReadInt();
                        m_speechInterval = reader.ReadDeltaTime();
                        m_Training = (Training)reader.ReadInt();
                        m_BaseName = reader.ReadString();

                        break;
                    }
            }

            if (Government != null && Government.Deleted && !Government.Employees.Contains(this))
                Government.Employees.Add(this);
        }
Пример #6
0
        public static void EquipSociety(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    {
                        LeatherChest chest = new LeatherChest();
                        chest.Resource = CraftResource.BeastLeather;
                        chest.Hue = 2830;

                        LeatherArms arms = new LeatherArms();
                        arms.Resource = CraftResource.BeastLeather;
                        arms.Hue = 2830;

                        LeatherLegs legs = new LeatherLegs();
                        legs.Resource = CraftResource.BeastLeather;
                        legs.Hue = 2830;

                        LeatherGorget gorget = new LeatherGorget();
                        gorget.Resource = CraftResource.BeastLeather;
                        gorget.Hue = 2830;

                        LeatherGloves gloves = new LeatherGloves();
                        gloves.Resource = CraftResource.BeastLeather;
                        gloves.Hue = 2830;

                        ThighBoots boots = new ThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2830;

                        m.EquipItem(chest);
                        m.EquipItem(arms);
                        m.EquipItem(legs);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);

                        Shortsword ss = new Shortsword();
                        ss.Resource = CraftResource.Bronze;
                        m.EquipItem(ss);

                        VhalurianMetalKiteShield shield = new VhalurianMetalKiteShield();
                        shield.Resource = CraftResource.Bronze;
                        shield.Name = "Society of Rymaliel Kite Shield";
                        shield.Hue = 2413;
                        shield.ItemID = 15726;
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Medium:
                    {
                        ChainChest chest = new ChainChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2830;

                        ChainArms arms = new ChainArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2830;

                        ChainLegs legs = new ChainLegs();
                        legs.Resource = CraftResource.Bronze;
                        legs.Hue = 2830;

                        ChainGorget gorget = new ChainGorget();
                        gorget.Resource = CraftResource.Bronze;
                        gorget.Hue = 2830;

                        ChainGloves gloves = new ChainGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2830;

                        VhalurianMetalKiteShield shield = new VhalurianMetalKiteShield();
                        shield.Resource = CraftResource.Bronze;
                        shield.Name = "Society of Rymaliel Kite Shield";
                        shield.Hue = 2413;
                        shield.ItemID = 15726;
                        m.EquipItem(shield);

                        FlangedMace fm = new FlangedMace();
                        fm.Resource = CraftResource.Bronze;
                        m.EquipItem(fm);

                        ThighBoots boots = new ThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2989;

                        m.EquipItem(chest);
                        m.EquipItem(arms);
                        m.EquipItem(legs);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(shield);
                        m.EquipItem(fm);
                        m.EquipItem(boots);

                        break;
                    }
                case Armament.Heavy:
                    {
                        PlateChest chest = new PlateChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2830;

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2830;

                        PlateLegs legs = new PlateLegs();
                        legs.Resource = CraftResource.Bronze;
                        legs.Hue = 2830;

                        PlateGorget gorget = new PlateGorget();
                        gorget.Resource = CraftResource.Bronze;
                        gorget.Hue = 2830;

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2830;

                        CloseHelm helm = new CloseHelm();
                        helm.Resource = CraftResource.Bronze;
                        helm.Hue = 2830;

                        VhalurianMetalKiteShield shield = new VhalurianMetalKiteShield();
                        shield.Resource = CraftResource.Bronze;
                        shield.Name = "Society of Rymaliel Kite Shield";
                        shield.Hue = 2413;
                        shield.ItemID = 15726;
                        m.EquipItem(shield);

                        Longsword sword = new Longsword();
                        sword.Resource = CraftResource.Iron;

                        m.EquipItem(chest);
                        m.EquipItem(arms);
                        m.EquipItem(legs);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(shield);
                        m.EquipItem(helm);
                        m.EquipItem(sword);

                        m.EquipItem(new ElegantCloak(2751));

                        break;
                    }
                case Armament.Ranged:
                    {
                        LeatherChest chest = new LeatherChest();
                        chest.Resource = CraftResource.BeastLeather;
                        chest.Hue = 2830;

                        LongPants legs = new LongPants();
                        legs.Resource = CraftResource.Wool;
                        legs.Hue = 2830;

                        LeatherGorget gorget = new LeatherGorget();
                        gorget.Resource = CraftResource.BeastLeather;
                        gorget.Hue = 2830;

                        LeatherGloves gloves = new LeatherGloves();
                        gloves.Resource = CraftResource.BeastLeather;
                        gloves.Hue = 2830;

                        ThighBoots boots = new ThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2830;

                        WingedHelm helm = new WingedHelm();
                        helm.Resource = CraftResource.Copper;

                        CompositeBow bow = new CompositeBow();
                        bow.Resource = CraftResource.Ash;

                        m.EquipItem(chest);
                        m.EquipItem(legs);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);
                        m.EquipItem(helm);
                        m.EquipItem(bow);

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }

            Surcoat coat = new Surcoat();
            coat.ItemID = 15483;
            coat.Name = "A Surcoat of the Society of Rymaliel";
            m.EquipItem(coat);
        }
Пример #7
0
        public static void EquipImperial(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            Surcoat coat = new Surcoat();
            coat.ItemID = 15476;
            coat.Name = "A Surcoat of the Imperial Legion";
            coat.Hue = 2751;
            m.EquipItem(coat);

            switch (a)
            {
                case Armament.Light:
                    {
                        LeatherBoots boots = new LeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 1899;
                        m.EquipItem(boots);

                        WolfMask mask = new WolfMask();
                        mask.Hue = 1899;
                        m.EquipItem(mask);

                        StuddedChest sc = new StuddedChest();
                        sc.Resource = CraftResource.BeastLeather;
                        sc.Hue = 1899;
                        m.EquipItem(sc);

                        StuddedLegs sl = new StuddedLegs();
                        sl.Resource = CraftResource.BeastLeather;
                        sl.Hue = 1899;
                        m.EquipItem(sl);

                        StuddedArms sa = new StuddedArms();
                        sa.Resource = CraftResource.BeastLeather;
                        sa.Hue = 1899;
                        m.EquipItem(sa);

                        StuddedGloves sg = new StuddedGloves();
                        sg.Resource = CraftResource.BeastLeather;
                        sg.Hue = 1899;
                        m.EquipItem(sg);

                        StuddedGorget so = new StuddedGorget();
                        so.Resource = CraftResource.BeastLeather;
                        so.Hue = 1899;
                        m.EquipItem(so);

                        VhalurianGladius vg = new VhalurianGladius();
                        vg.Resource = CraftResource.Iron;
                        vg.Hue = 0;
                        m.EquipItem(vg);

                        WoodenShield ws = new WoodenShield();
                        ws.Resource = CraftResource.Ash;
                        m.EquipItem(ws);

                        break;
                    }
                case Armament.Medium:
                    {
                        ChainChest cc = new ChainChest();
                        cc.Resource = CraftResource.Bronze;
                        cc.Hue = 1899;
                        m.EquipItem(cc);

                        ChainLegs cl = new ChainLegs();
                        cl.Resource = CraftResource.Bronze;
                        cl.Hue = 1899;
                        m.EquipItem(cl);

                        ChainCoif co = new ChainCoif();
                        co.Resource = CraftResource.Bronze;
                        co.Hue = 1899;
                        m.EquipItem(co);

                        RingmailArms ra = new RingmailArms();
                        ra.Resource = CraftResource.Bronze;
                        ra.Hue = 1899;
                        m.EquipItem(ra);

                        RingmailGloves rg = new RingmailGloves();
                        rg.Resource = CraftResource.Bronze;
                        rg.Hue = 1899;
                        m.EquipItem(rg);

                        TyreanKiteShield vmks = new TyreanKiteShield();
                        vmks.Resource = CraftResource.Bronze;
                        vmks.Hue = 1899;
                        m.EquipItem(vmks);

                        LeatherBoots boots = new LeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 1899;
                        m.EquipItem(boots);

                        TyreanOrnateAxe axe = new TyreanOrnateAxe();
                        axe.Resource = CraftResource.Iron;
                        m.EquipItem(axe);

                        break;
                    }
                case Armament.Heavy:
                    {
                        VhalurianOrnatePlateLegs vopl = new VhalurianOrnatePlateLegs();
                        vopl.Resource = CraftResource.Bronze;
                        vopl.Hue = 1899;
                        m.EquipItem(vopl);

                        VhalurianOrnatePlateGorget vopo = new VhalurianOrnatePlateGorget();
                        vopo.Resource = CraftResource.Bronze;
                        vopo.Hue = 1899;
                        m.EquipItem(vopo);

                        PlateSabatons ps = new PlateSabatons();
                        ps.Resource = CraftResource.Bronze;
                        ps.Hue = 1899;
                        m.EquipItem(ps);

                        VhalurianOrnateKiteShield voks = new VhalurianOrnateKiteShield();
                        voks.Resource = CraftResource.Bronze;
                        voks.Hue = 1899;
                        m.EquipItem(voks);

                        VhalurianWarHammer hammer = new VhalurianWarHammer();
                        hammer.Resource = CraftResource.Iron;
                        m.EquipItem(hammer);

                        TyreanHalfPlateChest thpc = new TyreanHalfPlateChest();
                        thpc.Resource = CraftResource.Bronze;
                        thpc.Hue = 1899;
                        m.EquipItem(thpc);

                        TyreanHalfPlateArms thpa = new TyreanHalfPlateArms();
                        thpa.Resource = CraftResource.Bronze;
                        thpa.Hue = 1899;
                        m.EquipItem(thpa);

                        TyreanHalfPlateGloves thpg = new TyreanHalfPlateGloves();
                        thpg.Resource = CraftResource.Bronze;
                        thpg.Hue = 1899;
                        m.EquipItem(thpg);

                        TyreanWingedHelm twh = new TyreanWingedHelm();
                        twh.Resource = CraftResource.Bronze;
                        twh.Hue = 1899;
                        m.EquipItem(twh);

                        m.EquipItem(new ElegantCloak(2751));

                        break;
                    }
                case Armament.Ranged:
                    {
                        FurBoots boots = new FurBoots();
                        boots.Resource = CraftResource.RegularLeather;
                        boots.Hue = 1899;
                        m.EquipItem(boots);

                        Bandana bandana = new Bandana();
                        bandana.Hue = 1899;
                        m.EquipItem(bandana);

                        LeatherChest lc = new LeatherChest();
                        lc.Resource = CraftResource.RegularLeather;
                        lc.Hue = 1899;
                        m.EquipItem(lc);

                        Quiver qv = new Quiver();
                        qv.Layer = Layer.Earrings;
                        m.EquipItem(qv);

                        RaggedPants rp = new RaggedPants();
                        rp.Resource = CraftResource.Cotton;
                        rp.Hue = 1899;
                        m.EquipItem(rp);

                        LeatherGloves lg = new LeatherGloves();
                        lg.Resource = CraftResource.RegularLeather;
                        lg.Hue = 1899;
                        m.EquipItem(lg);

                        VhalurianLongbow bow = new VhalurianLongbow();
                        bow.Resource = CraftResource.Yew;
                        m.EquipItem(bow);

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #8
0
        public static int CalculateSoldierPay(Armament arm, Training train)
        {
            int cost = 0;

            if (train != Training.None)
                cost += 1000;

            switch (arm)
            {
                case Armament.Light: cost += 1000; break;
                case Armament.Medium: cost += 1500; break;
                case Armament.Heavy: cost += 2000; break;
                case Armament.Ranged: cost += 1500; break;
                case Armament.LightCavalry: cost += 2500; break;
                case Armament.HeavyCavalry: cost += 3500; break;
                default: break;
            }

            return cost;
        }
Пример #9
0
 public static bool Fits(this Armament left, Armament right)
 {
     return(left.value() <= right.value());
 }
Пример #10
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     DisguiseAs(null);
 }
Пример #11
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     DisguiseAs(null);
 }
Пример #12
0
 // A motor has the same armament as the slot it was fitted on.
 private void Fitted(TurretComponent parentComponent, Armament armament)
 {
     component.slots[0].armament = armament;
 }
Пример #13
0
        // The rate of fire of the dummy weapon determines the launch cycle as each shot
        // invokes Attacking()
        void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
        {
            if (IsTraitDisabled)
            {
                return;
            }

            if (a.Info.Name != Info.SpawnerArmamentName)
            {
                return;
            }

            // Issue retarget order for already launched ones
            foreach (var slave in slaveEntries)
            {
                if (slave.IsLaunched && slave.IsValid)
                {
                    slave.SpawnerSlave.Attack(slave.Actor, target);
                }
            }

            var carrierSlaveEntry = GetLaunchable();

            if (carrierSlaveEntry == null)
            {
                return;
            }

            carrierSlaveEntry.IsLaunched = true;             // mark as launched

            // Launching condition is timed, so not saving the token.
            if (Info.LaunchingCondition != null)
            {
                if (launchCondition == ConditionManager.InvalidConditionToken)
                {
                    conditionManager.GrantCondition(self, Info.LaunchingCondition);
                }

                launchConditionTicks = Info.LaunchingTicks;
            }

            SpawnIntoWorld(self, carrierSlaveEntry.Actor, self.CenterPosition);

            Stack <int> spawnContainToken;

            if (spawnContainTokens.TryGetValue(a.Info.Name, out spawnContainToken) && spawnContainToken.Any())
            {
                conditionManager.RevokeCondition(self, spawnContainToken.Pop());
            }

            if (loadedTokens.Any())
            {
                conditionManager.RevokeCondition(self, loadedTokens.Pop());
            }

            // Queue attack order, too.
            self.World.AddFrameEndTask(w =>
            {
                // The actor might had been trying to do something before entering the carrier.
                // Cancel whatever it was trying to do.
                carrierSlaveEntry.SpawnerSlave.Stop(carrierSlaveEntry.Actor);

                carrierSlaveEntry.SpawnerSlave.Attack(carrierSlaveEntry.Actor, target);
            });
        }
Пример #14
0
 void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel)
 {
 }
Пример #15
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     --charges;
     timeToRecharge = info.ReloadDelay;
 }
Пример #16
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     --charges;
     timeToRecharge = info.ReloadTime;
 }
Пример #17
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     Attacking(self, target);
 }
Пример #18
0
        public static void EquipAzhuran(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    {
                        Sandals sandals = new Sandals();
                        sandals.Resource = CraftResource.BeastLeather;
                        sandals.Hue = 2810;
                        m.EquipItem(sandals);

                        LeatherLegs ll = new LeatherLegs();
                        ll.Resource = CraftResource.ScaledLeather;
                        m.EquipItem(ll);

                        LeatherGloves lg = new LeatherGloves();
                        lg.Resource = CraftResource.ScaledLeather;
                        m.EquipItem(lg);

                        AzhuranJesterMask mask = new AzhuranJesterMask();
                        mask.Hue = 2810;
                        m.EquipItem(mask);

                        Shortsword sword = new Shortsword();
                        if (Utility.Random(100) + 1 > 99)
                            sword.Resource = CraftResource.Obsidian;
                        else
                            sword.Resource = CraftResource.Bronze;
                        m.EquipItem(sword);

                        BoiledLeatherShield shield = new BoiledLeatherShield();
                        shield.Resource = CraftResource.Ash;
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Medium:
                    {
                        AzhuranLeatherTunic chest = new AzhuranLeatherTunic();
                        chest.Resource = CraftResource.BeastLeather;

                        AzhuranLeatherPauldrons pauldrons = new AzhuranLeatherPauldrons();
                        pauldrons.Resource = CraftResource.BeastLeather;

                        AzhuranLeatherBoots boots = new AzhuranLeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;

                        AzhuranLeatherLegs legs = new AzhuranLeatherLegs();
                        legs.Resource = CraftResource.BeastLeather;

                        LeatherGloves gloves = new LeatherGloves();
                        gloves.Resource = CraftResource.BeastLeather;

                        LeatherArms arms = new LeatherArms();
                        arms.Resource = CraftResource.BeastLeather;

                        AzhuranSpear spear = new AzhuranSpear();
                        spear.Resource = CraftResource.Bronze;

                        m.EquipItem(chest);
                        m.EquipItem(pauldrons);
                        m.EquipItem(new Bandana(2810));
                        m.EquipItem(spear);
                        m.EquipItem(boots);
                        m.EquipItem(legs);
                        m.EquipItem(gloves);
                        m.EquipItem(arms);
                        break;
                    }
                case Armament.Heavy:
                    {
                        AzhuranHelm helm = new AzhuranHelm();
                        helm.Resource = CraftResource.Bronze;

                        AzhuranSpikedChainChest chest = new AzhuranSpikedChainChest();
                        chest.Resource = CraftResource.Bronze;

                        RingmailArms arms = new RingmailArms();
                        arms.Resource = CraftResource.Bronze;

                        ChainLegs legs = new ChainLegs();
                        legs.Resource = CraftResource.Bronze;

                        RingmailGloves gloves = new RingmailGloves();
                        gloves.Resource = CraftResource.Bronze;

                        m.EquipItem(helm);
                        m.EquipItem(chest);
                        Sandals sandals = new Sandals();
                        sandals.Resource = CraftResource.BeastLeather;
                        sandals.Hue = 2810;
                        m.EquipItem(sandals);
                        m.EquipItem(gloves);
                        m.EquipItem(arms);
                        m.EquipItem(legs);
                        m.EquipItem(new Cloak(2810));

                        if (m.Female)
                        {
                            AzhuranKiteShield shield = new AzhuranKiteShield();
                            shield.Resource = CraftResource.Bronze;

                            AzhuranHookedClub club = new AzhuranHookedClub();
                            club.Resource = CraftResource.Bronze;

                            m.EquipItem(shield);
                            m.EquipItem(club);
                            m.EquipItem(new ElegantWaistCloth(2810));
                        }

                        else
                        {
                            AzhuranRoundShield shield = new AzhuranRoundShield();
                            shield.Resource = CraftResource.Bronze;

                            AzhuranBroadsword sword = new AzhuranBroadsword();
                            sword.Resource = CraftResource.Bronze;

                            m.EquipItem(shield);
                            m.EquipItem(sword);
                        }

                        break;
                    }
                case Armament.Ranged:
                    {
                        Sandals sandals = new Sandals();
                        sandals.Resource = CraftResource.BeastLeather;
                        sandals.Hue = 2810;
                        m.EquipItem(sandals);

                        if (m.Female)
                        {
                            AzhuranShortbow bow = new AzhuranShortbow();
                            bow.Resource = CraftResource.Redwood;

                            m.EquipItem(bow);
                            m.EquipItem(new MetallicBra());
                            m.EquipItem(new WaistCloth(2810));
                        }

                        else
                        {
                            AzhuranBoomerang bow = new AzhuranBoomerang();
                            bow.Resource = CraftResource.Redwood;

                            m.EquipItem(bow);
                            m.EquipItem(new LoinCloth(2810));
                        }

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;

                            if (m.Female)
                                bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #19
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     if (a != null && a.Info.AmmoPoolName == Info.Name)
         TakeAmmo();
 }
Пример #20
0
        public static void EquipKhemetar(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    {
                        Sandals sand = new Sandals();
                        sand.Resource = CraftResource.BeastLeather;
                        sand.Hue = 2947;
                        m.EquipItem(sand);

                        KhemetarScaleChest chest = new KhemetarScaleChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2947;
                        m.EquipItem(chest);

                        KhemetarScaleLegs legs = new KhemetarScaleLegs();
                        legs.Resource = CraftResource.Bronze;
                        legs.Hue = 2947;
                        m.EquipItem(legs);

                        KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                        helmet.Resource = CraftResource.Bronze;
                        helmet.Hue = 2947;
                        m.EquipItem(helmet);

                        KhemetarKukri k = new KhemetarKukri();
                        k.Resource = CraftResource.Iron;
                        m.EquipItem(k);

                        WoodenShield shield = new WoodenShield();
                        shield.Resource = CraftResource.Redwood;
                        m.EquipItem(shield);

                        if (m.Female)
                        {
                            ElegantWaistCloth waist = new ElegantWaistCloth();
                            waist.Hue = 2795;
                            m.EquipItem(waist);
                        }

                        else
                        {
                            WaistSash sash = new WaistSash();
                            sash.Hue = 2795;
                            m.EquipItem(sash);
                        }

                        break;
                    }
                case Armament.Medium:
                    {
                        ThighBoots boots = new ThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2947;
                        m.EquipItem(boots);

                        KhemetarScaleChest chest = new KhemetarScaleChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2947;
                        m.EquipItem(chest);

                        KhemetarScaleLegs legs = new KhemetarScaleLegs();
                        legs.Resource = CraftResource.Bronze;
                        legs.Hue = 2947;
                        m.EquipItem(legs);

                        KhemetarScaleArms arms = new KhemetarScaleArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2947;
                        m.EquipItem(arms);

                        RingmailGloves gloves = new RingmailGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2947;
                        m.EquipItem(gloves);

                        KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                        helmet.Resource = CraftResource.Bronze;
                        helmet.Hue = 2947;
                        m.EquipItem(helmet);

                        KhemetarKhopesh sword = new KhemetarKhopesh();
                        sword.Resource = CraftResource.Bronze;
                        m.EquipItem(sword);

                        MetalShield shield = new MetalShield();
                        shield.Resource = CraftResource.Bronze;
                        shield.Hue = 2947;
                        m.EquipItem(shield);

                        if (m.Female)
                        {
                            ElegantWaistCloth waist = new ElegantWaistCloth();
                            waist.Hue = 2795;
                            m.EquipItem(waist);
                        }

                        else
                        {
                            WaistSash sash = new WaistSash();
                            sash.Hue = 2795;
                            m.EquipItem(sash);
                        }

                        break;
                    }
                case Armament.Heavy:
                    {
                        KhemetarScaleChest chest = new KhemetarScaleChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2947;
                        m.EquipItem(chest);

                        PlateLegs legs = new PlateLegs();
                        legs.Resource = CraftResource.Bronze;
                        legs.Hue = 2947;
                        m.EquipItem(legs);

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2947;
                        m.EquipItem(arms);

                        PlateGorget gorget = new PlateGorget();
                        gorget.Resource = CraftResource.Bronze;
                        gorget.Hue = 2947;
                        m.EquipItem(gorget);

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2947;
                        m.EquipItem(gloves);

                        KhemetarScaleHelmet helmet = new KhemetarScaleHelmet();
                        helmet.Resource = CraftResource.Bronze;
                        helmet.Hue = 2947;
                        m.EquipItem(helmet);

                        RunicCloak cloak = new RunicCloak();
                        cloak.Hue = 2795;
                        m.EquipItem(cloak);

                        KhemetarAxe axe = new KhemetarAxe();
                        axe.Resource = CraftResource.Bronze;
                        m.EquipItem(axe);

                        if (m.Female)
                        {
                            ElegantWaistCloth waist = new ElegantWaistCloth();
                            waist.Hue = 2795;
                            m.EquipItem(waist);
                        }

                        else
                        {
                            WaistSash sash = new WaistSash();
                            sash.Hue = 2795;
                            m.EquipItem(sash);
                        }

                        break;
                    }
                case Armament.Ranged:
                    {
                        KhemetarRogueTurban turban = new KhemetarRogueTurban();
                        turban.Resource = CraftResource.Cotton;
                        turban.Hue = 2795;
                        m.EquipItem(turban);

                        BaggyPants pants = new BaggyPants();
                        pants.Resource = CraftResource.Cotton;
                        pants.Hue = 2795;
                        m.EquipItem(pants);

                        ElegantCloak cloak = new ElegantCloak();
                        cloak.Resource = CraftResource.Cotton;
                        cloak.Hue = 2795;
                        m.EquipItem(cloak);

                        m.EquipItem(new Sandals());

                        KhemetarScaleChest chest = new KhemetarScaleChest();
                        chest.Resource = CraftResource.Bronze;
                        chest.Hue = 2947;
                        m.EquipItem(chest);

                        KhemetarScaleArms arms = new KhemetarScaleArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2947;
                        m.EquipItem(arms);

                        KhemetarLongbow bow = new KhemetarLongbow();
                        bow.Resource = CraftResource.Redwood;
                        m.EquipItem(bow);

                        if (m.Female)
                        {
                            ElegantWaistCloth waist = new ElegantWaistCloth();
                            waist.Hue = 2795;
                            m.EquipItem(waist);
                        }

                        else
                        {
                            WaistSash sash = new WaistSash();
                            sash.Hue = 2795;
                            m.EquipItem(sash);
                        }

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #21
0
 void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel)
 {
 }
Пример #22
0
        public static void EquipTyrean(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            Surcoat coat = new Surcoat();
            coat.ItemID = 15477;
            coat.Name = "A Surcoat of the Jarlsgaard";
            coat.Hue = 2741;
            m.EquipItem(coat);

            switch (a)
            {
                case Armament.Light:
                    {
                        StuddedChest lc = new StuddedChest();
                        lc.Resource = CraftResource.BeastLeather;
                        lc.Hue = 1899;
                        m.EquipItem(lc);

                        StuddedLegs ll = new StuddedLegs();
                        ll.Resource = CraftResource.BeastLeather;
                        ll.Hue = 1899;
                        m.EquipItem(ll);

                        StuddedArms la = new StuddedArms();
                        la.Resource = CraftResource.BeastLeather;
                        la.Hue = 1899;
                        m.EquipItem(ll);

                        StuddedGloves lg = new StuddedGloves();
                        lg.Resource = CraftResource.BeastLeather;
                        lg.Hue = 1899;
                        m.EquipItem(lg);

                        StuddedGorget lo = new StuddedGorget();
                        lo.Resource = CraftResource.BeastLeather;
                        lo.Hue = 1899;
                        m.EquipItem(lo);

                        BearMask mask = new BearMask();
                        mask.Hue = 1899;
                        m.EquipItem(mask);

                        FurBoots boots = new FurBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2741;
                        m.EquipItem(boots);

                        TyreanThrowingAxe tta = new TyreanThrowingAxe();
                        tta.Resource = CraftResource.Bronze;
                        m.EquipItem(tta);

                        LeatherShield ls = new LeatherShield();
                        ls.Resource = CraftResource.Yew;
                        m.EquipItem(ls);

                        break;
                    }
                case Armament.Medium:
                    {
                        ChainChest cc = new ChainChest();
                        cc.Resource = CraftResource.Bronze;
                        cc.Hue = 1899;
                        m.EquipItem(cc);

                        ChainLegs cl = new ChainLegs();
                        cl.Resource = CraftResource.Bronze;
                        cl.Hue = 1899;
                        m.EquipItem(cl);

                        RingmailArms ra = new RingmailArms();
                        ra.Resource = CraftResource.Bronze;
                        ra.Hue = 1899;
                        m.EquipItem(ra);

                        RingmailGloves rg = new RingmailGloves();
                        rg.Resource = CraftResource.Bronze;
                        rg.Hue = 1899;
                        m.EquipItem(rg);

                        TyreanHornedHelm thh = new TyreanHornedHelm();
                        thh.Resource = CraftResource.Bronze;
                        thh.Hue = 1899;
                        m.EquipItem(thh);

                        FurBoots boots = new FurBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2741;
                        m.EquipItem(boots);

                        bool WeaponChance = Utility.RandomBool();

                        if (WeaponChance)
                        {
                            TyreanHarpoon weapon = new TyreanHarpoon();
                            weapon.Resource = CraftResource.Bronze;

                            m.EquipItem(weapon);
                        }

                        else
                        {
                            TyreanBattleAxe weapon = new TyreanBattleAxe();
                            weapon.Resource = CraftResource.Bronze;

                            m.EquipItem(weapon);
                        }

                        break;
                    }
                case Armament.Heavy:
                    {
                        TyreanHalfPlateChest thpc = new TyreanHalfPlateChest();
                        thpc.Resource = CraftResource.Bronze;
                        thpc.Hue = 1899;
                        m.EquipItem(thpc);

                        TyreanHalfPlateLegs thpl = new TyreanHalfPlateLegs();
                        thpl.Resource = CraftResource.Bronze;
                        thpl.Hue = 1899;
                        m.EquipItem(thpl);

                        TyreanHalfPlateSabatons thps = new TyreanHalfPlateSabatons();
                        thps.Resource = CraftResource.Bronze;
                        thps.Hue = 1899;
                        m.EquipItem(thps);

                        TyreanHalfPlateArms thpa = new TyreanHalfPlateArms();
                        thpa.Resource = CraftResource.Bronze;
                        thpa.Hue = 1899;
                        m.EquipItem(thpa);

                        TyreanHalfPlateGloves thpg = new TyreanHalfPlateGloves();
                        thpg.Resource = CraftResource.Bronze;
                        thpg.Hue = 1899;
                        m.EquipItem(thpg);

                        TyreanHalfPlateGorget thpo = new TyreanHalfPlateGorget();
                        thpo.Resource = CraftResource.Bronze;
                        thpo.Hue = 1899;
                        m.EquipItem(thpo);

                        TyreanKiteShield tks = new TyreanKiteShield();
                        tks.Resource = CraftResource.Bronze;
                        tks.Hue = 1899;
                        m.EquipItem(tks);

                        m.EquipItem(new Cloak(1445));

                        TyreanWingedHelm twh = new TyreanWingedHelm();
                        twh.Resource = CraftResource.Bronze;
                        twh.Hue = 1899;
                        m.EquipItem(twh);

                        bool WeaponChance = Utility.RandomBool();
                        if (WeaponChance)
                        {
                            TyreanWarAxe axe = new TyreanWarAxe();
                            axe.Resource = CraftResource.Bronze;

                            m.EquipItem(axe);
                        }

                        else
                        {
                            TyreanOrnateAxe axe = new TyreanOrnateAxe();
                            axe.Resource = CraftResource.Bronze;

                            m.EquipItem(axe);
                        }

                        break;
                    }
                case Armament.Ranged:
                    {
                        FancyShirt shirt = new FancyShirt();
                        shirt.Resource = CraftResource.Wool;
                        shirt.Hue = 1899;
                        m.EquipItem(shirt);

                        LeatherChest lc = new LeatherChest();
                        lc.Resource = CraftResource.BeastLeather;
                        lc.Hue = 1899;
                        m.EquipItem(lc);

                        LeatherLegs ll = new LeatherLegs();
                        ll.Resource = CraftResource.BeastLeather;
                        ll.Hue = 1899;
                        m.EquipItem(ll);

                        LeatherGloves lg = new LeatherGloves();
                        lg.Resource = CraftResource.BeastLeather;
                        lg.Hue = 1899;
                        m.EquipItem(lg);

                        FurBoots boots = new FurBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2741;
                        m.EquipItem(boots);

                        m.EquipItem(new Cloak(1445));

                        TyreanCompositeBow bow = new TyreanCompositeBow();
                        bow.Resource = CraftResource.Redwood;
                        m.EquipItem(bow);

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #23
0
        void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
        {
            if (!info.ArmamentNames.Contains(a.Info.Name))
            {
                return;
            }

            if (info.CheckTargetTypes)
            {
                bool          isContinue  = false;
                ITargetable[] targetables = target.Actor.Targetables;
                if (targetables != null)
                {
                    foreach (var targetable in targetables)
                    {
                        foreach (var targetType in targetable.TargetTypes)
                        {
                            if (info.TargetTypes.Contains(targetType))
                            {
                                isContinue = true;
                                break;
                            }
                        }
                        if (isContinue)
                        {
                            break;
                        }
                    }
                }
                if (!isContinue)
                {
                    return;
                }
            }

            if (info.RevokeOnNewTarget)
            {
                if (TargetChanged(lastTarget, target))
                {
                    RevokeInstance(self, info.RevokeAll);
                }

                lastTarget = target;
            }

            cooldown = info.RevokeDelay;

            if (!info.IsCyclic && tokens.Count >= info.MaximumInstances)
            {
                return;
            }

            shotsFired++;
            var requiredShots = tokens.Count < info.RequiredShotsPerInstance.Length
                                ? info.RequiredShotsPerInstance[tokens.Count]
                                : info.RequiredShotsPerInstance[info.RequiredShotsPerInstance.Length - 1];

            if (shotsFired >= requiredShots)
            {
                if (info.IsCyclic && tokens.Count == info.MaximumInstances)
                {
                    RevokeInstance(self, true);
                }
                else
                {
                    GrantInstance(self, info.Condition);
                }

                shotsFired = 0;
            }
        }
Пример #24
0
        public void TrainSoldier(Armament a)
        {
            switch (a)
            {
                case Armament.Light:
                    {
                        SetStr(Utility.Random(120, 130));
                        SetDex(Utility.Random(160, 180));
                        SetInt(Utility.Random(65, 85));
                        SetHits(Utility.Random(125, 130));
                        SetStam(Utility.Random(90, 110));

                        SetResistance(ResistanceType.Blunt, 50);
                        SetResistance(ResistanceType.Piercing, 50);
                        SetResistance(ResistanceType.Slashing, 50);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 75;
                        SetDamage(15, 20);

                        PassiveSpeed = 0.4;
                        ActiveSpeed = 0.2;

                        PayRate = 1000;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 5000;

                        break;
                    }
                case Armament.Medium:
                    {
                        SetStr(Utility.Random(140, 160));
                        SetDex(Utility.Random(130, 150));
                        SetInt(Utility.Random(90, 110));
                        SetHits(Utility.Random(135, 155));
                        SetStam(Utility.Random(100, 125));

                        SetResistance(ResistanceType.Blunt, 60);
                        SetResistance(ResistanceType.Piercing, 60);
                        SetResistance(ResistanceType.Slashing, 60);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 90;
                        SetDamage(20, 25);

                        PassiveSpeed = 0.45;
                        ActiveSpeed = 0.25;

                        PayRate = 1500;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 8000;

                        break;

                    }
                case Armament.Heavy:
                    {
                        SetStr(Utility.Random(160, 180));
                        SetDex(Utility.Random(90, 110));
                        SetInt(Utility.Random(115, 135));
                        SetHits(Utility.Random(175, 200));
                        SetStam(Utility.Random(200, 225));

                        SetResistance(ResistanceType.Blunt, 70);
                        SetResistance(ResistanceType.Piercing, 70);
                        SetResistance(ResistanceType.Slashing, 70);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 100;
                        SetDamage(25, 30);

                        PassiveSpeed = 0.5;
                        ActiveSpeed = 0.3;

                        PayRate = 2000;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 10000;

                        break;
                    }
                case Armament.Ranged:
                    {
                        SetStr(Utility.Random(120, 130));
                        SetDex(Utility.Random(150, 250));
                        SetInt(Utility.Random(90, 110));
                        SetHits(Utility.Random(100, 120));
                        SetStam(Utility.Random(100, 125));

                        SetResistance(ResistanceType.Blunt, 40);
                        SetResistance(ResistanceType.Piercing, 40);
                        SetResistance(ResistanceType.Slashing, 40);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 100;
                        SetDamage(1, 25);

                        PassiveSpeed = 0.4;
                        ActiveSpeed = 0.2;

                        PayRate = 1500;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 8000;

                        break;
                    }
                case Armament.LightCavalry:
                    {
                        SetStr(Utility.Random(140, 160));
                        SetDex(Utility.Random(130, 150));
                        SetInt(Utility.Random(90, 110));
                        SetHits(Utility.Random(135, 155));
                        SetStam(Utility.Random(100, 125));

                        SetResistance(ResistanceType.Blunt, 60);
                        SetResistance(ResistanceType.Piercing, 60);
                        SetResistance(ResistanceType.Slashing, 60);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 90;
                        SetDamage(25, 30);

                        PassiveSpeed = 0.3;
                        ActiveSpeed = 0.1;

                        PayRate = 2500;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 7000;

                        MountSoldier();

                        GiveFeat = "Riding 3";

                        break;
                    }
                case Armament.HeavyCavalry:
                    {
                        SetStr(Utility.Random(180, 200));
                        SetDex(Utility.Random(100, 120));
                        SetInt(Utility.Random(125, 135));
                        SetHits(Utility.Random(190, 200));
                        SetStam(Utility.Random(200, 225));

                        SetResistance(ResistanceType.Blunt, 70);
                        SetResistance(ResistanceType.Piercing, 70);
                        SetResistance(ResistanceType.Slashing, 70);
                        VirtualArmor = 0;

                        SetDamageType(ResistanceType.Blunt, 100);
                        CombatSkills = 100;
                        SetDamage(30, 35);

                        PassiveSpeed = 0.4;
                        ActiveSpeed = 0.2;

                        PayRate = 3500;

                        if (Nation == Nation.Insularii )
                        {
                            SetResistance( ResistanceType.Energy, 70, 70 );
                            SetSkill( SkillName.MagicResist, 100, 100 );
                        }

                        Fame = 12000;

                        MountSoldier();

                        GiveFeat = "Riding 3";

                        break;
                    }
            }
        }
Пример #25
0
 void INotifyBurstComplete.FiredBurst(Actor self, Target target, Armament a)
 {
     self.World.AddFrameEndTask(w => activeArmaments.Remove(a));
 }
Пример #26
0
 void INotifyBurstComplete.FiredBurst(Actor self, Target target, Armament a)
 {
     self.World.IssueOrder(new Order("Stop", self, false));
 }
Пример #27
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     wsb.PlayCustomAnimation(self, info.SequenceFire);
 }
Пример #28
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     pseudoidleDuration     = 100;
     GetAttackedorAttacking = target.Actor.Owner;
 }
Пример #29
0
 public void MoveTo(Transform target)
 {
     isFree = false;
     Armament.NoAttack();
     movement.MoveTo(target);
 }
Пример #30
0
 public void PreparingAttack(Actor self, Target target, Armament a, Barrel barrel)
 {
 }
Пример #31
0
 public void MoveTo(Transform target, Vector3 lookToPoint)
 {
     isFree = false;
     Armament.NoAttack();
     movement.MoveTo(target);
 }
		void INotifyBurstComplete.FiredBurst(Actor self, Target target, Armament a)
		{
			self.World.AddFrameEndTask(w => activeArmaments.Remove(a));
		}
Пример #33
0
 public void MoveTo(Vector3 target)
 {
     isFree = false;
     Armament.NoAttack();
     movement.MoveTo(target);
 }
Пример #34
0
		public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
		{
			if (self.World.SharedRandom.Next(100 / Info.AttackPanicChance) == 0)
				Panic();
		}
Пример #35
0
 public void NoAttack()
 {
     isFree = true;
     Armament.NoAttack();
 }
Пример #36
0
        public static void EquipAlyrian(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    {
                        AlyrianClaymore sword = new AlyrianClaymore();
                        sword.Resource = CraftResource.Bronze;
                        m.EquipItem(sword);

                        StuddedChest chest = new StuddedChest();
                        chest.Resource = CraftResource.RegularLeather;
                        m.EquipItem(chest);

                        StuddedLegs legs = new StuddedLegs();
                        legs.Resource = CraftResource.RegularLeather;
                        m.EquipItem(legs);

                        if (m.Female)
                        {
                            m.EquipItem(new ElegantFemaleKilt(2587));
                            m.EquipItem(new MetallicBra());
                            m.EquipItem(new ElegantShoes());
                        }
                        else
                        {
                            m.EquipItem(new OrnateKilt(2587));
                            m.EquipItem(new Sandals());
                        }

                        break;
                    }
                case Armament.Medium:
                    {
                        AlyrianRoundShield shield = new AlyrianRoundShield();
                        shield.Resource = CraftResource.Bronze;
                        m.EquipItem(shield);

                        AlyrianLongsword sword = new AlyrianLongsword();
                        sword.Resource = CraftResource.Bronze;
                        m.EquipItem(sword);

                        AlyrianChainChest chest = new AlyrianChainChest();
                        chest.Resource = CraftResource.Bronze;

                        AlyrianChainLegs legs = new AlyrianChainLegs();
                        legs.Resource = CraftResource.Bronze;

                        AlyrianChainArms arms = new AlyrianChainArms();
                        arms.Resource = CraftResource.Bronze;

                        AlyrianChainGorget gorget = new AlyrianChainGorget();
                        gorget.Resource = CraftResource.Bronze;

                        HardenedFurBoots boots = new HardenedFurBoots();

                        PlainKilt kilt = new PlainKilt(2587);
                        kilt.Resource = CraftResource.Wool;

                        Beret beret = new Beret(2587);
                        beret.Resource = CraftResource.Wool;

                        m.EquipItem(chest);
                        m.EquipItem(legs);
                        m.EquipItem(arms);
                        m.EquipItem(gorget);
                        m.EquipItem(boots);
                        m.EquipItem(kilt);
                        m.EquipItem(beret);

                        break;
                    }
                case Armament.Heavy:
                    {
                        AlyrianLeafShield shield = new AlyrianLeafShield();
                        shield.Resource = CraftResource.Bronze;
                        m.EquipItem(shield);

                        AlyrianSabre sabre = new AlyrianSabre();
                        sabre.Resource = CraftResource.Bronze;
                        m.EquipItem(sabre);

                        AlyrianChainChest chest = new AlyrianChainChest();
                        chest.Resource = CraftResource.Bronze;
                        m.EquipItem(chest);

                        PlateLegs legs = new PlateLegs();
                        legs.Resource = CraftResource.Bronze;
                        m.EquipItem(legs);

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        m.EquipItem(arms);

                        PlateGorget gorget = new PlateGorget();
                        gorget.Resource = CraftResource.Bronze;
                        m.EquipItem(gorget);

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        m.EquipItem(gloves);

                        m.EquipItem(new RunicCloak(2587));

                        if (m.Female)
                            m.EquipItem(new FemaleKilt(2587));
                        else
                            m.EquipItem(new ElegantKilt(2587));

                        break;

                    }
                case Armament.Ranged:
                    {
                        bool WeaponChance = Utility.RandomBool();
                        if (WeaponChance)
                        {
                            AlyrianLongbow bow = new AlyrianLongbow();
                            bow.Resource = CraftResource.Redwood;
                            m.EquipItem(bow);
                        }
                        else
                        {
                            AlyrianGiantBow bow = new AlyrianGiantBow();
                            bow.Resource = CraftResource.Redwood;
                            m.EquipItem(bow);
                        }

                        if (m.Female)
                        {
                            m.EquipItem(new ElegantKilt(2587));
                            m.EquipItem(new MetallicBra());
                        }
                        else
                            m.EquipItem(new PlainKilt(2587));

                        m.EquipItem(new Sandals());

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
        // The rate of fire of the dummy weapon determines the launch cycle as each shot
        // invokes Attacking()
        void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
        {
            if (IsTraitDisabled)
            {
                return;
            }

            if (a.Info.Name != Info.SpawnerArmamentName)
            {
                return;
            }

            // Issue retarget order for already launched ones
            foreach (var slave in SlaveEntries)
            {
                if (slave.IsValid)
                {
                    slave.SpawnerSlave.Attack(slave.Actor, target);
                }
            }

            var se = GetLaunchable();

            if (se == null)
            {
                return;
            }

            // Launching condition is timed, so not saving the token.
            if (Info.LaunchingCondition != null)
            {
                conditionManager.GrantCondition(self, Info.LaunchingCondition);
            }

            // Program the trajectory.
            var sbm = se.Actor.Trait <ShootableBallisticMissile>();

            sbm.Target = Target.FromPos(target.CenterPosition);

            SpawnIntoWorld(self, se.Actor, self.CenterPosition);

            Stack <int> spawnContainToken;

            if (spawnContainTokens.TryGetValue(a.Info.Name, out spawnContainToken) && spawnContainToken.Any())
            {
                conditionManager.RevokeCondition(self, spawnContainToken.Pop());
            }

            if (loadedTokens.Any())
            {
                conditionManager.RevokeCondition(self, loadedTokens.Pop());
            }

            // Queue attack order, too.
            self.World.AddFrameEndTask(w =>
            {
                se.Actor.QueueActivity(new ShootableBallisticMissileFly(se.Actor, sbm.Target, sbm));

                // invalidate the slave entry so that slave will regen.
                se.Actor = null;
            });

            // Set clock so that regen happens.
            if (respawnTicks <= 0)             // Don't interrupt an already running timer!
            {
                respawnTicks = Info.RespawnTicks;
            }
        }
Пример #38
0
        public static void EquipFreeSoldier(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            int chance = Utility.RandomMinMax(1, 6);
            Nation nation = Nation.Vhalurian;

            switch (chance)
            {
                case 1: nation = Nation.Alyrian; break;
                case 2: nation = Nation.Azhuran; break;
                case 3: nation = Nation.Khemetar; break;
                case 4: nation = Nation.Mhordul; break;
                case 5: nation = Nation.Tyrean; break;
                case 6: nation = Nation.Vhalurian; break;
            }

            m.Language = "Common";
            m.Female = Utility.RandomBool();

            if (m.Female)
            {
                m.Body = 0x191;
                (m as Soldier).BaseName = RandomName(nation, true) + RandomSurname(nation, true);
            }

            else
            {
                m.Body = 0x190;
                (m as Soldier).BaseName = BaseKhaerosMobile.RandomName(nation, false) + RandomSurname(nation, false);
            }

            m.Hue = BaseKhaerosMobile.AssignRacialHue(nation);
            m.HairItemID = BaseKhaerosMobile.AssignRacialHair(nation, m.Female);
            int hairhue = BaseKhaerosMobile.AssignRacialHairHue(nation);
            m.HairHue = hairhue;

            if (!m.Female)
            {
                m.FacialHairItemID = BaseKhaerosMobile.AssignRacialFacialHair(nation);
                m.FacialHairHue = hairhue;
            }
            else
                m.FacialHairItemID = 0;

            if (m.Backpack == null)
                m.AddItem(new Backpack());

            m.Name = ((m as Soldier).BaseName + " the Free Soldier");

            ChainChest cc = new ChainChest();
            m.EquipItem(cc);
            PlateArms pa = new PlateArms();
            m.EquipItem(pa);
            TyreanHalfPlateGloves thpg = new TyreanHalfPlateGloves();
            m.EquipItem(thpg);
            PlateGorget pg = new PlateGorget();
            m.EquipItem(pg);
            PlateLegs pl = new PlateLegs();
            m.EquipItem(pl);
            m.EquipItem(new Cloak(Utility.RandomMinMax(1873, 1908)));
            m.EquipItem(new Tunic(Utility.RandomMinMax(1873, 1908)));

            int RandomWeapons = Utility.Random(3);

            switch (RandomWeapons)
            {
                case 0: Broadsword sword = new Broadsword(); m.EquipItem(sword); MetalShield shield = new MetalShield(); m.EquipItem(shield); break;
                case 1: WarHammer wh = new WarHammer(); m.EquipItem(wh); break;
                case 2: Bow b = new Bow(); m.EquipItem(b); m.AddToBackpack(new Arrow(Utility.Random(20))); (m as BaseCreature).AI = AIType.AI_Archer; break;
            }
        }
Пример #39
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     if (a.Info.AmmoPoolName == Info.Name)
         TakeAmmo();
 }
Пример #40
0
        public static void EquipInsularii(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    {
                        MaleDress dress = new MaleDress();
                        dress.Name = "A Ceremonial Robe";
                        dress.Layer = Layer.InnerTorso;
                        dress.Hue = 2990;

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2990;

                        ElegantDoublet doub = new ElegantDoublet();
                        doub.Name = "A Ceremonial Tunic";
                        doub.Hue = 2707;

                        KhemetarRogueTurban gorget = new KhemetarRogueTurban();
                        gorget.Hue = 2990;

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2990;

                        HardenedThighBoots boots = new HardenedThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2990;

                        BeltPouch belt = new BeltPouch();
                        belt.Hue = 2990;

                        FancyGlasses glasses = new FancyGlasses();
                        glasses.Hue = 2707;

                        m.EquipItem(dress);
                        m.EquipItem(arms);
                        m.EquipItem(doub);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);
                        m.EquipItem(belt);
                        m.EquipItem(glasses);

                        Shortsword ss = new Shortsword();
                        ss.Resource = CraftResource.Iron;
                        m.EquipItem(ss);

                        Buckler shield = new Buckler();
                        shield.Resource = CraftResource.Bronze;
                        shield.Hue = 2707;
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Medium:
                    {
                        MaleDress dress = new MaleDress();
                        dress.Name = "A Ceremonial Robe";
                        dress.Layer = Layer.InnerTorso;
                        dress.Hue = 2990;

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2990;

                        ElegantDoublet doub = new ElegantDoublet();
                        doub.Name = "A Ceremonial Tunic";
                        doub.ItemID = 15502;
                        doub.Hue = 2707;

                        KhemetarRogueTurban gorget = new KhemetarRogueTurban();
                        gorget.Layer = Layer.Neck;
                        gorget.Hue = 2990;

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2990;

                        HardenedThighBoots boots = new HardenedThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2990;

                        TyreanHornedPlateHelm helm = new TyreanHornedPlateHelm();
                        helm.Resource = CraftResource.Bronze;
                        helm.Name = "A Horned Helmet";
                        helm.Hue = 2990;

                        BeltPouch belt = new BeltPouch();
                        belt.Hue = 2990;

                        FancyGlasses glasses = new FancyGlasses();
                        glasses.Hue = 2707;

                        m.EquipItem(dress);
                        m.EquipItem(arms);
                        m.EquipItem(doub);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);
                        m.EquipItem(helm);
                        m.EquipItem(belt);
                        m.EquipItem(glasses);

                        Machete ss = new Machete();
                        ss.Resource = CraftResource.Iron;
                        m.EquipItem(ss);

                        MetalShield shield = new MetalShield();
                        shield.Resource = CraftResource.Bronze;
                        shield.Hue = 2707;
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Heavy:
                    {
                        MaleDress dress = new MaleDress();
                        dress.Name = "A Ceremonial Robe";
                        dress.Layer = Layer.InnerTorso;
                        dress.Hue = 2707;

                        TyreanHalfPlateChest chest = new TyreanHalfPlateChest();
                        chest.Name = "A Ceremonial Breastplate";
                        chest.Layer = Layer.MiddleTorso;
                        chest.Hue = 2990;

                        PlateArms arms = new PlateArms();
                        arms.Resource = CraftResource.Bronze;
                        arms.Hue = 2990;

                        LargeScarf gorget = new LargeScarf();
                        gorget.Layer = Layer.Neck;
                        gorget.Hue = 2990;

                        PlateGloves gloves = new PlateGloves();
                        gloves.Resource = CraftResource.Bronze;
                        gloves.Hue = 2990;

                        HardenedThighBoots boots = new HardenedThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2990;

                        TyreanHornedHelm helm = new TyreanHornedHelm();
                        helm.Resource = CraftResource.Bronze;
                        helm.Name = "A Horned Helmet";
                        helm.Hue = 2707;

                        BeltPouch belt = new BeltPouch();
                        belt.Hue = 2990;

                        FemaleLoinCloth lc = new FemaleLoinCloth();
                        lc.Hue = 2990;
                        lc.Name = "A Ceremonial Loin Cloth";

                        FancyGlasses glasses = new FancyGlasses();
                        glasses.Hue = 2707;

                        m.EquipItem(dress);
                        m.EquipItem(chest);
                        m.EquipItem(arms);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);
                        m.EquipItem(helm);
                        m.EquipItem(belt);
                        m.EquipItem(lc);
                        m.EquipItem(glasses);

                        SerratedSword ss = new SerratedSword();
                        ss.Resource = CraftResource.Iron;
                        m.EquipItem(ss);

                        HeaterShield shield = new HeaterShield();
                        shield.Resource = CraftResource.Iron;
                        shield.Hue = 2990;
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Ranged:
                    {
                        MaleDress dress = new MaleDress();
                        dress.Name = "A Ceremonial Robe";
                        dress.Layer = Layer.InnerTorso;
                        dress.Hue = 2990;

                        ElegantDoublet doub = new ElegantDoublet();
                        doub.Name = "A Ceremonial Tunic";
                        doub.Hue = 2707;

                        KhemetarRogueTurban gorget = new KhemetarRogueTurban();
                        gorget.Layer = Layer.Neck;
                        gorget.Hue = 2990;

                        FancyGloves gloves = new FancyGloves();
                        gloves.Hue = 2990;

                        HardenedThighBoots boots = new HardenedThighBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2990;

                        KhemetarScaleHelmet helm = new KhemetarScaleHelmet();
                        helm.Resource = CraftResource.Bronze;
                        helm.Name = "A Ceremonial Helmet";
                        helm.Hue = 2990;

                        BeltPouch belt = new BeltPouch();
                        belt.Hue = 2990;

                        FancyGlasses glasses = new FancyGlasses();
                        glasses.Hue = 2707;

                        m.EquipItem(dress);
                        m.EquipItem(doub);
                        m.EquipItem(gorget);
                        m.EquipItem(gloves);
                        m.EquipItem(boots);
                        m.EquipItem(helm);
                        m.EquipItem(belt);
                        m.EquipItem(glasses);

                        AlyrianGiantBow bow = new AlyrianGiantBow();
                        bow.Resource = CraftResource.Oak;

                        m.EquipItem(bow);

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(35, 55)));
                        }

                        break;
                    }
            }
        }
Пример #41
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
 }
Пример #42
0
        public static void EquipMhordul(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            Sandals sandals = new Sandals();
            sandals.Resource = CraftResource.BeastLeather;
            sandals.Hue = 1194;
            m.EquipItem(sandals);

            MhordulBoneArms mba = new MhordulBoneArms();
            mba.Hue = 2101;
            m.EquipItem(mba);

            switch (a)
            {
                case Armament.Light:
                    {
                        MhordulBoneHelm mbh = new MhordulBoneHelm();
                        mbh.Hue = 2101;
                        m.EquipItem(mbh);

                        StuddedLegs sl = new StuddedLegs();
                        sl.Resource = CraftResource.BeastLeather;
                        m.EquipItem(sl);

                        if (m.Female)
                        {
                            m.EquipItem(new SmallRaggedSkirt(1194));
                            m.EquipItem(new RaggedBra(1194));
                        }
                        else
                        {
                            MhordulMedicineManBoneChest bc = new MhordulMedicineManBoneChest();
                            bc.Hue = 2101;
                            m.EquipItem(bc);
                        }

                        MhordulBoneSword mbs = new MhordulBoneSword();
                        m.EquipItem(mbs);

                        MhordulBoneShield shield = new MhordulBoneShield();
                        m.EquipItem(shield);

                        break;
                    }
                case Armament.Medium:
                    {
                        MhordulBoneHelm mbh = new MhordulBoneHelm();
                        mbh.Hue = 2101;
                        m.EquipItem(mbh);

                        MhordulBoneLegs mbl = new MhordulBoneLegs();
                        mbl.Hue = 2101;
                        m.EquipItem(mbl);

                        MhordulBoneGloves mbg = new MhordulBoneGloves();
                        mbg.Hue = 2101;
                        m.EquipItem(mbg);

                        StuddedChest chest = new StuddedChest();
                        chest.Hue = 2101;
                        m.EquipItem(chest);

                        if (m.Female)
                        {
                            m.EquipItem(new RaggedSkirt(1194));
                        }
                        else
                            m.EquipItem(new WaistCloth(1194));

                        if (Utility.RandomBool())
                            m.EquipItem(new MhordulBoneSpear());
                        else
                            m.EquipItem(new MhordulBoneScythe());

                        break;
                    }
                case Armament.Heavy:
                    {
                        MhordulHornedSkullHelm mhsh = new MhordulHornedSkullHelm();
                        mhsh.Hue = 2101;
                        m.EquipItem(mhsh);

                        MhordulBoneChest mbc = new MhordulBoneChest();
                        mbc.Hue = 2101;
                        m.EquipItem(mbc);

                        MhordulBoneLegs mbl = new MhordulBoneLegs();
                        mbl.Hue = 2101;
                        m.EquipItem(mbl);

                        MhordulBoneGloves mbg = new MhordulBoneGloves();
                        mbg.Hue = 2101;
                        m.EquipItem(mbg);

                        MhordulBoneShield mbs = new MhordulBoneShield();
                        mbs.Hue = 2101;
                        m.EquipItem(mbs);

                        if(m.Female)
                            m.EquipItem(new SmallRaggedSkirt(1194));

                        if (Utility.RandomBool())
                        {
                            MhordulWarFork mwf = new MhordulWarFork();
                            mwf.Resource = CraftResource.Iron;
                            m.EquipItem(mwf);
                        }

                        else
                            m.EquipItem(new MhordulBoneAxe());

                        break;
                    }
                case Armament.Ranged:
                    {
                        MhordulBoneHelm mbh = new MhordulBoneHelm();
                        mbh.Hue = 2101;
                        m.EquipItem(mbh);

                        m.EquipItem(new MhordulBoneBow());

                        if (m.Female)
                        {
                            m.EquipItem(new SmallRaggedSkirt(1194));
                            m.EquipItem(new RaggedBra(1194));
                        }

                        else
                            m.EquipItem(new RaggedPants(1194));

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #43
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     attacking = true;
     overlay.PlayThen(info.Sequence, () => attacking = false);
 }
Пример #44
0
        public static void EquipSovereign(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            switch (a)
            {
                case Armament.Light:
                    EquipAlyrian(a, m);
                    (m as BaseCreature).TurnAlyrian = true;
                    if (m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                    else
                        m.Name = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                        break;
                case Armament.Medium:
                    EquipMhordul(a, m);
                    (m as BaseCreature).TurnMhordul = true;
                    if (m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    else
                        m.Name = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    break;
                case Armament.Heavy:
                    EquipMhordul(a, m);
                    (m as BaseCreature).TurnMhordul = true;
                    if(m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    else
                        m.Name = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    break;
                case Armament.Ranged:
                    EquipAlyrian(a, m);
                    (m as BaseCreature).TurnAlyrian = true;
                    if(m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                    else
                        m.Name = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                    break;
                case Armament.LightCavalry:
                    EquipAlyrian(a, m);
                    (m as BaseCreature).TurnAlyrian = true;
                    if(m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                    else
                        m.Name = RandomName(Nation.Alyrian, m.Female) + RandomSurname(Nation.Alyrian, m.Female);
                    break;
                case Armament.HeavyCavalry:
                    EquipMhordul(a, m);
                    (m as BaseCreature).TurnMhordul = true;
                    if(m is Soldier)
                        (m as Soldier).BaseName = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    else
                        m.Name = RandomName(Nation.Mhordul, m.Female) + RandomSurname(Nation.Mhordul, m.Female);
                    break;
            }
        }
Пример #45
0
 void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     --charges;
     timeToRecharge = info.ReloadDelay;
 }
Пример #46
0
        public static void EquipVhalurian(Armament a, Mobile m)
        {
            if (a == Armament.LightCavalry)
                a = (Armament)1;
            else if (a == Armament.HeavyCavalry)
                a = (Armament)3;

            Surcoat coat = new Surcoat();
            coat.Name = "A Surcoat of the Rivergate Militia";
            coat.Hue = 2932;
            coat.ItemID = 15479;
            m.EquipItem(coat);

            switch (a)
            {
                case Armament.Light:
                    {
                        LeatherBoots boots = new LeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2101;

                        m.EquipItem(boots);

                        Beret beret = new Beret();
                        beret.Hue = 2932;
                        m.EquipItem(beret);

                        StuddedChest sc = new StuddedChest();
                        sc.Resource = CraftResource.BeastLeather;
                        sc.Hue = 2101;
                        m.EquipItem(sc);

                        StuddedLegs sl = new StuddedLegs();
                        sl.Resource = CraftResource.BeastLeather;
                        sl.Hue = 2101;
                        m.EquipItem(sl);

                        StuddedArms sa = new StuddedArms();
                        sa.Resource = CraftResource.BeastLeather;
                        sa.Hue = 2101;
                        m.EquipItem(sa);

                        StuddedGloves sg = new StuddedGloves();
                        sg.Resource = CraftResource.BeastLeather;
                        sg.Hue = 2101;
                        m.EquipItem(sg);

                        StuddedGorget so = new StuddedGorget();
                        so.Resource = CraftResource.BeastLeather;
                        so.Hue = 2101;
                        m.EquipItem(so);

                        VhalurianMace vm = new VhalurianMace();
                        vm.Resource = CraftResource.Iron;
                        vm.Hue = 0;
                        m.EquipItem(vm);

                        WoodenShield ws = new WoodenShield();
                        ws.Resource = CraftResource.Oak;
                        ws.Hue = 0;
                        m.EquipItem(ws);

                        break;
                    }
                case Armament.Medium:
                    {
                        ChainChest cc = new ChainChest();
                        cc.Resource = CraftResource.Bronze;
                        cc.Hue = 2101;
                        m.EquipItem(cc);

                        ChainLegs cl = new ChainLegs();
                        cl.Resource = CraftResource.Bronze;
                        cl.Hue = 2101;
                        m.EquipItem(cl);

                        ChainCoif co = new ChainCoif();
                        co.Resource = CraftResource.Bronze;
                        co.Hue = 2101;
                        m.EquipItem(co);

                        RingmailArms ra = new RingmailArms();
                        ra.Resource = CraftResource.Bronze;
                        ra.Hue = 2101;
                        m.EquipItem(ra);

                        RingmailGloves rg = new RingmailGloves();
                        rg.Resource = CraftResource.Bronze;
                        rg.Hue = 2101;
                        m.EquipItem(rg);

                        VhalurianMetalKiteShield vmks = new VhalurianMetalKiteShield();
                        vmks.Resource = CraftResource.Bronze;
                        vmks.Hue = 2101;
                        m.EquipItem(vmks);

                        LeatherBoots boots = new LeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2101;

                        m.EquipItem(boots);

                        if (m.Female)
                        {
                            VhalurianGladius sword = new VhalurianGladius();
                            sword.Resource = CraftResource.Bronze;

                            m.EquipItem(sword);
                        }

                        else
                        {
                            VhalurianBroadsword sword = new VhalurianBroadsword();
                            sword.Resource = CraftResource.Bronze;

                            m.EquipItem(sword);
                        }

                        break;
                    }
                case Armament.Heavy:
                    {
                        VhalurianOrnatePlateChest vopc = new VhalurianOrnatePlateChest();
                        vopc.Resource = CraftResource.Bronze;
                        vopc.Hue = 2101;
                        m.EquipItem(vopc);

                        VhalurianOrnatePlateLegs vopl = new VhalurianOrnatePlateLegs();
                        vopl.Resource = CraftResource.Bronze;
                        vopl.Hue = 2101;
                        m.EquipItem(vopl);

                        VhalurianOrnatePlateGorget vopo = new VhalurianOrnatePlateGorget();
                        vopo.Resource = CraftResource.Bronze;
                        vopo.Hue = 2101;
                        m.EquipItem(vopo);

                        PlateSabatons ps = new PlateSabatons();
                        ps.Resource = CraftResource.Bronze;
                        ps.Hue = 2105;
                        m.EquipItem(ps);

                        VhalurianOrnatePlateArms vopa = new VhalurianOrnatePlateArms();
                        vopa.Resource = CraftResource.Bronze;
                        vopa.Hue = 2101;
                        m.EquipItem(vopa);

                        VhalurianOrnatePlateGloves vopg = new VhalurianOrnatePlateGloves();
                        vopg.Resource = CraftResource.Bronze;
                        vopg.Hue = 2101;
                        m.EquipItem(vopg);

                        VhalurianOrnateKiteShield voks = new VhalurianOrnateKiteShield();
                        voks.Resource = CraftResource.Bronze;
                        voks.Hue = 2102;
                        m.EquipItem(voks);

                        m.EquipItem(new Cloak(1133));

                        if (m.Female)
                        {
                            VhalurianWarHammer hammer = new VhalurianWarHammer();
                            hammer.Resource = CraftResource.Bronze;
                            m.EquipItem(hammer);

                            VhalurianOrnateHelm voh = new VhalurianOrnateHelm();
                            voh.Resource = CraftResource.Bronze;
                            voh.Hue = 2102;
                            m.EquipItem(voh);
                        }

                        else
                        {
                            VhalurianBastardSword sword = new VhalurianBastardSword();
                            sword.Resource = CraftResource.Bronze;
                            m.EquipItem(sword);

                            VhalurianOrnatePlateHelm voph = new VhalurianOrnatePlateHelm();
                            voph.Resource = CraftResource.Bronze;
                            voph.Hue = 2102;
                            m.EquipItem(voph);
                        }

                        break;
                    }
                case Armament.Ranged:
                    {
                        LeatherBoots boots = new LeatherBoots();
                        boots.Resource = CraftResource.BeastLeather;
                        boots.Hue = 2101;
                        m.EquipItem(boots);

                        LeatherCap cap = new LeatherCap();
                        cap.Resource = CraftResource.RegularLeather;
                        cap.Hue = 2101;
                        m.EquipItem(cap);

                        LeatherChest lc = new LeatherChest();
                        lc.Resource = CraftResource.RegularLeather;
                        lc.Hue = 2101;
                        m.EquipItem(lc);

                        Quiver qv = new Quiver();
                        qv.Layer = Layer.Earrings;
                        m.EquipItem(qv);

                        LongPants lp = new LongPants();
                        lp.Resource = CraftResource.Cotton;
                        lp.Hue = 2101;
                        m.EquipItem(lp);

                        LeatherArms la = new LeatherArms();
                        la.Resource = CraftResource.RegularLeather;
                        la.Hue = 2101;
                        m.EquipItem(la);

                        LeatherGloves lg = new LeatherGloves();
                        lg.Resource = CraftResource.RegularLeather;
                        lg.Hue = 2101;
                        m.EquipItem(lg);

                        VhalurianLongbow bow = new VhalurianLongbow();
                        bow.Resource = CraftResource.Yew;
                        m.EquipItem(bow);

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = m as BaseCreature;
                            bc.AI = AIType.AI_Archer;
                            bc.PackItem(new Arrow(Utility.RandomMinMax(10, 20)));
                        }

                        break;
                    }
            }
        }
Пример #47
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     if (Info.UncloakOnAttack) Uncloak();
 }
Пример #48
0
        public void EquipSoldier(Nation n, Armament a)
        {
            if ((int)a > 6 || (int)a < 1)
                a = (Armament)Utility.RandomMinMax(1, 4);

            switch (n)
            {
                case Nation.Alyrian: SetRank(1); TrainSoldier(a); SetDex(Dex + 20); EquipAlyrian(a, this); break;
                case Nation.Azhuran: SetRank(1); TrainSoldier(a); SetDex(Dex + 20); EquipAzhuran(a, this); break;
                case Nation.Khemetar: SetRank(1); TrainSoldier(a); SetInt(Int + 20); EquipKhemetar(a, this); break;
                case Nation.Mhordul: SetRank(1); TrainSoldier(a); SetStr(Str + 20); EquipMhordul(a, this); break;
                case Nation.Tyrean: SetRank(1); TrainSoldier(a); SetStr(Str + 20); EquipTyrean(a, this); break;
                case Nation.Vhalurian: SetRank(1); TrainSoldier(a); SetHits(Hits + 20); EquipVhalurian(a, this); break;
                case Nation.Imperial: SetRank(1); TrainSoldier(a); SetHits(Hits + 10); SetStr(Str + 10); EquipImperial(a, this); break;
                case Nation.Sovereign: TrainSoldier(a); SetStr(Str + 10); SetDex(Dex + 10); EquipSovereign(a, this); SetRank(1); break;
                case Nation.Society: SetRank(1); TrainSoldier(a); SetStr(Str + 10); SetInt(Int + 10); EquipSociety(a, this); break;
                case Nation.Insularii: SetRank(1); TrainSoldier(a); SetDex(Dex + 20); SetHits(Hits + 20); SetStr(Str + 20); SetInt(Int + 20); EquipInsularii(a, this); break;

                default: TrainSoldier(a);   EquipFreeSoldier(a, this);      break;
            }
        }
Пример #49
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     Uncloak();
 }
Пример #50
0
        public static double CalculateResourceBonus(GovernmentEntity gov, Armament arm)
        {
            if (gov == null || gov.Deleted)
                return 0;

            double bonus = 0;
            double resDiv = (gov.MilitarySpawners.Count);
            resDiv -= (gov.Resources[ResourceType.Influence] / 1000);

            foreach (KeyValuePair<ResourceType, int> kvp in gov.Resources)
            {
                if (kvp.Value > 0)
                    resDiv -= 0.75;
            }

            if (resDiv < 1)
                resDiv = 1;

            switch (arm)
            {
                case Armament.Light:
                    {
                        bonus += ( gov.Resources[ResourceType.Cloth] / resDiv );
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                case Armament.Medium:
                    {
                        bonus += (gov.Resources[ResourceType.Metals] / (resDiv * 2));
                        bonus += (gov.Resources[ResourceType.Cloth] / (resDiv * 2));
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                case Armament.Heavy:
                    {
                        bonus += (gov.Resources[ResourceType.Metals] / resDiv);
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                case Armament.Ranged:
                    {
                        bonus += (gov.Resources[ResourceType.Wood] / resDiv);
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                case Armament.LightCavalry:
                    {
                        bonus += (gov.Resources[ResourceType.Cloth] / resDiv);
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                case Armament.HeavyCavalry:
                    {
                        bonus += (gov.Resources[ResourceType.Metals] / resDiv);
                        bonus += (gov.Resources[ResourceType.Food] / resDiv);
                        bonus += (gov.Resources[ResourceType.Water] / resDiv);
                        break;
                    }
                default: break;
            }

            return bonus;
        }
Пример #51
0
 public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
 {
     --charges;
     timeToRecharge = self.Info.Traits.Get<AttackTeslaInfo>().ReloadTime;
 }