Exemple #1
0
 public void Add( Character c, ushort droit )
 {
     Member m = new Member( c );
     m.Droits = droit;
     members.Add( m );
     if ( Count == 1 )
         groupLeader = m;
     else
         UpdateList();
 }
Exemple #2
0
 public void PromoteLeader( Character c )
 {
     foreach( Member to in Members )
     {
         int offset = 4;
         Converter.ToBytes( to.Char.Name, groupLeader.Char.tempBuff, ref offset );
         Converter.ToBytes( (byte)0, groupLeader.Char.tempBuff, ref offset );
         to.Char.Send( OpCodes.SMSG_GROUP_SET_LEADER, groupLeader.Char.tempBuff, offset );
         if ( c == to.Char )
             groupLeader = to;
     }
     UpdateList();
 }
Exemple #3
0
        public PathForTaxi(int taxiPathId,Character ch)
        {
            int map = ch.MapId;
            mapChange = 0;
            ArrayList list = new ArrayList();
            foreach(TaxiPathNode tpn in Server.Taxi.TaxiPathNodesList)
            {
                if(tpn.TaxiPath == taxiPathId)
                {
                    if (map != tpn.MapId)
                    {
                        mapIds[mapChange].index = tpn.Index;
                        mapIds[mapChange].mapId = tpn.MapId;
                        mapChange++;
                        map = tpn.MapId;
                    }
                    list.Add(tpn);
                }
            }

            int num = list.Count;
            Coord []coordinates = new Coord[num];
            TaxiPathNode []tpnArray = new TaxiPathNode[num];

            foreach(TaxiPathNode tpn in list)
            {
                tpnArray[tpn.Index] = tpn;
            }

            for(int i = 0; i < num; i++)
            {

                if (i == 0)	coordinates[i] = new Coord( tpnArray[i].X,tpnArray[i].Y,tpnArray[i].Z,null,null);
                else coordinates[i] = new Coord( tpnArray[i].X,tpnArray[i].Y,tpnArray[i].Z,coordinates[i-1],null);
            }

            t = new Trajet(coordinates);
        }
Exemple #4
0
			public CastTrainerSpell( BaseAbility i, Character t, Mobile teachr ) :  base( WowTimer.Priorities.Milisec100 , 500, "CastTrainerSpell" )
			{
				to = t;
				teach = i;
				teacher = teachr;				
				byte []buff = { 0,0, 0,0, 0xD9, 0xDB, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9, 0xDB, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
				//int offset = 4;
				int spell = 0;
				if ( i is Teach )
					spell = ( i as Teach ).TeachId;
				else
					spell = i.Id;
				/*
				Converter.ToBytes( t.Guid, buff, ref offset );
				Converter.ToBytes( teacher.Guid, buff, ref offset );
				Converter.ToBytes( spell, buff, ref offset );
				Converter.ToBytes( 0x100, buff, ref offset );
				Converter.ToBytes( 0, buff, ref offset );
				to.Send( OpCodes.SMSG_SPELL_START, buff );
*/
				teacher.FakeCast( spell, t );
				Start();
			}
Exemple #5
0
		public void MakeThePacket( UInt64 g, Character with, Character from )
		{
byte []buff = new byte[]{
		0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1F, 0x68, 0x29, 0x00, 0x00, 0x10, 0x00, 0xF0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x54, 0x0B,	0xC6, 0x04, 0x71, 0xDE, 0xC2, 0x1D, 
		0x3D, 0xA5, 0x42, 0xBC, 0x69, 0x99, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x66, 0xD1, 0x08, 0x00, 0x68, 0x09, 0x43, 0x35, 0x00, 0x10, 0x00, 0xF0, 0x1C, 0x64, 0x5E,	0x62, 0x38, 0xC3, 0x14, 0x08, 0x01, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x64, 0x5E, 0x62, 0x7C, 0xA1, 0x14, 0x08, 0x01, 0x00, 0x00, 0x00, 0x01, 0x5F, 0x71,	0xEF, 0x00, 0x1F, 0x68, 0x29, 0x00, 
		0x00, 0x10, 0x00, 0xF0, 0x21, 0x00, 0x00, 0x00, 0xB0, 0x54, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x65, 0x77, 0xE4, 0x00, 0x13, 0x03, 0x00, 0x00, 0xE5, 0x64,	0x10, 0x3F, 0x35, 0x64, 0x53, 0x3F, 
		0x01, 0x00, 0x00, 0x00, 0x3E, 0x54, 0x0B, 0xC6, 0x04, 0x71, 0xDE, 0xC2, 0x1D, 0x3D, 0xA5, 0x42, 0xBC, 0x69, 0x99, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 
		0x00, 0x65, 0x77, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x1F, 0x68, 0x29, 0x00, 0x00, 0x10, 
		0x00, 0xF0, 0x00, 0x36, 0xB7, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x00, 0x00, 0x1F, 0x68, 0x29, 0x00, 0x00, 0x10, 0x00, 0xF0
			};

					
			int t = 6;
			Converter.ToBytes( g, buff, ref t );
			t = 92;
			Converter.ToBytes( g, buff, ref t );
			t = 112;
			Converter.ToBytes( (uint)( from.Guid & 0xffffffff ), buff, ref t );
			t = 161;
			Converter.ToBytes( with.Guid, buff, ref t );
			t = 0x13a;
			Converter.ToBytes( g, buff, ref t );
			t++;
			Converter.ToBytes( Guid, buff, ref t );
			t = buff.Length - 8;
			Converter.ToBytes( g, buff, ref t );
			t = 23;
			Converter.ToBytes( X + 1, buff, ref t );
			Converter.ToBytes( Y + 1, buff, ref t );
			Converter.ToBytes( Z, buff, ref t );


			byte []res = Zip.Compress( buff, 0, buff.Length );
			byte []data = new byte[ res.Length + 8 ];
			int offset = 4;	
			Buffer.BlockCopy( res, 0, data, 8, res.Length );			
			Converter.ToBytes( buff.Length, data, ref offset );
			account.Handler.Send( 0x1F6, data, res.Length + 6 );
		}
Exemple #6
0
			public TestTimer( Character c, Mobile f ) : base( WowTimer.Priorities.Milisec100 , 1000, "TestTimer" )
			{
				from = c;
				to = f;
				float ax = ( c.X - to.X );
				float ay = ( c.Y - to.Y );
				float az = ( c.Z - to.Z );
				float dist = (float)Math.Sqrt( ax * ax + ay * ay + az * az );
				from.SendMessage( "dist = " + dist.ToString() );
				Start();
			}
Exemple #7
0
		void SendMessageTo( Character c, string txt, int langue )
		{
			SendMessageTo( c, ChatMsgType.CHAT_MSG_SAY, txt, langue );
		}
Exemple #8
0
			public DuelTimer( Character c1, Character c2, UInt64 f ) : base( WowTimer.Priorities.Milisec100 , 3000, "DuelTimer" )
			{
				from = c1;
				vs = c2;
				flag = f;
				x = c1.X;
				y = c1.Y;
				z = c1.Z;
				Start();
			}
Exemple #9
0
		public void PrepareUpdateDataForOther( byte []data, ref int offset, UpdateType type, Character f )
		{
			PrepareUpdateData( data, ref offset, type, true, f );
		}
Exemple #10
0
        public override void PrepareUpdateData( byte []data, ref int offset, UpdateType type, bool forOther, Character f )
        {
            if ( GameObjectDescription.all[ id ] == null )
            {
                Console.WriteLine("Gameobject id = {0} undifined !" , id );
                return;
            }
            int start = offset;
            data[ offset++ ] = (byte)UpdateType.UpdateFull;
            Converter.ToBytes( Guid, data, ref offset );

            Converter.ToBytes( (byte)5, data, ref offset );//	type A9 = 5
            Converter.ToBytes( (int)0, data, ref offset );
            Converter.ToBytes( (int)0, data, ref offset );//	Movement flags
            Converter.ToBytes( X, data, ref offset );
            Converter.ToBytes( Y, data, ref offset );
            Converter.ToBytes( Z, data, ref offset );
            Converter.ToBytes( Orientation, data, ref offset );
            Converter.ToBytes( (float)0f, data, ref offset );
            Converter.ToBytes( (float)2.5f, data, ref offset );
            Converter.ToBytes( (float)7.0f, data, ref offset );
            Converter.ToBytes( (float)2.5f, data, ref offset );
            Converter.ToBytes( (float)4.7222f, data, ref offset );
            Converter.ToBytes( (float)4.5f, data, ref offset );//	vitesse encore ?
            Converter.ToBytes( (float)Math.PI, data, ref offset );//	turn rate
            Converter.ToBytes( (uint)0, data, ref offset );
            Converter.ToBytes( (uint)1, data, ref offset );

            Converter.ToBytes( 0, data, ref offset );
            Converter.ToBytes( 0, data, ref offset );
            Converter.ToBytes( 0, data, ref offset );
            ResetBitmap();
            setUpdateValue( 0, Guid );
            setUpdateValue( 2, 0x21 );
            setUpdateValue( (int)UpdateFields.OBJECT_FIELD_ENTRY, (uint)id );
            setUpdateValue( (int)UpdateFields.OBJECT_FIELD_SCALE_X, (float)Size );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_DISPLAYID, (int)Model );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_FLAGS, Flags );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_ROTATION, RotationX );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_ROTATION + 1, RotationY );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_ROTATION + 2, RotationZ);
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_ROTATION + 3, Facing );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_STATE, (int)1 );//	2 = destroy
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_POS_X, X );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_POS_Y, Y);
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_POS_Z, Z );
            //setUpdateValue( (int)UpdateFields.GAMEOBJECT_FACING, RotationZ );
            setUpdateValue( (int)UpdateFields.GAMEOBJECT_TYPE_ID, ( GameObjectDescription.all[ id ] as GameObjectDescription ).Type );

            FlushUpdateData( data, ref offset, 1 );
            return;
        }
Exemple #11
0
 public void ForceLoot( Character c )
 {
     int offset = 4;
     Converter.ToBytes( c.Guid, tempBuff, ref offset );
     Converter.ToBytes( Guid, tempBuff, ref offset );
     c.Send( OpCodes.CMSG_LOOT, tempBuff, offset );
 }
Exemple #12
0
        public bool CheckLoot( Character c, float reussite )
        {
            GameObjectDescription god = (GameObjectDescription)GameObjectDescription.all[ id ];
            if ( god == null )
                return false;

            ArrayList loot = new ArrayList();
            c.LootOwner = Guid;
            if ( god.Loots != null )
            {/*
                foreach( Loot l in god.Loots )
                {
                    if ( Utility.RandomDouble() * 100 < l.Probability )
                    {
                        int n = (int)( reussite * l.Probability );
                        if ( n < 1 )
                            n = 1;
                        if ( n > 10 )
                            n = 6;
                        loot.Add( l.Create( n ) );
                    }
                }*/
                int lootMoney = 0;
                foreach( BaseTreasure l in god.Loots )
                {
                    if ( l.IsDrop() )
                    {
                        ArrayList ret = l.RandomDrop( ref lootMoney );
                        if ( ret != null )
                            loot.AddRange( ret );
                    }
                }
                Treasure = (Item[])loot.ToArray( typeof( Item ) );

                c.SendLootDetails( Guid, this, lootMoney  );
            }
            else
                return false;
            return true;
        }
Exemple #13
0
 public void ResetHonorWeek(Character ch)
 {
     XmlDocument doc = new XmlDocument();
     doc.Load(HonorTimer.DBpath);
     foreach(XmlElement player in doc.DocumentElement["players"].ChildNodes)
     {
         if (player["name"].InnerText==ch.Name)
         {
             //Last Week
             player["hkillsLastWeek"].InnerText=player["honarableThisWeek"].InnerText;
             player["dishkillsLastWeek"].InnerText=player["dishonarableThisWeek"].InnerText;
             //This Week
             player["dishonarableThisWeek"].InnerText=Convert.ToString(Convert.ToUInt32(player["dishonarableToday"].InnerText)+
                 Convert.ToUInt32(player["dishonarableThisWeek"].InnerText));
             player["honarableThisWeek"].InnerText=Convert.ToString(Convert.ToUInt32(player["honarableToday"].InnerText) +
                 Convert.ToUInt32(player["honarableThisWeek"].InnerText));
             player["honorThisWeek"].InnerText=Convert.ToString(Convert.ToUInt32(player["honorToday"].InnerText) +
                 Convert.ToUInt32(player["honorThisWeek"].InnerText));
             //Yesterday
             player["honarableYesterday"].InnerText=player["honarableToday"].InnerText;
             player["honorYesterday"].InnerText=player["honorToday"].InnerText;
             //Today
             player["honarableToday"].InnerText="0";
             player["dishonarableToday"].InnerText="0";
             player["honorToday"].InnerText="0";
             break;
         }
     }
     doc.Save(HonorTimer.DBpath);
 }
Exemple #14
0
 public void RankCalculate(Character ch)
 {
     XmlDocument doc = new XmlDocument();
     doc.Load(TBHonorPath);
     if(ch.Honor.HonorThisWeek > 25)
     {
         foreach(XmlElement ranks in doc.DocumentElement[ch.Race.ToString()].ChildNodes)
         {
             if(ch.Honor.HonorThisWeek > Convert.ToInt32(ranks.InnerText))
             {
                 ch.Honor.HigherstRank=ranks.Name.Replace('_', ' ');
                 continue;
             }
             else break;
         }
     }
     WriteHonor(ch, TBHonorPath, "higherstRank", ch.Honor.HigherstRank);
 }
Exemple #15
0
 public static void WriteHonor(Character ch, string from, string param, string val)
 {
     XmlDocument doc = new XmlDocument();
     doc.Load(from);
     foreach(XmlElement player in doc.DocumentElement["players"].ChildNodes)
     {
         if (player["name"].InnerText==ch.Name)
         {
             player[param].InnerText=val;
             break;
         }
     }
     doc.Save(from);
 }
Exemple #16
0
		public void CancelTrade()
		{
			if ( tradingWith != null )
			{
				int offset = 4;
				Converter.ToBytes( 3, tempBuff, ref offset );
				tradingWith.Send( OpCodes.SMSG_TRADE_STATUS, tempBuff, offset );
				tradingWith = null;
			}
		}
Exemple #17
0
		public void ReleaseTrade()
		{
			TradeState = 0;
			for(int t = 0;t < tradeItems.Length;t++ )
				tradeItems[ t ] = -1;
			tradingWith = null;
		}
Exemple #18
0
        public override bool SeenBy( Character c )
        {
            if ( MapId != c.MapId || Distance( c ) > 300 * 300 )
                return false;

            return true;
        }
Exemple #19
0
		public override void PrepareUpdateData( byte []data, ref int offset, UpdateType type, bool forOther, Character f )
		{
#if TESTCONSECUTIF
			activateorder = true;
			Object.order = 0;
#endif
			Console.WriteLine("PrepareUpdateData 1");
			int start = offset;
			if ( type == UpdateType.UpdateFull )
				data[ offset++ ] = 2;
			else
			{
				PreparePartielUpdateData( data, ref offset );
				return;
			}			
			Console.WriteLine("PrepareUpdateData 2");
			Converter.ToBytes( Guid, data, ref offset );			
			ResetBitmap();
			Converter.ToBytes( (byte)4, data, ref offset );
			Converter.ToBytes( (int)0, data, ref offset );
			Converter.ToBytes( (int)0, data, ref offset );//	Movement flags
			Converter.ToBytes( X, data, ref offset );
			Converter.ToBytes( Y, data, ref offset );
			Converter.ToBytes( Z, data, ref offset );
			Converter.ToBytes( Orientation, data, ref offset );
			/*	if ( Player.AccessLevel != AccessLevels.PlayerLevel )
						{
							WalkSpeed = RunSpeed = 40f;
						}*/
			Converter.ToBytes( 0f, data, ref offset );

			Converter.ToBytes( WalkSpeed, data, ref offset );
			Converter.ToBytes( RunSpeed, data, ref offset );
			Converter.ToBytes( SwimBackSpeed, data, ref offset );
			Converter.ToBytes( SwimSpeed, data, ref offset );			
			Converter.ToBytes( (float)4.5f, data, ref offset );//	turn rate
			Converter.ToBytes( (float)Math.PI, data, ref offset );//	turn rate
			if ( forOther )
				Converter.ToBytes( (uint)0, data, ref offset );//	Movement flags
			else
				Converter.ToBytes( (uint)1, data, ref offset );//	Movement flags
			Converter.ToBytes( (uint)1, data, ref offset );//	Movement flags

			Converter.ToBytes( 0, data, ref offset );
			Converter.ToBytes( 0, data, ref offset );
			Converter.ToBytes( 0, data, ref offset );
		
			setUpdateValue( Const.OBJECT_FIELD_GUID, Guid );			
			setUpdateValue( Const.OBJECT_FIELD_TYPE, 25 );
			setUpdateValue( Const.OBJECT_FIELD_ENTRY, 0 );
			setUpdateValue( Const.OBJECT_FIELD_SCALE_X, (float)1.0 );
			if ( Summon != null )
			{
				//	setUpdateValue( (int)UpdateFields.UNIT_FIELD_CHARM, Summon.Guid );
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_SUMMON, Summon.Guid );
			}
			Console.WriteLine("PrepareUpdateData 3");
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_HEALTH, HitPoints );			
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_POWER1 + ManaType, Mana );//	unknow			
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_MAXHEALTH, BaseHitPoints );//	unknow		
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_MAXPOWER1 + ManaType, BaseMana );//	unknow		
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_LEVEL, Level );	
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_FACTIONTEMPLATE, (int)Faction );//	unknow	
			//	setUpdateValue( 37,(short)( (int)race << 8 ) );//	unknow
			Console.WriteLine("PrepareUpdateData 4");		
			uint flags = (uint)( ( (uint)race ) + ( (int)Classe  << 8 ) + ( gender << 16 ) + ((uint)(manaType)<<24) );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_BYTES_0, flags );


			if ( !forOther )
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_FLAGS, Flags ); 
			else
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_FLAGS, Flags ); 
			//	Aura

			foreach( AuraReleaseTimer arts in Auras )
			{
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_AURA + arts.num, (int)arts.ae.Id );

				//	SendSmallUpdateToPlayerNearMe( new int[] { (int)UpdateFields.UNIT_FIELD_AURA + num, (int)UpdateFields.UNIT_FIELD_AURALEVELS, (int)UpdateFields.UNIT_FIELD_AURAAPPLICATIONS, (int)UpdateFields.UNIT_FIELD_AURAFLAGS, (int)UpdateFields.UNIT_FIELD_AURASTATE }, new object[] { (int)ae.Id, ae.Applications, 0, 0xdddddddd, 0x2 } );
			}
			Console.WriteLine("PrepareUpdateData 5");
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_AURALEVELS, 0 );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_AURAAPPLICATIONS, 0 );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_AURAFLAGS,  0xdddddddd );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_AURASTATE, 2 );


			setUpdateValue( (int)UpdateFields.UNIT_FIELD_BASEATTACKTIME, 0x000007D0 );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_BASEATTACKTIME_01, 0x000007D0 );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_BOUNDINGRADIUS, (float)0.389 );//	Bounding radius
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_COMBATREACH, (float)0.389 );//0x40400000 ); Combat reach
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_DISPLAYID, Model );//	model, 0x61C
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_NATIVEDISPLAYID, Model );
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_MOUNTDISPLAYID, MountModel );
			Console.WriteLine("PrepareUpdateData 6");

			if ( activeWeapon == null )
			{				
				activeWeapon = ChooseWeapon();
			}			
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_MINDAMAGE, this.BaseMinDamage );//	min damage
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_MAXDAMAGE, this.BaseMaxDamage );//	max damage

			setUpdateValue( (int)UpdateFields.UNIT_FIELD_BYTES_1, (int)StandState );
			if ( !forOther )
				setUpdateValue( (int)UpdateFields.UNIT_DYNAMIC_FLAGS, DynFlags( f ) );			
			Console.WriteLine("PrepareUpdateData 7");			
			if ( !forOther )
			{				
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_STR, (uint)Str ); //	Str
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_AGILITY, (uint)Agility ); //	Ag
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_STAMINA, (uint)Stamina );//	Stam
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_IQ, (uint)Iq ); //	IQ
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_SPIRIT, (uint)Spirit ); //	Spirit
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR, (uint)Armor );//	armor


				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 1, (uint)this.ResistHoly );//	semble etre resistance
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 2,(uint)this.ResistFire );			
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 3, (uint)this.ResistNature );
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 4, (uint)this.ResistFrost );
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 5,(uint)this.ResistShadow );
				setUpdateValue( (int)UpdateFields.UNIT_FIELD_ARMOR + 6,(uint)this.ResistArcane );
			}
			Console.WriteLine("PrepareUpdateData 8");
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_ATTACKPOWER, AttackPower );//	Attack power
			setUpdateValue( (int)UpdateFields.UNIT_FIELD_RANGEDATTACKPOWER, RangedAttackPower );//	Attack power

			if ( Player.AccessLevel == AccessLevels.PlayerLevel )
				setUpdateValue( (int)UpdateFields.PLAYER_FLAGS, 0x00000000 );
			else
				setUpdateValue( (int)UpdateFields.PLAYER_FLAGS, 0x00000008 );

			//	setUpdateValue( (int)UpdateFields.PLAYER_BYTES, 0 );
			uint t1 = (uint)( ((uint)skin) | ((uint)face << 8) | ((uint)hairStyle << 16) | ((uint)this.hairColour << 24) );
			uint t2 = (uint)( 0x0101EE00 + (uint)facialHair );
			setUpdateValue( (int)UpdateFields.PLAYER_BYTES, t1 );
			setUpdateValue( (int)UpdateFields.PLAYER_BYTES_2, t2 );
			//setUpdateValue( (int)UpdateFields.PLAYER_BYTES_3 + 1, 0 );
			Console.WriteLine("PrepareUpdateData 9");			
		
			if ( !forOther )
			{
				int questlog = (int)UpdateFields.PLAYER_QUEST_LOG_1_1;
				for (int i = 0 ; i < 20; i++)
				{
					if ( activeQuests[ i ] != null )
					{
						Console.WriteLine("PrepareUpdateData 10");
						setUpdateValue( ( questlog + ( i * 3 ) ), (UInt32)activeQuests[ i ].Id );
						if ( activeQuests[ i ].HaveDeliveryObj )
						{							
							setUpdateValue( ( questlog + 1 + ( i * 3 ) ), (UInt32)activeQuests[ i ].DeliveryCurrentAmount() );
						}
						else
							setUpdateValue( ( questlog + 1 + ( i * 3 ) ), (UInt32)activeQuests[ i ].NpcObjCurrentAmount( activeQuests[ i ].Id ) );
						setUpdateValue( ( questlog + 2 + ( i * 3 ) ), (UInt32)0 );
						Console.WriteLine("PrepareUpdateData 11");
					}
					else
					{
						Console.WriteLine("PrepareUpdateData 12");
						setUpdateValue( ( questlog + ( i * 3 ) ), (UInt32)0 );
						setUpdateValue( ( questlog + 1 + ( i * 3 ) ), (UInt32)0 );
						setUpdateValue( ( questlog + 2 + ( i * 3 ) ), (UInt32)0 );
						Console.WriteLine("PrepareUpdateData 13");
					}
				}
				int mrealxp = Mobile.xpNeeded[ Level ];
				if ( Level > 1 )
				{
					Console.WriteLine("PrepareUpdateData 14");
					uint realxp = (uint)( Exp - Mobile.xpNeeded[ Level - 1 ] );
					mrealxp = ( Mobile.xpNeeded[ Level ] - Mobile.xpNeeded[ Level - 1 ] );
					setUpdateValue( (int)UpdateFields.PLAYER_XP, (UInt32)realxp ); //	xp max 342
					Console.WriteLine("PrepareUpdateData 15");
				}
				else
					setUpdateValue( (int)UpdateFields.PLAYER_XP, (UInt32)Exp ); //	xp max 342
				Console.WriteLine("PrepareUpdateData 16");
				setUpdateValue( (int)UpdateFields.PLAYER_NEXT_LEVEL_XP, mrealxp ); //	xp max 342

				int skills = (int)UpdateFields.PLAYER_SKILL_INFO_1_1;
				Console.WriteLine("PrepareUpdateData 17");
				IDictionaryEnumerator Enumerator = AllSkills.GetEnumerator();
				while( Enumerator.MoveNext() )
				{
					ushort sid = (ushort)Enumerator.Key;
					Skill val = (Skill)Enumerator.Value;
					setUpdateValue( skills, (int)val.Id );
					setUpdateValue( skills+1, (short)val.CurrentVal(this) );
					setUpdateValue( skills+1, (short)val.Cap( this ) );
					setUpdateValue( skills+2, (int)0 );
					skills+=3;
				}
				Console.WriteLine("PrepareUpdateData 18");
				//		setUpdateValue( 728, 0 );
				
				setUpdateValue( (int)UpdateFields.PLAYER_CHARACTER_POINTS1, (int)Talent );
				if ( CumulativeAuraEffects[ EffectTypes.FindMineral ] != null && CumulativeAuraEffects[ EffectTypes.FindMineral ] is int )
					setUpdateValue( (int)UpdateFields.PLAYER_TRACK_RESOURCES, (int)CumulativeAuraEffects[ EffectTypes.FindMineral ] );
				
				setUpdateValue( (int)UpdateFields.PLAYER_BLOCK_PERCENTAGE, this.BaseBlockChance);
				setUpdateValue( (int)UpdateFields.PLAYER_DODGE_PERCENTAGE, this.BaseDodgeChance);
				setUpdateValue( (int)UpdateFields.PLAYER_PARRY_PERCENTAGE, this.BaseParryChance);
				setUpdateValue( (int)UpdateFields.PLAYER_CRIT_PERCENTAGE, this.BaseCritChance);
				Console.WriteLine("PrepareUpdateData 19");
				for (int i = 0 ; i < 32 ; i++)//	ZONE UPDATE
				{
					//zones[ i ] = 0xffffffff;
					setUpdateValue( ( (int)UpdateFields.PLAYER_EXPLORED_ZONES_1 + i ), zones[ i ] );
				}

				setUpdateValue( (int)UpdateFields.PLAYER_REST_STATE_EXPERIENCE, 1 );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_COINAGE, copper );
				
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_POSSTAT0, StrBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_POSSTAT1, AgBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_POSSTAT2, StaminaBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_POSSTAT3, IqBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_POSSTAT4, SpiritBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_NEGSTAT0, StrMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_NEGSTAT1, AgMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_NEGSTAT2, StaminaMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_NEGSTAT3, IqMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_NEGSTAT4, SpiritMalusUpdate );
				
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 0, ArmorBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 1, ArmorBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 2, HolyResistanceBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 3, FireResistanceBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 4, NatureResistanceBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 5, FrostResistanceBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6, ShadowResistanceBonusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE + 7, ArcaneResistanceBonusUpdate );

				
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 0, ArmorMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 1, ArmorMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 2, HolyResistanceMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 3, FireResistanceMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 4, NatureResistanceMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 5, FrostResistanceMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6, ShadowResistanceMalusUpdate );
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE + 7, ArcaneResistanceMalusUpdate );
				Console.WriteLine("PrepareUpdateData 20");
				setUpdateValue( (int)UpdateFields.PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, (float)1f );//this.MeleeDamageBonus + this.AllDamageDoneBonus + this.PhysicalDamageIncrease);
				//setUpdateValue( (int)UpdateFields.PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, (float)0f );//this.MeleeDamageMalus + this.AllDamageDoneMalus);		
				//setUpdateValue( (int)UpdateFields.PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,	(float)3f );
				setUpdateValue( (int)UpdateFields.PLAYER_AMMO_ID, ammoType );//(float)1 );//

				Console.WriteLine("PrepareUpdateData 21");
				FlushUpdateData( data, ref offset, 0x22 );
				Console.WriteLine("PrepareUpdateData 22");
			}
			else
			{
				Console.WriteLine("PrepareUpdateData 23");
				FlushUpdateData( data, ref offset, 0x22 );
			}
			/*			Console.WriteLine("A9");
						for(int i = start;i < offset;i++ )
							Console.Write( "{0} ", data[ i ].ToString( "X2" ) );
						Console.WriteLine("");*/
			/*
						offset = 0;
						Character.A9Reader( data, ref offset );
			
						HexViewer.View( data, 0, offset, false );*/
#if TESTCONSECUTIF
			activateorder = false;
#endif
			Console.WriteLine("PrepareUpdateData fin");
		}
Exemple #20
0
 public override bool SeenBy( Character c )
 {
     return true;
 }
Exemple #21
0
		public void CopyAllParameters(Character from) 
		{ 
			//Skills 
			AllSkills.Clear(); 
			IDictionaryEnumerator enumerator = from.AllSkills.GetEnumerator(); 
			while (enumerator.MoveNext()) 
			{ 
				AllSkills.Add( (ushort)enumerator.Key, (Skill)enumerator.Value);             
			} 
			//Abilities 
			KnownAbilities.Clear(); 
			enumerator = from.KnownAbilities.GetEnumerator(); 
			while (enumerator.MoveNext()) 
			{ 
				KnownAbilities.Add( enumerator.Key, enumerator.Value);             
			} 
			//Items 
			
			for(int i=0; i<from.Items.Length; i++) 
			{ 
				if (from.Items[i] != null) 
				{ 
					ConstructorInfo info = HelperTools.Utility.FindConstructor( from.Items[i].GetType().Name); 
					Item newitem = (Item)info.Invoke(null); 
					Items[i] = newitem; 
				}    
				else
					Items[ i ] = null;
			} 
			//Mobile fields       
			Classe = from.Classe; 
			ManaType = from.ManaType; 
			BaseHitPoints = from.BaseHitPoints; 
			HitPoints = from.HitPoints;
			Mana = from.Mana;
			BaseMana = from.BaseMana;          
			BaseAgility = from.BaseAgility; 
			BaseEnergy = from.BaseEnergy; 
			BaseFocus = from.BaseFocus; 
			BaseIq = from.BaseIq; 
			BaseRage = from.BaseRage; 
			BaseSpirit = from.BaseSpirit; 
			BaseStamina = from.BaseStamina; 
			BaseStr = from.BaseStr; 
			Exp = from.Exp; 
			Faction = from.Faction; 
			Level = from.Level; 
			Model = from.Model;          
			Orientation = from.Orientation; 
			RunSpeed = from.RunSpeed; 
			WalkSpeed = from.WalkSpeed; 
			Speed = from.Speed; 

			//Local fields 
			gender = (byte)from.Gender; 
			skin = (byte)from.Skin; 
			face = (byte)from.Face; 
			hairStyle = (byte)from.HairStyle; 
			hairColour = (byte)from.HairColour; 
			race = from.Race; 
			facialHair = (byte)from.FacialHair;                      
		} 
Exemple #22
0
		public static Corps Add( Character c, float X, float Y, float Z, ushort MapId )
		{
			Corps corps = new Corps( c.Guid );
			corps.X = X;
			corps.Y = Y;
			corps.Z = Z;
			corps.MapId = MapId;
			corps.Name = c.Name;
			corps.Model = c.Model;
			corps.Faction = c.Faction;
			corps.Bytes3 = (uint)( ( (uint)c.FacialHair << 24 )| ( (uint)c.Face ) | ((uint)c.HairStyle << 8) | ((uint)c.HairColour << 16 )  );
			corps.Bytes2 = (((uint)c.Skin )<<24) /*+ (((uint)c.Gender )<<16)*/ +  ( ( (uint)c.Race << 8 ) );
			World.allMobiles.Add( corps, false );	
			float nearest = float.MaxValue;
			BaseSpawner nearSpawner = null;
			foreach( BaseSpawner bs in World.allSpawners )
				if ( bs.Distance( corps ) < nearest )
				{
					nearest = bs.Distance( corps );
					nearSpawner = bs;
				}
			if ( nearSpawner != null )
			{
				nearSpawner.Bind( corps );			
				corps.SpawnerLink = nearSpawner;
			}
			return corps;
		}
Exemple #23
0
		void SendMessageTo( Character c, ChatMsgType chat, string txt, int langue )
		{
			int offset = 4;
			bool understand = false;
			switch( langue )
			{
				case 7://	Common
					if ( c.HaveSkill( 98 ) )
						understand = true;
					break;
				case 1://	Orcish
					if ( c.HaveSkill( 109 ) )
						understand = true;
					break;
				case 13://	Gnomish
					if ( c.HaveSkill( 313 ) )
						understand = true;
					break;
				case 33://	Gutter
					if ( c.HaveSkill( 673 ) )
						understand = true;
					break;
				case 3://	Tauren
					if ( c.HaveSkill( 115 ) )
						understand = true;
					break;
				case 14://	Troll
					if ( c.HaveSkill( 315 ) )
						understand = true;
					break;
				case 2://	Elf
					if ( c.HaveSkill( 113 ) )
						understand = true;
					break;
				case 6://	Dwarf
					if ( c.HaveSkill( 111 ) )
						understand = true;
					break;
			}
			if ( understand )
			{
				tempBuff[ offset++ ] = (byte)chat;//type, CHAT_MSG_SAY, CHAT_MSG_CHANNEL, CHAT_MSG_WHISPER, CHAT_MSG_YELL, CHAT_MSG_PARTY
				Converter.ToBytes( langue, tempBuff, ref offset );
			}
			else
			{
				tempBuff[ offset++ ] = (byte)chat;//type
				Converter.ToBytes( langue, tempBuff, ref offset );
			}
			Converter.ToBytes( Guid, tempBuff, ref offset );
			Converter.ToBytes( Guid, tempBuff, ref offset );
			
			//		string tx = txt + " ( " + r.ToString() + " )";
			//		r = (ushort)( r << 1 );
			Converter.ToBytes( txt.Length + 1, tempBuff, ref offset );
			Converter.ToBytes( txt, tempBuff, ref offset );
			Converter.ToBytes( (short)1, tempBuff, ref offset );// Togle afk
			int len = offset;

			c.Send( OpCodes.SMSG_MESSAGECHAT, tempBuff, len );
	
		}
Exemple #24
0
			public CombatTimer( UInt64 targ, Character c, int delay ) : base( WowTimer.Priorities.Milisec100 , delay, "CombatTimer" )
			{
				target = targ;
				from = c;
				Start();
			}
Exemple #25
0
			public MobBalance( Character from ) :  base( WowTimer.Priorities.Milisec100 , 1000, "MobBalance" )
			{
				to = from;
				Start();
			}
Exemple #26
0
			public FirstHitCombatTimer( Character c ) : base( WowTimer.Priorities.Milisec100 , 100, "FirstHitCombatTimer" )
			{
				from = c;
				Start();
			}
Exemple #27
0
		void PrepareInv( byte []data, int off )
		{
			if ( guowner != null )
			{
				SendMessage( "You have already requested a duel !" );
				return;
			}
			UInt64 g = BitConverter.ToUInt64( data, off + 12 );
			gu = (Character)this.Player.FindMobileByGuid( g );
			if ( gu.guowner != null )
			{
				SendMessage( "The target have already requested a duel !" );
				return;
			}
			guowner = this;
			gu.guowner = this;
			Deturn();
			return;
		}
Exemple #28
0
			public InternalHeartBeatTimer( Character c ) : base( WowTimer.Priorities.Second , 1000, "InternalHeartBeatTimer" )
			{
				from = c;
				Start();
			}
Exemple #29
0
		public override void OnDeath( Mobile by )
		{
			if ( Duel != 0 )
			{				
				this.ReleaseAllAura();
				int offset = 4;
				if ( gu != null )
				{
					Converter.ToBytes( (byte)0, tempBuff, ref offset );
					Converter.ToBytes( gu.Name, tempBuff, ref offset );
					Converter.ToBytes( (byte)0, tempBuff, ref offset );
					Converter.ToBytes( Name, tempBuff, ref offset );
					Converter.ToBytes( (byte)0, tempBuff, ref offset );
					Send( OpCodes.SMSG_DUEL_WINNER, tempBuff, offset );
					gu.Send( OpCodes.SMSG_DUEL_WINNER, tempBuff, offset );
					offset = 4;
					Converter.ToBytes( (byte)1, tempBuff, ref offset );
					Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
					gu.Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
					offset = 4;
					Converter.ToBytes( Duel, tempBuff, ref offset );
					Send( OpCodes.SMSG_GAMEOBJECT_DESPAWN_ANIM, tempBuff, offset );
					gu.Send( OpCodes.SMSG_GAMEOBJECT_DESPAWN_ANIM, tempBuff, offset );
					Send( OpCodes.SMSG_DESTROY_OBJECT, tempBuff, offset );
					gu.Send( OpCodes.SMSG_DESTROY_OBJECT, tempBuff, offset );
					this.HitPoints = this.BaseHitPoints / 4;
					this.SendSmallUpdateToPlayerNearMe( new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, 178, 179, 186 } , new object[] { 0, 0, 0, 0 } );				
					gu.SendSmallUpdateToPlayerNearMe( new int[] { (int)UpdateFields.UNIT_DYNAMIC_FLAGS, 178, 179, 186 } , new object[] { 0, 0, 0, 0 } );				
					Aura aura = new Aura();
					this.AddAura( ( Abilities.abilities[ 7267 ] as AuraEffect ), aura, true );
					offset = 4;
					gu.Send( OpCodes.SMSG_CANCEL_COMBAT, tempBuff, offset );
					Send( OpCodes.SMSG_CANCEL_COMBAT, tempBuff, offset );	
					gu.Duel = 0;
					gu.guowner = null;
					gu.gu = null;
				}
				Duel = 0;				
				guowner = null;				
				gu = null;
				dt.Stop();
				dt = null;
				return;
			}
			this.NextAttackEffects.Clear();
			by.NextAttackEffects.Clear();
			if ( Summon != null )
				DismissPet( Summon.Guid );
			ReleaseAllAura();
			corpsGuid = 0;
			CorpseLocationX = X;
			CorpseLocationY = Y;
			CorpseLocationZ = Z;
			CorpseMapId = MapId;
			foreach( Object ch in this.KnownObjects )
				if ( ch is Character && ch != this )
					( ch as Character ).Player.RefreshMobileList( false );

			if ( by != null )
				by.XpEarn( this );
			this.SendSmallUpdateToPlayerNearMe( new int [] { (int)UpdateFields.UNIT_FIELD_HEALTH, (int)UpdateFields.UNIT_FIELD_FLAGS }, new object[] { 0, 0x4008 } );
		}
Exemple #30
0
		//	l'inititateur du trade recoit : 
		public void InitiateTrade( UInt64 guid )
		{
			Character c = account.FindPlayerNearByGuid( guid );
			if ( c == null )
				return;
			// 01 00 00 00 16 00 00 00 00 00 00 0
			tradingWith = c;
			c.tradingWith = this;
			int offset = 4;
			tradeNum = 1;
			Converter.ToBytes( tradeState = 1, tempBuff, ref offset );
			Converter.ToBytes( Guid, tempBuff, ref offset );
			c.Send( OpCodes.SMSG_TRADE_STATUS, tempBuff, offset );
			for(int t = 0;t < 7;t++ )
				tradeItems[ t ] = -1;
		}