protected override void OnTarget(Mobile from, object o)
            {
                if (m_deed == null || m_deed.Deleted || !m_deed.IsChildOf(from.Backpack) || !from.CanSee(o))
                {
                    return;
                }

                if (o is Corpse && !((Corpse)o).Deleted)
                {
                    Corpse corpse = (Corpse)o;

                    if (!from.InRange(corpse.Location, 4))
                    {
                        from.SendLocalizedMessage(500446); // That is too far away.
                        return;
                    }

                    if (CheckCorpseType(from, corpse, m_deed) && CanUseWithDeed(from, corpse) && CheckUseWithDeedTime(from, corpse))
                    {
                        corpse.Delete();
                        m_deed.AmountCur++;
                        from.SendMessage("The corpse has been combined with the deed.");

                        from.SendGump(new SmallBODGump(from, m_deed));
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042600); // That is not a corpse!
                }
            }
예제 #2
0
        public void ClearRegion()
        {
            foreach (Item item in this.Region.GetEnumeratedItems())
            {
                Corpse corpse = item as Corpse;

                if (corpse != null)
                {
                    if (corpse.Owner is PlayerMobile)
                    {
                        corpse.MoveToWorld(Controller.KickLocation, Map.TerMur);
                    }
                    else
                    {
                        corpse.Delete();
                    }
                }
                else if (item is BaseAddon)
                {
                    ((BaseAddon)item).Internalize();
                }
                else if (item.Movable || IsInDeleteList(item))
                {
                    item.Delete();
                }
            }

            foreach (Mobile m in this.Region.GetEnumeratedMobiles())
            {
                if (m is BaseCreature && !(((BaseCreature)m).GetMaster() is PlayerMobile))
                {
                    m.Delete();
                }
            }
        }
        protected override void OnTarget(Mobile from, object o)
        {
            if (o is Corpse)
            {
                Corpse MCcorpse = (Corpse)o;

                if (MCcorpse.Channeled)
                {
                    from.SendMessage("This corpse has been profaned and cannot be added.");
                    return;
                }
                if (MCcorpse.Killer == from || IsValidFor(from, MCcorpse))
                {
                    if (MCcorpse.Owner.GetType() == MonsterContractType.Get[MCE.Monster].Type)
                    {
                        MCE.AmountKilled += 1;
                        MCcorpse.Delete();
                        from.SendGump(new MonsterContractBookGump((PlayerMobile)from, b));
                    }
                    else
                    {
                        from.SendMessage("This body isn't acceptable.");
                    }
                }
                else
                {
                    from.SendMessage("You cannot claim corpses killed by another.");
                }
            }
            else
            {
                from.SendMessage("This is not a corpse.");
            }
        }
예제 #4
0
        public static bool ClaimCorpse(Mobile from, Corpse corpse, ClaimOption option)
        {
            if (null == corpse || corpse.Owner == from)
            {
                return(false);
            }

            Container goldBag   = GetGoldBag(from);
            Container silverBag = GetSilverBag(from);
            Container lootBag   = GetLootBag(from);

            if (ClaimConfig.AggregateSilver)
            {
                AggregateSilver(from, silverBag);
            }

            if (ClaimOption.Carve == option && !(corpse.Owner is PlayerMobile))
            {
                corpse.Carve(from, null);
            }

            LootCorpse(from, corpse, option, goldBag, silverBag, lootBag);
            AwardGold(from, corpse, goldBag);
            corpse.Delete();

            return(true);
        }
예제 #5
0
        public void HandleCorpse(Mobile from)
        {
            if (from.Corpse != null)
            {
                Corpse      c     = (Corpse)from.Corpse;
                Container   b     = from.Backpack;
                List <Item> toAdd = new List <Item>();


                foreach (Item i in c.Items)
                {
                    if (i.Map != Map.Internal)
                    {
                        toAdd.Add(i);
                    }
                }

                foreach (Item i in toAdd)
                {
                    b.AddItem(i);
                }

                toAdd = null;

                c.Delete();

                from.SendMessage(1161, "The contents of your corpse have been safely placed into your backpack.");
            }
        }
예제 #6
0
        private void HandleMatchEnd(Mobile from, bool kick)
        {
            if (!from.Alive)
            {
                from.Resurrect();

                if (from.Corpse != null && from.Corpse is Corpse)
                {
                    Corpse c = (Corpse)from.Corpse;

                    for (int i = 0; i < c.Items.Count; ++i)
                    {
                        Item item = c.Items[i];

                        c.SetRestoreInfo(item, item.Location);
                    }

                    c.Open(from, true);
                    c.Delete();
                }
            }

            from.Criminal = false;
            from.Blessed  = false;
            from.Frozen   = false;

            from.CurePoison(from);
            from.StatMods.Clear();
            from.Hits = from.HitsMax;
            from.Mana = from.ManaMax;
            from.Stam = from.StamMax;

            Targeting.Target.Cancel(from);
            from.MagicDamageAbsorb = 0;
            from.MeleeDamageAbsorb = 0;
            ProtectionSpell.Registry.Remove(from);
            DefensiveSpell.Nullify(from);
            from.Combatant = null;

            from.Delta(MobileDelta.Noto);               //Update notoriety

            from.Location = m_SpectatorDest;

            if (kick && from.NetState == null)
            {
                Match m = FindMatch(from);

                if (m.Attackers.Contains(from))
                {
                    m.Attackers.Remove(from);
                }
                else if (m.Defenders.Contains(from))
                {
                    m.Defenders.Remove(from);
                }
            }
        }
예제 #7
0
        public override void OnCarve(Mobile from, Corpse corpse)
        {
            if (corpse.Carved == false)
            {
                base.OnCarve(from, corpse);

                new Blood(Utility.RandomMinMax(4650, 4655)).MoveToWorld(corpse.Location, corpse.Map);
                new GoblinEars().MoveToWorld(corpse.Location, corpse.Map);
                corpse.Delete();
            }
        }
예제 #8
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Corpse)
                {
                    Corpse MCcorpse = (Corpse)o;

                    if (MCcorpse.Channeled)
                    {
                        from.SendMessage("This corpse has been desecrated and can not be claimed!");
                        return;
                    }

                    //04MAR2008 Make sure player's pet or spell gets credit for the kill *** START ***
                    if (MCcorpse.Killer == null)
                    {
                        return;
                    }


                    if ((MCcorpse.Killer == from) || (((BaseCreature)MCcorpse.Killer).SummonMaster) == from)
                    //04MAR2008 Make sure player's pet or spell gets credit for the kill *** END ***
                    {
                        string m_type = "a " + MCparent.Monster;
                        m_type = m_type.ToLower();
                        string m_type2 = "an " + MCparent.Monster;
                        m_type2 = m_type2.ToLower();
                        string m_corpse = MCcorpse.Owner.Name;
                        m_corpse = m_corpse.ToLower();

                        if (m_type == m_corpse || m_type2 == m_corpse)
                        {
                            MCparent.AmountKilled += 1;
                            MCcorpse.Delete();
                        }
                        else
                        {
                            from.SendMessage("That corpse is not of the correct type!");
                        }
                    }
                    else
                    {
                        from.SendMessage("You cannot claim someone elses work!");
                    }
                }
                else
                {
                    from.SendMessage("That is not a corpse");
                }
            }
예제 #9
0
        public void HandleCorpse(Mobile from)
        {
            if (from.Corpse != null)
            {
                if (m_EventSupplier != null && m_EventSupplier.NewbieAllItems)
                {
                    from.Corpse.Delete();
                    return;
                }

                Corpse c = (Corpse)from.Corpse;
                c.Open(from, true);
                c.Delete();
                from.SendMessage(38, "The contents of your corpse have been safely placed into your backpack");
            }
        }
예제 #10
0
        public override void OnAfterDelete()
        {
            base.OnAfterDelete();

            SpawnAspectAbility.Unregister(this);

            if (Corpse != null)
            {
                Corpse.Delete();
            }

            if (Aspect != null)
            {
                Aspect = null;
            }
        }
예제 #11
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Corpse)
                {
                    Corpse MCcorpse = (Corpse)o;

                    if (MCcorpse.Channeled)
                    {
                        from.SendMessage("This corpse has been desecrated and can not be claimed!");
                        return;
                    }
                    if (MCcorpse.Killer == from)
                    {
                        string m_type = "a " + MCparent.Monster;
                        m_type = m_type.ToLower();
                        string m_type2 = "an " + MCparent.Monster;
                        m_type2 = m_type2.ToLower();
                        string m_type3 = "A Frozen Ogre Lord's Corpse ";
                        m_type3 = m_type3.ToLower();
                        string m_corpse = MCcorpse.Owner.Name;
                        m_corpse = m_corpse.ToLower();

                        if (m_type == m_corpse || m_type2 == m_corpse || m_type3 == m_corpse)
                        {
                            MCparent.AmountKilled += 1;
                            MCcorpse.Delete();
                        }
                        else
                        {
                            from.SendMessage("That corpse is not of the correct type!");
                        }
                    }
                    else
                    {
                        from.SendMessage("You cannot claim someone elses work!");
                    }
                }
                else
                {
                    from.SendMessage("That is not a corpse");
                }
            }
예제 #12
0
        protected override void OnTarget(Mobile from, object o)
        {
            if (MCparent == null || from == null || o == null || MCparent.Monster == null)
            {
                Console.WriteLine("MonsterContract: Sa bug !! Mais où, on sait pas :p");
                return;
            }
            if (o is Corpse)
            {
                Corpse MCcorpse = (Corpse)o;

                if (MCcorpse.Channeled)
                {
                    from.SendMessage("This body was profaned and cannot be used.");
                    return;
                }
                if (MCcorpse.Killer == from || IsValidFor(from, MCcorpse))
                {
                    if (MCcorpse.Owner.GetType() == MonsterContractType.Get[MCparent.Monster].Type)
                    {
                        MCparent.AmountKilled += 1;
                        MCcorpse.Delete();
                    }
                    else
                    {
                        from.SendMessage("This corpse is no good.");
                    }
                }
                else
                {
                    from.SendMessage("You cannot use a body killed by another.");
                }
            }
            else
            {
                try{ from.SendMessage("This is not a corpse."); }
                catch { Console.WriteLine("Crash sur monstercontractgump from == null"); }
            }
        }
예제 #13
0
        /**
         * Pega as coisas do corpo e veste no jogador e apaga o corpo
         */
        private void tratarCorpo()
        {
            //pega os itens do corpo
            Container pack   = jogador.Backpack;
            Container corpse = jogador.Corpse;

            if (pack != null && corpse != null)
            {
                List <Item> items = new List <Item>(corpse.Items);
                for (int i = 0; i < items.Count; ++i)
                {
                    Item item = items[i];

                    if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                    {
                        pack.DropItem(item);

                        if (item.Layer != Layer.Backpack && item.CanEquip(jogador))
                        {
                            jogador.EquipItem(item);
                        }
                    }
                }
            }

            //deleta o corpo
            if (corpse is Corpse)
            {
                Corpse corpo = (Corpse)corpse;
                corpo.Delete();
            }
            else
            {
                jogador.SendMessage("Nao foi possivel remover o seu corpo, aviso o Staff.");
            }
        }
예제 #14
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();
                        }
                    }
                }
            }
        }
예제 #15
0
        public void Target(object obj)
        {
            if (obj is Corpse)
            {
                Corpse c = (Corpse)obj;
                Mobile m = c.m_Owner;

                if (m is BaseCreature)
                {
                    SlayerEntry undead    = SlayerGroup.GetEntryByName(SlayerName.Silver);
                    SlayerEntry exorcism  = SlayerGroup.GetEntryByName(SlayerName.Exorcism);
                    SlayerEntry animal    = SlayerGroup.GetEntryByName(SlayerName.AnimalHunter);
                    SlayerEntry golems    = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction);
                    SlayerEntry plants    = SlayerGroup.GetEntryByName(SlayerName.WeedRuin);
                    SlayerEntry repond    = SlayerGroup.GetEntryByName(SlayerName.Repond);
                    SlayerEntry dragon    = SlayerGroup.GetEntryByName(SlayerName.DragonSlaying);
                    SlayerEntry reptile   = SlayerGroup.GetEntryByName(SlayerName.ReptilianDeath);
                    SlayerEntry spider    = SlayerGroup.GetEntryByName(SlayerName.ArachnidDoom);
                    SlayerEntry elemental = SlayerGroup.GetEntryByName(SlayerName.ElementalBan);
                    SlayerEntry wizard    = SlayerGroup.GetEntryByName(SlayerName.WizardSlayer);
                    SlayerEntry birds     = SlayerGroup.GetEntryByName(SlayerName.AvianHunter);
                    SlayerEntry slime     = SlayerGroup.GetEntryByName(SlayerName.SlimyScourge);
                    SlayerEntry giant     = SlayerGroup.GetEntryByName(SlayerName.GiantKiller);
                    SlayerEntry water     = SlayerGroup.GetEntryByName(SlayerName.NeptunesBane);
                    SlayerEntry fey       = SlayerGroup.GetEntryByName(SlayerName.Fey);

                    int level_corpse = DifficultyLevel.GetCreatureLevel(m);
                    int level_caster = (int)((Caster.Skills[SkillName.Necromancy].Value + Caster.Skills[SkillName.SpiritSpeak].Value) / 2);
                    if (level_caster > 100)
                    {
                        level_caster = 100;
                    }

                    int slots_max = (int)(level_corpse / 20);
                    if (slots_max > 5)
                    {
                        slots_max = 5;
                    }
                    if (slots_max < 1)
                    {
                        slots_max = 1;
                    }
                    int slots_limit = Caster.FollowersMax - Caster.Followers;

                    if (undead.Slays(m))
                    {
                        Caster.SendMessage("You cannot animate supernatural creatures!");
                    }
                    else if (golems.Slays(m))
                    {
                        Caster.SendMessage("You cannot animate constructs!");
                    }
                    else if (level_corpse > level_caster)
                    {
                        Caster.SendMessage("You are not powerful enough to animate that!");
                    }
                    else if (slots_limit >= slots_max)
                    {
                        TimeSpan duration = TimeSpan.FromSeconds(((Caster.Skills[SkillName.Necromancy].Value + Caster.Skills[SkillName.SpiritSpeak].Value) / 2) * 9);

                        BaseCreature bc = (BaseCreature)m;

                        int myBody = bc.Body;
                        if (m.TithingPoints > 0 && bc.Body != 400 && bc.Body != 401)
                        {
                            myBody = m.TithingPoints;
                        }                                                                                                                           // STORED ORIGINAL BODY VALUE DURING ONAFTERSPAWN IN BASECREATURE.CS

                        int hitpoison = 0;

                        if (bc.HitPoison == Poison.Lesser)
                        {
                            hitpoison = 1;
                        }
                        else if (bc.HitPoison == Poison.Regular)
                        {
                            hitpoison = 2;
                        }
                        else if (bc.HitPoison == Poison.Greater)
                        {
                            hitpoison = 3;
                        }
                        else if (bc.HitPoison == Poison.Deadly)
                        {
                            hitpoison = 4;
                        }
                        else if (bc.HitPoison == Poison.Lethal)
                        {
                            hitpoison = 5;
                        }

                        int immune = 0;

                        if (bc.PoisonImmune == Poison.Lesser)
                        {
                            immune = 1;
                        }
                        else if (bc.PoisonImmune == Poison.Regular)
                        {
                            immune = 2;
                        }
                        else if (bc.PoisonImmune == Poison.Greater)
                        {
                            immune = 3;
                        }
                        else if (bc.PoisonImmune == Poison.Deadly)
                        {
                            immune = 4;
                        }
                        else if (bc.PoisonImmune == Poison.Lethal)
                        {
                            immune = 5;
                        }

                        // THIS MODIFIES THE MONSTER BASED ON THE LEVEL OF THE CORPSE AND THE SKILLS OF THE CASTER
                        // TO GET A ANIMATED CREATURE WITH FULL STATS, A CASTER NEEDS A 125 IN BOTH SKILLS
                        int    modify = level_caster - (level_corpse + 50);
                        double mod    = 1.0;
                        if (modify < 0)
                        {
                            int lower = (level_corpse + 50) - level_caster;
                            mod = (100 - lower) * 0.01;
                        }

                        BaseCreature creature = new SummonedCorpse((int)(mod * bc.HitsMax), (int)(mod * bc.StamMax), (int)(mod * bc.ManaMax), (int)(mod * bc.RawStr), (int)(mod * bc.RawDex), (int)(mod * bc.RawInt), hitpoison, immune);

                        creature.DamageMin              = (int)(mod * bc.DamageMin);
                        creature.DamageMax              = (int)(mod * bc.DamageMax);
                        creature.ColdDamage             = (int)(mod * bc.ColdDamage);
                        creature.EnergyDamage           = (int)(mod * bc.EnergyDamage);
                        creature.FireDamage             = (int)(mod * bc.FireDamage);
                        creature.PhysicalDamage         = (int)(mod * bc.PhysicalDamage);
                        creature.PoisonDamage           = (int)(mod * bc.PoisonDamage);
                        creature.ColdResistSeed         = (int)(mod * bc.ColdResistSeed);
                        creature.EnergyResistSeed       = (int)(mod * bc.EnergyResistSeed);
                        creature.FireResistSeed         = (int)(mod * bc.FireResistSeed);
                        creature.PhysicalResistanceSeed = (int)(mod * bc.PhysicalResistanceSeed);
                        creature.PoisonResistSeed       = (int)(mod * bc.PoisonResistSeed);
                        creature.VirtualArmor           = (int)(mod * bc.VirtualArmor);
                        creature.CanSwim = bc.CanSwim;
                        if (creature.CanSwim)
                        {
                            creature.CantWalk = bc.CantWalk;
                        }
                        creature.ControlSlots = slots_max;

                        BaseCreature b = (BaseCreature)m;

                        creature.AI = AIType.AI_Melee;
                        bool mage = false;

                        if (b.AI == AIType.AI_Mage)
                        {
                            creature.AI = AIType.AI_Mage; mage = true;
                        }

                        SpellHelper.Summon(creature, Caster, 0x216, duration, false, false);

                        creature.Body = myBody;

                        string ghost = " creature";
                        if (exorcism.Slays(bc))
                        {
                            ghost = " demon";
                        }
                        else if (animal.Slays(bc))
                        {
                            ghost = " animal";
                        }
                        else if (plants.Slays(bc))
                        {
                            ghost = " weed";
                        }
                        else if (dragon.Slays(bc))
                        {
                            ghost = " dragon";
                        }
                        else if (reptile.Slays(bc))
                        {
                            ghost = " reptile";
                        }
                        else if (spider.Slays(bc))
                        {
                            ghost = " insect";
                        }
                        else if (elemental.Slays(bc))
                        {
                            ghost = " necromental";
                        }
                        else if (birds.Slays(bc))
                        {
                            ghost = " bird";
                        }
                        else if (slime.Slays(bc))
                        {
                            ghost = " slime";
                        }
                        else if (giant.Slays(bc))
                        {
                            ghost = " giant";
                        }
                        else if (repond.Slays(bc))
                        {
                            ghost = "";
                        }

                        // ZOMBIES //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        creature.Hue         = Utility.RandomList(0xB97, 0xB98, 0xB99, 0xB9A, 0xB85, 0xB79, 0xB5F, 0xB60, 0xB19, 0xACC, 0xACD, 0xACE, 0xACF, 0xAB0, 0x938, 0x92D);
                        creature.BaseSoundID = 471;
                        if (bc.Body == 400 || bc.Body == 401 || bc.Body == 605 || bc.Body == 606)
                        {
                            creature.Body = Utility.RandomList(3, 728, 305, 181, 304, 307);
                        }
                        switch (Utility.RandomMinMax(0, 5))
                        {
                        case 0: creature.Name = "a zombie" + ghost;             break;

                        case 1: creature.Name = "a dead" + ghost;               break;

                        case 2: creature.Name = "a rotten" + ghost;             break;

                        case 3: creature.Name = "an undead" + ghost;    break;

                        case 4: creature.Name = "a rotting" + ghost;    break;

                        case 5: creature.Name = "a decaying" + ghost;   break;
                        }

                        // GHOSTS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        if (mage)
                        {
                            creature.Hue         = Utility.RandomList(0x4001, 0x4001, 1150, 0x9C2);
                            creature.BaseSoundID = 0x482;
                            if (bc.Body == 400 || bc.Body == 401 || bc.Body == 605 || bc.Body == 606)
                            {
                                creature.Body = Utility.RandomList(0x3CA, 310, 26, 84);
                            }
                            switch (Utility.RandomMinMax(0, 6))
                            {
                            case 0: creature.Name = "a wraith" + ghost;                     break;

                            case 1: creature.Name = "a ghostly" + ghost;            break;

                            case 2: creature.Name = "a spectral" + ghost;           break;

                            case 3: creature.Name = "a haunting" + ghost;           break;

                            case 4: creature.Name = "a phantasmal" + ghost;         break;

                            case 5: creature.Name = "a phantom" + ghost;            break;

                            case 6: creature.Name = "a banshee" + ghost;            break;
                            }
                        }

                        // SKELETONS ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                        if (repond.Slays(bc) && ghost == "" && Utility.RandomMinMax(0, 1) == 1 && !mage)                             // MAKE INTO SKELETON
                        {
                            creature.Body = Utility.RandomList(57, 168, 170, 247, 327, 50, 56, 167);
                            creature.Hue  = 0;
                            if (creature.Body == 327)
                            {
                                creature.Hue = 0x9C4;
                            }
                            creature.BaseSoundID = 451;

                            switch (Utility.RandomMinMax(0, 6))
                            {
                            case 0: ghost = " warrior";             break;

                            case 1: ghost = " knight";              break;

                            case 2: ghost = " fighter";             break;

                            case 3: ghost = " champion";    break;

                            case 4: ghost = " crusader";    break;

                            case 5: ghost = " soldier";             break;

                            case 6: ghost = " guard";               break;
                            }

                            switch (Utility.RandomMinMax(0, 2))
                            {
                            case 0: creature.Name = "a skeletal" + ghost;   break;

                            case 1: creature.Name = "a bone" + ghost;               break;

                            case 2: creature.Name = "a skeleton" + ghost;   break;
                            }
                        }
                        else if (repond.Slays(bc) && wizard.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && ghost == "" && mage)
                        {
                            creature.Body        = Utility.RandomList(148, 110, 24);
                            creature.Hue         = 0;
                            creature.BaseSoundID = 0x3E9;

                            switch (Utility.RandomMinMax(0, 6))
                            {
                            case 0: ghost = " wizard";              break;

                            case 1: ghost = " mage";                break;

                            case 2: ghost = " sorcerer";    break;

                            case 3: ghost = " conjurer";    break;

                            case 4: ghost = " magician";    break;

                            case 5: ghost = " warlock";             break;

                            case 6: ghost = " enchanter";   break;
                            }

                            switch (Utility.RandomMinMax(0, 2))
                            {
                            case 0: creature.Name = "a skeletal" + ghost;   break;

                            case 1: creature.Name = "a bone" + ghost;               break;

                            case 2: creature.Name = "a skeleton" + ghost;   break;
                            }
                        }
                        else if (dragon.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && bc.Fame >= 15000 && ghost != "")
                        {
                            creature.Hue         = Utility.RandomList(0x83B, 0x89F, 0x8A0, 0x8A1, 0x8A2, 0x8A3, 0x8A4);
                            creature.BaseSoundID = 471;
                            switch (Utility.RandomMinMax(0, 5))
                            {
                            case 0: creature.Name = "a zombie" + ghost;             break;

                            case 1: creature.Name = "a dead" + ghost;               break;

                            case 2: creature.Name = "a rotten" + ghost;             break;

                            case 3: creature.Name = "an undead" + ghost;    break;

                            case 4: creature.Name = "a rotting" + ghost;    break;

                            case 5: creature.Name = "a decaying" + ghost;   break;
                            }

                            if (Utility.RandomMinMax(0, 1) == 1)
                            {
                                creature.Body        = Utility.RandomList(104, 323, 323);
                                creature.BaseSoundID = 0x488;
                                creature.Hue         = 0;

                                switch (Utility.RandomMinMax(0, 2))
                                {
                                case 0: creature.Name = "a skeletal" + ghost;   break;

                                case 1: creature.Name = "a bone" + ghost;               break;

                                case 2: creature.Name = "a skeleton" + ghost;   break;
                                }
                            }
                        }
                        else if (giant.Slays(bc) && Utility.RandomMinMax(0, 1) == 1 && ghost != "")
                        {
                            creature.Body = 999;

                            if (Utility.RandomMinMax(0, 1) == 1)
                            {
                                creature.Body        = 308;
                                creature.BaseSoundID = 0x4FB;
                                creature.Hue         = 0;

                                switch (Utility.RandomMinMax(0, 2))
                                {
                                case 0: creature.Name = "a skeletal" + ghost;   break;

                                case 1: creature.Name = "a bone" + ghost;               break;

                                case 2: creature.Name = "a skeleton" + ghost;   break;
                                }
                            }
                        }
                        else if (exorcism.Slays(bc) && Utility.RandomMinMax(0, 5) == 1 && ghost != "")
                        {
                            creature.Body        = 339;
                            creature.BaseSoundID = 0x48D;
                            creature.Hue         = 0x80F;

                            switch (Utility.RandomMinMax(0, 2))
                            {
                            case 0: creature.Name = "a skeletal" + ghost;   break;

                            case 1: creature.Name = "a bone" + ghost;               break;

                            case 2: creature.Name = "a skeleton" + ghost;   break;
                            }
                        }

                        if (mage)
                        {
                            creature.SetSkill(SkillName.Meditation, (mod * bc.Skills[SkillName.Meditation].Value));
                            creature.SetSkill(SkillName.EvalInt, (mod * bc.Skills[SkillName.EvalInt].Value));
                            creature.SetSkill(SkillName.Magery, (mod * bc.Skills[SkillName.Magery].Value));
                            creature.SetSkill(SkillName.MagicResist, (mod * bc.Skills[SkillName.MagicResist].Value));
                            creature.SetSkill(SkillName.Tactics, (mod * bc.Skills[SkillName.Tactics].Value));
                            creature.SetSkill(SkillName.Wrestling, (mod * bc.Skills[SkillName.Wrestling].Value));
                        }
                        else
                        {
                            creature.SetSkill(SkillName.MagicResist, (mod * bc.Skills[SkillName.MagicResist].Value));
                            creature.SetSkill(SkillName.Tactics, (mod * bc.Skills[SkillName.Tactics].Value));
                            creature.SetSkill(SkillName.Wrestling, (mod * bc.Skills[SkillName.Wrestling].Value));
                        }

                        creature.Location = c.Location;
                        Effects.SendLocationEffect(creature.Location, creature.Map, 0x3400, 60, 0, 0);
                        Effects.PlaySound(creature.Location, creature.Map, 0x108);

                        c.Delete();
                    }
                    else
                    {
                        Caster.SendLocalizedMessage(1049645);                           // You have too many followers to summon that creature.
                    }
                }
                else
                {
                    Caster.SendLocalizedMessage(1061084);                       // You cannot animate that.
                }
            }
            else
            {
                Caster.SendLocalizedMessage(1061084);                   // You cannot animate that.
            }

            FinishSequence();
        }
예제 #16
0
        public static void EndDuel(Duel duel, Mobile loser)
        {
            duel.State = DuelState.End;

            Mobile winner;

            if (loser == duel.Defender)
            {
                winner = duel.Attacker;
            }
            else
            {
                winner = duel.Defender;
            }

            DuelInfo wInfo = GetInfo(winner);
            DuelInfo lInfo = GetInfo(loser);

            wInfo.AddLogEntry(String.Format("Won in a{0}duel against {1}.", (duel.Ranked ? " ranked " : "n unranked "), loser.Name));
            lInfo.AddLogEntry(String.Format("Lost in a{0}duel against {1}.", (duel.Ranked ? " ranked " : "n unranked "), winner.Name));

            if (duel.Ranked)
            {
                ++wInfo.Wins;
                ++lInfo.Losses;
            }

            if (!loser.Alive)
            {
                loser.Resurrect();

                if (loser.Corpse != null && loser.Corpse is Corpse)
                {
                    Corpse c = (Corpse)loser.Corpse;

                    for (int i = 0; i < c.Items.Count; ++i)
                    {
                        c.SetRestoreInfo(c.Items[i], c.Items[i].Location);
                    }

                    c.Open(loser, true);
                    c.Delete();
                }
            }

            Mobile[] mobs = new Mobile[] { winner, loser };

            winner.Delta(MobileDelta.Noto); /*	  Update	*/
            loser.Delta(MobileDelta.Noto);  /*   Notoriety	*/

            foreach (Mobile m in mobs)
            {
                m.CurePoison(m);
                m.StatMods.Clear();
                m.Combatant = null;

                m.Hits = m.HitsMax;
                m.Mana = m.ManaMax;
                m.Stam = m.StamMax;

                m.Location = duel.Arena.Home;

                m.Warmode  = false;
                m.Criminal = false;

                m.Aggressed.Clear();
                m.Aggressors.Clear();

                m.Delta(MobileDelta.Noto);
                m.InvalidateProperties();
            }

            winner.Say(String.Format("{0} has won the duel.", winner.Name));
            loser.Say(String.Format("{0} has lost the duel.", loser.Name));

            CancelDuel(duel);

            duel.Arena.Duel = null;
            duel.Arena      = null;
        }
예제 #17
0
        public void Target(Corpse c)
        {
            Mobile m = c.Owner;

            if (m == null)
            {
            }
            else if (!Caster.CanSee(c))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m == Caster)
            {
                Caster.SendLocalizedMessage(501039);                   // Thou can not resurrect thyself.
            }
            else if (!Caster.Alive)
            {
                Caster.SendLocalizedMessage(501040);                   // The resurrecter must be alive.
            }
            else if (m.Alive)
            {
                Caster.SendLocalizedMessage(501041);                   // Target is not dead.
            }
            else if (!Caster.InRange(c, 1))
            {
                Caster.SendLocalizedMessage(501042);                   // Target is not close enough.
            }
            else if (!m.Player)
            {
                Caster.SendLocalizedMessage(501043);                   // Target is not a being.
            }
            else if (CheckBSequence(m, true))
            {
                PlayerMobile pm = m as PlayerMobile;

                if (pm != null)
                {
                    SpellHelper.Turn(Caster, pm);

                    pm.PlaySound(0x214);
                    Effects.SendTargetEffect(pm, 0x376A, 10, 16);

                    if (pm.MortEngine.TimerEvanouie != null)
                    {
                        pm.MortEngine.TimerEvanouie.Stop();
                        pm.MortEngine.TimerEvanouie = null;
                    }

                    if (pm.MortEngine.TimerMort != null)
                    {
                        pm.MortEngine.TimerMort.Stop();
                        pm.MortEngine.TimerMort = null;
                    }

                    pm.Location = c.Location;
                    pm.MortEngine.EndroitMort  = c.Location;
                    pm.MortEngine.RisqueDeMort = false;
                    pm.MortEngine.Mort         = false;
                    pm.Frozen = false;

                    ArrayList list = new ArrayList();

                    foreach (Item item in c.Items)
                    {
                        list.Add(item);
                    }

                    foreach (Item item in list)
                    {
                        if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair)
                        {
                            item.Delete();
                        }

                        if (item is RaceSkin || c.EquipItems.Contains(item))
                        {
                            if (!pm.EquipItem(item))
                            {
                                pm.AddToBackpack(item);
                            }
                        }
                        else
                        {
                            pm.AddToBackpack(item);
                        }
                    }

                    pm.Direction = c.Direction;
                    pm.Animate(21, 5, 1, false, false, 0);

                    c.Delete();

                    pm.Resurrect();

                    pm.CheckRaceSkin();
                }
            }
            FinishSequence();
        }
예제 #18
0
        public static void Grab_OnCommand(CommandEventArgs e)
        {
            //   Get LootData attachment
            LootData lootoptions = new LootData();

            // does player already have a lootdata attachment?
            if (XmlAttach.FindAttachment(e.Mobile, typeof(LootData)) == null)
            {
                XmlAttach.AttachTo(e.Mobile, lootoptions);
                // give them one free DocLootBag
                e.Mobile.AddToBackpack(new DocLootBag());
            }
            else
            {
                // they have the attachment, just load their options
                lootoptions = (LootData)XmlAttach.FindAttachment(e.Mobile, typeof(LootData));
            }

            //   Check args to see if they want to change loot options
            // if we have args after  "grab"
            if (e.Length != 0)
            {
                // we need to set the loot bag
                if (e.GetString(0) != "options")
                {
                    e.Mobile.SendMessage("Typing the command [grab  by itself loots corpses of your victims. [grab options will allow you to decide what you want to loot.");
                }
                // show loot options gump
                else if (e.GetString(0) == "options")
                {
                    e.Mobile.SendGump(new LootGump(e.Mobile));
                }
            }

            //   Check loot legalities
            Mobile from = e.Mobile;

            if (from.Alive == false)
            {
                from.PlaySound(1069);                   //hey
                from.SendMessage("You cannot do that while you are dead!");
                return;
            }
            else if (0 != CompetitiveGrabRadius && BlockingMobilesInRange(from, GrabRadius))
            {
                from.PlaySound(1069);                   //hey
                from.SendMessage("You are too close to another player to do that!");
                return;
            }

            ArrayList grounditems = new ArrayList();
            ArrayList lootitems   = new ArrayList();
            ArrayList corpses     = new ArrayList();
            Container DocLootBag  = GetLootBag(from);

            // Gather lootable corpses and items into lists
            foreach (Item item in from.GetItemsInRange(GrabRadius))
            {
                if (!from.InLOS(item) || !item.IsAccessibleTo(from) || !(item.Movable || item is Corpse))
                {
                    continue;
                }

                // add to corpse list if corpse
                if (item is Corpse && CorpseIsLootable(from, item as Corpse, false))
                {
                    corpses.Add(item);
                }

                // otherwise add to ground items list if loot options indicate
                else
                if (lootoptions.GetGroundItems)
                {
                    if (!(item is Corpse))
                    {
                        grounditems.Add(item);
                    }
                }
            }

            // see if we really want any of the junk lying on the ground
            GetItems(lootoptions, from, grounditems);

            grounditems.Clear();

            // now inspect and loot appropriate items in corpses
            foreach (Item corpse in corpses)
            {
                Corpse bod = corpse as Corpse;

                // if we are looting hides/scales/meat then carve the corpse
                if (lootoptions.GetHides && !(bod.Owner is PlayerMobile))
                {
                    bod.Carve(from, null);
                }

                //rummage through the corpse for good stuff
                foreach (Item item in bod.Items)
                {
                    lootitems.Add(item);
                }

                //  now see if we really want any of this junk
                GetItems(lootoptions, from, lootitems);

                // alrighty then, we have all the items we want, now award gold for this corpse, delete it and increment the body count
                AwardGold(from, bod, DocLootBag);
                bod.Delete();

                // empty lootitems arraylist
                lootitems.Clear();
            }
        }
예제 #19
0
        public static void Grab_OnCommand(CommandEventArgs e)
        {
            //   Get LootData attachment
            LootData lootoptions = new LootData();

            // does player already have a lootdata attachment?
            if (XmlAttach.FindAttachment(e.Mobile, typeof(LootData)) == null)
            {
                XmlAttach.AttachTo(e.Mobile, lootoptions);
                // give them one free lootbag
                e.Mobile.AddToBackpack(new LootBag());
            }
            else
            {
                // they have the attachment, just load their options
                lootoptions = (LootData)XmlAttach.FindAttachment(e.Mobile, typeof(LootData));
            }

            //   Check args to see if they want to change loot options
            // if we have args after  "grab"
            if (e.Length != 0)
            {
                // we need to set the loot bag
                if (e.GetString(0) != "options")
                {
                    e.Mobile.SendMessage("Typing the command [grab  by itself loots corpses of your victims. [grab options will allow you to decide what you want to loot.");
                }
                // show loot options gump
                else if (e.GetString(0) == "options")
                {
                    e.Mobile.SendGump(new LootGump(e.Mobile));
                }
            }

            //   Check loot legalities
            Mobile from = e.Mobile;

            if (from.Alive == false)
            {
                from.PlaySound(1069);                   //hey
                from.SendMessage("You cannot do that while you are dead!");
                return;
            }
            //else if ( 0 != CompetitiveGrabRadius && BlockingMobilesInRange( from, GrabRadius ))
            //{
            //	from.PlaySound( 1069 ); //hey
            //	from.SendMessage( "You are too close to another player to do that!" );
            //	return;
            //}

            ArrayList grounditems = new ArrayList();
            ArrayList lootitems   = new ArrayList();
            ArrayList corpses     = new ArrayList();
            Container lootBag     = GetLootBag(from);

            // Gather lootable corpses and items into lists
            foreach (Item item in from.GetItemsInRange(GrabRadius))
            {
                if (!from.InLOS(item) || !item.IsAccessibleTo(from) || !(item.Movable || item is Corpse))
                {
                    continue;
                }

                // add to corpse list if corpse
                if (item is Corpse && CorpseIsLootable(from, item as Corpse, false))                     // && item.Killer == from
                {
                    Corpse deadbody = item as Corpse;
                    if (deadbody.Killer == null)
                    {
                        corpses.Add(item);
                    }
                    else if (deadbody.Killer == from)
                    {
                        corpses.Add(item);
                    }
                    else if (deadbody.Killer is BaseCreature && !(deadbody.Killer is PlayerMobile))
                    {
                        BaseCreature pet = deadbody.Killer as BaseCreature;
                        if (pet.ControlMaster == from || pet.ControlMaster == null)
                        {
                            corpses.Add(item);
                        }
                    }
                }

                // otherwise add to ground items list if loot options indicate
//ORIGINALY HERE-Trying to clear up yellow startup saying that item moble never is
//				else if ( !( item is PlayerMobile ) )
//				{
//					if(lootoptions.GetGroundItems)
//						if (!(item is Corpse))
//							grounditems.Add( item );
//				}
//END ORIGINALY HERE
                else
                if (lootoptions.GetGroundItems)
                {
                    if (!(item is Corpse))
                    {
                        grounditems.Add(item);
                    }
                }
            }

            // see if we really want any of the junk lying on the ground
            GetItems(lootoptions, from, grounditems);

            grounditems.Clear();

            // now inspect and loot appropriate items in corpses
            foreach (Item corpse in corpses)
            {
                Corpse       bod = corpse as Corpse;
                PlayerMobile pm  = from as PlayerMobile;
                //pm.PlayerLevel += 1;

                /*                                          // Uncomment for eventual modifications (not to allow grabbing certain bodies)
                 * Mobile own = bod.Owner as Mobile;
                 * if( (own is Mobile1) || (own is Mobile2) )  // Change mobile names according to what you want to get
                 */
                {
                    // if we are looting hides/scales/meat then carve the corpse
                    if (lootoptions.GetHides && !(bod.Owner is PlayerMobile))
                    {
                        bod.Carve(from, null);
                    }

                    //rummage through the corpse for good stuff
                    foreach (Item item in bod.Items)
                    {
                        lootitems.Add(item);
                    }

                    //  now see if we really want any of this junk
                    GetItems(lootoptions, from, lootitems);

                    // alrighty then, we have all the items we want, now award gold for this corpse, delete it and increment the body count
//                    AwardGold(from, bod, lootBag); //REMED OUT SO THAT REGULAR MOBS WONT GIVE GOLD WHEN USE GRAB COMMAND
                    bod.Delete();

                    // empty lootitems arraylist
                    lootitems.Clear();
                }
            }
        }