Ejemplo n.º 1
0
            protected override void OnTick()
            {
                if (m_Pentagram != null)
                {
                    m_Pentagram.Delete();
                }

                if (m_EffectTimer != null)
                {
                    m_EffectTimer.Stop();
                }

                if (m_Summoner.Alive)
                {
                    m_Summoner.SendMessage("The creature you have summoned has arrived.");
                    m_Summoner.PlaySound(0xFB);

                    if (m_Creature != null)
                    {
                        m_Creature.MoveToWorld(m_Summoner.Location, m_Summoner.Map);
                        m_Creature.ControlTarget = m_Summoner;
                        m_Creature.ControlOrder  = OrderType.Follow;
                        m_Creature.BoltEffect(0);
                    }
                }
                else
                {
                    m_Summoner.SendMessage("You have died and your summoning has failed. ");

                    if (m_Creature != null)
                    {
                        m_Creature.Delete();
                    }
                }
                m_Summoner.EndAction(typeof(NecroSummonGump));
            }
Ejemplo n.º 2
0
        public void Target(object o)
        {
            if (o is Item)
            {
                Item targ = (Item)o;

                if (targ is LockableContainer)
                {
                    LockableContainer box = (LockableContainer)targ;
                    if (Multis.BaseHouse.CheckLockedDownOrSecured(box))
                    {
                        // You cannot cast this on a locked down item.
                        Caster.LocalOverheadMessage(MessageType.Regular, 0x22, 501761);
                    }
                    else if (box.Locked || box.LockLevel == 0 || box is ParagonChest)
                    {
                        // Target must be an unlocked chest.
                        Caster.SendLocalizedMessage(501762);
                    }
                    else if (CheckSequence())
                    {
                        SpellHelper.Turn(Caster, box);

                        Point3D loc = box.GetWorldLocation();

                        Effects.SendLocationParticles(
                            EffectItem.Create(loc, box.Map, EffectItem.DefaultDuration),
                            0x376A, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, 5020, 0);

                        Effects.PlaySound(loc, box.Map, 0x1FA);

                        // The chest is now locked!
                        Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501763);

                        box.LockLevel = (int)(Caster.Skills[SkillName.Magery].Value);
                        if (box.LockLevel > 90)
                        {
                            box.LockLevel = 90;
                        }
                        if (box.LockLevel < 0)
                        {
                            box.LockLevel = 0;
                        }
                        box.MaxLockLevel  = box.LockLevel + 20;
                        box.RequiredSkill = box.LockLevel;

                        //box.LockLevel = -255; // signal magic lock
                        box.Locked = true;
                    }
                }
                else if (targ is BaseDoor)
                {
                    BaseDoor door = (BaseDoor)targ;
                    if (Server.Items.DoorType.IsDungeonDoor(door))
                    {
                        if (door.Locked == true)
                        {
                            Caster.SendMessage("That door is already locked!");
                        }
                        else
                        {
                            SpellHelper.Turn(Caster, door);

                            Point3D loc = door.GetWorldLocation();

                            Effects.SendLocationParticles(
                                EffectItem.Create(loc, door.Map, EffectItem.DefaultDuration),
                                0x376A, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, 5020, 0);

                            Effects.PlaySound(loc, door.Map, 0x1FA);

                            Caster.SendMessage("That door is now locked!");

                            door.Locked = true;
                            Server.Items.DoorType.LockDoors(door);

                            new InternalTimer(door, Caster).Start();
                        }
                    }
                    else
                    {
                        Caster.SendMessage("This spell has no effect on that!");
                    }
                }
                else
                {
                    Caster.SendMessage("This spell has no effect on that!");
                }
            }
            else if (o is PlayerMobile)
            {
                Caster.SendMessage("That soul seems too strong to trap in the flask!");
            }
            else if (o is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)o;

                if (!bc.Alive)
                {
                    Caster.SendMessage("You cannot trap something that is dead!");
                }
                else if (bc.Controlled is LockedCreature)
                {
                    Caster.SendMessage("That creature cannot be trapped again!");
                }
                else if (bc.Controlled == true)
                {
                    Caster.SendMessage("That is under the control of another!");
                }
                else if (bc.EmoteHue == 505 || bc.ControlSlots >= 100)                   // SUMMON QUEST AND QUEST MONSTERS
                {
                    Server.Misc.IntelligentAction.FizzleSpell(Caster);
                    Caster.SendMessage("You are not powerful enough to trap that!");
                }
                else if (Caster.Backpack.FindItemByType(typeof(IronFlask)) == null)
                {
                    Caster.SendMessage("You need an empty iron flask to trap them!");
                }
                else
                {
                    int level  = Server.Misc.DifficultyLevel.GetCreatureLevel((Mobile)o) + 10;
                    int magery = (int)(Caster.Skills[SkillName.Magery].Value);

                    if (magery >= level)
                    {
                        int success = 10 + (magery - level);

                        if (Utility.RandomMinMax(1, 100) > success)
                        {
                            Server.Misc.IntelligentAction.FizzleSpell(Caster);
                            Caster.SendMessage("You fail to trap them in the flask!");
                        }
                        else
                        {
                            Item flask = Caster.Backpack.FindItemByType(typeof(IronFlask));
                            if (flask != null)
                            {
                                flask.Consume();
                            }

                            Caster.SendMessage("You trap " + bc.Name + " in the flask!");

                            IronFlaskFilled bottle = new IronFlaskFilled();

                            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;
                            }

                            bottle.TrappedName        = bc.Name;
                            bottle.TrappedTitle       = bc.Title;
                            bottle.TrappedBody        = bc.Body;
                            bottle.TrappedBaseSoundID = bc.BaseSoundID;
                            bottle.TrappedHue         = bc.Hue;

                            // TURN HUMANOIDS TO GHOSTS SO I DON'T NEED TO WORRY ABOUT CLOTHES AND GEAR
                            if (bc.Body == 400 || bc.Body == 401 || bc.Body == 605 || bc.Body == 606)
                            {
                                bottle.TrappedBody        = 0x3CA;
                                bottle.TrappedHue         = 0x9C4;
                                bottle.TrappedBaseSoundID = 0x482;
                            }

                            bottle.TrappedAI = 2; if (bc.AI == AIType.AI_Mage)
                            {
                                bottle.TrappedAI = 1;
                            }
                            bottle.TrappedStr          = bc.RawStr;
                            bottle.TrappedDex          = bc.RawDex;
                            bottle.TrappedInt          = bc.RawInt;
                            bottle.TrappedHits         = bc.HitsMax;
                            bottle.TrappedStam         = bc.StamMax;
                            bottle.TrappedMana         = bc.ManaMax;
                            bottle.TrappedDmgMin       = bc.DamageMin;
                            bottle.TrappedDmgMax       = bc.DamageMax;
                            bottle.TrappedColdDmg      = bc.ColdDamage;
                            bottle.TrappedEnergyDmg    = bc.EnergyDamage;
                            bottle.TrappedFireDmg      = bc.FireDamage;
                            bottle.TrappedPhysicalDmg  = bc.PhysicalDamage;
                            bottle.TrappedPoisonDmg    = bc.PoisonDamage;
                            bottle.TrappedColdRst      = bc.ColdResistSeed;
                            bottle.TrappedEnergyRst    = bc.EnergyResistSeed;
                            bottle.TrappedFireRst      = bc.FireResistSeed;
                            bottle.TrappedPhysicalRst  = bc.PhysicalResistanceSeed;
                            bottle.TrappedPoisonRst    = bc.PoisonResistSeed;
                            bottle.TrappedVirtualArmor = bc.VirtualArmor;
                            bottle.TrappedCanSwim      = bc.CanSwim;
                            bottle.TrappedCantWalk     = bc.CantWalk;
                            bottle.TrappedSkills       = level + 5;
                            bottle.TrappedPoison       = hitpoison;
                            bottle.TrappedImmune       = immune;
                            bottle.TrappedAngerSound   = bc.GetAngerSound();
                            bottle.TrappedIdleSound    = bc.GetIdleSound();
                            bottle.TrappedDeathSound   = bc.GetDeathSound();
                            bottle.TrappedAttackSound  = bc.GetAttackSound();
                            bottle.TrappedHurtSound    = bc.GetHurtSound();

                            Caster.BoltEffect(0);
                            Caster.PlaySound(0x665);

                            Caster.AddToBackpack(bottle);

                            bc.BoltEffect(0);
                            bc.PlaySound(0x665);
                            bc.Delete();
                        }
                    }
                    else
                    {
                        Server.Misc.IntelligentAction.FizzleSpell(Caster);
                        Caster.SendMessage("You are not powerful enough to trap that!");
                    }
                }
            }

            FinishSequence();
        }