예제 #1
0
        public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message)
        {
            if (!dismounted.Mounted && !Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted) && !dismounted.Flying)
            {
                return;
            }

            if (dismounted is ChaosDragoonElite)
            {
                dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount.
            }

            IMount mount = dismounted.Mount;

            if (mount != null)
            {
                mount.Rider = null;

                if (message)
                {
                    dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
                }
            }
            else if (Core.ML && Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted))
            {
                Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true);
            }
            else if (dismounted.Flying)
            {
                if (!OnFlightPath(dismounted))
                {
                    dismounted.Flying = false;
                    dismounted.Freeze(TimeSpan.FromSeconds(1));
                    dismounted.Animate(AnimationType.Land, 0);
                    BuffInfo.RemoveBuff(dismounted, BuffIcon.Fly);
                }
            }
            else
            {
                return;
            }

            if (delay != TimeSpan.MinValue)
            {
                BaseMount.SetMountPrevention(dismounted, blockmounttype, delay);
            }
        }
예제 #2
0
        public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message)
        {
            if (!dismounted.Mounted)
            {
                return;
            }

            if (dismounted is ChaosDragoonElite)
            {
                dismounter.SendLocalizedMessage(1042047); // You fail to knock the rider from its mount.
            }

            IMount mount = dismounted.Mount;

            if (mount != null)
            {
                mount.Rider = null;
                BaseMount.SetMountPrevention(dismounted, blockmounttype, delay);

                if (message)
                {
                    dismounted.SendLocalizedMessage(1040023); // You have been knocked off of your mount!
                }
                BuffInfo.AddBuff(dismounted, new BuffInfo(BuffIcon.DismountPrevention, 1075635, 1075636, delay, dismounted));
            }
            else if (dismounted.Flying)
            {
                if (!OnFlightPath(dismounted))
                {
                    dismounted.Flying = false;
                    dismounted.Freeze(TimeSpan.FromSeconds(1));
                    dismounted.Animate(61, 10, 1, true, false, 0);
                }
            }
            else if (Spells.Ninjitsu.AnimalForm.UnderTransformation(dismounted))
            {
                Spells.Ninjitsu.AnimalForm.RemoveContext(dismounted, true);
            }
        }
예제 #3
0
        public static void Dismount(Mobile dismounter, Mobile dismounted, BlockMountType blockmounttype, TimeSpan delay, bool message)
        {
            if (!dismounted.Mounted)
            {
                return;
            }

            if (dismounted is ChaosDragoonElite)
            {
                dismounter.SendLocalizedMessage(1042047);                   // You fail to knock the rider from its mount.
            }

            IMount mount = dismounted.Mount;

            if (mount != null)
            {
                mount.Rider = null;
                BaseMount.SetMountPrevention(dismounted, blockmounttype, delay);

                if (message)
                {
                    dismounted.SendLocalizedMessage(1040023);                       // You have been knocked off of your mount!
                }
            }
            else if (dismounted.Flying)
            {
                if (!OnFlightPath(dismounted))
                {
                    dismounted.Flying = false;
                    dismounted.Freeze(TimeSpan.FromSeconds(1));
                    dismounted.Animate(61, 10, 1, true, false, 0);
                }
                else
                {
                    // ...
                }
            }
        }
예제 #4
0
        public override void OnGaveMeleeAttack(Mobile from)
        {
            base.OnGaveMeleeAttack(from);

            if (0.5 > Utility.RandomDouble())
            {
                if (from == null)
                {
                    return;
                }

                Mobile target = from.Combatant;

                if (target == null)
                {
                    return;
                }
                else if (!target.Mounted)
                {
                    return;
                }

                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);                 // ~1_NAME~ begins to menacingly swing a bola...
                from.Direction = from.GetDirectionTo(target);
                from.Animate(11, 5, 1, true, false, 0);
                from.MovingEffect(target, 0x26AC, 10, 0, false, false);

                IMount mt = target.Mount;

                if (mt != null)
                {
                    mt.Rider = null;
                    target.SendLocalizedMessage(1040023);                     // You have been knocked off of your mount!
                    BaseMount.SetMountPrevention(target, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));
                }
            }
        }
예제 #5
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            name = from.Name;

            if (from != null)
            {
                if (0.15 > Utility.RandomDouble())//transformation
                {
                    if (from is BaseCreature)
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                    else if (from is PlayerMobile)
                    {
                        if (from != null)
                        {
                            if (from.BodyValue == 400)
                            {
                                originalbody = 400;
                            }
                            else if (from.BodyValue == 401)
                            {
                                originalbody = 401;
                            }
                            else
                            {
                            }

                            if (from != null)
                            {
                                from.BodyValue = Utility.RandomList(31, 24, 26, 50, 56, 147, 3);
                                from.SendMessage("{0}, you have been transformed into a undead!", name);
                                BodyReturnTimer m_timer = new BodyReturnTimer(from, originalbody);
                                m_timer.Start();
                                from.PlaySound(0x19C);


                                if (from.Mounted == true)
                                {
                                    IMount mount = from.Mount;

                                    if (mount != null)
                                    {
                                        mount.Rider = null;

                                        from.SendLocalizedMessage(1040023);

                                        BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));

                                        BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                    }
                                }
                                else if (from.Mounted == false)
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                                else
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                            }
                        }
                    }
                    else
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                }

                if (0.10 > Utility.RandomDouble())//spawn
                {
                    spawn    = new UndeadSpawn();
                    spawnmap = this.Map;
                    spawnloc = new Point3D(this.X + Utility.RandomMinMax(0, 4), this.Y + Utility.RandomMinMax(0, 4), this.Z);
                    spawn.MoveToWorld(spawnloc, spawnmap);
                    Effects.PlaySound(spawnloc, spawnmap, 0x1FB);
                    Effects.SendLocationParticles(EffectItem.Create(spawnloc, spawnmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);
                    spawn.Combatant = from;
                }

                if (0.10 > Utility.RandomDouble())//wither
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        if (m is UndeadSpawn)
                        {
                        }
                        else
                        {
                            targets.Add(m);
                        }
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else if (0.8 > Utility.RandomDouble())
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= Utility.RandomMinMax(10, 20);

                        this.Mana -= 5;
                    }
                }

                if (0.2 > Utility.RandomDouble())//animate dead
                {
                    ArrayList corpses = new ArrayList();

                    foreach (Item item in this.GetItemsInRange(4))
                    {
                        if (item is Corpse)
                        {
                            corpses.Add(item);
                        }
                    }

                    for (int i = 0; i < corpses.Count; ++i)
                    {
                        Item corpse = (Item)corpses[i];

                        mobloc      = new Point3D(corpse.X, corpse.Y, corpse.Z);
                        mobmap      = corpse.Map;
                        spawn       = new UndeadSpawn();
                        spawn.Name  = corpse.Name;
                        spawn.Title = "wrongly resurected";
                        spawn.MoveToWorld(mobloc, mobmap);
                        spawn.Combatant = from;

                        Effects.PlaySound(mobloc, mobmap, 0x1FB);
                        Effects.SendLocationParticles(EffectItem.Create(mobloc, mobmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                        Corpse corpseb = (Corpse)corpse;

                        owner = corpseb.m_Owner;

                        if (owner is PlayerMobile)
                        {
                        }
                        else
                        {
                            corpseb.Delete();
                        }
                    }
                }
            }
        }
예제 #6
0
        protected override void OnExpansionChanged(Expansion old)
        {
            base.OnExpansionChanged(old);

            if (ExpansionInfo.GetInfo(Expansion).Name != "Third Dawn")
            {
                this.SendNotification <ExpansionNotifyGump>(
                    String.Format(
                        "You are now bound by the rules and physics of the [b]{0}[/b] era!",
                        ExpansionInfo.GetInfo(Expansion).Name),
                    true,
                    1.0,
                    10.0,
                    Color.LawnGreen);
            }
            else
            {
                this.SendNotification <ExpansionNotifyGump>(
                    String.Format(
                        "Welcome to Zombie Land!"),
                    true,
                    1.0,
                    10.0,
                    Color.LawnGreen);
            }

            if (Expansion <= Expansion.T2A && AccessLevel < AccessLevel.Counselor || Expansion == Expansion.UOTD && AccessLevel < AccessLevel.Counselor)
            {
                BaseMount.SetMountPrevention(this, BlockMountType.MapRestricted, TimeSpan.FromDays(365));
            }
            else
            {
                BaseMount.ClearMountPrevention(this);
            }

            if (!Snapshot.Pull(old))
            {
                return;
            }

            var leaveEquip = new List <Item>();

            if (Alive)
            {
                leaveEquip.AddRange(
                    Items.Where(i => i != null && !i.Deleted && i.IsPhased && i != BankBox && i != Backpack));
            }

            foreach (Item item in leaveEquip)
            {
                Backpack.DropItem(item);
            }

            Item holding = Holding;

            if (holding != null)
            {
                if (!holding.Deleted && holding.HeldBy == this && holding.Map == Map.Internal)
                {
                    Backpack.DropItem(holding);
                }

                Holding = null;
                holding.ClearBounce();
            }

            Dictionary <Item, Point3D> takePack = Backpack.FindItemsByType <Item>(true,
                                                                                  i => i != null && !i.Deleted && !i.IsPhased)
                                                  .ToDictionary(i => i, i => i.Location);

            if (!Snapshot.Push(Expansion))
            {
                foreach (Item item in leaveEquip)
                {
                    EquipItem(item);
                }

                return;
            }

            foreach (Item item in leaveEquip)
            {
                Send(item.RemovePacket);
            }

            foreach (KeyValuePair <Item, Point3D> kv in takePack)
            {
                Backpack.DropItem(kv.Key);
                kv.Key.Location = kv.Value;
            }

            UpdateTotals();
            ProcessDelta();

            SendMessage(0x22, "Character snapshots synced successfully.");
        }