Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)//XUO SCROLLS
        {
            if (!Sphere.CanUse(from, this))
                return;

            if (from.Mana < 11)
            {
                from.LastKiller = from;
                from.Kill();
            }
            else
            {
                from.Mana -= 10;
                
                base.OnDoubleClick(from);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Kills the given Mobile
        /// </summary>
        /// <param name="m">Mobile to kill</param>
        /// <param name="packToBank">true to move the Mobile's items to the bank</param>
        /// <param name="createTimedCorpse">true to create a temporary corpse</param>
        /// <param name="deleteCorpse">true to delete the Mobile's corpse after death</param>
        public virtual void Kill( Mobile m, bool packToBank, bool createTimedCorpse, bool deleteCorpse )
        {
            if( m == null )
                return;

            if( packToBank )
                PackToBank(m);

            if( createTimedCorpse )
            {
                _timedCorpse = new TimedItem(120.0, Utility.Random(0xECA, 8));
                _timedCorpse.MoveToWorld(m.Location, m.Map);
            }

            m.Kill();

            if( deleteCorpse && m.Corpse != null )
                m.Corpse.Delete();
        }
Ejemplo n.º 3
0
        public override void OnDoubleClick(Mobile from)//XUO SCROLLS
        {
            if (!Sphere.CanUse(from, this))
                return;

            if (from.Mana < 21)
            {
                from.LastKiller = from;
                from.Kill();
            }
            else
            {
                from.Mana -= 20;
            /*  from.PlaySound(from.GetHurtSound());

                if (!from.Mounted)
                    from.Animate(20, 5, 1, true, false, 0);
                else
                    from.Animate(29, 5, 1, true, false, 0);
            */
                base.OnDoubleClick(from);
            }
        }
Ejemplo n.º 4
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!Sphere.CanUse(from, this))
                return;

            if (from.Hits < 25)
            {
                from.LastKiller = from;
                from.Kill();
            }
            else
            {
                from.Hits -= 24;
                from.PlaySound(from.GetHurtSound());

                if (!from.Mounted)
                    from.Animate(20, 5, 1, true, false, 0);
                else
                    from.Animate(29, 5, 1, true, false, 0);

                base.OnDoubleClick(from);
            }
        }
Ejemplo n.º 5
0
        public override bool OnBeforeDeath()
        {
            if (m_TrueForm)
            {
                List <DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);

                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight && ds.m_Mobile is PlayerMobile)
                    {
                        PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle((PlayerMobile)ds.m_Mobile);
                    }
                }

                if (!NoKillAwards)
                {
                    GivePowerScrolls();

                    Map map = this.Map;

                    if (map != null)
                    {
                        for (int x = -16; x <= 16; ++x)
                        {
                            for (int y = -16; y <= 16; ++y)
                            {
                                double dist = Math.Sqrt(x * x + y * y);

                                if (dist <= 16)
                                {
                                    new GoodiesTimer(map, X + x, Y + y).Start();
                                }
                            }
                        }
                    }

                    m_DamageEntries = new Dictionary <Mobile, int>();

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

                        if (!m.Deleted)
                        {
                            m.Kill();
                        }

                        RegisterDamageTo(m);
                    }

                    m_Tentacles.Clear();

                    RegisterDamageTo(this);
                    AwardArtifact(GetArtifact());

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

                return(base.OnBeforeDeath());
            }
            else
            {
                Morph();
                return(false);
            }
        }
Ejemplo n.º 6
0
        public override bool OnBeforeDeath()
        {
            if (m_TrueForm)
            {
                var rights = GetLootingRights(DamageEntries, HitsMax);

                for (var i = rights.Count - 1; i >= 0; --i)
                {
                    var ds = rights[i];

                    if (ds.m_HasRight && ds.m_Mobile is PlayerMobile mobile)
                    {
                        ChampionTitleInfo.AwardHarrowerTitle(mobile);
                    }
                }

                if (!NoKillAwards)
                {
                    GivePowerScrolls();

                    var map = Map;

                    if (map != null)
                    {
                        for (var x = -16; x <= 16; ++x)
                        {
                            for (var y = -16; y <= 16; ++y)
                            {
                                var dist = Math.Sqrt(x * x + y * y);

                                if (dist <= 16)
                                {
                                    new GoodiesTimer(map, X + x, Y + y).Start();
                                }
                            }
                        }
                    }

                    m_DamageEntries = new Dictionary <Mobile, int>();

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

                        if (!m.Deleted)
                        {
                            m.Kill();
                        }

                        RegisterDamageTo(m);
                    }

                    m_Tentacles.Clear();

                    RegisterDamageTo(this);
                    AwardArtifact(GetArtifact());

                    m_GateItem?.Delete();
                }

                return(base.OnBeforeDeath());
            }

            Morph();
            return(false);
        }
Ejemplo n.º 7
0
			public static void KILL(TriggerObject trigObject, Mobile toKill)
			{
				if (toKill != null)
				{
					toKill.Kill();
				}
			}
Ejemplo n.º 8
0
        public static void Decapitate(Mobile from, Mobile target, Func <Mobile, Item> createHead = null)
        {
            if (from == null || target == null)
            {
                return;
            }

            Map map = target.Map;

            target.Freeze(TimeSpan.FromSeconds(1.0));

            int range   = Utility.RandomMinMax(5, 7);
            int zOffset = target.Mounted ? 20 : 10;

            Point3D src    = target.Location.Clone3D(0, 0, zOffset);
            var     points = src.GetAllPointsInRange(map, range, range);

            Effects.PlaySound(target.Location, map, 0x19C);
            target.Send(VNScreenLightFlash.Instance);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                foreach (Point3D trg in points)
                {
                    int bloodID = Utility.RandomMinMax(4650, 4655);

                    new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact(
                        info =>
                    {
                        new Blood(bloodID).MoveToWorld(info.Target.Location, info.Map);
                        Effects.PlaySound(info.Target, info.Map, 0x028);
                    });
                }
            });

            target.Kill();

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                var corpse = target.Corpse as Corpse;

                if (corpse != null && !corpse.Deleted)
                {
                    corpse.TurnToBones();
                }
            });

            var head = createHead != null?createHead(target) : null;

            int headID;
            int headHue;

            if (head != null)
            {
                headID  = head.ItemID;
                headHue = head.Hue;
            }
            else
            {
                headID  = 7393;
                headHue = target.SolidHueOverride >= 0 ? target.SolidHueOverride : target.Hue;
            }

            new MovingEffectInfo(src, src.Clone3D(0, 0, 40), map, headID, headHue).MovingImpact(
                info =>
                new MovingEffectInfo(
                    info.Target,
                    info.Source.Clone3D(Utility.RandomMinMax(-1, 1), Utility.RandomMinMax(-1, 1), 2),
                    info.Map,
                    headID,
                    headHue).MovingImpact(
                    hInfo =>
            {
                if (head != null && !head.Deleted)
                {
                    head.MoveToWorld(hInfo.Target.Location, info.Map);
                }
            }));
        }
Ejemplo n.º 9
0
            private static void DoLaunchLimbs(Mobile killed, PlayerMobile from, Point3D OurLoc, Point3D StartLoc, Map map)
            {
                if (killed.Player && (killed.BodyValue == 0x190 || killed.BodyValue == 0x191))
                {
                    if (killed.Mounted == true)
                    {
                        IMount mount = killed.Mount;

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

                    Backpack  bag        = new Backpack();
                    Container pack       = killed.Backpack;
                    BankBox   box        = killed.BankBox;
                    ArrayList equipitems = new ArrayList(killed.Items);
                    ArrayList bagitems   = new ArrayList(pack.Items);
                    foreach (Item item in equipitems)

                    {
                        if ((item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
                        {
                            pack.DropItem(item);
                        }
                    }
                    Container pouch      = killed.Backpack;
                    ArrayList finalitems = new ArrayList(pouch.Items);
                    foreach (Item items in finalitems)
                    {
                        bag.DropItem(items);
                    }
                    box.DropItem(bag);

                    killed.Kill();

                    int effecthue = killed.Hue;
                    if (effecthue >= 30000)
                    {
                        effecthue = 0;
                    }

                    //BEGIN HEAD//
                    Point3D endHeadLoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endHeadLoc, map),
                                             0x1CE1, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishHeadLaunch), new object[] { from, endHeadLoc, map, killed });
                    //END HEAD//

                    //BEGIN TORSO//
                    Point3D endTorsoLoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endTorsoLoc, map),
                                             0x1DAD, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishTorsoLaunch), new object[] { from, endTorsoLoc, map, killed });
                    //END TORSO//

                    //LEFT LEG//
                    Point3D endLLLoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endLLLoc, map),
                                             0x1DB2, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishLLLaunch), new object[] { from, endLLLoc, map, killed });
                    //END LEFT LEG//

                    //RIGHT LEG//
                    Point3D endRLLoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endRLLoc, map),
                                             0x1DA4, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishRLLaunch), new object[] { from, endRLLoc, map, killed });
                    //END RIGHT LEG//

                    //LEFT ARM//
                    Point3D endLALoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endLALoc, map),
                                             0x1DA1, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishLALaunch), new object[] { from, endLALoc, map, killed });
                    //END LEFT ARM//

                    //RIGHT ARM//
                    Point3D endRALoc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endRALoc, map),
                                             0x1DAF, 5, effecthue, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishRALaunch), new object[] { from, endRALoc, map, killed });
                    //END RIGHT ARM//

                    //BLOOD//
                    Point3D endBlood1Loc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endBlood1Loc, map),
                                             0x122B, 5, 0, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishBlood1Launch), new object[] { from, endBlood1Loc, map, killed });

                    Point3D endBlood2Loc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endBlood2Loc, map),
                                             0x122B, 5, 0, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishBlood2Launch), new object[] { from, endBlood2Loc, map, killed });

                    Point3D endBlood3Loc = new Point3D(StartLoc.X + Utility.RandomMinMax(-6, 6), StartLoc.Y + Utility.RandomMinMax(-6, 6), StartLoc.Z);
                    Effects.SendMovingEffect(new Entity(Serial.Zero, StartLoc, map), new Entity(Serial.Zero, endBlood3Loc, map),
                                             0x122B, 5, 0, false, false);
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(FinishBlood3Launch), new object[] { from, endBlood3Loc, map, killed });
                    //END BLOOD//
                }
                else
                {
                    killed.Kill();
                }
                if (killed.Corpse != null)
                {
                    killed.Corpse.Delete();
                }
            }
Ejemplo n.º 10
0
        public override void OnResponse(NetState state, int index)
        {
            //pla, 03/10/07
            // Log help stuck attempt
            if (index != 2)
            {
                LogHelper log = new LogHelper("HelpStuck.log");
                if (log != null)
                {
                    log.Log(LogType.Mobile, state.Mobile);
                    log.Finish();
                }
            }
            if (index == 0)
            {
                bool bGood = false;
                if (m_From.Alive == false)                 //dead: always allow to transport
                {
                    bGood = true;
                }
                else if (m_From.Region is Regions.FeluccaDungeon)                 //alive and in dungeon
                {
                    m_From.SendMessage("You have chosen to die.");
                    m_From.Kill();
                    bGood = true;
                }
                else if (m_From.TotalWeight < StuckMenu.MAXHELPSTUCKALIVEWEIGHT)                 //alive and out of dungeon and not over weight limit
                {
                    bGood = true;
                }
                else                 // alive, out of dungeon, over weight limit
                {
                    m_From.SendMessage("You are too encumbered to be moved, drop most of your stuff and help-stuck again.");
                }

                if (bGood)
                {
                    //auto-choose destination now, so don't give them this message
                    //m_From.SendMessage("You will now be given the standard help-stuck menu.");

                    StuckMenu menu = new StuckMenu(m_From, m_From, true, true);
                    //menu.BeginClose();
                    //m_From.SendGump(menu);
                    menu.AutoSelect();
                }
            }
            else if (index == 1)
            {
                if (!HelpGump.TryMoveStuckPlayer(m_From, 4))
                {
                    int staffonline = 0;
                    foreach (NetState ns in NetState.Instances)
                    {
                        Mobile m = ns.Mobile;
                        if (m != null && m.AccessLevel >= AccessLevel.Counselor && m.AutoPageNotify)
                        {
                            staffonline++;
                        }
                    }

                    if (staffonline == 0)
                    {
                        StuckMenu menu = new StuckMenu(m_From, m_From, true);
                        //menu.BeginClose();
                        //m_From.SendGump(menu);
                        menu.AutoSelect();
                    }
                }
            }
            else if (index == 2)
            {
                m_From.SendMessage("Help Stuck request cancelled.");
            }
        }
 public override void OnGotMeleeAttack(Mobile attacker)
 {
     attacker.Kill();
 }
Ejemplo n.º 12
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (DateTime.Now >= timeTalk)
            {
                switch (Utility.Random(72))
                {
                //Speech
                case 0: attacker.Say("So, are we gonna kill something now?"); break;

                case 1: attacker.Say("I am invincible, INVINCIBLE I say! *laughs*"); break;

                case 2: attacker.Say("I know! Find someone rich, and kill them! Then find someone richer, and kill them too! Hack and slash your way to fortune! Whoo-hoo!!"); break;

                case 3: attacker.Say("I'm sharp, I can come up with something... OK... find someone who knows what you want to know and threaten to kill them! Yeah! Then kill them! Woo-hoo!!!"); break;

                case 4: attacker.Say("I know! Start swinging! Eventually you'll lop off the head of someone important and then the good fights will REALLY start!"); break;

                case 5: attacker.Say("You know, once, long time ago, I was, like, a Moonblade."); break;

                case 6: attacker.Say("Err... find that wizard guy. Yeah... find him and kill him. Kill kill kill kill KILL!! Whoo-hoo!!"); break;

                case 7: attacker.Say("My brother's a +12 Hackmaster!"); break;

                case 8: attacker.Say("Choke up, dolt, your grip's all-wrong!"); break;

                case 9: attacker.Say("What's my status? Since when do you care about me unless I'm impaled in something's guts? Oh well, fine, let me think for a minute... Well, as a matter of fact I would like to register a complaint."); break;

                case 10: attacker.Say("Murder! Death! Kill! Murder! Death! Kill! Bouah-ha-ha-ha!"); break;

                case 11: attacker.Say("Hands up, kiddies, who wants to die?"); break;

                case 12: attacker.Say("(sigh) ...come on..."); break;

                case 13: attacker.Say("(double sigh) Rassa-frackin' (grumbling) c'mon-c'mon-C'MON!!!"); break;

                case 14: attacker.Say("Come get some! Boo-yah!"); break;

                case 15: attacker.Say("YOINK!!! Got your nose!"); break;

                case 16: attacker.Say("You really need to clean me. I like to shine! Ha-ha-ha!"); break;

                case 17: attacker.Say("Kill it! Kill it quick before they're all gone!"); break;

                case 18: attacker.Say("Mwoo-ha-ha-ha-ha-ha-ha!"); break;

                case 19: attacker.Say("Swish! Hot butta!"); break;

                case 20: attacker.Say("I refuse to answer any more questions until I'm cleaned and polished thoroughly. Grab a rag already!"); break;

                case 21: attacker.Say("I'm the best at what I do, and what I do ain't pretty! *laughs*"); break;

                case 22: attacker.Say("I think you need to take better care of me. I've got more chips than a blind beaver! I look like a second rate pig-poker!"); break;

                case 23: attacker.Say("You talking to me?"); break;

                case 24: attacker.Say("I love the smell of daisies in the morning!"); break;

                case 25: attacker.Say("Listen beefy, I may be an intelligent sword, but I've had no formal edjumacation."); break;

                case 26: attacker.Say("You know, my last owner always said I was 'sharp' and 'edgy'. He was such an ass."); break;

                case 27: attacker.Say("And that's for grandma, who said I'd never amount to anything more than a butterknife!"); break;

                case 28: attacker.Say("Kill! Kill! Kill! Yeah cool!!"); break;

                case 29: attacker.Say("I don't know what you have expected, but as a sword I'm pretty one-dimensional in what I waaant!!!"); break;

                case 30: attacker.Say("I don't chop wood, OK? I'm not an axe!"); break;

                case 31: attacker.Say("I want to kill a dragon. Right now. Go find one and kill it. That would be SO cool."); break;

                case 32: attacker.Say("Can we go kill something now, huh?"); break;

                case 33: attacker.Say("How about now?  No?"); break;

                case 34: attacker.Say("Come on let's kill something NOW!"); break;

                case 35: attacker.Say("mmmm.... now?"); break;

                case 36: attacker.Say("What about now?"); break;

                case 37: attacker.Say("Now!  Now!  Kill something now!! Yeah!"); break;

                case 38: attacker.Say("Now?  Please?  Pretty please?"); break;

                case 39: attacker.Say("Can we go whack something now?"); break;

                case 40: attacker.Say("Let's whack something eeeeevvvvillllll...."); break;

                case 41: attacker.Say("Why don't we go kill that over there?"); break;

                case 42: attacker.Say("Are we going to kill something now, maybe?  Huh?"); break;

                case 43: attacker.Say("Booooo-ring!"); break;

                case 44: attacker.Say("(sigh)"); break;

                case 45: attacker.Say("(double sigh)"); break;

                case 46: attacker.Say("Wanna go kill that over there? C'mon, let's kill somthin'!"); break;

                case 47: attacker.Say("You deal, I'll cut!"); break;

                case 48: attacker.Say("Let's see what's inside this one! Yeah!"); break;

                case 49: attacker.Say("Choke up, dolt, your grip is all wrong!"); break;

                case 50: attacker.Say("Hands up, kiddies, who wants to die?!"); break;

                case 51: attacker.Say("Mmmm... tastes like chicken!"); break;

                case 52: attacker.Say("Sissy fighter!  You grab, I'll scratch!'"); break;

                case 53: attacker.Say("Muwahahaha-ha-ha!!"); break;

                case 54: attacker.Say("You can't be serious!"); break;

                case 55: attacker.Say("Ooo, that'll leave a mark!"); break;

                case 56: attacker.Say("Murder!  Death!!  KILL!!!"); break;

                case 57: attacker.Say("Who's your daddy!"); break;

                case 58: attacker.Say("We got a gusher!"); break;

                case 59: attacker.Say("Are YOU talking to ME?!!"); break;

                case 60: attacker.Say("Some of my finest work!"); break;

                case 61: attacker.Say("I'm the best at what I do, and what I do ain't pretty!"); break;

                case 62: attacker.Say("Yeah! Hit it!  Hit it again!"); break;

                case 63: attacker.Say("Wouldn't it be cool if you could dual-wield me?"); break;

                case 64: attacker.Say("YOINK!  Got yer nose!"); break;

                case 65: attacker.Say("Swing harder!  Swing harder!!"); break;

                case 66: attacker.Say("Bring 'em on!  I ain't done!"); break;

                case 67: attacker.Say("Oh yeah!"); break;

                case 68: attacker.Say("You feel lucky, punk?"); break;

                case 69: attacker.Say("Oooh, throw a coin in that fountain! Hahaha!"); break;

                case 70: attacker.Say("Oooh, I'm shaking! Haha!"); break;

                // Poison Chance
                case 71: defender.ApplyPoison(attacker, Poison.Lethal);
                    attacker.SendMessage("Lilarcor: Oop's, i must be dirty, he looks ill!"); break;
                }

                timeTalk = DateTime.Now + TimeSpan.FromSeconds(30.0);
            }
            //Critical Hit
            if (attacker == null || defender == null)
            {
                return;
            }
            //Exceptions Go Here, 1% chance for success.
            if (defender is BaseCreature && .01 >= Utility.RandomDouble())
            {
                if (defender is BaseChampion || defender is BasePeerless || defender is Harrower)
                {
                    attacker.SendMessage("Lilarcor: Attack Roll 1 + 5 = 6 : Miss");
                    return;
                }
                else
                {
                    defender.Kill();
                    attacker.SendMessage("Lilarcor: Attack Roll 19 + 5 = 24 : Critical Hit!");
                }
            }
        }
Ejemplo n.º 13
0
        public override bool OnBeforeDeath()
        {
            if (m_TrueForm)
            {
                #region Taran: Reward all attackers
                List <DamageEntry> rights2       = DamageEntries;
                List <Mobile>      toGiveGold    = new List <Mobile>();
                List <Mobile>      toGiveItem    = new List <Mobile>();
                List <Mobile>      toRemove      = new List <Mobile>();
                List <int>         GoldToRecieve = new List <int>();

                for (int i = 0; i < rights2.Count; ++i)
                {
                    DamageEntry de = rights2[i];

                    //Only players get rewarded
                    if (de.HasExpired || !de.Damager.Player)
                    {
                        DamageEntries.RemoveAt(i);
                        continue;
                    }

                    toGiveGold.Add(de.Damager);
                    GoldToRecieve.Add(de.DamageGiven * 10); //Player gets 10 times the damage dealt in gold

                    if (de.DamageGiven > 1000)              //Players doing more than 1000 damage gets a random weapon or armor
                    {
                        toGiveItem.Add(de.Damager);
                    }
                }

                foreach (Mobile m in toGiveGold)
                {
                    if (m is PlayerMobile)
                    {
                        int amountofgold = GoldToRecieve[toGiveGold.IndexOf(m)];

                        if (amountofgold > 100000)
                        {
                            amountofgold = 100000; //Taran: Could be good with a max of 100k if damage bugs occur
                        }
                        if (amountofgold > 65000)
                        {
                            m.AddToBackpack(new BankCheck(amountofgold));
                        }
                        else
                        {
                            m.AddToBackpack(new Gold(amountofgold));
                        }

                        m.SendAsciiMessage("You dealt {0} damage to the champion and got {1} gold", amountofgold / 10, amountofgold);
                    }
                }

                foreach (Mobile m in toGiveItem)
                {
                    if (m is PlayerMobile)
                    {
                        Item item = Loot.RandomArmorOrShieldOrWeapon();

                        if (item is BaseWeapon)
                        {
                            BaseWeapon weapon = (BaseWeapon)item;
                            weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                            weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                        }
                        else if (item is BaseArmor)
                        {
                            BaseArmor armor = (BaseArmor)item;
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        m.AddToBackpack(item);
                        m.SendAsciiMessage("You dealt more than 1000 damage to the harrower, your reward is well deserved!");
                    }
                }

                //Remove all monsters within 20 tiles when the harrower is killed
                foreach (Mobile m in Map.GetMobilesInRange(Location, 20))
                {
                    if (m is BaseCreature && !(m is Harrower))
                    {
                        BaseCreature bc = (BaseCreature)m;
                        if (!(m is BaseMount) && m.Spawner == null && bc.LastOwner == null && !bc.Controlled)
                        {
                            toRemove.Add(m);
                        }
                    }
                }

                foreach (Mobile m in toRemove)
                {
                    if (m != null)
                    {
                        m.Delete();
                    }
                }
                #endregion

                List <DamageStore> rights = GetLootingRights(DamageEntries, HitsMax);

                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight && ds.m_Mobile is PlayerMobile)
                    {
                        PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle((PlayerMobile)ds.m_Mobile);
                    }
                }

                if (!NoKillAwards)
                {
                    //GivePowerScrolls();

                    Map map = Map;

                    if (map != null)
                    {
                        for (int x = -16; x <= 16; ++x)
                        {
                            for (int y = -16; y <= 16; ++y)
                            {
                                double dist = Math.Sqrt(x * x + y * y);

                                if (dist <= 16)
                                {
                                    new GoodiesTimer(map, X + x, Y + y).Start();
                                }
                            }
                        }
                    }

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

                        if (!m.Deleted)
                        {
                            m.Kill();
                        }
                    }

                    m_Tentacles.Clear();

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

                return(base.OnBeforeDeath());
            }
            else
            {
                Morph();
                return(false);
            }
        }
Ejemplo n.º 14
0
        public void Explode(Mobile from, bool direct, Point3D loc, Map map)
        {
            if (Deleted)
            {
                return;
            }

            Consume();

            for (int i = 0; m_Users != null && i < m_Users.Count; ++i)
            {
                Mobile      m    = (Mobile)m_Users[i];
                ThrowTarget targ = m.Target as ThrowTarget;

                if (targ != null && targ.Potion == this)
                {
                    Target.Cancel(m);
                }
            }

            if (map == null)
            {
                return;
            }

            Effects.PlaySound(loc, map, 0x207);
            Effects.SendLocationEffect(loc, map, 0x36BD, 20);

            int alchemyBonus = 0;

            if (direct)
            {
                alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
            }

            IPooledEnumerable eable     = LeveledExplosion ? map.GetObjectsInRange(loc, ExplosionRange) : map.GetMobilesInRange(loc, ExplosionRange);
            ArrayList         toExplode = new ArrayList();

            int toDamage = 0;

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    toExplode.Add(o);
                    ++toDamage;
                }
                else if (o is BaseZombieKillerPotion && o != this)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();

            int min = Scale(from, MinDamage);
            int max = Scale(from, MaxDamage);

            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    if (m is Zombiex)
                    {
                        m.Kill();
                    }
                    else

                    if (from == null || (SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false)))
                    {
                        if (from != null)
                        {
                            from.DoHarmful(m);
                        }

                        int damage = Utility.RandomMinMax(min, max);

                        damage += alchemyBonus;

                        if (!Core.AOS && damage > 40)
                        {
                            damage = 40;
                        }
                        else if (Core.AOS && toDamage > 2)
                        {
                            damage /= toDamage - 1;
                        }

                        AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
                    }
                }
                else if (o is BaseZombieKillerPotion)
                {
                    BaseZombieKillerPotion pot = (BaseZombieKillerPotion)o;

                    pot.Explode(from, false, pot.GetWorldLocation(), pot.Map);
                }
            }
        }
Ejemplo n.º 15
0
        public override void OnDamagedBySpell(Mobile caster)
        {
            base.OnDamagedBySpell(caster);

            caster.Kill();
        }
Ejemplo n.º 16
0
        public override void Damage(Mobile m)
        {
            base.Damage(m);
			
            if (m.Alive)
            {
                if (m.Location.X > 6484 && m.Location.Y > 500)
                    m.Kill();
                else
                {
                    m.FixedParticles(0x36B0, 1, 14, 0x26BB, 0x3F, 0x7, EffectLayer.Waist);
                    m.PlaySound(0x229);
					
                    int damage = 0;
					
                    damage += (int)Math.Pow(m.Location.X - 6200, 0.5);				
                    damage += (int)Math.Pow(m.Location.Y - 330, 0.5);	
					
                    if (damage > 20)
                        m.SendLocalizedMessage(1074567); // The acid river is much stronger here. You realize that allowing the acid to touch your flesh will surely kill you.
                    else if (damage > 10)
                        m.SendLocalizedMessage(1074566); // The acid river has gotten deeper. The concentration of acid is significantly stronger.
                    else
                        m.SendLocalizedMessage(1074565); // The acid river burns your skin.
					
                    AOS.Damage(m, damage, 0, 0, 0, 100, 0);
                }
            }
        }
Ejemplo n.º 17
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Mobile.Deleted)
            {
                m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                return;
            }
            else if (!BaseCommand.IsAccessible(m_From, m_Mobile))
            {
                m_From.SendMessage("That is no longer accessible.");
                m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                return;
            }

            switch (info.ButtonID)
            {
            case 0:
            case 1:
            {
                m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                break;
            }

            case 2:     // Properties
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                m_From.SendGump(new PropertiesGump(m_From, m_Mobile));
                break;
            }

            case 3:     // Delete
            {
                if (!m_Mobile.Player)
                {
                    CommandLogging.WriteLine(m_From, "{0} {1} deleting {2}", m_From.AccessLevel, CommandLogging.Format(m_From), CommandLogging.Format(m_Mobile));
                    m_Mobile.Delete();
                    m_From.SendGump(new InterfaceGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                }

                break;
            }

            case 4:     // Go there
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                InvokeCommand(string.Format("Go {0}", m_Mobile.Serial.Value));
                break;
            }

            case 5:     // Bring them here
            {
                if (m_From.Map == null || m_From.Map == Map.Internal)
                {
                    m_From.SendMessage("You cannot bring that person here.");
                }
                else
                {
                    m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                    m_Mobile.MoveToWorld(m_From.Location, m_From.Map);
                }

                break;
            }

            case 6:     // Move to target
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));
                m_From.Target = new MoveTarget(m_Mobile);
                break;
            }

            case 7:     // Kill
            {
                if (m_From == m_Mobile || m_From.AccessLevel > m_Mobile.AccessLevel)
                {
                    m_Mobile.Kill();
                }

                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));

                break;
            }

            case 8:     // Res
            {
                if (m_From == m_Mobile || m_From.AccessLevel > m_Mobile.AccessLevel)
                {
                    m_Mobile.PlaySound(0x214);
                    m_Mobile.FixedEffect(0x376A, 10, 16);

                    m_Mobile.Resurrect();
                }

                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));

                break;
            }

            case 9:     // Client
            {
                m_From.SendGump(new InterfaceMobileGump(m_From, m_Columns, m_List, m_Page, m_Mobile));

                if (m_Mobile.NetState != null)
                {
                    m_From.SendGump(new ClientGump(m_From, m_Mobile.NetState));
                }

                break;
            }
            }
        }
Ejemplo n.º 18
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_State == null)
            {
                return;
            }

            Mobile focus = m_State.Mobile;
            Mobile from  = state.Mobile;

            if (focus == null)
            {
                from.SendMessage("Le personnage n'est plus connecte.");
                return;
            }
            else if (focus.Deleted)
            {
                from.SendMessage("Le personnage n'existe plus.");
                return;
            }
            else if (focus.AccessLevel > from.AccessLevel && from.AccessLevel == AccessLevel.Player)
            {
                from.SendMessage("Vous ne pouvez envoyer un message à un maitre du jeu. Veuillez utiliser le systèmes de pages.");
                return;
            }
            else if (from != focus && (focus.Hidden && focus.HideAdmin && from.AccessLevel < focus.AccessLevel))
            {
                from.SendMessage("Le personnage n'est plus visible.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:     // Tell
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    focus.SendMessage(0x482, "{0} {1} vous a envoye un message HRP: ", from.GetNameUsedBy(focus));
                    focus.SendMessage(0x482, text.Text);

                    CommandLogging.WriteLine(from, "{0} {1} telling {2} \"{3}\" ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), text.Text);
                }

                from.SendGump(new ClientGump(from, m_State));

                break;
            }

            case 2:     // Tell + Reply Gump
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    string name = from.GetNameUsedBy(focus);
                    if (focus is PlayerMobile)
                    {
                        PlayerMobile pm = focus as PlayerMobile;
                        int          q  = (int)pm.QuiOptions;
                        bool         cantBeDelivered = (q & 0x100) != 0 || (name == "Anonyme" && (q & 0x001) != 0) || (name == "Identite Cachee" && (q & 0x010) != 0);
                        Console.WriteLine("q = {0:X}, canBeDelivered = {1}, q & 0x100 = {2}, name == \"Anonyme\" = {3}", q, cantBeDelivered, q & 0x100, name == "Anonyme");
                        if (from.AccessLevel > AccessLevel.Player || !cantBeDelivered)
                        {
                            focus.SendGump(new ClientGump(focus, state, from.GetNameUsedBy(focus), "", text.Text));
                            CommandLogging.WriteLine(from, "{0} {1} telling {2} \"{3}\" ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), text.Text);
                        }
                        else
                        {
                            from.SendMessage("{0} refuse de recevoir votre message", focus.GetNameUsedBy(from));
                        }
                    }
                }

                //from.SendGump(new ClientGump(from, m_State));

                break;
            }

            case 4:     // Props
            {
                Resend(from, info);

                if (!BaseCommand.IsAccessible(from, focus))
                {
                    from.SendMessage("Cela ne vous est pas accessible.");
                }
                else
                {
                    from.SendGump(new PropertiesGump(from, focus));
                    CommandLogging.WriteLine(from, "{0} {1} ouverture des propriétés de {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 5:     // Go to
            {
                if (focus.Map == null || focus.Map == Map.Internal)
                {
                    from.SendMessage("Ce personnage n'est pas dans ce monde.");
                }
                else
                {
                    from.MoveToWorld(focus.Location, focus.Map);
                    Resend(from, info);

                    CommandLogging.WriteLine(from, "{0} {1} se dirige sur {2}, Localisation {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), focus.Location, focus.Map);
                }

                break;
            }

            case 6:     // Get
            {
                if (from.Map == null || from.Map == Map.Internal)
                {
                    from.SendMessage("Vous ne pouvez pas amener ce personnage en ce lieu.");
                }
                else
                {
                    focus.MoveToWorld(from.Location, from.Map);
                    Resend(from, info);

                    CommandLogging.WriteLine(from, "{0} {1} amène {2} à la Localisation {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), from.Location, from.Map);
                }

                break;
            }

            case 7:     // Move
            {
                from.Target = new MoveTarget(focus);
                Resend(from, info);

                break;
            }

            case 8:     // Kick
            {
                if (from.AccessLevel >= AccessLevel.Batisseur && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Say("I've been kicked!");

                    m_State.Dispose();

                    CommandLogging.WriteLine(from, "{0} {1} kicking {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 9:     // Kill
            {
                if (from.AccessLevel >= AccessLevel.Batisseur && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Kill();
                    CommandLogging.WriteLine(from, "{0} {1} tue {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 10:     //Res
            {
                if (from.AccessLevel >= AccessLevel.Batisseur && from.AccessLevel > focus.AccessLevel)
                {
                    focus.PlaySound(0x214);
                    Effects.SendTargetEffect(focus, 0x376A, 10, 16);

                    focus.Resurrect();

                    CommandLogging.WriteLine(from, "{0} {1} résurrecte {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 11:     // .Voir
            {
                Resend(from, info);

                /*if (from is PlayerMobile && focus is PlayerMobile && from.AccessLevel > AccessLevel.GameMaster && focus.AccessLevel == AccessLevel.Player)
                 * {
                 *  from.SendGump(new CotationVoirGump((PlayerMobile)from, (PlayerMobile)focus));
                 * }*/

                break;
            }
            }
        }
Ejemplo n.º 19
0
            protected override void OnTarget(Mobile from, object targeted)
            {
////////////////////////////////////////////////////////////// Mobiles
                if (targeted is BaseCreature)
                {
                    BaseCreature creature = (BaseCreature)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, creature, 0.0, 100.0))
                    {
////////////////////////////////////////////////////////////// Zaythalor Forest
                        if (creature is BlackAntZaythalorForest)
                        {
                            creature.Say("Bro, I ain't worth nutin! You hear me {0}", from.Name);
                        }
                        else if (creature is FaerieBeetle)
                        {
                            from.Hits += (Utility.Random(10, 15));
                            from.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head);
                            from.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head);
                            from.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist);
                            from.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist);
                            from.PlaySound(0x202);

                            from.SendMessage("It's magically delicious.");
                        }
                        else if (creature is FaerieBeetleCollector)
                        {
                            from.Hits += (Utility.Random(2, 5));
                            from.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                            from.PlaySound(0x1F2);

                            from.SendMessage("It's magically delicious, at a fraction of the price.");
                        }
                        else if (creature is ForestBat)
                        {
                            creature.SendMessage("Nah Nah Nah Nah Nah Nah Nah Nah! Batman!");
                        }
                        else if (creature is GazerLarva)
                        {
                            if (from.Skills.Magery.Base >= 50.0)
                            {
                                from.Skills.Magery.Base += 0.2;
                                creature.Kill();
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is Gizzard)
                        {
                            from.AddToBackpack(new BlackPearl(5));
                            creature.Combatant = from;

                            if (from.Skills.Magery.Base >= 50.0)
                            {
                                from.Skills.Magery.Base += 0.2;
                                creature.Kill();
                            }
                        }
                        else if (creature is GreenSlime)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.Kill();
                            }
                            else
                            {
                                from.SendMessage("Slimer!");
                                from.ApplyPoison(from, Poison.Lesser);
                            }
                        }
                        else if (creature is GreySquirrel)
                        {
                            from.AddToBackpack(new Apple(3));
                            creature.Combatant = from;

                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is LargeFrog)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 80;
                                from.HueMod  = 663;
                                from.SendMessage("You shall forever remain stuck as a large frog until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*ribbit!*");
                            }
                        }
                        else if (creature is LesserAntLion)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 787;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a lesser antlion until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is MadPumpkinSpirit)
                        {
                            if (from.Skills.Cooking.Base >= 50.0)
                            {
                                from.Skills.Cooking.Base += 0.3;
                                creature.Kill();
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*Not Appropriate!*");
                            }
                        }
                        else if (creature is RhinoBeetle)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 247;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a rhino beetle until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.PlaySound(0x21D);
                                creature.Say("*fresh meat!*");
                            }
                        }
                        else if (creature is WildTurkey)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 1026;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a wild turkey until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is Ogumo)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                creature.Kill();
                                from.AddToBackpack(new SpiderPotion());
                                from.SendMessage("You vanquish thy foe using your dirty mouth. A potion has been added to your pack. Use it wisely.");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Alytharr Region

                        else if (creature is SandCrab)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 357;
                                from.HueMod  = 1864;
                                from.SendMessage("You shall forever remain stuck as a sand crab until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

                        else if (creature is WyvernYoungling)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 62;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a wyvern until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Autumnwood

                        else if (creature is Harpy)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 30;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a harpy until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

                        else if (creature is SkitteringHopper)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 302;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a skittering hopper until your next death");
                                from.Flying = true;
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Glimmerwood

                        else if (creature is HealerAnt)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.Hits += (Utility.Random(25, 50));
                                from.FixedParticles(0x375A, 1, 30, 9966, 88, 2, EffectLayer.Head);
                                from.FixedParticles(0x37B9, 1, 30, 9502, 85, 3, EffectLayer.Head);
                                from.FixedParticles(0x376A, 1, 31, 9961, 80, 0, EffectLayer.Waist);
                                from.FixedParticles(0x37C4, 1, 31, 9502, 88, 2, EffectLayer.Waist);
                                from.PlaySound(0x202);
                            }
                        }
                        else if (creature is Parrot)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;

                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }

////////////////////////////////////////////////////////////// Harashi Nabi Desert

                        else if (creature is OphidianMatriarch)
                        {
                            if (from.Skills.TasteID.Base >= 100.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 87;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as an ophidian matriarch until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }

////////////////////////////////////////////////////////////// Samson Swamplands

                        else if (creature is AnnoyingLlama1)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 792 : 1064);
                                from.Say("*farts*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.Skills.AnimalTaming.Base += 1;
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                            }
                        }
                        else if (creature is AnnoyingLlama2)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 782 : 1053);
                                from.Say("*burp!*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.Skills.AnimalTaming.Base += 1;
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                            }
                        }
                        else if (creature is AnnoyingLlama3)
                        {
                            if (from.Skills.AnimalTaming.Base >= 50.0)
                            {
                                creature.Delete();
                                from.PlaySound(from.Female ? 812 : 1086);
                                from.Say("*oops!*");
                            }
                            else
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Delete();
                                from.PlaySound(from.Female ? 811 : 1085);
                                from.Say("*oooh!*");
                                from.Skills.AnimalTaming.Base += 1;
                            }
                        }

////////////////////////////////////////////////////////////// Misc Mobiles
                        else if (creature is Bird)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is Boar)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;
                        }
                        else if (creature is Cat)
                        {
                            if (from.Skills.Poisoning.Base >= 50.0)
                            {
                                creature.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                creature.PlaySound(0x307);
                                creature.Kill();
                            }
                        }
                        else if (creature is Chicken)
                        {
                            if (from.Skills.TasteID.Base >= 50.0)
                            {
                                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                                from.BodyMod = 0xD0;
                                from.HueMod  = 0;
                                from.SendMessage("You shall forever remain stuck as a chicken until your next death");
                            }
                            else
                            {
                                creature.Combatant = from;
                                creature.Say("*bawk! bawk!*");
                            }
                        }
                        else if (creature is PoisonArrowFrog)
                        {
                            if (from.Skills.Poisoning.Base >= 80.0)
                            {
                                from.ApplyPoison(from, Poison.Lesser);
                                from.SendMessage("You've become too corrosive even for this toxic frog to handle.");
                            }
                            else
                            {
                                from.ApplyPoison(from, Poison.Lethal);
                                from.Skills.Poisoning.Base += 1;
                                creature.Kill();
                            }
                        }
                        else if (creature is Pookah)
                        {
                            if (from.Skills.Meditation.Base >= 50.0)
                            {
                                from.Location = new Point3D(364, 733, -20);                            // Glimmerwood Entrance
                                from.PlaySound(0x1FC);
                                from.SendMessage("You've been teleported to the entrance.");
                            }
                            else
                            {
                                creature.Combatant = from;
                            }
                        }
                        else if (creature is BaseGuardian)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            creature.Combatant = from;
                            creature.Say("Not gonna put up with that nonsense!");
                        }
                        else if (creature is BaseVendor)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                            creature.Say("Faulk off {0}", from.Name);
                        }
                    }
                }
                else if (targeted is PlayerMobile)
                {
                    PlayerMobile playermobile = (PlayerMobile)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, playermobile, 0, 100.0))
                    {
                        if (playermobile.Female == false)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                        }
                        else if (playermobile.Female == true)
                        {
                            from.PlaySound(from.Female ? 800 : 1072);
                            from.Say("*kisses*");
                            from.Karma = -100;
                            from.SendMessage("You've lost some karma.");
                        }
                    }
                }
                else if (targeted is Food)
                {
                    Food food = (Food)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, food, 0, 100))
                    {
                        if (food.Poison != null)
                        {
                            food.SendLocalizedMessageTo(from, 1038284);                               // It appears to have poison smeared on it.
                        }
                        else
                        {
                            // No poison on the food
                            food.SendLocalizedMessageTo(from, 1010600);                               // You detect nothing unusual about this substance.
                        }
                    }
////////////////////////////////////////////////////////////// Fruits
                    else if (food is Apple)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This apple appears rich in nutrients and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This apple appears rich in nutrients and has a fill factor of 1.");
                        }
                    }
                    else if (food is Bananas)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These bananas make for a great breakfast and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These bananas make for a great breakfast and have a fill factor of 1.");
                        }
                    }
                    else if (food is Cantaloupe)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This cantaloupe is as big as yo mommas biscuits and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This cantaloupe is as big as yo mommas biscuits and has a fill factor of 1.");
                        }
                    }
                    else if (food is Coconut)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This coconut may have been originally carried by a swallow of sorts and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This coconut may have been originally carried by a swallow of sorts and has a fill factor of 1.");
                        }
                    }
                    else if (food is Dates)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These dates are a delicacy among Ljosalfar high class officials and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These dates are a delicacy among Ljosalfar high class officials and have a fill factor of 1.");
                        }
                    }
                    else if (food is FruitBasket)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This fruit basket is one of a kind and has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This fruit basket is one of a kind and has a fill factor of 5.");
                        }
                    }
                    else if (food is FruitBowl)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This fruit bowl, the fruit baskets retarded cousin has a fill factor of 4. You're Welcome.");
                        }
                        else
                        {
                            from.SendMessage("This fruit bowl, the fruit baskets retarded cousin has a fill factor of 4. You're Welcome.");
                        }
                    }
                    else if (food is Grapes)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("These grapes are as violet as they come and have a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("These grapes are as violet as they come and have a fill factor of 1.");
                        }
                    }
                    else if (food is HoneydewMelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This melon is sometimes cherished by certain arachnids and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This melon is sometimes cherished by certain arachnids and has a fill factor of 1.");
                        }
                    }
                    else if (food is Lemon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This lemon is not without its renowned sour touch and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This lemon is not without its renowned sour touch and has a fill factor of 1.");
                        }
                    }
                    else if (food is Lime)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This lime, normally considered the green bastard reject of the lemon and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This lime, normally considered the green bastard reject of the lemon and has a fill factor of 1.");
                        }
                    }
                    else if (food is Peach)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This peach has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This peach has a fill factor of 1.");
                        }
                    }
                    else if (food is PeachCobbler)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This peach cobbler has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This peach cobbler has a fill factor of 5.");
                        }
                    }
                    else if (food is Pear)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This pear has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This pear has a fill factor of 1.");
                        }
                    }
                    else if (food is SmallWatermelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This small watermelon has a fill factor of 3.");
                        }
                        else
                        {
                            from.SendMessage("This small watermelon has a fill factor of 3.");
                        }
                    }
                    else if (food is SplitCoconut)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This split coconut has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This split coconut has a fill factor of 1.");
                        }
                    }
                    else if (food is Squash)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This squash has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This squash has a fill factor of 1.");
                        }
                    }
                    else if (food is Watermelon)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This watermelon has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This watermelon has a fill factor of 5.");
                        }
                    }
////////////////////////////////////////////////////////////// Vegetables
                    else if (food is Cabbage)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This cabbage has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This cabbage has a fill factor of 1.");
                        }
                    }
                    else if (food is Carrot)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This carrot has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This carrot has a fill factor of 1.");
                        }
                    }
                    else if (food is EarOfCorn)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This ear of corn has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This ear of corn has a fill factor of 1.");
                        }
                    }
                    else if (food is GreenGourd)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This green gourd has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This green gourd has a fill factor of 1.");
                        }
                    }
                    else if (food is Lettuce)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This head of lettuce has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This head of lettuce has a fill factor of 1.");
                        }
                    }
                    else if (food is Onion)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This onion is full of layers, like an ogre and has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This onion is full of layers, like an ogre and has a fill factor of 1.");
                        }
                    }
                    else if (food is Pumpkin)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This pumpkin has a fill factor of 8.");
                        }
                        else
                        {
                            from.SendMessage("This pumpkin has a fill factor of 8.");
                        }
                    }
                    else if (food is Quiche)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This quiche has a fill factor of 5.");
                        }
                        else
                        {
                            from.SendMessage("This quiche has a fill factor of 5.");
                        }
                    }
                    else if (food is SmallPumpkin)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This small pumpkin has a fill factor of 6.");
                        }
                        else
                        {
                            from.SendMessage("This small pumpkin has a fill factor of 6.");
                        }
                    }
                    else if (food is Turnip)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This turnip has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This turnip has a fill factor of 1.");
                        }
                    }
                    else if (food is YellowGourd)
                    {
                        if (from.CheckTargetSkill(SkillName.TasteID, food, 0.0, 100.0))
                        {
                            from.SendMessage("This yellow gourd has a fill factor of 1.");
                        }
                        else
                        {
                            from.SendMessage("This yellow gourd has a fill factor of 1.");
                        }
                    }
                    else
                    {
                        // Skill check failed
                        food.SendLocalizedMessageTo(from, 502823);                           // You cannot discern anything about this substance.
                    }
                }
                else if (targeted is BasePotion)
                {
                    BasePotion potion = (BasePotion)targeted;

                    potion.SendLocalizedMessageTo(from, 502813);                       // You already know what kind of potion that is.
                    potion.SendLocalizedMessageTo(from, potion.LabelNumber);
                }
                else if (targeted is PotionKeg)
                {
                    PotionKeg keg = (PotionKeg)targeted;

                    if (keg.Held <= 0)
                    {
                        keg.SendLocalizedMessageTo(from, 502228);                           // There is nothing in the keg to taste!
                    }
                    else
                    {
                        keg.SendLocalizedMessageTo(from, 502229);                           // You are already familiar with this keg's contents.
                        keg.SendLocalizedMessageTo(from, keg.LabelNumber);
                    }
                }
                else if (targeted is DecoHorseDung)
                {
                    DecoHorseDung horsedung = (DecoHorseDung)targeted;

                    from.RawInt -= 1;
                    from.Fame   -= 5000;
                    from.Karma  -= 5000;

                    if (0.05 > Utility.RandomDouble())
                    {
                        from.RawInt -= 1;
                        from.Fame   -= 10000;
                        from.Karma  -= 10000;
                        from.Kill();
                    }
                    else if (from.RawInt <= 1)
                    {
                        from.Delete();
                        World.Broadcast(0x35, true, string.Format("{0} was permanently killed off due to being a colossal scathead!", from.Name));
                    }
                }
                else if (targeted is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)targeted;

                    if (from.CheckTargetSkill(SkillName.TasteID, weapon, 0.0, 100.0))
                    {
                        if (weapon is BaseAxe)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseBashing)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseKnife)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BasePoleArm)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 15));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseSpear)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseStaff)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                        else if (weapon is BaseSword)
                        {
                            from.PlaySound(from.Female ? 814 : 1088);
                            AOS.Damage(from, 0, 0, 0, 0, 0, 0);
                            from.Hits -= (Utility.Random(1, 10));

                            if (from.Hits <= 10)
                            {
                                from.Kill();
                            }
                        }
                    }
                }
                else
                {
                    // The target is not food or potion or potion keg.
                    from.SendLocalizedMessage(502820);                       // That's not something you can taste.
                }
            }
Ejemplo n.º 20
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            //if (m == null)
            //return;

            switch (info.ButtonID)
            {
            case 0:
                m.CloseGump(typeof(StatGump));
                return;

            case 1:
                m.Hits = m.HitsMax;
                m.SendMessage("Your life is full.");
                break;

            case 2:
                m.Mana = m.ManaMax;
                m.SendMessage("Your mana is full.");
                break;

            case 3:
                m.Stam = m.StamMax;
                m.SendMessage("Your stamina is full.");
                break;

            case 4:
                m.Karma = 0;
                m.SendMessage("Karma 0");
                break;

            case 5:
                m.Karma = 15000;
                m.SendMessage("Karma 15000");
                break;

            case 6:
                m.Karma = -15000;
                m.SendMessage("Karma -15000");
                break;

            case 7:
                m.Fame = 0;
                m.SendMessage("Fame 0");
                break;

            case 8:
                m.Fame = 15000;
                m.SendMessage("Fame 15000");
                break;

            case 9:
                m.Kills = 0;
                m.SendMessage("You're not a killer.");
                break;

            case 10:
                m.Kills = 100;
                m.SendMessage("You're a killer.");
                break;

            case 11:

                m.Skills[SkillName.Chivalry].Base      = 0;
                m.Skills[SkillName.Alchemy].Base       = 0;
                m.Skills[SkillName.Anatomy].Base       = 0;
                m.Skills[SkillName.AnimalLore].Base    = 0;
                m.Skills[SkillName.AnimalTaming].Base  = 0;
                m.Skills[SkillName.Archery].Base       = 0;
                m.Skills[SkillName.ArmsLore].Base      = 0;
                m.Skills[SkillName.Begging].Base       = 0;
                m.Skills[SkillName.Blacksmith].Base    = 0;
                m.Skills[SkillName.Camping].Base       = 0;
                m.Skills[SkillName.Carpentry].Base     = 0;
                m.Skills[SkillName.Cartography].Base   = 0;
                m.Skills[SkillName.Cooking].Base       = 0;
                m.Skills[SkillName.DetectHidden].Base  = 0;
                m.Skills[SkillName.Discordance].Base   = 0;
                m.Skills[SkillName.EvalInt].Base       = 0;
                m.Skills[SkillName.Fishing].Base       = 0;
                m.Skills[SkillName.Fencing].Base       = 0;
                m.Skills[SkillName.Fletching].Base     = 0;
                m.Skills[SkillName.Focus].Base         = 0;
                m.Skills[SkillName.Forensics].Base     = 0;
                m.Skills[SkillName.Healing].Base       = 0;
                m.Skills[SkillName.Herding].Base       = 0;
                m.Skills[SkillName.Hiding].Base        = 0;
                m.Skills[SkillName.Inscribe].Base      = 0;
                m.Skills[SkillName.ItemID].Base        = 0;
                m.Skills[SkillName.Lockpicking].Base   = 0;
                m.Skills[SkillName.Lumberjacking].Base = 0;
                m.Skills[SkillName.Macing].Base        = 0;
                m.Skills[SkillName.Magery].Base        = 0;
                m.Skills[SkillName.MagicResist].Base   = 0;
                m.Skills[SkillName.Meditation].Base    = 0;
                m.Skills[SkillName.Mining].Base        = 0;
                m.Skills[SkillName.Musicianship].Base  = 0;
                m.Skills[SkillName.Parry].Base         = 0;
                m.Skills[SkillName.Peacemaking].Base   = 0;
                m.Skills[SkillName.Poisoning].Base     = 0;
                m.Skills[SkillName.Provocation].Base   = 0;
                m.Skills[SkillName.RemoveTrap].Base    = 0;
                m.Skills[SkillName.Snooping].Base      = 0;
                m.Skills[SkillName.SpiritSpeak].Base   = 0;
                m.Skills[SkillName.Stealing].Base      = 0;
                m.Skills[SkillName.Stealth].Base       = 0;
                m.Skills[SkillName.Swords].Base        = 0;
                m.Skills[SkillName.Tactics].Base       = 0;
                m.Skills[SkillName.Tailoring].Base     = 0;
                m.Skills[SkillName.TasteID].Base       = 0;
                m.Skills[SkillName.Tinkering].Base     = 0;
                m.Skills[SkillName.Tracking].Base      = 0;
                m.Skills[SkillName.Veterinary].Base    = 0;
                m.Skills[SkillName.Wrestling].Base     = 0;
                m.Skills[SkillName.Bushido].Base       = 0;
                m.Skills[SkillName.Ninjitsu].Base      = 0;
                m.Skills[SkillName.Necromancy].Base    = 0;

                m.SendMessage("All skills were reseted.");
                break;

            case 12:
                m.Str = 10;
                m.Dex = 10;
                m.Int = 10;
                m.SendMessage("Status reseted.");
                break;

            case 13:
                m.Kill();
                m.SendMessage("You killed yourself.");
                break;

            case 14:

                m.SendMessage("You have {0} Karma\n{1} Fame\n{2} Kill{3}", m.Karma, m.Fame, m.Kills, m.Kills > 1 ? "s" : "");
                break;
            }
            m.SendGump(new StatGump());
        }
Ejemplo n.º 21
0
            protected override void OnTick()
            {
                if (m_LMP == null || m_LMP.Deleted)
                {
                    Stop();
                }

                string message = "";

                if (!m_GetWinner)
                {
                    m_Count--;

                    if (m_Count < 1)
                    {
                        m_GetWinner = true;
                        CommandHandlers.BroadcastMessage(AccessLevel.Player, 1150, String.Format("The pentagram at {0} is active!", m_Location));
                    }

                    else if (m_Count % 10 == 0)
                    {
                        CommandHandlers.BroadcastMessage(AccessLevel.Player, 1150, String.Format("The pentagram at {0} will be active in {1} minutes. The first one who stands on it alone for {2} seconds will receive a random reward. Hiding at this pentagram is deadly mistake.", m_Location, m_Count / 10, m_TimerTicksRequired * 6));
                    }
                }

                else
                {
                    List <Mobile> moblist = new List <Mobile>();

                    foreach (Mobile m in m_LMP.Map.GetMobilesInRange(m_LMP.Location, 1))                                            // Edit by Silver: Changed range from 2 to 1
                    {
                        if (m.Player && m.Alive && m.AccessLevel == AccessLevel.Player && m.Z + 2 >= m_LMP.Z && m.Z - 5 <= m_LMP.Z) // Edit by Silver: Z-check
                        {
                            moblist.Add(m);
                        }
                    }

                    for (int i = moblist.Count - 1; i >= 0; i--)
                    {
                        Mobile m = moblist[i];
                        if (m.Hidden)
                        {
                            m.Kill();
                            moblist.RemoveAt(i);
                        }
                    }

                    if (moblist.Count == 1)
                    {
                        if (moblist[0] == m_Winner)
                        {
                            if (m_ConsWinner == 0)
                            {
                                CommandHandlers.BroadcastMessage(AccessLevel.Player, 1150, m_Winner.Name + String.Format(" was appointed as the sole person standing on the {0} pentagram!", m_Location));
                            }
                            else
                            {
                                message = m_Winner.Name + String.Format(" was appointed as the sole person standing on the {0} pentagram!", m_Location);
                            }
                            m_ConsWinner++;
                        }
                        else
                        {
                            m_Winner     = moblist[0];
                            m_ConsWinner = 0;
                        }

                        if (m_ConsWinner >= m_TimerTicksRequired)
                        {
                            CommandHandlers.BroadcastMessage(AccessLevel.Player, 1150, m_Winner.Name + " has won the pentagram event.");

                            /*	GoldMarkCoin p = new GoldMarkCoin();
                             *      p.Amount = 1000;
                             *
                             *      m_Winner.BankBox.DropItem(p);
                             *      m_Winner.SendMessage("You have won the pentagram event and 1000 Marks have been deposited into your bankbox.");
                             */
                            message = "";
                            Stop();
                        }
                    }

                    else
                    {
                        m_ConsWinner = 0;
                        if (Utility.Random(6) == 0)
                        {
                            CommandHandlers.BroadcastMessage(AccessLevel.Player, 1150, String.Format("No person could be appointed to be the only one standing on the {0} pentagram", m_Location));
                        }
                        else
                        {
                            message = String.Format("No person could be appointed to be the only one standing on the {0} pentagram", m_Location);
                        }
                    }
                }

                List <Mobile> mobilelist = new List <Mobile>();

                foreach (Mobile m in m_LMP.Map.GetMobilesInRange(m_LMP.Location, 20))
                {
                    if (m.Player && m.Alive)
                    {
                        mobilelist.Add(m);
                    }
                }

                foreach (Mobile m in mobilelist)
                {
                    if (!m.Criminal && m.AccessLevel == AccessLevel.Player)
                    {
                        m.Criminal = true;
                    }

                    if (message != "")
                    {
                        m.SendMessage(message);
                    }
                }
            }
Ejemplo n.º 22
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (defender is PlayerMobile)
            {
                if (defender.Hits < 10)
                {
                    Zombiex zomb = new Zombiex();

                    zomb.Map      = defender.Map;
                    zomb.Female   = defender.Female;
                    zomb.Body     = defender.Body;
                    zomb.Location = defender.Location;
                    zomb.Hue      = Utility.RandomMinMax(1267, 1272);
                    zomb.Name     = defender.Name;
                    zomb.Title    = "*Infected*";

                    //21JAN2008 Added Hair & Facial & Lower Torso Items *** START ***
                    zomb.HairItemID       = defender.HairItemID;
                    zomb.HairHue          = defender.HairHue;
                    zomb.FacialHairItemID = defender.FacialHairItemID;
                    zomb.FacialHairHue    = defender.FacialHairHue;
                    zomb.BodyMod          = defender.BodyMod;

                    zomb.EquipItemFromLayer(defender, zomb, Layer.InnerLegs);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.OuterLegs);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.InnerTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.MiddleTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.OuterTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.Waist);

                    //if (zomb.Female != null)
                    if (!zomb.Female)
                    {
                        zomb.EquipItemFromLayer(defender, zomb, Layer.Shirt);
                    }
                    //21JAN2008 Some updated *** END   ***
                    new Zombiex();

                    defender.Kill();
                }

                switch (Utility.Random(2))
                {
                case 0: this.Str -= 1;
                    //this.Say(" losing 1 Str from hitting");
                    break;
                }
            }

            if (defender is BaseCreature)
            {
                switch (Utility.Random(4))
                {
                case 0: this.Str -= 1;
                    //this.Say(" losing 1 Str from hitting");
                    break;
                }
            }
        }
Ejemplo n.º 23
0
        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile mob  = (Mobile)obj;
            Mobile from = e.Mobile;

            if (m_Value)
            {
                if (!mob.Alive)
                {
                    LogFailure("They are already dead.");
                }
                else if (!mob.CanBeDamaged())
                {
                    LogFailure("They cannot be harmed.");
                }
                else
                {
                    CommandLogging.WriteLine(
                        from,
                        "{0} {1} killing {2}",
                        from.AccessLevel,
                        CommandLogging.Format(from),
                        CommandLogging.Format(mob));
                    mob.Kill();

                    AddResponse("They have been killed.");
                }
            }
            else
            {
                if (mob.IsDeadBondedPet)
                {
                    BaseCreature bc = mob as BaseCreature;

                    if (bc != null)
                    {
                        CommandLogging.WriteLine(
                            from,
                            "{0} {1} resurrecting {2}",
                            from.AccessLevel,
                            CommandLogging.Format(from),
                            CommandLogging.Format(mob));

                        bc.PlaySound(0x214);
                        bc.FixedEffect(0x376A, 10, 16);

                        bc.ResurrectPet();

                        AddResponse("It has been resurrected.");
                    }
                }
                else if (!mob.Alive)
                {
                    CommandLogging.WriteLine(
                        from,
                        "{0} {1} resurrecting {2}",
                        from.AccessLevel,
                        CommandLogging.Format(from),
                        CommandLogging.Format(mob));

                    mob.PlaySound(0x214);
                    mob.FixedEffect(0x376A, 10, 16);

                    mob.Resurrect();

                    AddResponse("They have been resurrected.");
                }
                else
                {
                    LogFailure("They are not dead.");
                }
            }
        }
Ejemplo n.º 24
0
            protected override void OnTick()
            {
                if (this.m_Owner.Deleted)
                {
                    this.Stop();
                    return;
                }

                this.m_Owner.Criminal = false;
                this.m_Owner.Kills    = 0;
                this.m_Owner.Stam     = this.m_Owner.StamMax;

                Mobile target = this.m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !this.m_Owner.CanBeHarmful(target)))
                {
                    this.m_Owner.Focus = null;
                    this.Stop();
                    return;
                }
                else if (this.m_Owner.Weapon is Fists)
                {
                    this.m_Owner.Kill();
                    this.Stop();
                    return;
                }

                if (target != null && this.m_Owner.Combatant != target)
                {
                    this.m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    this.Stop();
                }
                else
                { // <instakill>
                    this.TeleportTo(target);
                    target.BoltEffect(0);

                    if (target is BaseCreature)
                    {
                        ((BaseCreature)target).NoKillAwards = true;
                    }

                    target.Damage(target.HitsMax, this.m_Owner);
                    target.Kill(); // just in case, maybe Damage is overriden on some shard

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

                    this.m_Owner.Focus = null;
                    this.Stop();
                }// </instakill>

                /*else if ( !m_Owner.InRange( target, 20 ) )
                 * {
                 * m_Shooting = false;
                 * m_Owner.Focus = null;
                 * }
                 * else if ( !m_Owner.InLOS( target ) )
                 * {
                 * m_Shooting = false;
                 * TeleportTo( target );
                 * }
                 * else if ( !m_Owner.CanSee( target ) )
                 * {
                 * m_Shooting = false;
                 * if ( !m_Owner.InRange( target, 2 ) )
                 * {
                 * if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
                 * TeleportTo( target );
                 * }
                 * else
                 * {
                 * if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                 * m_Owner.Say( "Reveal!" );
                 * }
                 * }
                 * else
                 * {
                 * if ( m_Shooting && (TimeToSpare() || OutOfMaxDistance( target )) )
                 * m_Shooting = false;
                 * else if ( !m_Shooting && InMinDistance( target ) )
                 * m_Shooting = true;
                 * if ( !m_Shooting )
                 * {
                 * if ( m_Owner.InRange( target, 1 ) )
                 * {
                 * if ( !m_Owner.Move( (Direction)(m_Owner.GetDirectionTo( target ) - 4) | Direction.Running ) && OutOfMaxDistance( target ) ) // Too close, move away
                 * TeleportTo( target );
                 * }
                 * else if ( !m_Owner.InRange( target, 2 ) )
                 * {
                 * if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
                 * TeleportTo( target );
                 * }
                 * }
                 * }*/
            }
Ejemplo n.º 25
0
			protected override void OnTarget( Mobile from, object target )
			{
				if( target == from )
				{
					from.SendMessage( "Don't you think that would hurt?" );
				}
				else if( target is Mobile )
				{
					Mobile m = (Mobile)target;

					if( from.Hidden && from.AccessLevel < AccessLevel.GameMaster )
						from.RevealingAction();

					if( from.AccessLevel < m.AccessLevel )
					{
						from.Blessed = false;
						from.Kill();

						return;
					}

					from.BeginAction( typeof( RockPile ) );
					from.PlaySound( 0x2F3 );
					from.Animate( 9, 1, 1, true, false, 0 );
					from.SendMessage( "You throw a rock and hit the target!" );

					int hits = m.Hits;
					int str = m.RawStr;

					if( m.Alive )
					{
						if( m.Hits > 15 )
							m.Hits /= 2;
						else
							m.Kill();
					}

					Effects.SendMovingEffect( from, m, 0x11B6, 8, 0, false, false, 0, 0 );
				}
				else
				{
					from.SendMessage( "Wouldn't be nice to throw that at someone so weak, would it?" );
				}
				new InternalTimer( from ).Start();
			}
Ejemplo n.º 26
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (defender is PlayerMobile)
            {
                if (defender.Hits < 10)
                {
                    Zombiex zomb = new Zombiex();

                    zomb.Map = defender.Map;
                    zomb.Female = defender.Female;
                    zomb.Body = defender.Body;
                    zomb.Location = defender.Location;
                    zomb.Hue = Utility.RandomMinMax(1267, 1272);
                    zomb.Name = defender.Name;
                    zomb.Title = "*Infected*";

                    //21JAN2008 Added Hair & Facial & Lower Torso Items *** START ***
                    zomb.HairItemID = defender.HairItemID;
                    zomb.HairHue = defender.HairHue;
                    zomb.FacialHairItemID = defender.FacialHairItemID;
                    zomb.FacialHairHue = defender.FacialHairHue;
                    zomb.BodyMod = defender.BodyMod;

                    zomb.EquipItemFromLayer(defender, zomb, Layer.InnerLegs);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.OuterLegs);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.InnerTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.MiddleTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.OuterTorso);
                    zomb.EquipItemFromLayer(defender, zomb, Layer.Waist);

                    //if (zomb.Female != null)
                    if (!zomb.Female)
                        zomb.EquipItemFromLayer(defender, zomb, Layer.Shirt);
                    //21JAN2008 Some updated *** END   ***
                    new Zombiex();

                    defender.Kill();
                    
                }

                switch (Utility.Random(2))
                {
                    case 0: this.Str -= 1;
                        //this.Say(" losing 1 Str from hitting"); 
                        break;
                }
            }

            if (defender is BaseCreature)
            {
                switch (Utility.Random(4))
                {
                    case 0: this.Str -= 1;
                        //this.Say(" losing 1 Str from hitting"); 
                        break;
                }
            }
        }
Ejemplo n.º 27
0
        public void Target(Mobile ma)
        {
            BaseCreature m = ma as BaseCreature;

            if (ma is CharmedMobile)
            {
                ma.Kill();
                Caster.SendMessage("You free them from their charm!");
            }
            else if (m != null)
            {
                if (!Caster.CanSee(m))
                {
                    Caster.SendLocalizedMessage(500237); // Target can not be seen.
                }
                else if (m.Controlled || m.Summoned)
                {
                    Caster.SendMessage("That target is already under somone's control!");
                }
                else if (!m.Alive)
                {
                    Caster.SendMessage("The dead are beyond your charms.");
                }
                else if (!m.Tamable || m.Blessed)
                {
                    Caster.SendMessage("You have no chance of charming that!");
                }
                else if (Caster.Followers >= 1)
                {
                    Caster.SendMessage("You couldn't control that if you did charm it!");
                }
                else if (CheckHSequence(m))
                {
                    SpellHelper.Turn(Caster, m);


                    if (!m.Controlled && m != null && !m.Deleted)
                    {
                        double taming;
                        if (m.MinTameSkill <= 1.0)
                        {
                            taming = 1.0;
                        }
                        else
                        {
                            taming = m.MinTameSkill;
                        }

                        double charmchance = (Caster.Skills[SkillName.Stealing].Value / taming);
                        if (charmchance <= 0.5)
                        {
                            Caster.SendMessage("You have no chance of charming them.");
                        }
                        else if (charmchance >= 0.9)
                        {
                            Caster.SendMessage("You charm them!");
                            Point3D       mloc = new Point3D(m.X, m.Y, m.Z);
                            CharmedMobile dg   = new CharmedMobile(m);
                            dg.Owner = m;

                            dg.Body      = m.Body;
                            dg.AI        = m.AI;
                            dg.Hue       = m.Hue;
                            dg.Name      = m.Name;
                            dg.SpeechHue = m.SpeechHue;
                            dg.Fame      = m.Fame;
                            dg.Karma     = m.Karma;
                            dg.EmoteHue  = m.EmoteHue;
                            dg.Title     = m.Title;
                            dg.Criminal  = (m.Criminal);
                            dg.Str       = m.Str;
                            dg.Int       = m.Int;
                            dg.Hits      = m.Hits;
                            dg.Dex       = m.Dex;
                            dg.Mana      = m.Mana;
                            dg.Stam      = m.Stam;

                            dg.VirtualArmor = (m.VirtualArmor);
                            dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
                            dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
                            dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);

                            dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
                            dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
                            dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
                            dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);

                            dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
                            dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
                            dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
                            dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
                            dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
                            dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
                            dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
                            dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
                            dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
                            dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
                            dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
                            dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
                            dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
                            dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
                            dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
                            dg.Kills = (m.Kills);


                            // Clear Items
                            RemoveFromAllLayers(dg);

                            // Then copy
                            CopyFromLayer(m, dg, Layer.FirstValid);
                            CopyFromLayer(m, dg, Layer.TwoHanded);
                            CopyFromLayer(m, dg, Layer.Shoes);
                            CopyFromLayer(m, dg, Layer.Pants);
                            CopyFromLayer(m, dg, Layer.Shirt);
                            CopyFromLayer(m, dg, Layer.Helm);
                            CopyFromLayer(m, dg, Layer.Gloves);
                            CopyFromLayer(m, dg, Layer.Ring);
                            CopyFromLayer(m, dg, Layer.Neck);
                            CopyFromLayer(m, dg, Layer.Hair);
                            CopyFromLayer(m, dg, Layer.Waist);
                            CopyFromLayer(m, dg, Layer.InnerTorso);
                            CopyFromLayer(m, dg, Layer.Bracelet);
                            CopyFromLayer(m, dg, Layer.Unused_xF);
                            CopyFromLayer(m, dg, Layer.FacialHair);
                            CopyFromLayer(m, dg, Layer.MiddleTorso);
                            CopyFromLayer(m, dg, Layer.Earrings);
                            CopyFromLayer(m, dg, Layer.Arms);
                            CopyFromLayer(m, dg, Layer.Cloak);
                            CopyFromLayer(m, dg, Layer.OuterTorso);
                            CopyFromLayer(m, dg, Layer.OuterLegs);
                            CopyFromLayer(m, dg, Layer.LastUserValid);
                            CopyFromLayer(m, dg, Layer.Mount);
                            dg.ControlSlots  = 5;
                            dg.Controlled    = true;
                            dg.ControlMaster = Caster;
                            TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Stealing].Value * 1.2); // 120% of Stealing
                            m_Timer = new InternalTimer(dg, duration);
                            m_Timer.Start();
                            dg.Map      = m.Map;
                            dg.Location = m.Location;
                            m.Blessed   = true;
                            m.Hidden    = true;

                            m.Location = new Point3D(m.X, m.Y, m.Z - 95);
                        }
                        else if (charmchance >= Utility.RandomDouble())
                        {
                            Caster.SendMessage("You charm them!");
                            CharmedMobile dg = new CharmedMobile(m);
                            dg.Owner = m;

                            dg.Body = m.Body;

                            dg.Hue       = m.Hue;
                            dg.Name      = m.Name;
                            dg.SpeechHue = m.SpeechHue;
                            dg.Fame      = m.Fame;
                            dg.Karma     = m.Karma;
                            dg.EmoteHue  = m.EmoteHue;
                            dg.Title     = m.Title;
                            dg.Criminal  = (m.Criminal);
                            dg.Str       = m.Str;
                            dg.Int       = m.Int;
                            dg.Hits      = m.Hits;
                            dg.Dex       = m.Dex;
                            dg.Mana      = m.Mana;
                            dg.Stam      = m.Stam;
                            dg.AI        = m.AI;

                            dg.VirtualArmor = (m.VirtualArmor);
                            dg.SetSkill(SkillName.Wrestling, m.Skills[SkillName.Wrestling].Value);
                            dg.SetSkill(SkillName.Tactics, m.Skills[SkillName.Tactics].Value);
                            dg.SetSkill(SkillName.Anatomy, m.Skills[SkillName.Anatomy].Value);

                            dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
                            dg.SetSkill(SkillName.MagicResist, m.Skills[SkillName.MagicResist].Value);
                            dg.SetSkill(SkillName.Meditation, m.Skills[SkillName.Meditation].Value);
                            dg.SetSkill(SkillName.EvalInt, m.Skills[SkillName.EvalInt].Value);

                            dg.SetSkill(SkillName.Archery, m.Skills[SkillName.Archery].Value);
                            dg.SetSkill(SkillName.Macing, m.Skills[SkillName.Macing].Value);
                            dg.SetSkill(SkillName.Swords, m.Skills[SkillName.Swords].Value);
                            dg.SetSkill(SkillName.Fencing, m.Skills[SkillName.Fencing].Value);
                            dg.SetSkill(SkillName.Lumberjacking, m.Skills[SkillName.Lumberjacking].Value);
                            dg.SetSkill(SkillName.Alchemy, m.Skills[SkillName.Alchemy].Value);
                            dg.SetSkill(SkillName.Parry, m.Skills[SkillName.Parry].Value);
                            dg.SetSkill(SkillName.Focus, m.Skills[SkillName.Focus].Value);
                            dg.SetSkill(SkillName.Necromancy, m.Skills[SkillName.Necromancy].Value);
                            dg.SetSkill(SkillName.Chivalry, m.Skills[SkillName.Chivalry].Value);
                            dg.SetSkill(SkillName.ArmsLore, m.Skills[SkillName.ArmsLore].Value);
                            dg.SetSkill(SkillName.Poisoning, m.Skills[SkillName.Poisoning].Value);
                            dg.SetSkill(SkillName.SpiritSpeak, m.Skills[SkillName.SpiritSpeak].Value);
                            dg.SetSkill(SkillName.Stealing, m.Skills[SkillName.Stealing].Value);
                            dg.SetSkill(SkillName.Inscribe, m.Skills[SkillName.Inscribe].Value);
                            dg.Kills = (m.Kills);


                            // Clear Items
                            RemoveFromAllLayers(dg);

                            // Then copy
                            CopyFromLayer(m, dg, Layer.FirstValid);
                            CopyFromLayer(m, dg, Layer.TwoHanded);
                            CopyFromLayer(m, dg, Layer.Shoes);
                            CopyFromLayer(m, dg, Layer.Pants);
                            CopyFromLayer(m, dg, Layer.Shirt);
                            CopyFromLayer(m, dg, Layer.Helm);
                            CopyFromLayer(m, dg, Layer.Gloves);
                            CopyFromLayer(m, dg, Layer.Ring);
                            CopyFromLayer(m, dg, Layer.Neck);
                            CopyFromLayer(m, dg, Layer.Hair);
                            CopyFromLayer(m, dg, Layer.Waist);
                            CopyFromLayer(m, dg, Layer.InnerTorso);
                            CopyFromLayer(m, dg, Layer.Bracelet);
                            CopyFromLayer(m, dg, Layer.Unused_xF);
                            CopyFromLayer(m, dg, Layer.FacialHair);
                            CopyFromLayer(m, dg, Layer.MiddleTorso);
                            CopyFromLayer(m, dg, Layer.Earrings);
                            CopyFromLayer(m, dg, Layer.Arms);
                            CopyFromLayer(m, dg, Layer.Cloak);
                            CopyFromLayer(m, dg, Layer.OuterTorso);
                            CopyFromLayer(m, dg, Layer.OuterLegs);
                            CopyFromLayer(m, dg, Layer.LastUserValid);
                            CopyFromLayer(m, dg, Layer.Mount);
                            dg.ControlSlots  = 5;
                            dg.Controlled    = true;
                            dg.ControlMaster = Caster;
                            TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills[SkillName.Stealing].Value * 1.2); // 120% of Stealing
                            m_Timer     = new InternalTimer(dg, duration);
                            dg.Map      = m.Map;
                            dg.Location = m.Location;
                            m.Blessed   = true;
                            m.Hidden    = true;
                            m.Location  = new Point3D(m.X, m.Y, m.Z - 95);
                        }
                        else
                        {
                            Caster.SendMessage("You fail to charm them.");
                        }
                    }
                }
                else
                {
                    Caster.SendMessage("You have no chance of charming them.");
                }
            }
            FinishSequence();
        }
Ejemplo n.º 28
0
 public void Carve(Mobile from, Item item)
 {
     from.PublicOverheadMessage(MessageType.Regular, 33, true, "Auto cut detected - Killing.");
     from.Kill();
 }
Ejemplo n.º 29
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_State == null)
            {
                return;
            }

            Mobile focus = m_State.Mobile;
            Mobile from  = state.Mobile;

            if (focus == null)
            {
                from.SendMessage("That character is no longer online.");
                return;
            }
            else if (focus.Deleted)
            {
                from.SendMessage("That character no longer exists.");
                return;
            }
            else if (from != focus && focus.Hidden && from.AccessLevel < focus.AccessLevel)
            {
                from.SendMessage("That character is no longer visible.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:     // Tell
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    focus.SendMessage(0x482, "{0} tells you:", from.Name);
                    focus.SendMessage(0x482, text.Text);

                    string Author  = from.Name;
                    string Message = text.Text;

                    focus.SendGump(new SIMGumpSend(Author, Message));

                    CommandLogging.WriteLine(from, "{0} {1} telling {2} \"{3}\" ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), text.Text);
                }

                from.SendGump(new SIMGumpChat(from, m_State));

                break;
            }

            case 4:     // Props
            {
                Resend(from, info);

                if (!BaseCommand.IsAccessible(from, focus))
                {
                    from.SendMessage("That is not accessible.");
                }
                else
                {
                    from.SendGump(new PropertiesGump(from, focus));
                    CommandLogging.WriteLine(from, "{0} {1} opening properties gump of {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 5:     // Go to
            {
                if (focus.Map == null || focus.Map == Map.Internal)
                {
                    from.SendMessage("That character is not in the world.");
                }
                else
                {
                    from.MoveToWorld(focus.Location, focus.Map);
                    Resend(from, info);

                    CommandLogging.WriteLine(from, "{0} {1} going to {2}, Location {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), focus.Location, focus.Map);
                }

                break;
            }

            case 6:     // Get
            {
                if (from.Map == null || from.Map == Map.Internal)
                {
                    from.SendMessage("You cannot bring that person here.");
                }
                else
                {
                    focus.MoveToWorld(from.Location, from.Map);
                    Resend(from, info);

                    CommandLogging.WriteLine(from, "{0} {1} bringing {2} to Location {3}, Map {4}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus), from.Location, from.Map);
                }

                break;
            }

            case 7:     // Move
            {
                from.Target = new MoveTarget(focus);
                Resend(from, info);

                break;
            }

            case 8:     // Kick
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Say("I've been kicked!");

                    m_State.Dispose();

                    CommandLogging.WriteLine(from, "{0} {1} kicking {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }

            case 9:     // Kill
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Kill();
                    CommandLogging.WriteLine(from, "{0} {1} killing {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 10:     //Res
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.PlaySound(0x214);
                    focus.FixedEffect(0x376A, 10, 16);

                    focus.Resurrect();

                    CommandLogging.WriteLine(from, "{0} {1} resurrecting {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                Resend(from, info);

                break;
            }

            case 11:     // Skills
            {
                Resend(from, info);

                if (from.AccessLevel > focus.AccessLevel)
                {
                    from.SendGump(new SkillsGump(from, (Mobile)focus));
                    CommandLogging.WriteLine(from, "{0} {1} Opening Skills gump of {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(focus));
                }

                break;
            }
            }
        }
Ejemplo n.º 30
0
            protected override void OnTick()
            {
                if (!Running)
                {
                    return;                     // this is ok because the underlying Timer is set up to be never-ending; TimerMain() will never
                }
                // call Stop() on us. THIS IS NOT THE GENERAL CASE! Normally this sort of check is BAD.

                if (DateTime.Now > m_End)
                {
                    m_Mobile.Frozen = false;

                    if (StuckMenu.ValidUseLocation(m_Sender, m_Mobile))
                    {
                        //if mobile is already logged out, leave it where it is!
                        if (m_Mobile.Map != Map.Internal)
                        {
                            //Force mobile to drop whatever they're holding.
                            m_Mobile.DropHolding();

                            bool bMoveMe = true;
                            if (m_bAdditionalChecks)
                            {
                                bool bGood = false;
                                if (m_Mobile.Alive == false)                                 //dead: always allow to transport
                                {
                                    bGood = true;
                                }
                                else if (m_Mobile.Region.IsDungeonRules)                                 //alive and in dungeon
                                {
                                    m_Mobile.Kill();
                                    bGood = true;
                                }
                                else if (m_Mobile.TotalWeight < StuckMenu.MAXHELPSTUCKALIVEWEIGHT)                                 //alive and out of dungeon and not over weight limit
                                {
                                    bGood = true;
                                }
                                else                                 // alive, out of dungeon, over weight limit
                                {
                                    m_Mobile.SendMessage("You are too encumbered to be moved, drop most of your stuff and help-stuck again.");
                                }

                                if (bGood)
                                {
                                    //all good - proceed

                                    //check his pets in range:
                                    try
                                    {
                                        IPooledEnumerable eable = m_Mobile.GetMobilesInRange(3);
                                        foreach (Mobile m in eable)
                                        {
                                            if (m is BaseCreature)
                                            {
                                                BaseCreature pet = (BaseCreature)m;

                                                if (pet.Controlled && pet.ControlMaster == m_Mobile)
                                                {
                                                    if (pet.ControlOrder == OrderType.Guard || pet.ControlOrder == OrderType.Follow || pet.ControlOrder == OrderType.Come)
                                                    {
                                                        if (pet is PackHorse || pet is PackLlama || pet is Beetle || pet is HordeMinion)
                                                        {
                                                            if (pet.Backpack != null && pet.Backpack.Items.Count > 0)
                                                            {
                                                                m_Mobile.SendMessage("You cannot be transported because you have a pack animal that is not empty!");
                                                                bMoveMe = false;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        eable.Free();
                                    }
                                    catch (Exception checkexception)
                                    {
                                        Server.Commands.LogHelper.LogException(checkexception);
                                    }
                                }
                                else
                                {
                                    bMoveMe = false;
                                }
                            }

                            if (bMoveMe)
                            {
                                Mobiles.BaseCreature.TeleportPets(m_Mobile, m_Location, Map.Felucca);
                                m_Mobile.MoveToWorld(m_Location, Map.Felucca);
                                m_Mobile.UsedStuckMenu();
                            }
                        }
                    }
                    else
                    {
                        m_Mobile.SendMessage("You are not in a valid location to use auto-help-stuck. You may use help-stuck again to ask for GM intervention.");
                    }

                    Stop();
                }
                else
                {
                    m_Mobile.Frozen = true;
                }
            }
Ejemplo n.º 31
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal = false;
                m_Owner.Kills    = 0;
                m_Owner.Stam     = m_Owner.StamMax;

                Mobile target = m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target)))
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }

                //10OCT2007 InstaKill for Creatures ONLY *** START ***

                if (target != null && m_Owner.Combatant != target)
                {
                    m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    Stop();
                }

                else
                {
                    //kill creatures only
                    if (target is BaseCreature)
                    {
                        target.BoltEffect(0);
                        //((BaseCreature)target).NoKillAwards = true;
                        target.Kill(); // just in case, maybe Damage is overriden on some shard
                        m_Owner.Focus = null;
                        Stop();
                    }
                    else
                    {
                        //kill player if in a certian region
                        IPoint3D ip = m_Owner as IPoint3D;

                        if (ip != null)
                        {
                            Point3D p = new Point3D(ip);

                            Region reg = Region.Find(new Point3D(p), m_Owner.Map);

                            Console.WriteLine("Guards Called to: " + reg.Name);

                            if (reg.Name == "SafeZone")
                            {
                                target.Frozen = true;
                                target.BoltEffect(0);
                                target.BodyMod = Utility.RandomList(50, 56);

                                Timer.DelayCall(TimeSpan.FromSeconds(20.0), new TimerCallback(ReportKill));
                                target.BoltEffect(0);
                                //((BaseCreature)target).NoKillAwards = true;
                                target.Kill(); // just in case, maybe Damage is overriden on some shard

                                target.BodyMod = 0x0;
                                target.Frozen  = false;

                                m_Owner.Focus = null;
                                m_TeleportTo  = false;
                                Stop();
                            }
                            else
                            {
                                //Turn Off Guard
                                m_Owner.Focus = null;

                                //wander around and wait for timer to end
                                if ((m_Stage++ % 4) == 0 || !m_Owner.Move(m_Owner.Direction))
                                {
                                    m_Owner.Direction = (Direction)Utility.Random(8);
                                }

                                //Time to talk
                                switch (Utility.Random(5))  //picks one of the following
                                {
                                case 0:
                                { m_Owner.Say("Depend not on fortune, but on conduct."); break; }

                                case 1:
                                { m_Owner.Say("A great fortune in the hands of a fool is a great misfortune."); break; }

                                case 2:
                                { m_Owner.Say("To save time is to lengthen life."); break; }

                                case 3:
                                { m_Owner.Say("Rich gifts wax poor when givers prove unkind."); break; }

                                case 4:
                                { m_Owner.Say("Act the way you'd like to be and soon you'll be the way you act."); break; }
                                }
                            }
                        }
                    }
                }

                //10OCT2007 InstaKill for Creatures ONLY *** END  ***

                //{// <instakill>
                //    TeleportTo( target );
                //    target.BoltEffect( 0 );

                //    if ( target is BaseCreature )
                //        ((BaseCreature)target).NoKillAwards = true;

                //    target.Damage( target.HitsMax, m_Owner );
                //    target.Kill(); // just in case, maybe Damage is overriden on some shard

                //    if ( target.Corpse != null && !target.Player )
                //        target.Corpse.Delete();

                //    m_Owner.Focus = null;
                //    Stop();
                //}// </instakill>
                ///*else if ( !m_Owner.InRange( target, 20 ) )
                //{
                //    m_Owner.Focus = null;
                //}
                //else if ( !m_Owner.InRange( target, 10 ) || !m_Owner.InLOS( target ) )
                //{
                //    TeleportTo( target );
                //}
                //else if ( !m_Owner.InRange( target, 1 ) )
                //{
                //    if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) )
                //        TeleportTo( target );
                //}
                //else if ( !m_Owner.CanSee( target ) )
                //{
                //    if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                //        m_Owner.Say( "Reveal!" );
                //}*/
            }
Ejemplo n.º 32
0
		public void Carve( Mobile from, Item item )
		{
            from.PublicOverheadMessage(MessageType.Regular, 33, true, "Auto cut detected - Killing.");
            from.Kill();
		}
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal = false;
                m_Owner.Kills    = 0;
                m_Owner.Stam     = m_Owner.StamMax;

                Mobile target = m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target)))
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }
                else if (m_Owner.Weapon is Fists)
                {
                    m_Owner.Kill();
                    Stop();
                    return;
                }

                if (target != null && m_Owner.Combatant != target)
                {
                    m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    Stop();
                }
                else
                {                // <instakill>
                    TeleportTo(target);
                    target.BoltEffect(0);

                    if (target is BaseCreature)
                    {
                        ((BaseCreature)target).NoKillAwards = true;
                    }

                    target.Damage(target.HitsMax, m_Owner);
                    target.Kill();                     // just in case, maybe Damage is overriden on some shard

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

                    m_Owner.Focus = null;
                    Stop();
                }                // </instakill>

                /*else if ( !m_Owner.InRange( target, 20 ) )
                 * {
                 *      m_Owner.Focus = null;
                 * }
                 * else if ( !m_Owner.InRange( target, 10 ) || !m_Owner.InLOS( target ) )
                 * {
                 *      TeleportTo( target );
                 * }
                 * else if ( !m_Owner.InRange( target, 1 ) )
                 * {
                 *      if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) )
                 *              TeleportTo( target );
                 * }
                 * else if ( !m_Owner.CanSee( target ) )
                 * {
                 *      if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                 *              m_Owner.Say( "Reveal!" );
                 * }*/
            }
Ejemplo n.º 34
0
		public override void OnDoubleClick( Mobile from )
		{
			from.SendMessage("You O.D. on Heroin!");
			from.Kill();
			this.Delete();
		}
Ejemplo n.º 35
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_State == null)
            {
                return;
            }

            Mobile focus = m_State.Mobile;
            Mobile from  = state.Mobile;

            if (focus == null)
            {
                from.SendMessage("That character is no longer online.");
                return;
            }
            else if (focus.Deleted)
            {
                from.SendMessage("That character no longer exists.");
                return;
            }
            else if (from != focus && focus.Hidden && from.AccessLevel < focus.AccessLevel)
            {
                from.SendMessage("That character is no longer visible.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Tell
            {
                TextRelay text = info.GetTextEntry(0);

                if (text != null)
                {
                    focus.SendMessage(0x482, "{0} tells you:", from.Name);
                    focus.SendMessage(0x482, text.Text);
                }

                from.SendGump(new ClientGump(from, m_State));

                break;
            }

            case 4:                     // Props
            {
                Resend(from, info);
                from.SendGump(new PropertiesGump(from, focus));

                break;
            }

            case 5:                     // Go to
            {
                if (focus.Map == null || focus.Map == Map.Internal)
                {
                    from.SendMessage("That character is not in the world.");
                }
                else
                {
                    from.MoveToWorld(focus.Location, focus.Map);
                    Resend(from, info);
                }

                break;
            }

            case 6:                     // Get
            {
                if (from.Map == null || from.Map == Map.Internal)
                {
                    from.SendMessage("You cannot bring that person here.");
                }
                else
                {
                    focus.MoveToWorld(from.Location, from.Map);
                    Resend(from, info);
                }

                break;
            }

            case 7:                     // Move
            {
                from.Target = new MoveTarget(focus);
                Resend(from, info);

                break;
            }

            case 8:                     // Kick
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Say("I've been kicked!");

                    m_State.Dispose();
                }

                break;
            }

            case 9:                     // Kill
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.Kill();
                }

                Resend(from, info);

                break;
            }

            case 10:                     //Res
            {
                if (from.AccessLevel >= AccessLevel.GameMaster && from.AccessLevel > focus.AccessLevel)
                {
                    focus.PlaySound(0x214);
                    focus.FixedEffect(0x376A, 10, 16);

                    focus.Resurrect();
                }

                Resend(from, info);

                break;
            }

            case 11:                     // Skills
            {
                Resend(from, info);

                if (from.AccessLevel > focus.AccessLevel)
                {
                    from.SendGump(new SkillsGump(from, (Mobile)focus));
                }

                break;
            }
            }
        }
Ejemplo n.º 36
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal = false;
                m_Owner.Kills    = 0;
                m_Owner.Stam     = m_Owner.StamMax;

                Mobile target = m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target)))
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }

                //10OCT2007 InstaKill for Creatures ONLY *** START ***

                if (target != null && m_Owner.Combatant != target)
                {
                    m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    Stop();
                }

                else
                {
                    //kill creatures only
                    if (target is BaseCreature)
                    {
                        target.BoltEffect(0);
                        //((BaseCreature)target).NoKillAwards = true;
                        target.Kill(); // just in case, maybe Damage is overriden on some shard
                        m_Owner.Focus = null;
                        m_TeleportTo  = false;
                        Stop();
                    }
                    else
                    {
                        //kill player if in a certian region
                        IPoint3D ip = m_Owner as IPoint3D;

                        if (ip != null)
                        {
                            Point3D p = new Point3D(ip);

                            Region reg = Region.Find(new Point3D(p), m_Owner.Map);

                            if (reg.Name == "SafeZone")
                            {
                                target.BoltEffect(0);
                                ((BaseCreature)target).NoKillAwards = true;
                                target.Kill(); // just in case, maybe Damage is overriden on some shard
                                m_Owner.Focus = null;
                                m_TeleportTo  = false;
                                Stop();
                            }
                            else
                            {
                                //Turn Off Guard
                                m_Owner.Focus = null;

                                //wander around and wait for timer to end
                                if ((m_Stage++ % 4) == 0 || !m_Owner.Move(m_Owner.Direction))
                                {
                                    m_Owner.Direction = (Direction)Utility.Random(8);
                                }

                                //Time to talk
                                switch (Utility.Random(5))  //picks one of the following
                                {
                                case 0:
                                { m_Owner.Say("Depend not on fortune, but on conduct."); break; }

                                case 1:
                                { m_Owner.Say("The appearance of right oft leads us wrong."); break; }

                                case 2:
                                { m_Owner.Say("To save time is to lengthen life."); break; }

                                case 3:
                                { m_Owner.Say("Rich gifts wax poor when givers prove unkind."); break; }

                                case 4:
                                { m_Owner.Say("Act the way you'd like to be and soon you'll be the way you act."); break; }
                                }
                            }
                        }
                    }

                    //    //if target is using his/her hands (don't know why this was important)
                    //    if (m_Owner.Weapon is Fists)
                    //    {
                    //        m_Owner.Say("I should have brought a weapon!");
                    //        m_Shooting = true;
                    //        return;
                    //    }

                    //    //if target is too far away, let him go
                    //    if (!m_Owner.InRange(target, 20))
                    //    {
                    //        m_Owner.Say("You hear the guard laughing at you");
                    //        m_Owner.Focus = null;
                    //        m_Shooting = false;
                    //        m_TeleportTo = false;
                    //        Stop();
                    //    }

                    //    //if target is not visiable, stop shooting
                    //    if (!m_Owner.CanSee(target) || !m_Owner.InLOS(target))
                    //    {
                    //        m_Shooting = false;
                    //    }

                    //    //if target is hiding, reveal him
                    //    if (!m_Owner.UseSkill(SkillName.DetectHidden) && Utility.Random(50) == 0)
                    //    {
                    //        m_Owner.Say("Reveal!");
                    //        m_Shooting = true;
                    //    }
                    //}
                }

                //{// <instakill>
                //    TeleportTo( target );
                //    target.BoltEffect( 0 );

                //    if ( target is BaseCreature )
                //        ((BaseCreature)target).NoKillAwards = true;

                //    target.Damage( target.HitsMax, m_Owner );
                //    target.Kill(); // just in case, maybe Damage is overriden on some shard

                //    if ( target.Corpse != null && !target.Player )
                //        target.Corpse.Delete();

                //    m_Owner.Focus = null;
                //    Stop();
                //}// </instakill>
                ///*else if ( !m_Owner.InRange( target, 20 ) )
                //{
                //    m_Shooting = false;
                //    m_Owner.Focus = null;
                //}
                //else if ( !m_Owner.InLOS( target ) )
                //{
                //    m_Shooting = false;
                //    TeleportTo( target );
                //}
                //else if ( !m_Owner.CanSee( target ) )
                //{
                //    m_Shooting = false;

                //    if ( !m_Owner.InRange( target, 2 ) )
                //    {
                //        if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
                //            TeleportTo( target );
                //    }
                //    else
                //    {
                //        if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
                //            m_Owner.Say( "Reveal!" );
                //    }
                //}
                //else
                //{
                //    if ( m_Shooting && (TimeToSpare() || OutOfMaxDistance( target )) )
                //        m_Shooting = false;
                //    else if ( !m_Shooting && InMinDistance( target ) )
                //        m_Shooting = true;

                //    if ( !m_Shooting )
                //    {
                //        if ( m_Owner.InRange( target, 1 ) )
                //        {
                //            if ( !m_Owner.Move( (Direction)(m_Owner.GetDirectionTo( target ) - 4) | Direction.Running ) && OutOfMaxDistance( target ) ) // Too close, move away
                //                TeleportTo( target );
                //        }
                //        else if ( !m_Owner.InRange( target, 2 ) )
                //        {
                //            if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
                //                TeleportTo( target );
                //        }
                //    }
                //}*/

                //10OCT2007 InstaKill for Creatures ONLY *** END   ***
            }
Ejemplo n.º 37
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                m_Owner.Criminal        = false;
                m_Owner.LongTermMurders = 0;
                m_Owner.Stam            = m_Owner.StamMax;

                Mobile target = m_Owner.Focus;

                if (target != null && (target.Deleted || !target.Alive || !m_Owner.CanBeHarmful(target)))
                {
                    m_Owner.Focus = null;
                    Stop();
                    return;
                }
                else if (m_Owner.Weapon is Fists)
                {
                    m_Owner.Kill();
                    Stop();
                    return;
                }

                if (target != null && m_Owner.Combatant != target)
                {
                    m_Owner.Combatant = target;
                }

                if (target == null)
                {
                    Stop();
                }
                else if (Core.UOSP || Core.UOMO)
                {                // <instakill>
                    TeleportTo(target);
                    target.BoltEffect(0);

                    if (target is BaseCreature)
                    {
                        ((BaseCreature)target).NoKillAwards = true;
                    }

                    target.Damage(target.HitsMax, m_Owner);
                    target.Kill();                     // just in case, maybe Damage is overriden on some shard

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

                    m_Owner.Focus = null;
                    Stop();
                }                // </instakill>
                else if (!m_Owner.InRange(target, 20))
                {
                    m_Owner.Focus = null;
                }
                else if ((!m_Owner.InRange(target, 10) || !m_Owner.InLOS(target)) && !PreferMagic())
                {
                    TeleportTo(target);
                }
                else if (!m_Owner.InRange(target, 1) && !PreferMagic())
                {
                    if (!m_Owner.Move(m_Owner.GetDirectionTo(target) | Direction.Running))
                    {
                        TeleportTo(target);
                    }
                }
                else if (!m_Owner.CanSee(target) && DateTime.Now > m_NextRevealChatter)
                {
                    bWasHidden          = true;
                    m_NextRevealChatter = DateTime.Now + TimeSpan.FromMilliseconds(850);
                    switch (Utility.Random(4))
                    {
                    case 0: m_Owner.Say("Reveal yourself!"); break;

                    case 1: m_Owner.Say("Reveal!"); break;

                    case 2: m_Owner.Say("I know you are here somewhere!"); break;

                    case 3: m_Owner.Say("I'll find you!"); break;
                    }
                }
                else if (m_Owner.CanSee(target) && bWasHidden)
                {
                    bWasHidden = false;
                    switch (Utility.Random(4))
                    {
                    case 0: m_Owner.Say("Ah ha! I have found you"); break;

                    case 1: m_Owner.Say("There you are you wretch!"); break;

                    case 2: m_Owner.Say("You can run but you cannot hide."); break;

                    case 3: m_Owner.Say("Gotcha!"); break;
                    }
                }
            }
Ejemplo n.º 38
0
		public override void OnDoubleClick( Mobile from )
		{
			Container pack = from.Backpack;

			if ( pack != null && pack.ConsumeTotal( typeof( CrackRock ), 1 ) )
			{
				from.SendMessage("You O.D. on Crack!");
				from.Kill();
			}
			else
			{
				from.SendMessage(37, "You are out of crack rock!");
			}
		}