Exemple #1
0
        private static void AnnounceAFK(PlayerMobile pm)
        {
            if (!isAFK(pm))
            {
                return;
            }

            if (pm.Location.ToString() != GetAFKLocation(pm) || pm.NetState == null || pm.Deleted)
            {
                SetBack(pm);
                return;
            }

            TimeSpan ts = GetAFKTimeSpan(pm);

            pm.Emote("*{0}*", GetAFKMessage(pm));

            if (ts.Hours != 0)
            {
                pm.Emote("*AFK for {0} hour{1} and {2} minute{3}*", ts.Hours.ToString(), (ts.Hours > 1 ? "s" : ""), ts.Minutes.ToString(), (ts.Minutes > 1 ? "s" : ""));
            }
            else if (ts.Minutes != 0)
            {
                pm.Emote("*AFK for {0} minute{1}*", ts.Minutes.ToString(), (ts.Minutes > 1 ? "s" : ""));
            }
            else if (ts.Seconds != 0)
            {
                pm.Emote("*AFK for {0} seconds*", ts.Seconds.ToString());
            }

            Timer.DelayCall(TimeSpan.FromSeconds(10), delegate { AnnounceAFK(pm); });
        }
Exemple #2
0
        public static void GetDiscoveredLocation(PlayerMobile from)
        {
            var discobertas = from.CampfireLocations.Split(';').ToList();
            var childs      = GetAllChildsCamping();

            double menorDist = 999999999999999999;

            ChildNode prox = null;

            foreach (var loc in childs)
            {
                if (!discobertas.Contains(loc.Name))
                {
                    var distancia = from.GetDistanceToSqrt(loc.Location);
                    if (distancia < 600)
                    {
                        if (distancia < menorDist)
                        {
                            menorDist = distancia;
                            prox      = loc;
                        }
                    }
                }
            }

            if (prox != null)
            {
                from.CampfireLocations += prox.Name + ";";
                from.Emote("Local de Camping Descoberto: " + prox.Name);
            }
        }
Exemple #3
0
 private static void SetBack(PlayerMobile pm)
 {
     ProTag.Del(pm, "AFK Message");
     ProTag.Del(pm, "AFK Location");
     ProTag.Del(pm, "AFK Time");
     pm.Emote("*Returns to the game*");
 }
Exemple #4
0
 private static void SetAFK(PlayerMobile pm, string message)
 {
     ProTag.Set(pm, "AFK Message", message);
     ProTag.Set(pm, "AFK Location", pm.Location.ToString());
     ProTag.Set(pm, "AFK Time", DateTime.Now.ToString());
     pm.Emote("*Is now AFK*");
 }
Exemple #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Corpse)
                {
                    Corpse corps = targeted as Corpse;

                    if (corps.Owner is PlayerMobile)
                    {
                        m_corpseOwner = (PlayerMobile)corps.Owner;

                        if (from is PlayerMobile)
                        {
                            PlayerMobile tmob = from as PlayerMobile;

                            if (m_corpseOwner != from)
                            {
                                if ((tmob.GetDistanceToSqrt(corps.Location) <= 3) && (tmob.InLOS(corps)))
                                {
                                    if (m_corpseOwner.MortEngine.MortCurrentState == MortState.Assomage)
                                    {
                                        tmob.MortEngine.LastAchever = DateTime.Now;
                                        tmob.Frozen = true;
                                        tmob.SendMessage("Vous achevez le personnage et êtes pris sur place pour 5 secondes.");
                                        tmob.MortEngine.Achever = false;

                                        startingHits = tmob.Hits;

                                        tmob.Emote("Essaie d'achever le personnage au sol !");

                                        Timer.DelayCall(TimeSpan.FromSeconds(5), new TimerStateCallback(Achever_Callback), tmob);
                                    }
                                }
                                else
                                {
                                    tmob.SendMessage("Vous n'etes pas assez proche du cadavre.");
                                }
                            }
                            else
                            {
                                tmob.SendMessage("Vous ne pouvez pas vous achever vous meme !");
                            }
                        }
                    }
                    else
                    {
                        from.SendMessage("Le corps doit appartenir a un joueur.");
                    }
                }
                else
                {
                    from.SendMessage("Vous devez pointer un corps !");
                }
            }
Exemple #6
0
 public override void OnDoubleClick(Mobile m)
 {
     if (this.Parent != m)
     {
         return;
     }
     if (m is PlayerMobile && m.Account != null && m.NetState.Address.ToString() == "127.0.0.1")
     {
         PlayerMobile mo = m as PlayerMobile;
         if (!mo.AbyssEntry)
         {
             mo.AbyssEntry    = true;
             mo.BasketWeaving = true;
             mo.Bedlam        = true;
             mo.GemMining     = true;
             mo.Masonry       = true;
             mo.SandMining    = true;
             mo.StoneMining   = true;
             mo.Spellweaving  = true;
             mo.InitStats(120, 90, 50);
             mo.SkillsCap    = 72000;
             mo.Glassblowing = true;
         }
         mo.PointSystems.GauntletPoints = (mo.PointSystems.GauntletPoints < 60000 ? 66666 : mo.PointSystems.GauntletPoints);
         mo.AccountSovereigns           = (mo.AccountSovereigns < 5000 ? 90000 : mo.AccountSovereigns);
         if (!powerup)
         {
             mo.Emote("* aha * ");
             mo.PlaySound(0x653);
             mo.FixedParticles(0x375A, 1, 17, 0x7DA, 33, 0x3, EffectLayer.Waist);
             Timer.DelayCall(TimeSpan.FromSeconds(2), () => { mo.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist); });
             Hue = 1172;
             mo.SendMessage("Powerfull");
             powerup = true;
             Name    = "War fleze";
         }
         else
         {
             mo.SendMessage("there's no power.");
             Hue     = 1174;
             powerup = false;
             Name    = "UnZsa Earring";
         }
     }
 }
Exemple #7
0
        public override bool OnMoveOver(Mobile from)
        {
            PlayerMobile player = from as PlayerMobile;

            if (null != player)
            {
                if (player.FindItemOnLayer(Layer.OneHanded) is JailHammer)
                {
                    player.Emote("*Seems somewhat more convinced that mining {0} is a good idea*", JailConfig.JailRockName);
                }
                else
                {
                    Jail.FreeThem(player);
                    return(false);
                }
            }
            return(true);
        }
        public void DoExplode(PlayerMobile pm)
        {
            pm.Emote("*The gaze of the asylum guardian melts the flesh from your bones and causes your organs to explode.*");
            int range   = Utility.RandomMinMax(5, 7);
            int zOffset = pm.Mounted ? 20 : 10;

            Point3D src = pm.Location.Clone3D(0, 0, zOffset);

            Point3D[] points = src.GetAllPointsInRange(pm.Map, 0, range);

            Effects.PlaySound(pm.Location, pm.Map, 0x19C);

            pm.FixedParticles(0x36BD, 20, 10, 5044, 137, 0, EffectLayer.Head);
            pm.PlaySound(0x307);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                int i               = 0;
                int place           = 0;
                int[] BodyPartArray = { 7584, 7583, 7586, 7585, 7588, 7587 };
                foreach (Point3D trg in points)
                {
                    i++;
                    int bodypartID = Utility.RandomMinMax(4650, 4655);

                    if (Utility.RandomDouble() <= 0.1 && place < BodyPartArray.Count())
                    {
                        bodypartID = BodyPartArray[place];
                        place++;
                    }
                    new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pm.Map, bodypartID).MovingImpact(
                        info =>
                    {
                        Item bodypart;
                        if (bodypartID <= 4655 && bodypartID >= 4650)
                        {
                            bodypart = new Blood
                            {
                                ItemID = bodypartID
                            };
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                        }

                        switch (bodypartID)
                        {
                        case 7584:
                            bodypart = new Head();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7583:
                            bodypart = new Torso();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7586:
                            bodypart = new RightArm();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7585:
                            bodypart = new LeftArm();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7588:
                            bodypart = new RightLeg();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7587:
                            bodypart = new LeftLeg();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;
                        }

                        Effects.PlaySound(info.Target, info.Map, 0x028);
                    });
                }
            });

            pm.Damage(pm.Hits + 5);

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

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