Inheritance: Mobile, IHonorTarget
Exemplo n.º 1
0
		public StatBallGump( PlayerMobile from, StatBall ball ): base( 50, 50 )
		{
			m_From = from;
			m_Ball = ball;
			
			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;
			this.AddPage(0);
			this.AddBackground(50, 50, 437, 215, 2620);
			this.AddLabel(200, 67, 1160, "Stat Ball Selection");
			this.AddLabel(114, 96, 1160, "Choose your Strength, Dexterity, and Intelligence");
			this.AddLabel(84, 156, 1152, "STR");
			this.AddLabel(228, 156, 1152, "DEX");
			this.AddLabel(368, 156, 1152, "INT");
			this.AddTextEntry(134, 156, 50, 20, 1359, 0, "50");
			this.AddTextEntry(278, 156, 50, 20, 1359, 1, "50");
			this.AddTextEntry(411, 156, 50, 20, 1359, 2, "50");
			this.AddButton(405, 221, 238, 240, 4, GumpButtonType.Reply, 0);
			
//  Swap these comment lines if using custom Cap variable.  Then set the number in the gump display here
//  Remember to comment out ALL 3 lines, and uncomment the 1 line.
//			this.AddLabel(114, 200, 1152, "* Stat totals should equal ");
//			this.AddLabel(282, 200, 1152, m_From.StatCap.ToString() );
//			this.AddLabel(313, 200, 1152, "*");
			this.AddLabel(114, 200, 1152, "* Stat totals should equal 200 *");
			this.AddLabel(110, 215, 1152, "* Minium 10 points in each stat *");
		}
Exemplo n.º 2
0
        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            QuestSystem qs = player.Quest;

            if ( qs is CollectorQuest )
            {
                Direction = GetDirectionTo( player );

                QuestObjective obj = qs.FindObjective( typeof( FindGabrielObjective ) );

                if ( obj != null && !obj.Completed )
                {
                    obj.Complete();
                }
                else if ( qs.IsObjectiveInProgress( typeof( FindSheetMusicObjective ) ) )
                {
                    qs.AddConversation( new GabrielNoSheetMusicConversation() );
                }
                else
                {
                    obj = qs.FindObjective( typeof( ReturnSheetMusicObjective ) );

                    if ( obj != null && !obj.Completed )
                    {
                        obj.Complete();
                    }
                    else if ( qs.IsObjectiveInProgress( typeof( ReturnAutographObjective ) ) )
                    {
                        qs.AddConversation( new GabrielIgnoreConversation() );
                    }
                }
            }
        }
Exemplo n.º 3
0
		public virtual void TeleportToEjectLocation(PlayerMobile pm)
		{
			if (pm != null && !pm.Deleted && !Options.Locations.Eject.Zero && !Options.Locations.Eject.Internal)
			{
				Teleport(pm, Options.Locations.Eject, Options.Locations.Eject);
			}
		}
Exemplo n.º 4
0
        public BushidoMaster2()
            : base(AIType.AI_None, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name = "Lee";
            Title = ", Le Combattant";
            Direction = Direction.South;

            Body = 400;
            Hue = 33825;
            Blessed = true;

            InitStats(25, 25, 25);
            SetHits(5);

            SpeechHue = 802;
            EmoteHue = 802;

            Backpack bp = new Backpack();
            bp.Movable = false;
            AddItem(bp);
            AddItem(new LeatherDo());
            AddItem(new LeatherHaidate());
            AddItem(new LeatherHiroSode());
            AddItem(new LeatherJingasa());
            Boots b = new Boots();
            b.Hue = 1527;
            AddItem(b);
            this.HairItemID = 8253;
            this.HairHue = 1129;
            QuestPlayer = null;
        }
Exemplo n.º 5
0
		public virtual void Enqueue(PlayerMobile pm, PvPTeam team = null, bool party = true)
		{
			if (pm == null || pm.Deleted)
			{
				return;
			}

			if (!CanQueue(pm))
			{
				OnQueueReject(pm);
				return;
			}

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

			if (!IsQueued(pm))
			{
				Queue.Add(pm, team);
				OnQueueJoin(pm, team);
			}
			else
			{
				Queue[pm] = team;
				OnQueueUpdate(pm, team);
			}

			if (party)
			{
				EnqueueParty(pm, Party.Get(pm), team);
			}
		}
Exemplo n.º 6
0
 public override int GetAutoTalkRange( PlayerMobile m )
 {
     if ( m.Quest == null )
         return 3;
     else
         return -1;
 }
Exemplo n.º 7
0
		public MLQuestInstance( MLQuest quest, IQuestGiver quester, PlayerMobile player )
		{
			m_Quest = quest;

			m_Quester = quester;
			m_QuesterType = ( quester == null ) ? null : quester.GetType();
			m_Player = player;

			m_Accepted = DateTime.UtcNow;
			m_Flags = MLQuestInstanceFlags.None;

			m_ObjectiveInstances = new BaseObjectiveInstance[quest.Objectives.Count];

			BaseObjectiveInstance obj;
			bool timed = false;

			for ( int i = 0; i < quest.Objectives.Count; ++i )
			{
				m_ObjectiveInstances[i] = obj = quest.Objectives[i].CreateInstance( this );

				if ( obj.IsTimed )
					timed = true;
			}

			Register();

			if ( timed )
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), Slice );
		}
		public NavigationGump( PlayerMobile from ) : base( 40, 40 )
		{
			from.CloseGump( typeof( NavigationGump ) ); 
			m_From = from;

			AddPage( 0 );
			AddBackground( 0, 0, 140, 155, 83 );//5054 83
			AddImageTiled(8, 9, 126, 135, 1416);
			AddAlphaRegion(8, 9, 126, 135);

		AddButton( 20, 124, 0x15E6, 0x15E6, 1, GumpButtonType.Reply, 0 );//Drop 0x985
		AddLabel( 50, 120, 0x34, "Anchor" );

		AddButton( 107, 124, 0x15E0, 0x15E0, 2, GumpButtonType.Reply, 0 );//Raise 0x983

		AddButton( 60, 10, 0x26AC, 0x26AC, 3, GumpButtonType.Reply, 0 ); //Forward
		AddButton( 60, 90, 0x26B2, 0x26B2, 4, GumpButtonType.Reply, 0 ); //Back
		AddButton( 20, 50, 0x26B5, 0x26B5, 5, GumpButtonType.Reply, 0 ); //Left
		AddButton( 100, 50, 0x26AF, 0x26AF, 6, GumpButtonType.Reply, 0 ); //Right
		AddButton( 62, 53, 0x2C93, 0x2C93, 7, GumpButtonType.Reply, 0 ); //Stop

		AddButton( 20, 90, 0x5786, 0x5786, 8, GumpButtonType.Reply, 0 ); //TurnLeft
		//AddLabel( 55, 125, 0x34, "Turn" );
		AddButton( 100, 90, 0x5781, 0x5781, 9, GumpButtonType.Reply, 0 ); //TurnRight
		AddButton( 62, 31, 0x2621, 0x2621, 10, GumpButtonType.Reply, 0 ); //OneForward
		AddButton( 62, 73, 0x2625, 0x2625, 11, GumpButtonType.Reply, 0 ); //OneBack
		AddButton( 40, 52, 0x2627, 0x2627, 12, GumpButtonType.Reply, 0 ); //OneLeft
		AddButton( 83, 52, 0x2623, 0x2623, 13, GumpButtonType.Reply, 0 ); //OneRight

		AddButton( 39, 29, 0x24C0, 0x24C0, 14, GumpButtonType.Reply, 0 ); //LeftForward 0x13F4
		AddButton( 92, 29, 0x24BE, 0x24BE, 15, GumpButtonType.Reply, 0 ); //RightForward 0x13F2
		}
Exemplo n.º 9
0
		public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
		{
			if ( m == null )
			{
			}
			else if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
			{
				m.SendLocalizedMessage( 500446 ); // That is too far away.
			}
			else if ( m.Alive )
			{
				m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
			}
			else if ( m.AnkhNextUse > DateTime.UtcNow )
			{			
				TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;

				if ( delay.TotalMinutes > 0 )
					m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
				else
					m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.		
			}
			else
			{
				m.CloseGump( typeof( AnkhResurrectGump ) );
				m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
			}
		}
Exemplo n.º 10
0
		public SummonedPaladin( PlayerMobile necromancer ) : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			m_Necromancer = necromancer;

			InitStats( 45, 30, 5 );
			Title = "the Paladin";

			Hue = 0x83F3;

			Female = false;
			Body = 0x190;
			Name = NameList.RandomName( "male" );

			Utility.AssignRandomHair( this );
			Utility.AssignRandomFacialHair( this, false );

			FacialHairHue = HairHue;

			AddItem( new Boots( 0x1 ) );
			AddItem( new ChainChest() );
			AddItem( new ChainLegs() );
			AddItem( new RingmailArms() );
			AddItem( new PlateHelm() );
			AddItem( new PlateGloves() );
			AddItem( new PlateGorget() );

			AddItem( new Cloak( 0xCF ) );

			AddItem( new ThinLongsword() );

			SetSkill( SkillName.Swords, 50.0 );
			SetSkill( SkillName.Tactics, 50.0 );

			PackGold( 500 );
		}
Exemplo n.º 11
0
        //private string m_PieceName = "None";
        //private int m_PiecePage = 1;
        //private BaseIngot m_Ingot;
        public BStartGump(PlayerMobile crafter, BlackSmithingCraftState craftstate, BaseTool tool, BStartContext context)
            : base(0, 0)
        {
            m_CraftState = craftstate;
            m_Crafter = crafter;
            m_Tool = tool;

            if (context == null)
                m_Context = new BStartContext();
            else
                m_Context = context;

            this.Closable = true;
            this.Disposable = false;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);

            InitialSetUp();

            if (m_Context.Ingot != null)
                AddResourceImage(m_Context.Ingot);

            switch (m_Context.Page)
            {
                case 1: InitialPiecePage(); break;
                case 2: ArmorPiecePage(); break;
                case 3: WeaponPiecePage(); break;
                case 4: AttackPiecePage(); break;
                case 5: HiltsPage(); break;
                //case 6: EmbellishmentsPage(); break;
            }
        }
Exemplo n.º 12
0
		public static void FixPlayer( PlayerMobile mob )
		{
			if ( mob != null )
			{
				Server.Skills skills = mob.Skills;

				int totalDecrease = 0;

				for ( int i = 0; i < skills.Length; i++ )
				{
					Skill skill = skills[i];

					if ( skill.CapFixedPoint > 1000 )
						skill.CapFixedPoint = 1000;

					if ( skill.BaseFixedPoint > 1000 )
					{
						totalDecrease += skill.BaseFixedPoint - 1000;
						skill.BaseFixedPoint = 1000;
					}
				}

				mob.SkillsCap = 7000;

				int totalGiveSkill = Math.Min( totalDecrease, 7000 - skills.Total );

				if ( totalGiveSkill > 0 )
				{
					EtherealSoulStone stone = new EtherealSoulStone( mob.Account.Username );
					stone.SkillValue = (totalGiveSkill / 10.0);
					mob.AddToBackpack( stone );
				}
			}
		}
Exemplo n.º 13
0
		public NotifyGump(PlayerMobile user, string html)
			: base(user, null, 0, 120)
		{
			AnimDuration = DefaultAnimDuration;
			PauseDuration = DefaultPauseDuration;

			Html = html ?? String.Empty;
			HtmlColor = Color.White;
			HtmlIndent = 10;

			BorderSize = 4;
			BorderID = 9204;
			BorderAlpha = false;

			BackgroundID = 2624;
			BackgroundAlpha = true;

			AutoClose = true;

			Frame = 0;
			State = AnimState.Pause;

			CanMove = false;
			CanResize = false;

			ForceRecompile = true;
			AutoRefreshRate = TimeSpan.FromMilliseconds(100.0);
			AutoRefresh = true;

			var sMin = GetSizeMin();
			var sMax = GetSizeMax();

			WidthMax = Math.Max(sMin.Width, Math.Min(sMax.Width, 250));
			HeightMax = Math.Max(sMin.Height, Math.Min(sMax.Height, 30));
		}
Exemplo n.º 14
0
 public GuildAdvancedSearchGump(PlayerMobile pm, Guild g, GuildDisplayType display, SearchSelectionCallback callback)
     : base(pm, g)
 {
     this.m_Callback = callback;
     this.m_Display = display;
     this.PopulateGump();
 }
Exemplo n.º 15
0
		public RegsGump ( Mobile from ) : base ( 40, 40 )
		{
			m_From = from as PlayerMobile;
			
			m_From.CloseGump( typeof( RegsGump ) );
			
			Container backpack = m_From.Backpack;
			
			AddPage( 0 );
			AddBackground( 0, 0, 440, 270, 5054 );
			AddBlackAlpha( 10, 10, 420, 25 );
			AddBlackAlpha( 10, 45, 200, 215 );
			AddBlackAlpha( 220, 45, 200, 215 );
			
			AddLabel( 155, 14, 0x384, "Réactifs" );
			AddLabel( 100, 50, 0x284, "Mages" );
			AddLabel( 295, 50, 0x284, "Necros" );
			
			for( int i = 0; i < m_Types_Mage.Length; i++ )
			{
				nb = backpack.GetAmount( m_Types_Mage[i] );
				
				AddItem( 15, 70 + (i * 20), m_Img_Mage[i] );
				AddLabelCropped( 55, 70 + (i * 20) , 150, 21, 0x384, m_Txt_Mage[i] + " :" );
				AddLabelCropped( 183, 70 + (i * 20) , 46, 21, 0x284, nb.ToString() );
			}
			for( int i = 0; i < m_Types_Necro.Length; i++ )
			{
				nb = backpack.GetAmount( m_Types_Necro[i] );
				
				AddItem( 225, 70 + (i * 22), m_Img_Necro[i] );
				AddLabelCropped( 265, 70 + (i * 20) , 150, 21, 0x384, m_Txt_Necro[i] + " :" );
				AddLabelCropped( 395, 70 + (i * 20) , 46, 21, 0x284, nb.ToString() );
			}
		}
Exemplo n.º 16
0
        public JoinStoneGump(PlayerMobile from, Faction faction)
            : base(20, 30)
        {
            this.m_From = from;
            this.m_Faction = faction;

            this.AddPage(0);

            this.AddBackground(0, 0, 550, 440, 5054);
            this.AddBackground(10, 10, 530, 420, 3000);

            this.AddHtmlText(20, 30, 510, 20, faction.Definition.Header, false, false);
            this.AddHtmlText(20, 130, 510, 100, faction.Definition.About, true, true);

            this.AddHtmlLocalized(20, 60, 100, 20, 1011429, false, false); // Led By :
            this.AddHtml(125, 60, 200, 20, faction.Commander != null ? faction.Commander.Name : "Nobody", false, false);

            this.AddHtmlLocalized(20, 80, 100, 20, 1011457, false, false); // Tithe rate :
            if (faction.Tithe >= 0 && faction.Tithe <= 100 && (faction.Tithe % 10) == 0)
                this.AddHtmlLocalized(125, 80, 350, 20, 1011480 + (faction.Tithe / 10), false, false);
            else
                this.AddHtml(125, 80, 350, 20, faction.Tithe + "%", false, false);

            this.AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(55, 400, 200, 20, 1011425, false, false); // JOIN THIS FACTION

            this.AddButton(300, 400, 4005, 4007, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(335, 400, 200, 20, 1011012, false, false); // CANCEL
        }
Exemplo n.º 17
0
 public ChosenDeityGump( PlayerMobile from )
     : base(0, 0)
 {
     this.Closable=true;
     this.Disposable=true;
     this.Dragable=true;
     this.Resizable=false;
     from.CloseGump( typeof(ChosenDeityGump) );
     AddPage( 0 );
     AddBackground( 42, 23, 202, 331, 9270 );
     AddBackground( 58, 39, 169, 298, 3500 );
     AddLabel( 101, 51, 2010, @"Patron Deity" );
     AddButton( 72, 81, (from.ChosenDeity == ChosenDeity.Arianthynt ? 9723 : 9720), 9722, (int)Buttons.Arianthynt, GumpButtonType.Reply, 0 );
     AddButton( 72, 116, (from.ChosenDeity == ChosenDeity.Xipotec ? 9723 : 9720), 9722, (int)Buttons.Xipotec, GumpButtonType.Reply, 0 );
     AddButton( 72, 151, (from.ChosenDeity == ChosenDeity.Mahtet ? 9723 : 9720), 9722, (int)Buttons.Mahtet, GumpButtonType.Reply, 0 );
     AddButton( 72, 186, (from.ChosenDeity == ChosenDeity.Xorgoth ? 9723 : 9720), 9722, (int)Buttons.Xorgoth, GumpButtonType.Reply, 0 );
     AddButton( 72, 221, (from.ChosenDeity == ChosenDeity.Ohlm ? 9723 : 9720), 9722, (int)Buttons.Ohlm, GumpButtonType.Reply, 0 );
     AddButton( 72, 256, (from.ChosenDeity == ChosenDeity.Elysia ? 9723 : 9720), 9722, (int)Buttons.Elysia, GumpButtonType.Reply, 0 );
     AddButton( 72, 291, (from.ChosenDeity == ChosenDeity.None ? 9723 : 9720), 9722, (int)Buttons.None, GumpButtonType.Reply, 0 );
     AddLabel( 107, 86, 0, @"Arianthynt" );
     AddLabel( 107, 121, 0, @"Xipotec" );
     AddLabel( 107, 156, 0, @"Mah'tet" );
     AddLabel( 107, 191, 0, @"Xorgoth" );
     AddLabel( 107, 226, 0, @"Ohlm" );
     AddLabel( 107, 261, 0, @"Elysia" );
     AddLabel( 107, 296, 0, @"None for now" );
 }
Exemplo n.º 18
0
		private static void InvokeRegistered(PlayerMobile pm)
		{
			if (OnRegistered != null)
			{
				OnRegistered(pm);
			}
		}
Exemplo n.º 19
0
        public static PlayerEventScoreProfile EnsureProfile(PlayerMobile pm)
        {
            PlayerEventScoreProfile p;

            var account = pm.Account as Account;

            if (account == null)
            {
                Console.WriteLine("NULL ACCOUNT?!");
                return null;
            }

            if (!PlayerProfiles.TryGetValue(pm, out p))
            {
                foreach (PlayerMobile mobile in account.Mobiles.OfType<PlayerMobile>())
                {
                    if (PlayerProfiles.TryGetValue(mobile, out p))
                    {
                        break;
                    }
                }
                if (p == null)
                {
                    PlayerProfiles.Add(pm, p = new PlayerEventScoreProfile(pm));
                }
            }
            else if (p == null)
            {
                PlayerProfiles[pm] = p = new PlayerEventScoreProfile(pm);
            }

            return p;
        }
Exemplo n.º 20
0
        public static int HasFeat( PlayerMobile owner, BaseBreedableCreature creat )
        {
            if( creat is Dog )
                return owner.Feats.GetFeatLevel(FeatList.DogBreeding);

            if( creat is Wolf )
                return owner.Feats.GetFeatLevel(FeatList.WolfBreeding);

            if( creat is Horse || creat is WorkHorse )
                return owner.Feats.GetFeatLevel(FeatList.HorseBreeding);

            if( creat is IRacialMount && owner.Feats.GetFeatLevel(FeatList.RacialMounts) > 0 )
                return owner.Feats.GetFeatLevel(FeatList.RacialMounts);

            if( creat is Serpent )
                return owner.Feats.GetFeatLevel(FeatList.Snakecharmer);

            if (creat is Bear)
                return owner.Feats.GetFeatLevel(FeatList.Beartalker);

            if (creat is BirdOfPrey)
                return owner.Feats.GetFeatLevel(FeatList.AvianBreeding);

            return 0;
        }
Exemplo n.º 21
0
		private static void EmbraceHonor( PlayerMobile pm )
		{
			if ( pm.HonorActive )
			{
				pm.SendLocalizedMessage( 1063230 ); // You must wait awhile before you can embrace honor again.
				return;
			}

			if ( GetHonorDuration( pm ) == 0 )
			{
				pm.SendLocalizedMessage( 1063234 ); // You do not have enough honor to do that
				return;
			}

			TimeSpan waitTime = DateTime.UtcNow - pm.LastHonorUse;
			if ( waitTime < UseDelay )
			{
				TimeSpan remainingTime = UseDelay - waitTime;
				int remainingMinutes = (int) Math.Ceiling( remainingTime.TotalMinutes );

				pm.SendLocalizedMessage( 1063240, remainingMinutes.ToString() ); // You must wait ~1_HONOR_WAIT~ minutes before embracing honor again
				return;
			}
			
			pm.SendGump( new HonorSelf( pm ) );
			
		}
Exemplo n.º 22
0
        private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
        {
            if (from != target && CanUseWeapon(from, weapon) && from.CanBeHarmful(target))
            {
                if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
                {
                    from.NinjaWepCooldown = true;

                    from.Direction = from.GetDirectionTo(target);

                    from.RevealingAction();

                    weapon.AttackAnimation(from, target);

                    ConsumeUse(weapon);

                    if (CombatCheck(from, target))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback<object[]>(OnHit), new object[] { from, target, weapon });
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback<PlayerMobile>(ResetUsing), from);
                }
                else
                {
                    from.SendLocalizedMessage(1063303); // Your target is too close!
                }
            }
        }
Exemplo n.º 23
0
 public static void AttemptShoot(PlayerMobile from, INinjaWeapon weapon)
 {
     if (CanUseWeapon(from, weapon))
     {
         from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, new TargetStateCallback<INinjaWeapon>(OnTarget), weapon);
     }
 }
Exemplo n.º 24
0
        public HorseBreederGump( PlayerMobile from, Faction faction )
            : base(20, 30)
        {
            m_From = from;
            m_Faction = faction;

            AddPage( 0 );

            AddBackground( 0, 0, 320, 280, 5054 );
            AddBackground( 10, 10, 300, 260, 3000 );

            AddHtmlText( 20, 30, 300, 25, faction.Definition.Header, false, false );

            AddHtmlLocalized( 20, 60, 300, 25, 1018306, false, false ); // Purchase a Faction War Horse
            AddItem( 70, 120, 0x3FFE );

            AddItem( 150, 120, 0xEF2 );
            AddLabel( 190, 122, 0x3E3, FactionWarHorse.SilverPrice.ToString( "N0" ) ); // NOTE: Added 'N0'

            AddItem( 150, 150, 0xEEF );
            AddLabel( 190, 152, 0x3E3, FactionWarHorse.GoldPrice.ToString( "N0" ) ); // NOTE: Added 'N0'

            AddHtmlLocalized( 55, 210, 200, 25, 1011011, false, false ); // CONTINUE
            AddButton( 20, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 240, 200, 25, 1011012, false, false ); // CANCEL
            AddButton( 20, 240, 4005, 4007, 0, GumpButtonType.Reply, 0 );
        }
Exemplo n.º 25
0
		public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
		{
			BaseHouse ankhhouse = BaseHouse.FindHouseAt( ankh );

			if ( m != null && ankhhouse != null && ankhhouse.IsFriend( m ) )
			{
				if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
					m.SendLocalizedMessage( 500446 ); // That is too far away.
				else if ( m.Alive )
					m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
				else if ( m.AnkhNextUse > DateTime.UtcNow )
				{
					TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;

					if ( delay.TotalMinutes > 0 )
						m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
					else
						m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
				}
				else
				{
					m.CloseGump( typeof( AnkhResurrectGump ) );
					/*PlayerMobile pres = m as PlayerMobile;

					if (pres.MurderBounty > 0)
						m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
					else*/
						m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
				}
			}
		}
Exemplo n.º 26
0
		private static void InvokeUserBanned(WorldChatChannel channel, PlayerMobile user)
		{
			if (OnUserBanned != null)
			{
				OnUserBanned(channel, user);
			}
		}
		public PetSummonGump( PlayerMobile user, PetSummonBall ball ) : base( 20, 30 )
		{
			m_Mobile = user;
			m_PetSummonBall = ball;

			Dragable = true;

			AddPage( 0 );
			AddBackground( 0, 0, 200, 315, 2520 );

			ArrayList pets = GetPetList( m_Mobile );

			AddHtml( 30, 20, 180, 30, "", false, false );
			AddHtml( 30, 35, 180, 30, "IMPORTANT!", false, false );
			AddHtml( 30, 50, 180, 30, "Cost: 75,000 gold.", false, false );
			AddHtml( 30, 65, 180, 30, "Pets lose 10% skills.", false, false );
			AddHtml( 30, 75, 180, 30, "", false, false );

			for ( int i = 0; i < pets.Count; i++ )
			{
				AddButton( 30, 95 + 30 * i, 4005, 4007, i + 1, GumpButtonType.Reply, 0 );
				AddHtml( 65, 95 + 30 * i, 145, 30, ((Mobile)pets[i]).Name, false, false );
			}

			AddButton( 30, 245, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtml( 63, 245, 145, 30, "Exit", false, false ); // EXIT
		}
Exemplo n.º 28
0
		public FactionTownStoneGump( PlayerMobile from, Faction faction, Town town ) : base( 50, 50 )
		{
			m_From = from;
			m_Faction = faction;
			m_Town = town;

			AddPage( 0 );

			AddBackground( 0, 0, 320, 250, 5054 );
			AddBackground( 10, 10, 300, 230, 3000 );

			AddHtmlText( 25, 30, 250, 25, town.Definition.FactionTownStoneHeader, false, false );

			AddHtmlLocalized( 55, 60, 150, 25, 1011557, false, false ); // Hire Sheriff
			AddButton( 20, 60, 4005, 4007, 1, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 90, 150, 25, 1011559, false, false ); // Hire Finance Minister
			AddButton( 20, 90, 4005, 4007, 2, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 120, 150, 25, 1011558, false, false ); // Fire Sheriff
			AddButton( 20, 120, 4005, 4007, 3, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 150, 150, 25, 1011560, false, false ); // Fire Finance Minister
			AddButton( 20, 150, 4005, 4007, 4, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 210, 150, 25, 1011441, false, false ); // EXIT
			AddButton( 20, 210, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
Exemplo n.º 29
0
		private static void addToMasterLootersList(PlayerMobile player, MasterLooterBackpack bag)
		{
			if (bag == null)
				return;
			if (!Daat99MasterLootersUtils.PlayersMasterLooterList.ContainsKey(player.Serial))
				Daat99MasterLootersUtils.PlayersMasterLooterList.Add(player.Serial, bag);
		}
Exemplo n.º 30
0
		public BaseGuildGump( PlayerMobile pm, Guild g, int x, int y ) : base( x, y )
		{
			m_Guild = g;
			m_Player = pm;
			
			pm.CloseGump( typeof( BaseGuildGump ) );
		}
Exemplo n.º 31
0
        public override void OnDoubleClick(Mobile from)
        {
            Server.Mobiles.PlayerMobile pm = from as Server.Mobiles.PlayerMobile;

            if (IsChildOf(from.Backpack))
            {
                pm.CloseGump(typeof(SmallBODGump));
                from.SendGump(new SmallBODGump(from, this));
            }
            else
            {
                // You must have the deed in your backpack to use it.
                from.SendLocalizedMessage(1045156);
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            PlayerMobile pm = from as PlayerMobile;

            switch (info.ButtonID)
            {
            case 0:
            {
                from.SendGump(new AdvancedCharacterChoiceGump());

                break;
            }

            case 100:                     // Samurai
            {
                from.Skills[SkillName.Bushido].Base = 85.0;
                from.Skills[SkillName.Swords].Base  = 85.0;
                from.Skills[SkillName.Parry].Base   = 85.0;
                from.Skills[SkillName.Tactics].Base = 70.0;
                from.Skills[SkillName.Focus].Base   = 70.0;

                from.RawStr = 85;
                from.RawDex = 55;
                from.RawInt = 55;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 101:                     // Ninja
            {
                from.Skills[SkillName.Ninjitsu].Base = 85.0;
                from.Skills[SkillName.Hiding].Base   = 85.0;
                from.Skills[SkillName.Stealth].Base  = 85.0;
                from.Skills[SkillName.Fencing].Base  = 70.0;
                from.Skills[SkillName.Tactics].Base  = 70.0;

                from.RawStr = 85;
                from.RawDex = 85;
                from.RawInt = 55;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 102:                     // Necromancer
            {
                from.Skills[SkillName.Necromancy].Base  = 85.0;
                from.Skills[SkillName.SpiritSpeak].Base = 85.0;
                from.Skills[SkillName.MagicResist].Base = 85.0;
                from.Skills[SkillName.Fencing].Base     = 70.0;
                from.Skills[SkillName.Meditation].Base  = 70.0;

                from.RawStr = 80;
                from.RawDex = 70;
                from.RawInt = 75;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 103:                     // Paladin
            {
                from.Skills[SkillName.Chivalry].Base    = 85.0;
                from.Skills[SkillName.MagicResist].Base = 85.0;
                from.Skills[SkillName.Swords].Base      = 85.0;
                from.Skills[SkillName.Tactics].Base     = 70.0;
                from.Skills[SkillName.Focus].Base       = 60.0;

                from.RawStr = 85;
                from.RawDex = 85;
                from.RawInt = 55;

                from.Karma = 10000;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 104:                     // Treasure Hunter
            {
                from.Skills[SkillName.Lockpicking].Base  = 85.0;
                from.Skills[SkillName.Cartography].Base  = 85.0;
                from.Skills[SkillName.Peacemaking].Base  = 85.0;
                from.Skills[SkillName.Magery].Base       = 70.0;
                from.Skills[SkillName.Musicianship].Base = 70.0;

                from.RawStr = 100;
                from.RawDex = 25;
                from.RawInt = 100;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 105:                     // Mage
            {
                from.Skills[SkillName.Magery].Base      = 85.0;
                from.Skills[SkillName.MagicResist].Base = 85.0;
                from.Skills[SkillName.EvalInt].Base     = 85.0;
                from.Skills[SkillName.Inscribe].Base    = 70.0;
                from.Skills[SkillName.Meditation].Base  = 70.0;

                from.RawStr = 80;
                from.RawDex = 35;
                from.RawInt = 110;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 106:                     // Swordsman
            {
                from.Skills[SkillName.Swords].Base      = 85.0;
                from.Skills[SkillName.Tactics].Base     = 85.0;
                from.Skills[SkillName.Anatomy].Base     = 85.0;
                from.Skills[SkillName.Healing].Base     = 70.0;
                from.Skills[SkillName.MagicResist].Base = 70.0;

                from.RawStr = 110;
                from.RawDex = 80;
                from.RawInt = 25;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 107:                     // Fencer
            {
                from.Skills[SkillName.Fencing].Base     = 85.0;
                from.Skills[SkillName.Tactics].Base     = 85.0;
                from.Skills[SkillName.Anatomy].Base     = 85.0;
                from.Skills[SkillName.Healing].Base     = 70.0;
                from.Skills[SkillName.MagicResist].Base = 70.0;

                from.RawStr = 110;
                from.RawDex = 80;
                from.RawInt = 25;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 108:                     // Macer
            {
                from.Skills[SkillName.Macing].Base      = 85.0;
                from.Skills[SkillName.Tactics].Base     = 85.0;
                from.Skills[SkillName.Anatomy].Base     = 85.0;
                from.Skills[SkillName.Healing].Base     = 70.0;
                from.Skills[SkillName.MagicResist].Base = 70.0;

                from.RawStr = 110;
                from.RawDex = 80;
                from.RawInt = 25;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 109:                     // Archer
            {
                from.Skills[SkillName.Archery].Base     = 85.0;
                from.Skills[SkillName.Tactics].Base     = 85.0;
                from.Skills[SkillName.Anatomy].Base     = 85.0;
                from.Skills[SkillName.Healing].Base     = 70.0;
                from.Skills[SkillName.MagicResist].Base = 70.0;

                from.RawStr = 110;
                from.RawDex = 80;
                from.RawInt = 25;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 110:                     // Blacksmith
            {
                from.Skills[SkillName.Blacksmith].Base = 85.0;
                from.Skills[SkillName.Mining].Base     = 85.0;
                from.Skills[SkillName.ArmsLore].Base   = 85.0;
                from.Skills[SkillName.Tinkering].Base  = 70.0;
                from.Skills[SkillName.Tailoring].Base  = 70.0;

                from.RawStr = 100;
                from.RawDex = 90;
                from.RawInt = 25;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 111:                     // Bard
            {
                from.Skills[SkillName.Provocation].Base  = 85.0;
                from.Skills[SkillName.Musicianship].Base = 85.0;
                from.Skills[SkillName.Peacemaking].Base  = 85.0;
                from.Skills[SkillName.Discordance].Base  = 70.0;
                from.Skills[SkillName.MagicResist].Base  = 70.0;

                from.RawStr = 85;
                from.RawDex = 85;
                from.RawInt = 55;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }

            case 112:                     // Tamer
            {
                from.Skills[SkillName.AnimalTaming].Base = 85.0;
                from.Skills[SkillName.AnimalLore].Base   = 85.0;
                from.Skills[SkillName.Veterinary].Base   = 85.0;
                from.Skills[SkillName.Magery].Base       = 70.0;
                from.Skills[SkillName.Meditation].Base   = 70.0;

                from.RawStr = 80;
                from.RawDex = 55;
                from.RawInt = 80;

                pm.ACState = AdvancedCharacterState.None;

                break;
            }
            }
        }
Exemplo n.º 33
0
        public void GivePowerScrolls()
        {
            List <Mobile>      toGive = new List <Mobile>();
            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)
                {
                    toGive.Add(ds.m_Mobile);
                }
            }

            if (toGive.Count == 0)
            {
                return;
            }

            // Randomize
            for (int i = 0; i < toGive.Count; ++i)
            {
                int    rand = Utility.Random(toGive.Count);
                Mobile hold = toGive[i];
                toGive[i]    = toGive[rand];
                toGive[rand] = hold;
            }

            for (int i = 0; i < 16; ++i)
            {
                int    level;
                double random = Utility.RandomDouble();

                if (0.1 >= random)
                {
                    level = 25;
                }
                else if (0.25 >= random)
                {
                    level = 20;
                }
                else if (0.45 >= random)
                {
                    level = 15;
                }
                else if (0.70 >= random)
                {
                    level = 10;
                }
                else
                {
                    level = 5;
                }

                Mobile m = toGive[i % toGive.Count];

                m.SendLocalizedMessage(1049524); // You have received a scroll of power!
                m.AddToBackpack(new StatCapScroll(225 + level));

                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;

                    for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                    {
                        Mobile prot = (Mobile)pm.JusticeProtectors[j];

                        if (prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot))
                        {
                            continue;
                        }

                        int chance = 0;

                        switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                        {
                        case VirtueLevel.Seeker:
                            chance = 60;
                            break;

                        case VirtueLevel.Follower:
                            chance = 80;
                            break;

                        case VirtueLevel.Knight:
                            chance = 100;
                            break;
                        }

                        if (chance > Utility.Random(100))
                        {
                            prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!
                            prot.AddToBackpack(new StatCapScroll(225 + level));
                        }
                    }
                }
            }
        }
Exemplo n.º 34
0
        public static void HandleKill(Mobile victim, Mobile killer)
        {
            PlayerMobile pm = killer as PlayerMobile;
            BaseCreature bc = victim as BaseCreature;

            if (!Core.AOS)
            {
                return;
            }

            if (pm == null || bc == null || bc.NoKillAwards /*|| !CheckLocation(bc) || !CheckLocation(pm)*/)
            {
                return;
            }

            //Make sure its a boss we killed!!
            bool boss = bc is Impaler || bc is DemonKnight || bc is DarknightCreeper || bc is FleshRenderer || bc is ShadowKnight || bc is AbysmalHorror;

            if (!boss)
            {
                return;
            }

            double gpoints = pm.GauntletPoints;

            pm.GauntletPoints += (int)(bc.Fame * (1 + Math.Sqrt(pm.RealLuck) / 100)) / 2;

            const double A = 0.000863316841;
            const double B = 0.00000425531915;

            double chance = A * Math.Pow(10, B * gpoints);
            double roll   = Utility.RandomDouble();

            if (chance > roll)
            {
                Item i = null;

                if (Core.TOL)
                {
                    int ran = Utility.Random(m_RewardTable.Length + 1);

                    if (ran >= m_RewardTable.Length)
                    {
                        int luck = killer is PlayerMobile ? ((PlayerMobile)killer).RealLuck : killer.Luck;

                        i = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(killer), LootPackEntry.IsMondain(killer), LootPackEntry.IsStygian(killer));
                        RunicReforging.GenerateRandomArtifactItem(i, luck, Utility.RandomMinMax(1000, 1200));
                        NegativeAttributes attrs = RunicReforging.GetNegativeAttributes(i);

                        if (attrs != null)
                        {
                            attrs.Prized    = 1;
                            attrs.Brittle   = 0;
                            attrs.Massive   = 0;
                            attrs.Unwieldly = 0;
                            attrs.Antique   = 0;
                            attrs.NoRepair  = 0;
                        }
                    }
                    else
                    {
                        Type[] list = m_RewardTable[ran];
                        Type   t    = list.Length == 1 ? list[0] : list[Utility.Random(list.Length)];

                        i = Activator.CreateInstance(t) as Item;
                    }
                }
                else
                {
                    i = Activator.CreateInstance(m_DoomArtifact[Utility.Random(m_DoomArtifact.Length)]) as Item;
                }

                if (i != null)
                {
                    pm.SendLocalizedMessage(1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

                    pm.PlaySound(0x5B4);

                    if (!pm.PlaceInBackpack(i))
                    {
                        if (pm.BankBox != null && pm.BankBox.TryDropItem(killer, i, false))
                        {
                            pm.SendLocalizedMessage(1079730); // The item has been placed into your bank box.
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1072523); // You find an artifact, but your backpack and bank are too full to hold it.
                            i.MoveToWorld(pm.Location, pm.Map);
                        }
                    }

                    pm.GauntletPoints = 0;
                }
            }
        }
Exemplo n.º 35
0
 public virtual bool CheckCustomReqs(PlayerMobile pm)
 {
     return(true);
 }
Exemplo n.º 36
0
            public override void OnClick()
            {
                PlayerMobile mobile = (PlayerMobile)m_Mobile;
                {
                    Item am = mobile.Backpack.FindItemByType(typeof(PandoraMarker));
                    if (am != null)
                    {
                        Item ao = mobile.Backpack.FindItemByType(typeof(PrideCrystal));
                        Item ai = mobile.Backpack.FindItemByType(typeof(GreedCrystal));
                        Item ae = mobile.Backpack.FindItemByType(typeof(LustCrystal));
                        Item au = mobile.Backpack.FindItemByType(typeof(EnvyCrystal));
                        Item aw = mobile.Backpack.FindItemByType(typeof(GluttonyCrystal));
                        Item ax = mobile.Backpack.FindItemByType(typeof(SlothCrystal));
                        Item av = mobile.Backpack.FindItemByType(typeof(WrathCrystal));


                        if (ao == null || ao.Amount < 1 || ai == null || ai.Amount < 1 || ae == null || ae.Amount < 1 || au == null || au.Amount < 1 || aw == null || aw.Amount < 1 || ax == null || ax.Amount < 1 || av == null || av.Amount < 1)
                        {
                            mobile.SendMessage("You do not have all the required items");
                        }
                        else
                        {
                            mobile.SendGump(new PandoraGump2(mobile));
                            mobile.Backpack.ConsumeTotal(typeof(PrideCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(GreedCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(LustCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(EnvyCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(GluttonyCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(SlothCrystal), 1);
                            mobile.Backpack.ConsumeTotal(typeof(WrathCrystal), 1);
                            am.Delete();

                            switch (Utility.Random(10))
                            {
                            case 0: mobile.AddToBackpack(new BBQSouthAddonDeed()); break;

                            case 1: mobile.AddToBackpack(new SoulstoneFragmentToken()); break;

                            case 2: mobile.AddToBackpack(new AG_BloodAltarAddonDeed()); break;

                            case 3: mobile.AddToBackpack(new BankHiive()); break;

                            case 4: mobile.AddToBackpack(new AG_BloodSkeletonsAddonDeed()); break;

                            case 5: mobile.AddToBackpack(new ItemBlessDeed()); break;

                            case 6: mobile.AddToBackpack(new RidablePolarDeed()); break;

                            case 7: mobile.AddToBackpack(new HeritageToken()); break;

                            case 8: mobile.AddToBackpack(new CloakOfInvisibility()); break;

                            //case 9: mobile.AddToBackpack(new SerenityWallSouthAddonDeed()); break;
                            case 9: mobile.AddToBackpack(new BBQEastAddonDeed()); break;
                            }
                        }
                    }
                    else
                    {
                        mobile.SendGump(new PandoraGump(mobile));
                    }
                }
            }
Exemplo n.º 37
0
        //28MAR2007 Adding Web Based List *** END ***

        public static void Killed(Mobile m) //done
        {
            PlayerMobile owner = m as PlayerMobile;

            Mobile m_Killer = (Mobile)m.LastKiller;

            Mobile from = (Mobile)m.LastKiller;

            if (m_Killer != null && m_Killer.Player && owner != null && owner.Player)
            {
                KillBook book = m_Killer.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (book != null)
                {
                    if ((owner != book.BookOwner) && (m_Killer == book.BookOwner))
                    {
                        book.AddEntry(owner.Name, 1);
                        book.TotKills++;

                        //28MAR2007 Adding Web Based List *** START ***
                        /*********************************************************/
                        /*             path to where your website is stored      */
                        string path = "C:/Inetpub/wwwroot/status/web/kills";
                        /*********************************************************/

                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }

                        //if (!File.Exists(path + "/index.html"))
                        //{
                        //    //29MAR2006 Checks for index.html file if not present it creates one
                        //    using (StreamWriter op = new StreamWriter(path + "/index.html"))
                        //    {
                        //        op.WriteLine("<html>");
                        //        op.WriteLine("   <head>");
                        //        op.WriteLine("      <title>Book of Kills - updated by Ravon of An Nox</title>");
                        //        op.WriteLine("   </head>");
                        //        op.WriteLine("   <body bgcolor=\"black\">");
                        //        op.WriteLine("      <a href='http://annox.no-ip.com'><img border='0' src='http://bp2.blogger.com/_CGKuPVAFxb0/Rgp566xjEaI/AAAAAAAAAFo/Dv4bJaNU_xs/s200/Cemetery.jpg' alt='http://annox.no-ip.com' /></a>");
                        //        op.WriteLine("      <h1><font color='red'>Book of Kills Index</h1>");
                        //        op.WriteLine("      <font color='yellow'><a href='http://annox.no-ip.com/status/web/kills/{0}.html'>{1}</a><font color='white'> began killing on {2}.<br>", Encode(m_Killer.Name), Encode(m_Killer.Name), DateTime.Now);
                        //        op.WriteLine("   </body>");
                        //        op.WriteLine("</html>");
                        //    }
                        //}
                        //else
                        //{
                        //    //29MAR2006 Checks for index.html file it is present and adds information
                        //    using (StreamWriter op = File.AppendText(path + "/index.html"))
                        //    {
                        //        op.WriteLine("<html>");
                        //        op.WriteLine("   <body bgcolor=\"black\">");
                        //        op.WriteLine("      <font color='yellow'><a href='http://annox.no-ip.com/status/web/kills/{0}.html'>{1}</a><font color='white'> began killing on {2}.<br>", Encode(m_Killer.Name), Encode(m_Killer.Name), DateTime.Now);
                        //        op.WriteLine("   </body>");
                        //        op.WriteLine("</html>");
                        //    }
                        //}

                        //if (!File.Exists(path + "/" + Encode(m_Killer.Name) + ".html"))
                        if (!File.Exists(path + "/index.html"))
                        {
                            //29MAR2006 Creates m_Killer.Name.html file
                            //using (StreamWriter op = new StreamWriter(path + "/" + Encode(m_Killer.Name) + ".html"))
                            using (StreamWriter op = new StreamWriter(path + "/index.html"))
                            {
                                op.WriteLine("<html>");
                                op.WriteLine("   <head>");
                                op.WriteLine("      <title>Book of Kills - updated by Ravon of An Nox</title>");
                                op.WriteLine("   </head>");
                                op.WriteLine("   <body bgcolor=\"black\">");
                                op.WriteLine("      <a href='http://annox.no-ip.com'><img border='0' src='http://bp2.blogger.com/_CGKuPVAFxb0/Rg2-IKxjEdI/AAAAAAAAAGE/tyKWGQFaFic/s200/laugh.jpg' alt='http://annox.no-ip.com' /></a>");
                                //op.WriteLine("      <h1><font color='red'>{0} Kill Status</font></h1>", Encode(m_Killer.Name));
                                op.WriteLine("      <h1><font color='red'>The Book of Kills</font></h1>");
                                //op.WriteLine("      <font color='white'>Kill #{0}</font><br>", book.TotKills);
                                op.WriteLine("      <font color='yellow'>{0}</font><font color='white'> has killed {1} people.  {2}'s last kill was </font><font color='cyan'>{3}</font> ", Encode(m_Killer.Name), book.TotKills, Encode(m_Killer.Name), Encode(owner.Name));
                                op.WriteLine("      <font color='white'>in </font><font color='gold'>{0}</font> ", m.Region.Name);
                                op.WriteLine("      <font color='white'>(</font> <font color=\"khaki\">{0}, {1}, {2}</font>)<font color='white'>) in the land of {3}</font> ", from.X, from.Y, from.Z, from.Map);
                                op.WriteLine("      <font color='white'>on </font><font color=\"red\">{0}.</font><br>", DateTime.Now);
                                op.WriteLine("   </body>");
                                op.WriteLine("</html>");
                            }
                        }
                        else
                        {
                            //29MAR2006 Update m_Killer.Name.html file (Yes, this seems repetive, my mental block)
                            //13NOV2007 Mental block cleared, append not new, duh
                            //using (StreamWriter op = new StreamWriter(path + "/" + m_Killer.Name + ".html"))
                            //using (StreamWriter op = File.AppendText(path + "/" + Encode(m_Killer.Name) + ".html"))
                            using (StreamWriter op = File.AppendText(path + "/index.html"))
                            {
                                op.WriteLine("<html>");
                                op.WriteLine("   <body bgcolor=\"black\">");
                                op.WriteLine("      <font color='yellow'>{0}</font><font color='white'> has killed {1} people.  {2}'s last kill was </font><font color='cyan'>{3}</font> ", Encode(m_Killer.Name), book.TotKills, Encode(m_Killer.Name), Encode(owner.Name));
                                op.WriteLine("      <font color='white'>in </font><font color='gold'>{0}</font> ", m.Region.Name);
                                op.WriteLine("      <font color='white'>(</font> <font color=\"khaki\">{0}, {1}, {2}</font>)<font color='white'>) in the land of {3}</font> ", from.X, from.Y, from.Z, from.Map);
                                op.WriteLine("      <font color='white'>on </font><font color=\"red\">{0}.</font><br>", DateTime.Now);
                                op.WriteLine("   </body>");
                                op.WriteLine("</html>");
                            }
                        }
                        //28MAR2007 Adding Web Based List *** END   ***
                    }
                }
            }

            if (owner != null && owner.Player && m_Killer != null && m_Killer.Player)
            {
                KillBook deathbook = owner.Backpack.FindItemByType(typeof(KillBook), true) as KillBook;

                if (deathbook != null)
                {
                    if (owner == deathbook.BookOwner)
                    {
                        if (deathbook.TotDeaths >= 0)
                        {
                            deathbook.TotDeaths++;
                        }
                    }
                }
            }
        }
Exemplo n.º 38
0
        public void GiveTitles(ArrayList toGive)
        {
            // TODO: verify scores for killing champions

            for (int i = 0; i < toGive.Count; ++i)
            {
                PlayerMobile pm = (PlayerMobile)toGive[i % toGive.Count];

                switch (SkullType)
                {
                case ChampionSkullType.Power:
                    pm.ChampionTiers[0] += 2;
                    pm.SuperChampionTiers[1]++;
                    break;

                case ChampionSkullType.Enlightenment:
                    pm.ChampionTiers[1] += 2;
                    pm.SuperChampionTiers[2]++;
                    break;

                case ChampionSkullType.Venom:
                    pm.ChampionTiers[2] += 2;
                    pm.SuperChampionTiers[3]++;
                    break;

                case ChampionSkullType.Pain:
                    pm.ChampionTiers[3] += 2;
                    pm.SuperChampionTiers[4]++;
                    break;

                case ChampionSkullType.Greed:
                    pm.ChampionTiers[4] += 2;
                    pm.SuperChampionTiers[5]++;
                    break;

                case ChampionSkullType.Death:
                    pm.ChampionTiers[5] += 2;
                    pm.SuperChampionTiers[6]++;
                    break;
                }

                if (this is Serado)
                {
                    pm.ChampionTiers[6] += 2;
                    pm.SuperChampionTiers[7]++;
                }

                if (this is IlhenirTheStained)
                {
                    pm.ChampionTiers[7] += 2;
                    pm.SuperChampionTiers[8]++;
                }

                if (this is TwauloOfTheGlade)
                {
                    pm.ChampionTiers[8] += 2;
                    pm.SuperChampionTiers[9]++;
                }

                if (this is PrimevalLich)
                {
                    pm.ChampionTiers[9] += 2;
                    pm.SuperChampionTiers[10]++;
                }

                if (this is AbyssalInfernal)
                {
                    pm.ChampionTiers[10] += 2;
                    pm.SuperChampionTiers[11]++;
                }
            }
        }
Exemplo n.º 39
0
 public bool IsValidTarget(PlayerMobile m) =>
 m?.PeacedUntil < Core.Now && !m.Hidden && m.AccessLevel == AccessLevel.Player &&
 CanBeHarmful(m);
Exemplo n.º 40
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile       m      = from;
            PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                if (dropped is MagiScroll)
                {
                    Container pack = from.Backpack;

                    if (pack != null && pack.ConsumeTotal(typeof(MagiOre), 1))
                    {
                        if (1 > Utility.RandomDouble())                  // 1 = 100% = chance to drop
                        {
                            switch (Utility.Random(11))
                            {
                            case 0: mobile.AddToBackpack(new Chestofthemagi()); break;

                            case 1: mobile.AddToBackpack(new ChestoftheFemaleMagi()); break;

                            case 2: mobile.AddToBackpack(new Glovesofthemagi()); break;

                            case 3: mobile.AddToBackpack(new Legsofthemagi()); break;

                            case 4: mobile.AddToBackpack(new Gorgetofthemagi()); break;

                            case 5: mobile.AddToBackpack(new Armsofthemagi()); break;

                            case 6: mobile.AddToBackpack(new StaffOfTheMagi()); break;

                            case 7: mobile.AddToBackpack(new HatOfTheMagi()); break;

                            case 8: mobile.AddToBackpack(new CloakOfTheMagi()); break;

                            case 9: mobile.AddToBackpack(new HoodedShroudofthemagi()); break;

                            case 10: mobile.AddToBackpack(new BeltOfTheMagi()); break;
                            }
                        }

                        return(true);
                    }
                    else
                    {
                        from.SendMessage(0x22, "You also need a Magi Ore before you recieve a piece of armor.");
                    }
                    return(false);
                }
                else if (dropped is MagiOre)
                {
                    Container pack = from.Backpack;

                    if (pack != null && pack.ConsumeTotal(typeof(MagiScroll), 1))
                    {
                        if (1 > Utility.RandomDouble())                          // 1 = 100% = chance to drop
                        {
                            switch (Utility.Random(10))
                            {
                            case 0: mobile.AddToBackpack(new Chestofthemagi()); break;

                            case 1: mobile.AddToBackpack(new ChestoftheFemaleMagi()); break;

                            case 2: mobile.AddToBackpack(new Glovesofthemagi()); break;

                            case 3: mobile.AddToBackpack(new Legsofthemagi()); break;

                            case 4: mobile.AddToBackpack(new Gorgetofthemagi()); break;

                            case 5: mobile.AddToBackpack(new Armsofthemagi()); break;

                            case 6: mobile.AddToBackpack(new StaffOfTheMagi()); break;

                            case 7: mobile.AddToBackpack(new HatOfTheMagi()); break;

                            case 8: mobile.AddToBackpack(new CloakOfTheMagi()); break;

                            case 9: mobile.AddToBackpack(new HoodedShroudofthemagi()); break;
                            }
                        }

                        return(true);
                    }
                    else
                    {
                        from.SendMessage(0x22, "You also need a Magi Scroll before you recieve a piece of armor.");
                    }
                    return(false);
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need of this!", mobile.NetState);
                }
            }
            return(false);
        }
Exemplo n.º 41
0
        public void GivePowerScrolls(ArrayList toGive)
        {
            if (NoKillAwards)
            {
                return;
            }

            if (Map != Map.Felucca)
            {
                return;
            }

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

                if (!(m.Map == this.Map && m.InRange(this, 90)) || (!m.Alive && m.Corpse == null))
                {
                    toGive.Remove(m);
                }
            }

            if (toGive.Count == 0)
            {
                return;
            }

            for (int i = 0; i < 6; ++i)
            {
                int    level;
                double random = Utility.RandomDouble();

                /* Powerscroll type chance:
                 * - 80% chance to get a 110 powerscroll
                 * - 15% chance to get a 115 powerscroll
                 * - 5% chance to get a 120 powerscroll
                 */

                if (0.05 >= random)
                {
                    level = 20;
                }
                else if (0.2 >= random)
                {
                    level = 15;
                }
                else
                {
                    level = 10;
                }

                Mobile m = (Mobile)toGive[i % toGive.Count];

                PowerScroll ps = PowerScroll.CreateRandomNoCraft(level, level);

                m.SendLocalizedMessage(1049524);                   // You have received a scroll of power!

                if (m.Alive)
                {
                    m.AddToBackpack(ps);
                }
                else
                {
                    Container corpse = m.Corpse;

                    if (corpse != null)
                    {
                        corpse.DropItem(ps);
                    }
                }

                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;

                    for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                    {
                        Mobile prot = (Mobile)pm.JusticeProtectors[j];

                        if (prot.Map != m.Map || prot.Murderer || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot))
                        {
                            continue;
                        }

                        int chance = 0;

                        switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                        {
                        case VirtueLevel.Seeker:
                            chance = 60;
                            break;

                        case VirtueLevel.Follower:
                            chance = 80;
                            break;

                        case VirtueLevel.Knight:
                            chance = 100;
                            break;
                        }

                        if (chance > Utility.Random(100))
                        {
                            PowerScroll pps = PowerScroll.CreateRandomNoCraft(level, level);
                            prot.SendLocalizedMessage(1049368);                               // You have been rewarded for your dedication to Justice!
                            prot.AddToBackpack(pps);
                        }
                    }
                }
            }
        }
Exemplo n.º 42
0
 public AccountGoldProps(PlayerMobile pm)
 {
     Player = pm;
 }
Exemplo n.º 43
0
        public static void GivePowerScrollTo(Mobile m, Item item, BaseChampion champ)
        {
            if (m == null)      //sanity
            {
                return;
            }

            if (!Core.SE || m.Alive)
            {
                m.AddToBackpack(item);
            }
            else
            {
                if (m.Corpse != null && !m.Corpse.Deleted)
                {
                    m.Corpse.DropItem(item);
                }
                else
                {
                    m.AddToBackpack(item);
                }
            }

            if (item is PowerScroll && m is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)m;

                for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                {
                    Mobile prot = pm.JusticeProtectors[j];

                    if (prot.Map != m.Map || prot.Murderer || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot) || !prot.InRange(champ, 100))
                    {
                        continue;
                    }

                    int chance = 0;

                    switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                    {
                    case VirtueLevel.Seeker:
                        chance = 60;
                        break;

                    case VirtueLevel.Follower:
                        chance = 80;
                        break;

                    case VirtueLevel.Knight:
                        chance = 100;
                        break;
                    }

                    if (chance > Utility.Random(100))
                    {
                        PowerScroll powerScroll = CreateRandomPowerScroll();

                        prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!

                        if (!Core.SE || prot.Alive)
                        {
                            prot.AddToBackpack(powerScroll);
                        }
                        else
                        {
                            if (prot.Corpse != null && !prot.Corpse.Deleted)
                            {
                                prot.Corpse.DropItem(powerScroll);
                            }
                            else
                            {
                                prot.AddToBackpack(powerScroll);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 44
0
 public virtual bool CanDonate(PlayerMobile player)
 {
     return(true);
 }
Exemplo n.º 45
0
 public PointsSystemProps(PlayerMobile pm)
 {
     Player = pm;
 }
Exemplo n.º 46
0
                                                                                                            public override void OnClick()
                                                                                                            {
                                                                                                                if (!(m_Mobile is PlayerMobile))
                                                                                                                {
                                                                                                                    return;
                                                                                                                }
                                                                                                                PlayerMobile mobile = (PlayerMobile)m_Mobile; {
///////////////////////////////////////////////// gumpname
                                                                                                                    if (!mobile.HasGump(typeof(HermyGump)))
                                                                                                                    {
                                                                                                                        mobile.SendGump(new HermyGump(mobile));
                                                                                                                    }
                                                                                                                }
                                                                                                            }
Exemplo n.º 47
0
        public static void GivePowerScrollTo(Mobile m, PowerScroll ps)
        {
            if (ps == null || m == null)                //sanity
            {
                return;
            }

            m.SendLocalizedMessage(1049524);               // You have received a scroll of power!

            if (!Core.SE || m.Alive)
            {
                m.AddToBackpack(ps);
            }
            else
            {
                if (m.Corpse != null && !m.Corpse.Deleted)
                {
                    m.Corpse.DropItem(ps);
                }
                else
                {
                    m.AddToBackpack(ps);
                }
            }

            if (m is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)m;

                for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                {
                    Mobile prot = pm.JusticeProtectors[j];

                    if (prot.Map != m.Map || prot.Kills >= Mobile.MurderCount || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot))
                    {
                        continue;
                    }

                    int chance = 0;

                    switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                    {
                    case VirtueLevel.Seeker: chance = 60; break;

                    case VirtueLevel.Follower: chance = 80; break;

                    case VirtueLevel.Knight: chance = 100; break;
                    }

                    if (chance > Utility.Random(100))
                    {
                        PowerScroll powerScroll = new PowerScroll(ps.Skill, ps.Value);

                        prot.SendLocalizedMessage(1049368);                           // You have been rewarded for your dedication to Justice!

                        if (!Core.SE || prot.Alive)
                        {
                            prot.AddToBackpack(powerScroll);
                        }
                        else
                        {
                            if (prot.Corpse != null && !prot.Corpse.Deleted)
                            {
                                prot.Corpse.DropItem(powerScroll);
                            }
                            else
                            {
                                prot.AddToBackpack(powerScroll);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 48
0
 public bool IsValidTarget(PlayerMobile m)
 {
     return(m.PeacedUntil < DateTime.UtcNow && !m.Hidden && CanBeHarmful(m));
 }
Exemplo n.º 49
0
                                                               public override bool OnDragDrop(Mobile from, Item dropped)
                                                               {
                                                                   Mobile m = from; PlayerMobile mobile = m as PlayerMobile;

                                                                   if (mobile != null)
                                                                   {
/////////////////////////////////////////////////////////// item to be dropped
                                                                       if (dropped is PresentBomb3)
                                                                       {
                                                                           if (dropped.Amount != 30)
                                                                           {
                                                                               this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", mobile.NetState); return(false);
                                                                           }
                                                                           dropped.Delete();
///////////////the reward
                                                                           mobile.AddToBackpack(new Gold(1200));
                                                                           mobile.AddToBackpack(new SwordOfChristmas( ));
////////////////////////////////////////////////////////// thanksmessage
                                                                           this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank You For Finding the Exploding Presents! Thank You!", mobile.NetState);
                                                                           return(true);
                                                                       }
                                                                       else if (dropped is Whip)
                                                                       {
                                                                           this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, mobile.NetState); return(false);
                                                                       }
                                                                       else
                                                                       {
                                                                           this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState);
                                                                       }
                                                                   }
                                                                   return(false);
                                                               }
Exemplo n.º 50
0
        public override bool OnDragDrop(Mobile m, Item item)
        {
            if (item is Head)
            {
                Head head = (Head)item;
                if (!(head.Owner is PlayerMobile) || head.Age >= TimeSpan.FromDays(1.0) || head.MaxBounty <= 0 || ((PlayerMobile)head.Owner).Bounty <= 0 || head.Owner == m || (m.Account != null && head.Owner.Account != null && head.Owner.Account == m.Account))
                {
                    this.Say(true, "'Tis a decapitated head. How disgusting.");
                }
                else
                {
                    PlayerMobile owner = (PlayerMobile)head.Owner;

                    int total = owner.Bounty;
                    if (head.MaxBounty < total)
                    {
                        total = head.MaxBounty;
                    }

                    if (total >= 15000)
                    {
                        Say(true, String.Format("Thou hast brought the infamous {0} to justice!  Thy reward of {1}gp hath been deposited in thy bank account.", owner.Name, total));
                    }
                    else if (total > 100)
                    {
                        Say(true, String.Format("Tis a minor criminal, thank thee. Thy reward of {0}gp hath been deposited in thy bank account.", total));
                    }
                    else
                    {
                        Say(true, String.Format("Thou hast wasted thy time for {0}gp.", total));
                    }

                    double statloss = 1.0;

                    if (total > 750000)
                    {
                        statloss = 0.90;
                    }
                    else if (total > 500000)
                    {
                        statloss = 0.91;
                    }
                    else if (total > 300000)
                    {
                        statloss = 0.92;
                    }
                    else if (total > 200000)
                    {
                        statloss = 0.93;
                    }
                    else if (total > 125000)
                    {
                        statloss = 0.94;
                    }
                    else if (total > 75000)
                    {
                        statloss = 0.95;
                    }
                    else if (total > 50000)
                    {
                        statloss = 0.96;
                    }
                    else if (total > 30000)
                    {
                        statloss = 0.97;
                    }
                    else if (total > 15000)
                    {
                        statloss = 0.98;
                    }
                    else if (total > 5000)
                    {
                        statloss = 0.99;
                    }

                    if (statloss < 1.0)
                    {
                        if (statloss < 0.9)
                        {
                            statloss = 0.9;
                        }

                        if (owner.RawStr * statloss >= 10)
                        {
                            owner.RawStr = (int)(owner.RawStr * statloss);
                        }
                        else
                        {
                            owner.RawStr = 10;
                        }

                        if (owner.RawDex * statloss >= 10)
                        {
                            owner.RawDex = (int)(owner.RawDex * statloss);
                        }
                        else
                        {
                            owner.RawDex = 10;
                        }

                        if (owner.RawInt * statloss >= 10)
                        {
                            owner.RawInt = (int)(owner.RawInt * statloss);
                        }
                        else
                        {
                            owner.RawInt = 10;
                        }

                        for (int i = 0; i < owner.Skills.Length; i++)
                        {
                            if (owner.Skills[i].Base * statloss > 50)
                            {
                                owner.Skills[i].Base *= statloss;
                            }
                        }

                        owner.SendAsciiMessage("Thy head has been turned in for a bounty of {0}gp.  Suffer thy punishment!", total);
                    }

                    if (total < owner.Bounty)
                    {
                        owner.Kills /= 2;
                    }
                    else
                    {
                        owner.Kills = 0;
                    }

                    owner.Bounty -= total;
                    if (owner.Bounty < 0)
                    {
                        owner.Bounty = 0;
                    }

                    while (total > 0)
                    {
                        int amount = total > 65000 ? 65000 : total;
                        m.BankBox.DropItem(new Gold(amount));
                        total -= amount;
                    }
                }

                return(true);
            }
            else
            {
                this.Say(true, "I have no use for this.");
                return(false);
            }
        }
Exemplo n.º 51
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                return(false);
            }

            if (dest.Contains(Location))
            {
                Say(1042809, escorter.Name);                 // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination       = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if (cont == null)
                {
                    cont = escorter.BankBox;
                }

                Gold gold = new Gold(500, 1000);

                if (!cont.TryDropItem(escorter, gold, false))
                {
                    gold.MoveToWorld(escorter.Location, escorter.Map);
                }

                StopFollow();
                SetControlMaster(null);
                m_EscortTable.Remove(escorter);
                BeginDelete();

                Misc.Titles.AwardFame(escorter, 10, true);

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if (pm != null)
                {
                    if (pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay)
                    {
                        pm.NextCompassionDay = DateTime.MinValue;
                        pm.CompassionGains   = 0;
                    }

                    if (pm.CompassionGains >= 5)                     // have already gained 5 times in one day, can gain no more
                    {
                        pm.SendLocalizedMessage(1053004);            // You must wait about a day before you can gain in compassion again.
                    }
                    else if (VirtueHelper.Award(pm, VirtueName.Compassion, this.IsPrisoner ? 400 : 200, ref gainedPath))
                    {
                        if (gainedPath)
                        {
                            pm.SendLocalizedMessage(1053005);                             // You have achieved a path in compassion!
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1053002);                             // You have gained in compassion.
                        }
                        pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays(1.0);     // in one day CompassionGains gets reset to 0
                        ++pm.CompassionGains;
                    }
                    else
                    {
                        pm.SendLocalizedMessage(1053003);                         // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 52
0
 public LockKarmaEntry(PlayerMobile mobile)
     : base(mobile.KarmaLocked ? 6197 : 6196, 2)
 {
     m_Mobile = mobile;
 }
Exemplo n.º 53
0
                                                                         public override bool OnDragDrop(Mobile from, Item dropped)
                                                                         {
                                                                             Mobile m = from; PlayerMobile mobile = m as PlayerMobile;

                                                                             if (mobile != null)
                                                                             {
/////////////////////////////////////////////////////////// item to be dropped
                                                                                 if (dropped is StatCapScroll)
                                                                                 {
                                                                                     if (dropped.Amount != 1)
                                                                                     {
                                                                                         this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", mobile.NetState); return(false);
                                                                                     }
                                                                                     dropped.Delete();
///////////////the reward
                                                                                     mobile.AddToBackpack(new Gold(0));
                                                                                     mobile.AddToBackpack(new BankCheck(5000));
////////////////////////////////////////////////////////// thanksmessage
                                                                                     this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I Thank Thee for Thy Buisness. Come back another time!", mobile.NetState);
                                                                                     return(true);
                                                                                 }
                                                                                 else if (dropped is Whip)
                                                                                 {
                                                                                     this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, mobile.NetState); return(false);
                                                                                 }
                                                                                 else
                                                                                 {
                                                                                     this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState);
                                                                                 }
                                                                             }
                                                                             return(false);
                                                                         }
Exemplo n.º 54
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (Utility.RandomBool())
            {
                c.AddItem(ScrollofTranscendence.CreateRandom(30, 30));
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new TatteredAncientScroll());
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new UntransTome());
            }

            if (Utility.RandomBool())
            {
                c.AddItem(new SpiderCarapace());
            }

            if (Utility.RandomDouble() < 0.01)
            {
                DistributeRandomArtifact(this, m_Artifact);
            }

            // distribute quest items for the 'Green with Envy' quest given by Vernix
            List <DamageStore> rights = GetLootingRights(DamageEntries, HitsMax);

            for (int i = rights.Count - 1; i >= 0; --i)
            {
                DamageStore ds = rights[i];
                if (!ds.m_HasRight)
                {
                    rights.RemoveAt(i);
                }
            }

            // for each with looting rights... give an eye of navrey if they have the quest
            foreach (DamageStore d in rights)
            {
                PlayerMobile pm = d.m_Mobile as PlayerMobile;
                if (null != pm)
                {
                    foreach (BaseQuest quest in pm.Quests)
                    {
                        if (quest is GreenWithEnvyQuest)
                        {
                            Container pack = pm.Backpack;
                            Item      item = new EyeOfNavrey();
                            if (pack == null || !pack.TryDropItem(pm, item, false))
                            {
                                pm.BankBox.DropItem(item);
                            }
                            pm.SendLocalizedMessage(1095155); // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 55
0
        public void SetTimedEgg(Point3D location, Map map, EggType eggType)
        {
            int eggHue = Hue = Utility.RandomMinMax(2, 362);

            DecoyEasterEgg decoyEasterEgg = new DecoyEasterEgg();

            decoyEasterEgg.Hue = eggHue;
            decoyEasterEgg.MoveToWorld(location, map);

            int delayTime = Utility.RandomMinMax(1, 10);

            Effects.SendLocationParticles(EffectItem.Create(location, map, TimeSpan.FromSeconds(0.25)), 0x9B5, 10, delayTime * 25, eggHue, 0, 5029, 0);

            Timer.DelayCall(TimeSpan.FromSeconds(delayTime), delegate
            {
                if (decoyEasterEgg != null)
                {
                    if (!decoyEasterEgg.Deleted)
                    {
                        if (decoyEasterEgg.ParentEntity is PlayerMobile)
                        {
                            PlayerMobile pm_Owner = decoyEasterEgg.ParentEntity as PlayerMobile;

                            pm_Owner.SendMessage("The eggs you gathered appear to be some sort of decoy, and they crumble in your backpack...");
                            pm_Owner.SendSound(0x134);
                        }

                        decoyEasterEgg.Delete();
                    }
                }

                int radius = 2;

                int effectSound = 0;

                switch (eggType)
                {
                case EggType.Explosive: effectSound = 0x359; break;

                case EggType.Entangle: effectSound = 0x211; break;

                case EggType.Poison: effectSound = 0x22F; break;

                case EggType.Ice: effectSound = 0x64F; break;

                case EggType.Banish: effectSound = 0x655; break;

                case EggType.Gust: effectSound = 0x64C; break;

                case EggType.Bloody: effectSound = 0x62B; break;
                }

                Effects.PlaySound(location, map, effectSound);

                Dictionary <Point3D, double> m_ExplosionLocations = new Dictionary <Point3D, double>();

                m_ExplosionLocations.Add(location, 0);

                for (int a = 1; a < radius + 1; a++)
                {
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y - a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y + a, location.Z), a);
                    m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y, location.Z), a);
                }

                foreach (KeyValuePair <Point3D, double> pair in m_ExplosionLocations)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(pair.Value * .25), delegate
                    {
                        switch (eggType)
                        {
                        case EggType.Explosive:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044);
                            break;

                        case EggType.Entangle:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.5)), 0x3973, 10, 50, 5029);
                            break;

                        case EggType.Poison:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x372A, 10, 20, 59, 0, 5029, 0);
                            break;

                        case EggType.Ice:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0);
                            break;

                        case EggType.Banish:
                            radius = 3;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x3763, 10, 20, 2199, 0, 5029, 0);
                            break;

                        case EggType.Gust:
                            radius = 4;
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x1FB2, 10, 20, 0, 0, 5029, 0);
                            break;

                        case EggType.Bloody:
                            Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 10, 20, 0, 0, 5029, 0);
                            break;
                        }
                    });
                }

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

                IPooledEnumerable eable = map.GetMobilesInRange(location, radius);

                foreach (Mobile mobile in eable)
                {
                    if (mobile is EasterBunny)
                    {
                        continue;
                    }

                    if (!mobile.CanBeDamaged())
                    {
                        continue;
                    }

                    m_TargetsHit.Add(mobile);
                }

                eable.Free();

                int targets = m_TargetsHit.Count;

                for (int a = 0; a < targets; a++)
                {
                    double damage = 0;

                    Mobile mobile = m_TargetsHit[a];

                    if (mobile == null)
                    {
                        continue;
                    }
                    if (!mobile.Alive || mobile.Deleted)
                    {
                        continue;
                    }

                    switch (eggType)
                    {
                    case EggType.Explosive:
                        damage = (double)(Utility.RandomMinMax(20, 40));

                        if (mobile is BaseCreature)
                        {
                            damage *= 1.5;
                        }

                        AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                        break;

                    case EggType.Entangle:
                        if (mobile != null)
                        {
                            SpecialAbilities.EntangleSpecialAbility(1.0, null, mobile, 1, 10, -1, true, "", "You are held in place!", "-1");
                        }
                        break;

                    case EggType.Poison:
                        Poison poison = Poison.GetPoison(Utility.RandomMinMax(2, 4));
                        mobile.ApplyPoison(mobile, poison);
                        break;

                    case EggType.Ice:
                        damage = (double)(Utility.RandomMinMax(10, 20));

                        if (mobile is BaseCreature)
                        {
                            damage *= 1.5;
                        }

                        SpecialAbilities.CrippleSpecialAbility(1.0, null, mobile, .5, 10, -1, true, "", "A blast of ice has slowed your actions!", "-1");

                        AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0);
                        break;

                    case EggType.Gust:
                        SpecialAbilities.KnockbackSpecialAbility(1.0, Location, null, mobile, 40, 8, -1, "", "A gust of wind knocks you off your feet!");
                        break;

                    case EggType.Banish:
                        SpecialAbilities.HinderSpecialAbility(1.0, null, mobile, 1.0, 5, false, -1, false, "", "You cannot move or speak!", "-1");

                        mobile.Squelched = true;
                        mobile.Hidden    = true;

                        Timer.DelayCall(TimeSpan.FromSeconds(5), delegate
                        {
                            if (mobile == null)
                            {
                                return;
                            }

                            mobile.Squelched = false;
                            mobile.Hidden    = false;
                        });
                        break;

                    case EggType.Bloody:
                        SpecialAbilities.BleedSpecialAbility(1.0, null, mobile, 40, 8.0, 0x44D, true, "", "You begin to bleed!", "-1");
                        break;
                    }
                }
            });
        }
Exemplo n.º 56
0
        //----------------------------------------------------------------------------------------------------//

        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile       m      = from;
            PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                if

//----------------------------------------------------------------------------------------------------//



//----------------------------------------------------------------------------------------------------//

//---------Follow The Format Below To Add Your Own Weapons For The Weapons Collector To Buy-----------//

//----------------------------------------------------------------------------------------------------//



//--------------------------------------------------------------------------Ancient Weapon Set--------//

                ((dropped is AncientAxe)
                 | (dropped is AncientBattleAxe)
                 | (dropped is AncientDoubleAxe)
                 | (dropped is AncientExecutionersAxe)
                 | (dropped is AncientHatchet)
                 | (dropped is AncientLargeBattleAxe)
                 | (dropped is AncientPickaxe)
                 | (dropped is AncientTwoHandedAxe)
                 | (dropped is AncientWarAxe)
                 | (dropped is AncientBow)
                 | (dropped is AncientCompositeBow)
                 | (dropped is AncientCrossbow)
                 | (dropped is AncientHeavyCrossbow)
                 | (dropped is AncientRepeatingCrossbow)
                 | (dropped is AncientButcherKnife)
                 | (dropped is AncientCleaver)
                 | (dropped is AncientDagger)
                 | (dropped is AncientSkinningKnife)
                 | (dropped is AncientClub)
                 | (dropped is AncientHammerPick)
                 | (dropped is AncientMace)
                 | (dropped is AncientMaul)
                 | (dropped is AncientScepter)
                 | (dropped is AncientWarHammer)
                 | (dropped is AncientWarMace)
                 | (dropped is AncientBardiche)
                 | (dropped is AncientHalberd)
                 | (dropped is AncientScythe)
                 | (dropped is AncientBladedStaff)
                 | (dropped is AncientDoubleBladedStaff)
                 | (dropped is AncientPike)
                 | (dropped is AncientPitchfork)
                 | (dropped is AncientShortSpear)
                 | (dropped is AncientSpear)
                 | (dropped is AncientWarFork)
                 | (dropped is AncientBlackStaff)
                 | (dropped is AncientGnarledStaff)
                 | (dropped is AncientQuarterStaff)
                 | (dropped is AncientShepherdsCrook)
                 | (dropped is AncientBoneHarvester)
                 | (dropped is AncientBroadSword)
                 | (dropped is AncientCrescentBlade)
                 | (dropped is AncientCutlass)
                 | (dropped is AncientKatana)
                 | (dropped is AncientKryss)
                 | (dropped is AncientLance)
                 | (dropped is AncientLongSword)
                 | (dropped is AncientScimitar)
                 | (dropped is AncientVikingSword)

//----------------------------------------------------------------------------Venom Weapon Set---------//


                 | (dropped is VenomAxe)
                 | (dropped is VenomBattleAxe)
                 | (dropped is VenomDoubleAxe)
                 | (dropped is VenomExecutionersAxe)
                 | (dropped is VenomHatchet)
                 | (dropped is VenomLargeBattleAxe)
                 | (dropped is VenomPickaxe)
                 | (dropped is VenomTwoHandedAxe)
                 | (dropped is VenomWarAxe)
                 | (dropped is VenomButcherKnife)
                 | (dropped is VenomCleaver)
                 | (dropped is VenomDagger)
                 | (dropped is VenomSkinningKnife)
                 | (dropped is VenomClub)
                 | (dropped is VenomHammerPick)
                 | (dropped is VenomMace)
                 | (dropped is VenomMaul)
                 | (dropped is VenomScepter)
                 | (dropped is VenomWarHammer)
                 | (dropped is VenomWarMace)
                 | (dropped is VenomBardiche)
                 | (dropped is VenomHalberd)
                 | (dropped is VenomScythe)
                 | (dropped is VenomBow)
                 | (dropped is VenomCompositeBow)
                 | (dropped is VenomCrossbow)
                 | (dropped is VenomHeavyCrossbow)
                 | (dropped is VenomRepeatingCrossbow)
                 | (dropped is VenomBladedStaff)
                 | (dropped is VenomDoubleBladedStaff)
                 | (dropped is VenomPike)
                 | (dropped is VenomPitchfork)
                 | (dropped is VenomShortSpear)
                 | (dropped is VenomSpear)
                 | (dropped is VenomWarFork)
                 | (dropped is VenomBlackStaff)
                 | (dropped is VenomGnarledStaff)
                 | (dropped is VenomQuarterStaff)
                 | (dropped is VenomShepherdsCrook)
                 | (dropped is VenomBoneHarvester)
                 | (dropped is VenomBroadSword)
                 | (dropped is VenomCrescentBlade)
                 | (dropped is VenomCutlass)
                 | (dropped is VenomKatana)
                 | (dropped is VenomKryss)
                 | (dropped is VenomLance)
                 | (dropped is VenomLongSword)
                 | (dropped is VenomScimitar)
                 | (dropped is VenomVikingSword)


//-----------------------------------------------------------------------------Soul Weapon Set---------//

                 | (dropped is EntrappedSoulAxe)
                 | (dropped is EntrappedSoulBattleAxe)
                 | (dropped is EntrappedSoulDoubleAxe)
                 | (dropped is EntrappedSoulExecutionersAxe)
                 | (dropped is EntrappedSoulHatchet)
                 | (dropped is EntrappedSoulLargeBattleAxe)
                 | (dropped is EntrappedSoulPickaxe)
                 | (dropped is EntrappedSoulTwoHandedAxe)
                 | (dropped is EntrappedSoulWarAxe)
                 | (dropped is EntrappedSoulButcherKnife)
                 | (dropped is EntrappedSoulCleaver)
                 | (dropped is EntrappedSoulDagger)
                 | (dropped is EntrappedSoulSkinningKnife)
                 | (dropped is EntrappedSoulClub)
                 | (dropped is EntrappedSoulHammerPick)
                 | (dropped is EntrappedSoulMace)
                 | (dropped is EntrappedSoulMaul)
                 | (dropped is EntrappedSoulScepter)
                 | (dropped is EntrappedSoulWarHammer)
                 | (dropped is EntrappedSoulWarMace)
                 | (dropped is EntrappedSoulBardiche)
                 | (dropped is EntrappedSoulHalberd)
                 | (dropped is EntrappedSoulScythe)
                 | (dropped is EntrappedSoulBow)
                 | (dropped is EntrappedSoulCompositeBow)
                 | (dropped is EntrappedSoulCrossbow)
                 | (dropped is EntrappedSoulHeavyCrossbow)
                 | (dropped is EntrappedSoulRepeatingCrossbow)
                 | (dropped is EntrappedSoulBladedStaff)
                 | (dropped is EntrappedSoulDoubleBladedStaff)
                 | (dropped is EntrappedSoulPike)
                 | (dropped is EntrappedSoulPitchfork)
                 | (dropped is EntrappedSoulShortSpear)
                 | (dropped is EntrappedSoulSpear)
                 | (dropped is EntrappedSoulWarFork)
                 | (dropped is EntrappedSoulBlackStaff)
                 | (dropped is EntrappedSoulGnarledStaff)
                 | (dropped is EntrappedSoulQuarterStaff)
                 | (dropped is EntrappedSoulShepherdsCrook)
                 | (dropped is EntrappedSoulBoneHarvester)
                 | (dropped is EntrappedSoulBroadSword)
                 | (dropped is EntrappedSoulCrescentBlade)
                 | (dropped is EntrappedSoulCutlass)
                 | (dropped is EntrappedSoulKatana)
                 | (dropped is EntrappedSoulKryss)
                 | (dropped is EntrappedSoulLance)
                 | (dropped is EntrappedSoulLongSword)
                 | (dropped is EntrappedSoulScimitar)
                 | (dropped is EntrappedSoulVikingSword)

//-----------------------------------------------------------------------------Area Weapon Set---------//

                 | (dropped is AreaAxe)
                 | (dropped is AreaBattleAxe)
                 | (dropped is AreaDoubleAxe)
                 | (dropped is AreaExecutionersAxe)
                 | (dropped is AreaHatchet)
                 | (dropped is AreaLargeBattleAxe)
                 | (dropped is AreaPickaxe)
                 | (dropped is AreaTwoHandedAxe)
                 | (dropped is AreaWarAxe)
                 | (dropped is AreaButcherKnife)
                 | (dropped is AreaCleaver)
                 | (dropped is AreaDagger)
                 | (dropped is AreaSkinningKnife)
                 | (dropped is AreaClub)
                 | (dropped is AreaHammerPick)
                 | (dropped is AreaMace)
                 | (dropped is AreaMaul)
                 | (dropped is AreaScepter)
                 | (dropped is AreaWarHammer)
                 | (dropped is AreaWarMace)
                 | (dropped is AreaBardiche)
                 | (dropped is AreaHalberd)
                 | (dropped is AreaScythe)
                 | (dropped is AreaBow)
                 | (dropped is AreaCompositeBow)
                 | (dropped is AreaCrossbow)
                 | (dropped is AreaHeavyCrossbow)
                 | (dropped is AreaRepeatingCrossbow)
                 | (dropped is AreaBladedStaff)
                 | (dropped is AreaDoubleBladedStaff)
                 | (dropped is AreaPike)
                 | (dropped is AreaPitchfork)
                 | (dropped is AreaShortSpear)
                 | (dropped is AreaSpear)
                 | (dropped is AreaWarFork)
                 | (dropped is AreaBlackStaff)
                 | (dropped is AreaGnarledStaff)
                 | (dropped is AreaQuarterStaff)
                 | (dropped is AreaShepherdsCrook)
                 | (dropped is AreaBoneHarvester)
                 | (dropped is AreaBroadSword)
                 | (dropped is AreaCrescentBlade)
                 | (dropped is AreaCutlass)
                 | (dropped is AreaKatana)
                 | (dropped is AreaKryss)
                 | (dropped is AreaLance)
                 | (dropped is AreaLongSword)
                 | (dropped is AreaScimitar)
                 | (dropped is AreaVikingSword)

//--------------------------------------------------------------------------Standard Weapon Set-------//

                 | (dropped is Axe)
                 | (dropped is BattleAxe)
                 | (dropped is DoubleAxe)
                 | (dropped is ExecutionersAxe)
                 | (dropped is Hatchet)
                 | (dropped is LargeBattleAxe)
                 | (dropped is Pickaxe)
                 | (dropped is TwoHandedAxe)
                 | (dropped is WarAxe)
                 | (dropped is ButcherKnife)
                 | (dropped is Cleaver)
                 | (dropped is Dagger)
                 | (dropped is SkinningKnife)
                 | (dropped is Club)
                 | (dropped is HammerPick)
                 | (dropped is Mace)
                 | (dropped is Maul)
                 | (dropped is Scepter)
                 | (dropped is WarHammer)
                 | (dropped is WarMace)
                 | (dropped is Bardiche)
                 | (dropped is Halberd)
                 | (dropped is Scythe)
                 | (dropped is Bow)
                 | (dropped is CompositeBow)
                 | (dropped is Crossbow)
                 | (dropped is HeavyCrossbow)
                 | (dropped is RepeatingCrossbow)
                 | (dropped is BladedStaff)
                 | (dropped is DoubleBladedStaff)
                 | (dropped is Pike)
                 | (dropped is Pitchfork)
                 | (dropped is ShortSpear)
                 | (dropped is Spear)
                 | (dropped is WarFork)
                 | (dropped is BlackStaff)
                 | (dropped is GnarledStaff)
                 | (dropped is QuarterStaff)
                 | (dropped is ShepherdsCrook)
                 | (dropped is BoneHarvester)
                 | (dropped is Broadsword)
                 | (dropped is CrescentBlade)
                 | (dropped is Cutlass)
                 | (dropped is Katana)
                 | (dropped is Kryss)
                 | (dropped is Lance)
                 | (dropped is Longsword)
                 | (dropped is Scimitar)
                 | (dropped is VikingSword))

                //--------------------------------------------------------------------<New Set Name> Weapon Set-------//

                // Left Blank For Further Additions...

                //----------------------------------------------------------------------------------------------------//

                //---------Follow The Format Above To Add Your Own Weapons For The Weapons Collector To Buy-----------//

                //----------------------------------------------------------------------------------------------------//
                {
                    mobile.AddToBackpack(new Gold(1500, 2500));
                    mobile.SendMessage("You have sold your Weapon to the Weapons Collector!");
                    this.PrivateOverheadMessage(MessageType.Regular, 0, false, "I thank thee kindly!", mobile.NetState);
                    dropped.Delete();
                }

                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 0, false, "I have no need for this item.", mobile.NetState);
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
Exemplo n.º 57
0
        public static bool WithdrawUniqueCurrency(Mobile from, Type currencyType, int amount, bool playSound)
        {
            if (from == null || currencyType == null || amount == null)
            {
                return(false);
            }

            Container bankBox = from.FindBankNoCreate();

            PlayerMobile pm_From = from as PlayerMobile;

            if (pm_From == null)
            {
                return(false);
            }

            Item[] currencyPiles;

            int balance = 0;

            if (bankBox != null)
            {
                currencyPiles = bankBox.FindItemsByType(currencyType);

                for (int i = 0; i < currencyPiles.Length; ++i)
                {
                    balance += currencyPiles[i].Amount;
                }

                if (balance < amount)
                {
                    return(false);
                }

                for (int i = 0; amount > 0 && i < currencyPiles.Length; ++i)
                {
                    if (currencyPiles[i].Amount <= amount)
                    {
                        amount -= currencyPiles[i].Amount;
                        currencyPiles[i].Delete();
                    }

                    else
                    {
                        currencyPiles[i].Amount -= amount;
                        amount = 0;
                    }
                }
            }

            else
            {
                return(false);
            }

            if (playSound)
            {
                from.SendSound(0x2E6);
            }

            return(true);
        }