Ejemplo n.º 1
0
		public override void BeginInvoke( Player from )
		{
			if ( from.Steed != null && from.Steed.Deleted )
				from.Steed = null;

			if ( from.Steed != null )
			{
				from.Mobile.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You already have a holy steed." );
				return;
			}

			if ( ( from.Mobile.Followers + 1 ) > from.Mobile.FollowersMax )
			{
				from.Mobile.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
				return;
			}

			Mobiles.HolySteed steed = new Mobiles.HolySteed();

			if ( BaseCreature.Summon( steed, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours( 1.0 ) ) )
			{
				from.Steed = steed;

				FinishInvoke( from );
			}
		}
Ejemplo n.º 2
0
		public override void BeginInvoke( Player from )
		{
			if ( from.Familiar != null && from.Familiar.Deleted )
				from.Familiar = null;

			if ( from.Familiar != null )
			{
				from.Mobile.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You already have an unholy familiar." );
				return;
			}

			if ( ( from.Mobile.Followers + 1 ) > from.Mobile.FollowersMax )
			{
				from.Mobile.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature.
				return;
			}

			UnholyFamiliar familiar = new UnholyFamiliar();

			if ( BaseCreature.Summon( familiar, from.Mobile, from.Mobile.Location, 0x217, TimeSpan.FromHours( 1.0 ) ) )
			{
				from.Familiar = familiar;

				FinishInvoke( from );
			}
		}
Ejemplo n.º 3
0
        public StatusGump( Player from )
            : base(200, 200)
        {
            StatusEntry[] entries = new StatusEntry[]
            {
                new StatusEntry("Race", from.Race),
                new StatusEntry("Skills", String.Format("{0}", (from.SkillsTotal / 10).ToString("F1"))),
                new StatusEntry("E.o.C", from.EssenceOfCharacter),
                
                new StatusEntry("bar"),
                
                new StatusEntry("Knockout Counts", from.KOCount),

                new StatusEntry("bar"),

                new StatusEntry("Hunger", String.Format("({0}/20)", from.Hunger )),
                new StatusEntry("Thirst", String.Format("({0}/20)", from.Thirst ))
            };

            AddPage(1);
            AddBackground(0, 0, 255, 330, 9250);
            AddAlphaRegion(15, 15, 225, 300);

            AddButton(225, 15, 3, 4, 0, GumpButtonType.Reply, 0); // X

            AddButton(45, 235, 234, 234, 1, GumpButtonType.Reply, 0);
            AddLabel(57, 295, 1154, "Perks");

            AddButton(150, 235, 229, 229, 2, GumpButtonType.Reply, 0);
            AddLabel(162, 295, 1154, "Skills");

            AddButton(200, 125, 252, 253, 3, GumpButtonType.Reply, 0); //Reduce KO's


            AddLabel(20, 15, 1152, "Character Overview");
            AddBar(40);

            for( int i = 0, y = 50; i < entries.Length; i++ )
            {
                if( entries[i].Prompt == "bar" )
                {
                    y += 5;

                    AddBar(y);

                    y += 10;
                }
                else
                {
                    AddLabel(20, y, LabelHue, entries[i].Prompt + "");
                    AddLabel(160, y, LabelHue, entries[i].Value.ToString());

                    y += 20;
                }
            }
        }
Ejemplo n.º 4
0
 public UnholySteedPower(Player Caster)
     : base(Caster.Mobile, m_Info)
 {
     m_Definition = new PowerDefinition(
         50,
         "Unholy Steed",
         "Xen Yeliab",
         "Summon an unholy steed.",
         20997
         );
     EthicCaster = Caster;
 }
Ejemplo n.º 5
0
 public HolyUnion(Player Caster)
     : base(Caster.Mobile, m_Info)
 {
     m_Definition = new PowerDefinition(
         100,
         "Holy Union",
         "Vingir Yeliab",
         "Expend a moderate amount of life force to resurrect an ally or pet",
         23001
         );
     EthicCaster = Caster;
 }
Ejemplo n.º 6
0
 public SummonFamiliar(Player Caster)
     : base(Caster.Mobile, m_Info)
 {
     m_Definition = new PowerDefinition(
         25,
         "Holy Beast",
         "Xen Vingir",
         "Summon a holy beast to aid you in combat.",
         20491
         );
     EthicCaster = Caster;
 }
Ejemplo n.º 7
0
 public static void BeginJump( Player pm )
 {
     if( !pm.Alive || pm.Frozen || pm.Paralyzed || pm.Stam <= 0 || ( pm.Mounted && (pm.Race != Race.Elemental && !pm.AbilityActive)))
     {
         pm.SendMessage("You cannot jump in your current state.");
     }
     else if( pm.JumpRange == 0 )
     {
         pm.SendMessage("You cannot jump right now!");
     }
     else
     {
         pm.BeginTarget(pm.JumpRange, true, Targeting.TargetFlags.None, OnJumpTarget);
     }
 }
Ejemplo n.º 8
0
        public RespawnGump( Player from, TimeSpan minToRespawn )
            : base(200, 100)
        {
            _from = from;

            Closable = false;

            Timer.DelayCall(TimeSpan.FromMinutes(1), new TimerStateCallback(Resend), Tuple.Create<Player, TimeSpan>(from, (minToRespawn.Subtract(TimeSpan.FromMinutes(1)))));

            AddPage(1);
            AddBackground(0, 0, 245, 190, 9250);

            AddHtml(15, 15, 215, 100, "<Center>You have been knocked out! You must wait here for another adventurer to assist you, or wait to regain consciousness on your own.</Center>", false, false);
            AddHtml(15, 115, 215, 20, String.Format("<Center>Current Knockout Count: {0}</Center>", from.KOCount), false, false);
            AddHtml(15, 155, 215, 20, String.Format("<CENTER>Automatic recovery in {0} minute{1}.</CENTER>", minToRespawn.Minutes, (minToRespawn.Minutes == 1 ? "" : "s")), false, false);
        }
Ejemplo n.º 9
0
        private static bool ConsumeJumpStamina( Player pm, IPoint2D start, IPoint2D end )
        {
            double weightRatio = (pm.TotalWeight / pm.MaxWeight);
            int weightInducedLoss = (int)(5 * weightRatio);

            int dist = Util.DistanceBetween(start, end);
            int toConsume = (int)(dist * 5);
            toConsume += weightInducedLoss;

            if( (pm.Stam - toConsume) <= 0 )
                return false;

            pm.Stam -= toConsume;

            return true;
        }
Ejemplo n.º 10
0
        public static bool ElementalJump( Player pm, IPoint3D p )
        {
            bool isWater = false;

            Map map = pm.Map;
            LandTile land = map.Tiles.GetLandTile(p.X, p.Y);
            StaticTile[] tiles = map.Tiles.GetStaticTiles(p.X, p.Y);

            isWater = (land.Z == p.Z && ((land.ID >= 168 && land.ID <= 171) || (land.ID >= 310 && land.ID <= 311)));

            for (int i = 0; i < tiles.Length; ++i)
            {
                StaticTile tile = tiles[i];
                isWater = (tile.ID >= 0x1796 && tile.ID <= 0x17B2);
            }

            return (pm.Race == Race.Elemental && pm.AbilityActive && isWater);
        }
Ejemplo n.º 11
0
 public StatusGump( Player from )
     : base(200, 200)
 {
     this.AddPage(0);
     this.AddBackground(4, 4, 271, 415, 9260);
     this.AddAlphaRegion(16, 134, 246, 82);
     this.AddAlphaRegion(15, 15, 247, 97);
     this.AddLabel(25, 15, 1410, @"" + from.Name);
     this.AddLabel(60, 85, 1149, @"E.o.C");
     this.AddLabel(60, 60, 1149, @"Skills");
     this.AddLabel(60, 35, 1149, @"Race");
     this.AddLabel(165, 35, 1149, @"" + ((Player)from).Race);
     this.AddLabel(165, 60, 1149, @"" + (int)(from.SkillsTotal / 10));
     this.AddLabel(165, 85, 1149, @"" + ((Player)from).EoC);
     this.AddLabel(65, 140, 1149, @"Strength :");
     this.AddLabel(62, 165, 1149, @"Dexterity :");
     this.AddLabel(55, 190, 1149, @"Intelligence :");
     this.AddLabel(150, 140, 1149, @"" + from.Str);
     this.AddLabel(150, 165, 1149, @"" + from.Dex);
     this.AddLabel(150, 190, 1149, @"" + from.Int);
     this.AddButton(190, 142, 5402, 5402, (int)Buttons.strButton, GumpButtonType.Reply, 0);
     this.AddButton(190, 167, 5402, 5402, (int)Buttons.dexButton, GumpButtonType.Reply, 0);
     this.AddButton(190, 192, 5402, 5402, (int)Buttons.intButton, GumpButtonType.Reply, 0);
     this.AddItem(29, 236, 4088);
     this.AddItem(141, 239, 4155);
     this.AddLabel(71, 236, 1149, String.Format("{0} / 20", from.Thirst));
     this.AddLabel(177, 236, 1149, String.Format("{0} / 20", from.Hunger));
     this.AddAlphaRegion(18, 267, 245, 35);
     this.AddLabel(25, 275, 1149, @"Knockout Counts :");
     this.AddLabel(205, 275, 1149, @"" + ((Player)from).KOCount);
     this.AddButton(240, 274, 252, 253, (int)Buttons.koBtn, GumpButtonType.Reply, 0);
     this.AddButton(50, 320, 234, 234, (int)Buttons.perkBtn, GumpButtonType.Reply, 0);
     this.AddButton(175, 320, 229, 229, (int)Buttons.skillsBtn, GumpButtonType.Reply, 0);
     this.AddLabel(46, 385, 1410, @"Perk Table");
     this.AddLabel(168, 385, 1410, @"Skill Levels");
 }
Ejemplo n.º 12
0
            /// <summary>
            /// ctor
            /// </summary>
            public EoCContext( Player player )
            {
                _mountedSteps = 0;
                _walkingSteps = 0;

                OpenCorpses = new List<Corpse>();
                Player = player;
            }
Ejemplo n.º 13
0
 public CreatureTameStateChangeArgs( Player player, BaseCreature bc, bool tamed )
     : base(player)
 {
     Creature = bc;
     Tamed = tamed;
 }
Ejemplo n.º 14
0
 public override void BeginInvoke(Player from)
 {
     new SummonFamiliar(from).Cast();
 }
Ejemplo n.º 15
0
            public HitsTimer( Player player )
                : base(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10))
            {
                Player = player;

                Priority = TimerPriority.OneSecond;
            }
Ejemplo n.º 16
0
        private static Mobile CreateMobile( Account a )
        {
            if( a.Count >= a.Limit || a.Count >= AccountHandler.ServerLimit )
                return null;

            for( int i = 0; i < a.Length; ++i )
            {
                if( a[i] == null )
                    return (a[i] = new Player());
            }

            return null;
        }
Ejemplo n.º 17
0
 public ItemCraftEventArgs( Player player, bool success, CraftItem item, CraftSystem system )
     : base(player)
 {
     CraftItem = item;
     CraftSystem = system;
     Success = success;
 }
Ejemplo n.º 18
0
        /// <summary>
        /// Completes a perk level upgrade
        /// </summary>
        private void PurchaseUpgrade( Player player, Perk currentPerk, PerkLevel targetLevel )
        {
            if( currentPerk == null )
            {
                player.SendMessage("You have not started on this perk track!");
            }
            else if( targetLevel <= currentPerk.Level )
            {
                player.SendMessage("Your current abilities exceed your selected upgrade.");
            }
            else
            {
                int upgradeCost = GetUpgradeCost(currentPerk.Level, targetLevel);

                if( upgradeCost > player.EssenceOfCharacter )
                {
                    player.SendMessage("You do not have enough Essence of Character to afford this upgrade!");
                }
                else
                {
                    player.EssenceOfCharacter -= upgradeCost;
                    currentPerk.Level = targetLevel;

                    PlayUpgradeEffect(player, currentPerk, targetLevel);
                }
            }
        }
Ejemplo n.º 19
0
 public override void BeginInvoke(Player from)
 {
     new UnholySteedPower(from).Cast();
 }
Ejemplo n.º 20
0
 public PerkOverviewGump( Player from, Page page, Perk perk, PerkLevel displayLevel )
     : this(from, page, perk, displayLevel, PerkLevel.None)
 {
 }
Ejemplo n.º 21
0
        public PerkOverviewGump( Player from, Page page, Perk perk, PerkLevel displayLevel, PerkLevel targetLevel )
            : base(10, 10)
        {
            Player = from;
            Perk = perk;
            CurrentLevel = displayLevel;
            bool hasPerk = Perk.HasPerk(from, perk);

            AddPage(0);

            int bkHeight = 135, bkWidth = 30;

            if( page == Page.Detail )
            {
                if( targetLevel > PerkLevel.None && (!hasPerk || targetLevel != Perk.Get(from, perk).Level) )
                    bkHeight = 475;
                else
                    bkHeight = 415;

                bkWidth = 450;
            }
            else
            {
                int columns = (int)Math.Ceiling((double)Perk.AllPerks.Count / 4);
                int rows = (Perk.AllPerks.Count >= 4 ? 4 : Perk.AllPerks.Count);

                bkHeight += (rows * 70);
                bkWidth += (columns * 105);
            }

            AddBackground(0, 0, bkWidth, bkHeight, 9250);

            switch( page )
            {
                case Page.Overview:
                    AddHtml(15, 15, (bkWidth - 30), 15, Color(Center("Perks Overview"), HtmlWhite), false, false);
                    AddHtml(15, 35, (bkWidth - 30), 70, String.Format("<center>Upgrade your character's Abilities using Essence of Character." +
                                                "<br><br><center>You currently have {0}",
                                                Color(String.Format("{0:N0} Essence of Character", from.EssenceOfCharacter), HtmlBlack)
                                                ), false, true);
                    AddImageTiled(15, 110, (bkWidth - 30), 4, 9151);

                    int x = 20, y = 120;

                    for( int i = 0; i < Perk.AllPerks.Count; i++ )
                    {
                        hasPerk = Perk.HasPerk(from, Perk.AllPerks[i]);

                        if( i > 0 && (i % 4) == 0 )
                        {
                            x += 105;
                            y = 120;
                        }

                        AddBlackAlpha((x - 2), (y + 3), 90, 65);
                        AddLabel(x, y, LabelHue, Perk.AllPerks[i].Label);

                        int perkIcon = Perk.AllPerks[i].GumpID;

                        if( perkIcon == 0 )
                            perkIcon = 21280;

                        AddButton((x + 30), (y + 20), perkIcon, perkIcon, GetButtonId(1, i), GumpButtonType.Reply, 0);
                        AddButton((x + 59), (y + 49), (hasPerk ? 2361 : 2360), (hasPerk ? 2361 : 2360), GetButtonId(1, i), GumpButtonType.Reply, 0);

                        y += 70;
                    }
                    break;
                case Page.Detail:
                    if( perk == null )
                        return;

                    AddHtml(15, 15, (bkWidth - 30), 18, Color(Center(perk.Label), HtmlWhite), false, false);

                    int imgId = perk.GumpID;

                    if( imgId == 0 )
                        imgId = 21280;

                    AddImage(15, 38, imgId);
                    AddHtml(45, 38, (bkWidth - 75), 40, Center(perk.Description), false, false);
                    AddImageTiled(15, 84, (bkWidth - 30), 4, 9151);
                    AddButton(15, 15, 4014, 4015, GetButtonId(2, 0), GumpButtonType.Reply, 0);

                    AddImage(45, 90, 2200);

                    if( displayLevel > PerkLevel.First )
                        AddButton(68, 94, 2205, 2205, GetButtonId(2, 1), GumpButtonType.Reply, 0);

                    if( displayLevel < PerkLevel.Fifth )
                        AddButton(339, 94, 2206, 2206, GetButtonId(2, 2), GumpButtonType.Reply, 0);

                    LabelEntry left = perk.LabelEntries[displayLevel];

                    AddHtml(70, 117, 140, 40, Center(left.Label), false, false);
                    AddHtml(70, 162, 140, 110, Color(left.Description, HtmlBlack), false, true);
                    AddLabel(135, 275, 0, LevelToNumeral(displayLevel));

                    if( displayLevel != PerkLevel.Fifth )
                    {
                        LabelEntry right = perk.LabelEntries[(displayLevel + 1)];

                        AddHtml(230, 117, 140, 40, Center(right.Label), false, false);
                        AddHtml(230, 162, 140, 110, Color(right.Description, HtmlBlack), false, true);
                        AddLabel(295, 275, 0, LevelToNumeral(displayLevel + 1));
                    }

                    string trackProgressLbl = "";

                    if( !hasPerk )
                    {
                        if( Perk.HasFreeSlot(from) )
                        {
                            trackProgressLbl = "You have not started on this perk track.";

                            if( from.EssenceOfCharacter >= Perk.FirstLevelCost )
                            {
                                AddLabel(15, 350, LabelHue, "You can begin developing this perk for 10,000 Essence of Character.");
                                AddButton(205, 380, 4023, 4024, GetButtonId(6, 0), GumpButtonType.Reply, 0);
                                AddLabel(245, 380, LabelHue, String.Format("Begin {0}", perk.Label));
                            }
                            else
                            {
                                AddLabel(15, 350, LabelHue, "You need at least 10,000 Essence of Character to develop a perk.");
                            }
                        }
                        else
                        {
                            trackProgressLbl = "You already have two other perks and cannot begin another track.";
                        }
                    }
                    else
                    {
                        Perk playerPerk = Perk.Get(from, perk);
                        from.ValidateEquipment();

                        if( playerPerk.Level == PerkLevel.Fifth )
                            trackProgressLbl = "You have mastered this perk, congratulations!";
                        else
                            trackProgressLbl = "You are currently progressing on this perk track.";

                        AddLabel(30, 365, LabelHue, "Level:");
                        AddImage(75, 370, 2053); //base progress bar

                        if( targetLevel > PerkLevel.None && targetLevel != playerPerk.Level )
                        {
                            AddImageTiled(75, 370, (4 + GetProgressionDim(targetLevel)), 11, 2057); //yellow progress overlay

                            if( targetLevel == PerkLevel.Fifth )
                            {
                                AddButton(190, 370, 2437, 2438, GetButtonId(4, (int)(targetLevel - 1)), GumpButtonType.Reply, 0);
                                AddLabel(205, 365, LabelHue, "- level");
                            }
                            else
                            {
                                AddButton(190, 360, 2435, 2436, GetButtonId(3, (int)(targetLevel + 1)), GumpButtonType.Reply, 0);
                                AddLabel(205, 355, LabelHue, "+ level");

                                AddButton(190, 380, 2437, 2438, GetButtonId(4, (int)(targetLevel - 1)), GumpButtonType.Reply, 0);
                                AddLabel(205, 375, LabelHue, "- level");
                            }

                            int upgradeCost = GetUpgradeCost(playerPerk.Level, targetLevel);

                            AddLabel(80, 395, LabelHue, "EoC Cost:");
                            AddLabel(155, 395, LabelHue, upgradeCost.ToString("N0"));

                            AddLabel(80, 415, LabelHue, "You have:");
                            AddLabel(155, 415, LabelHue, from.EssenceOfCharacter.ToString("N0"));

                            AddLabel(80, 435, LabelHue, "Remainder:");
                            AddLabel(155, 435, (upgradeCost > from.EssenceOfCharacter ? 32 : 1154), (from.EssenceOfCharacter - upgradeCost).ToString("N0"));

                            if( upgradeCost <= from.EssenceOfCharacter )
                            {
                                AddLabel(285, 440, LabelHue, "Purchase Upgrade");
                                AddButton(405, 440, 4023, 4024, GetButtonId(5, (int)targetLevel), GumpButtonType.Reply, 0);
                            }
                        }
                        else if( playerPerk.Level != PerkLevel.Fifth )
                        {
                            AddButton(190, 370, 2435, 2436, GetButtonId(3, (int)(playerPerk.Level + 1)), GumpButtonType.Reply, 0);
                            AddLabel(205, 365, LabelHue, "+ level");
                        }

                        int progress = GetProgressionDim(playerPerk.Level);

                        AddLabel((75 + progress), 350, LabelHue, ((int)playerPerk.Level).ToString()); //progress level indicator
                        AddImageTiled(75, 370, (4 + progress), 11, 2054); //blue progress overlay
                        AddImage((75 + progress), 370, 2104); //progress pin
                    }

                    AddLabel(15, 330, LabelHue, trackProgressLbl);
                    break;
            }
        }
Ejemplo n.º 22
0
 public CreatureKilledEventArgs( Player player, BaseCreature bc )
     : base(player)
 {
     Creature = bc;
 }
Ejemplo n.º 23
0
 /// <summary>
 /// ctor
 /// </summary>
 public Acrobat( Player player )
     : base(player)
 {
 }
Ejemplo n.º 24
0
 /// <summary>
 /// ctor
 /// </summary>
 public EoCLedger( Player pl )
 {
     Player = pl;
     Expenditures = new Stack<EoCExpenditure>();
 }
Ejemplo n.º 25
0
 /// <summary>
 /// ctor
 /// </summary>
 public Scout( Player player )
     : base(player)
 {
 }
Ejemplo n.º 26
0
        /// <summary>
        /// Plays a special effect for upgrading a perk level
        /// </summary>
        private void PlayUpgradeEffect( Player player, Perk perk, PerkLevel newLevel )
        {
            Effects.SendMovingEffect(new Entity(Server.Serial.Zero, new Point3D(player.Location, player.Z + 20), player.Map), player, 0x373A, 10, 10, false, false);
            Effects.SendTargetEffect(player, 0x3779, 10, 10);
            player.PlaySound(0x0F8);

            if( newLevel == PerkLevel.First )
            {
                player.SendMessage("You have unlocked the first level of the {0} perk!", perk.Label);
            }
            else
            {
                player.SendMessage("You have upgraded {0} to the {1} level!", perk.Label, newLevel);
            }
        }
Ejemplo n.º 27
0
 public override void BeginInvoke(Player from)
 {
     new HolyUnion(from).Cast();
 }
Ejemplo n.º 28
0
 /// <summary>
 /// ctor
 /// </summary>
 public Adventurer( Player player )
     : base(player)
 {
 }
Ejemplo n.º 29
0
 public PerkOverviewGump( Player from )
     : this(from, Page.Overview, null, PerkLevel.First)
 {
 }
Ejemplo n.º 30
0
 public CorpseActionEventArgs( Player player, Corpse c, CorpseAction action )
     : base(player)
 {
     Action = action;
     Corpse = c;
 }