public void UseSkinning(Mobile.Casting cast, Character c, Mobile go)
        {
            c.cast = cast;
            int rdiff = CurrentVal(c) - 1;
            int res   = StrSkillCheck(c, rdiff);

            if (res > 50 && !go.Skinned)
            {
                //c.SpellSuccess();
                float reussite = (float)res;

                reussite = reussite / 10f;
                ArrayList loot = new ArrayList();
                c.LootOwner = go.Guid;
                if (go.SkinLoot != null)
                {
                    ArrayList sl = new ArrayList();
                    foreach (Loot l in go.SkinLoot)
                    {
                        if (Utility.RandomDouble() * 100 < l.Probability)
                        {
                            int n = (int)(reussite * l.Probability);
                            sl.Add(l.Create(1));
                        }
                    }
                    if (sl.Count == 0)
                    {
                        c.SpellFaillure(SpellFailedReason.FailedAttempt);
                        return;
                    }
                    go.Skinned = true;
                    if (Current < Cap(c) && c.SkillUp(Current, rdiff, 1))
                    {
                        Current++;
                        c.SendSkillUpdate();
                    }
                    c.SpellSuccess();
                    c.previousSpellCasted = cast.id;

                    go.Treasure = (Item[])sl.ToArray(typeof(Item));
                    c.SendLootDetails(go.Guid, go, 0);
                    go.SendSmallUpdateToPlayerNearMe(new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, (int)UpdateFields.UNIT_FIELD_FLAGS }, new object[] { go.DynFlags(c), go.Flags });
                }
                else
                {
                    c.SpellFaillure(SpellFailedReason.FailedAttempt);
                }
            }
            else
            {
                c.SpellFaillure(SpellFailedReason.FailedAttempt);
                go.SendSmallUpdateToPlayerNearMe(new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, (int)UpdateFields.UNIT_FIELD_FLAGS }, new object[] { go.DynFlags(c), go.Flags });
            }
        }
        public void UseHerbalist(Mobile.Casting cast, Character c, GameObject go)
        {
            Hashtable diff = new Hashtable();

            diff[29] = 0;
            diff[8]  = 20;
            diff[9]  = 50;
            diff[10] = 75;
            diff[11] = 100;
            diff[26] = 125;
            diff[27] = 150;
            diff[35] = 140;
            diff[45] = 125;
            diff[47] = 160;
            diff[48] = 215;
            diff[49] = 185;
            diff[50] = 205;
            diff[51] = 195;
            int rdiff = CurrentVal(c) - (int)diff[(int)go.Sound[0]];
            int res   = IqSkillCheck(c, rdiff);

            if (res > 50)
            {
                if (Current < Cap(c) && c.SkillUp(Current, rdiff, 1))
                {
                    Current++;
                    c.SendSkillUpdate();
                    //c.SendSmallUpdate( new int[]{ Index, Index + 1, Index + 2 }, new object[]{ (int)Id, (short)CurrentVal(c), (short)Cap( c ), (int)0 } );
                }
                c.SpellSuccess();
                float reussite = (float)res;

                reussite = reussite / 10f;
                string str = "Reussite : " + reussite.ToString();
                c.SendMessage(str);
                if (!go.CheckLoot(c, reussite))
                {
                    c.SpellFaillure(SpellFailedReason.FailedAttempt);
                }
            }
            else
            {
                //	Console.WriteLine("SPELL RESULT :{0}", result );
                c.SpellFaillure(SpellFailedReason.FailedAttempt);
            }
        }
        public void UseMining(Mobile.Casting cast, Character c, GameObject go)
        {
            Hashtable diff = new Hashtable();

            diff[18] = 25;
            diff[19] = 50;
            diff[20] = 75;
            diff[21] = 100;
            diff[22] = 125;
            diff[25] = 150;
            diff[38] = 0;              //	Copper
            diff[39] = 50;             // Tin
            diff[40] = 100;            //	Silver
            diff[41] = 150;            // Iron
            diff[42] = 200;            //	Gold
            int rdiff = CurrentVal(c) - (int)diff[(int)go.Sound[0]];
            int res   = StrSkillCheck(c, rdiff);

            if (res > 50)
            {
                if (Current < Cap(c) && c.SkillUp(Current, rdiff, 1))
                {
                    Current++;
                    c.SendSkillUpdate();
                }
                c.SpellSuccess();
                float reussite = (float)res;

                reussite = reussite / 10f;
                //	string str = "Reussite : " + reussite.ToString();
                //	c.SendMessage( str );
                if (!go.CheckLoot(c, reussite))
                {
                    c.SpellFaillure(SpellFailedReason.FailedAttempt);
                }
            }
            else
            {
                //	Console.WriteLine("SPELL RESULT :{0}", result );
                c.SpellFaillure(SpellFailedReason.FailedAttempt);
            }
        }
        public void UseFishing(Mobile.Casting cast, Character c)
        {
            GameObject desc = c.InsideFishingZone();

            if (desc == null)
            {
                c.SpellFaillure(SpellFailedReason.TheyArentAnyFishHere);
                return;
            }
            int rdiff = CurrentVal(c);
            int res   = AgiSkillCheck(c, rdiff);

            if (res > 50)
            {
                if (Current < Cap(c) && c.SkillUp(Current, rdiff, 1))
                {
                    Current++;
                    c.SendSkillUpdate();
                }
                c.SpellSuccess();
                float reussite = (float)res;

                reussite = reussite / 10f;
                string str = "Reussite : " + reussite.ToString();
                c.SendMessage(str);
                if (!desc.CheckLoot(c, reussite))
                {
                    c.SpellFaillure(SpellFailedReason.FailedAttempt);
                }
            }
            else
            {
                //	Console.WriteLine("SPELL RESULT :{0}", result );
                c.SpellFaillure(SpellFailedReason.FailedAttempt);
            }
        }
Esempio n. 5
0
		public void UseSkinning( Mobile.Casting cast, Character c, Mobile go )
		{
			c.cast = cast;
			int rdiff = CurrentVal(c) - 1;
			int res = StrSkillCheck( c, rdiff );

			if ( res > 50 && !go.Skinned )
			{
				//c.SpellSuccess();
				float reussite = (float)res;

				reussite = reussite / 10f;
				ArrayList loot = new ArrayList();
				c.LootOwner = go.Guid;				
				if ( go.SkinLoot != null )
				{					

					ArrayList sl = new ArrayList();
					foreach( Loot l in go.SkinLoot )
					{
						if ( Utility.RandomDouble() * 100 < l.Probability )
						{					
							int n = (int)( reussite * l.Probability );
							sl.Add( l.Create( 1 ) );
						}
					}
					if ( sl.Count == 0 )
					{
						c.SpellFaillure( SpellFailedReason.FailedAttempt );
						return;
					}
					go.Skinned = true;
					if ( Current < Cap( c ) && c.SkillUp( Current, rdiff, 1 ) )
					{
						Current++;
						c.SendSkillUpdate();
					}
					c.SpellSuccess();
					c.previousSpellCasted = cast.id;
					
					go.Treasure = (Item[])sl.ToArray( typeof( Item ) );
					c.SendLootDetails( go.Guid, go, 0 );
					go.SendSmallUpdateToPlayerNearMe( new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, (int)UpdateFields.UNIT_FIELD_FLAGS }, new object[] { go.DynFlags( c ), go.Flags } );
				}
				else
					c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
			else
			{
				c.SpellFaillure( SpellFailedReason.FailedAttempt );
				go.SendSmallUpdateToPlayerNearMe( new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, (int)UpdateFields.UNIT_FIELD_FLAGS }, new object[] { go.DynFlags( c ), go.Flags } );
			}
		}
Esempio n. 6
0
		public void UseMining(Mobile.Casting cast, Character c, GameObject go )
		{
			Hashtable diff = new Hashtable();
			diff[ 18 ] = 25;
			diff[ 19 ] = 50;
			diff[ 20 ] = 75;
			diff[ 21 ] = 100;
			diff[ 22 ] = 125;
			diff[ 25 ] = 150;
			diff[ 38 ] = 0;//	Copper
			diff[ 39 ] = 50;// Tin
			diff[ 40 ] = 100;//	Silver
			diff[ 41 ] = 150;// Iron
			diff[ 42 ] = 200;//	Gold
			int rdiff = CurrentVal(c) - (int)diff[ (int)go.Sound[ 0 ] ];
			int res = StrSkillCheck( c, rdiff );

			if ( res > 50 )
			{
				if ( Current < Cap( c ) && c.SkillUp( Current, rdiff, 1 ) )
				{
					Current++;
					c.SendSkillUpdate();
				}
				c.SpellSuccess();
				float reussite = (float)res;

				reussite = reussite / 10f;
			//	string str = "Reussite : " + reussite.ToString();
			//	c.SendMessage( str );
				if(	!go.CheckLoot( c, reussite ) )
					c.SpellFaillure( SpellFailedReason.FailedAttempt );
				
			}
			else
			{
			//	Console.WriteLine("SPELL RESULT :{0}", result );
				c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
		}
Esempio n. 7
0
		public void UseFishing(Mobile.Casting cast, Character c )
		{
			GameObject desc = c.InsideFishingZone();
			if ( desc == null )
			{
				c.SpellFaillure( SpellFailedReason.TheyArentAnyFishHere );
				return;				
			}
			int rdiff = CurrentVal(c);
			int res = AgiSkillCheck( c, rdiff );
			if ( res > 50 )
			{
				if ( Current < Cap( c ) && c.SkillUp( Current, rdiff, 1 ) )
				{
					Current++;
					c.SendSkillUpdate();
				}
				c.SpellSuccess();
				float reussite = (float)res;

				reussite = reussite / 10f;
				string str = "Reussite : " + reussite.ToString();
				c.SendMessage( str );
				if(	!desc.CheckLoot( c, reussite ) )
					c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
			else
			{
				//	Console.WriteLine("SPELL RESULT :{0}", result );
				c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
		}
Esempio n. 8
0
		public void UseHerbalist(Mobile.Casting cast, Character c, GameObject go )
		{
			Hashtable diff = new Hashtable();
			diff[ 29 ] = 0;
			diff[ 8 ] = 20;
			diff[ 9 ] = 50;
			diff[ 10 ] = 75;
			diff[ 11 ] = 100;
			diff[ 26 ] = 125;
			diff[ 27 ] = 150;
			diff[ 35 ] = 140;
			diff[ 45 ] = 125;
			diff[ 47 ] = 160;
			diff[ 48 ] = 215;
			diff[ 49 ] = 185;
			diff[ 50 ] = 205;
			diff[ 51 ] = 195;
			int rdiff = CurrentVal(c) - (int)diff[ (int)go.Sound[ 0 ] ];
			int res = IqSkillCheck( c, rdiff );
			
			if ( res > 50 )
			{
				if ( Current < Cap( c ) && c.SkillUp( Current, rdiff, 1 ) )
				{
					Current++;
					c.SendSkillUpdate();
					//c.SendSmallUpdate( new int[]{ Index, Index + 1, Index + 2 }, new object[]{ (int)Id, (short)CurrentVal(c), (short)Cap( c ), (int)0 } );
				}
				c.SpellSuccess();
				float reussite = (float)res;

				reussite = reussite / 10f;
				string str = "Reussite : " + reussite.ToString();
				c.SendMessage( str );
				if ( !go.CheckLoot( c, reussite ) )
					c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
			else
			{
				//	Console.WriteLine("SPELL RESULT :{0}", result );
				c.SpellFaillure( SpellFailedReason.FailedAttempt );
			}
		}