Beispiel #1
0
		/// <summary>
		/// Full Offer Reward ( with emotes )
		/// </summary>
		public void OfferReward( Mobile m, int questId, string title, string text, qEmote[] emoteList ) 
		{
			BaseQuest bq = World.CreateQuestById( questId ); 

			int i = 4; 
			Converter.ToBytes( (ulong)m.Guid,			tempBuff, ref i);				// ( Guid of questOwner )
			Converter.ToBytes( (int)questId,			tempBuff, ref i);				// ( quest Id )
			Converter.ToBytes( (string)title,			tempBuff, ref i);				// ( Header )
			Converter.ToBytes( (byte)0,					tempBuff, ref i);
			Converter.ToBytes( (string)text,			tempBuff, ref i);				// ( Description )
			Converter.ToBytes( (byte)0,					tempBuff, ref i);
			Converter.ToBytes( (int)1,					tempBuff, ref i);				// Unknown
			//Emotes .. Ok
			if ( emoteList!=null )
			{
				Converter.ToBytes(  (int)emoteList.Length,	tempBuff, ref i);
				for ( int ind=0; ind<emoteList.Length; ind++ ) 
				{
					qEmote em = emoteList[ ind ];
					Converter.ToBytes(  (int)em.Delay,		tempBuff, ref i); 
					Converter.ToBytes(  (int)em.emote,		tempBuff, ref i); 
				}
			}
			else Converter.ToBytes(  (int)0,			tempBuff, ref i); 
			//Reward Choice .. Ok
			if ( bq.HasRewardChoice() ) 
			{ 
				Reward[] list = bq.RewardChoice.Items; 
				Converter.ToBytes( (int)list.Length,		tempBuff, ref i );		// count choice rewards
				for ( int ind=0; ind<list.Length; ind++ ) 
				{ 
					Reward rew = list[ind]; 
					Converter.ToBytes( (int)rew.Id,			tempBuff, ref i );		// id 
					Converter.ToBytes( (int)rew.Amount,		tempBuff, ref i );		// amount 
					Converter.ToBytes( (int)rew.Model,		tempBuff, ref i );		// model 
				} 
			} 
			else Converter.ToBytes( (int)0,				tempBuff, ref i );
			//Rewards .. Ok
			if ( bq.HasReward() )
			{ 
				Reward[] list = bq.Reward.Items; 
				Converter.ToBytes( (int)list.Length,			tempBuff, ref i );		// count rewards 
				for ( int ind=0; ind<list.Length; ind++ ) 
				{ 
					Reward rew = list[ind]; 
					Converter.ToBytes( (int)rew.Id,			tempBuff, ref i );		// id 
					Converter.ToBytes( (int)rew.Amount,		tempBuff, ref i );		// amount 
					Converter.ToBytes( (int)rew.Model,		tempBuff, ref i );		// model 
				} 
			} 
			else Converter.ToBytes( (int)0,				tempBuff, ref i );

			//Other Rewards .. Ok
			Converter.ToBytes( (int)bq.RewardGold,		tempBuff, ref i );		// reward gold 
			Converter.ToBytes( (int)0,					tempBuff, ref i );		// unknown
			Converter.ToBytes( (int)bq.RewardSpell,		tempBuff, ref i );		// reward spell 
			Send( OpCodes.SMSG_QUESTGIVER_OFFER_REWARD, tempBuff, i );

			#region Old
			/* 
			int offset = 4; 
			Converter.ToBytes( m.Guid, tempBuff, ref offset ); 
			Converter.ToBytes( id, tempBuff, ref offset ); 
			Converter.ToBytes( title, tempBuff, ref offset ); 
			Converter.ToBytes( (byte)0, tempBuff, ref offset ); 
			Converter.ToBytes( text, tempBuff, ref offset ); 
			Converter.ToBytes( (byte)0, tempBuff, ref offset ); 
			Converter.ToBytes( 1, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			BaseQuest bq = World.CreateQuestById( id ); 
			if ( bq != null ) 
			{ 
				if ( bq.RewardChoice != null ) 
				{ 
					Converter.ToBytes( bq.RewardChoice.Length, tempBuff, ref offset ); 
					foreach( Reward r in bq.RewardChoice ) 
					{ 
						Converter.ToBytes( r.Id, tempBuff, ref offset ); 
						Converter.ToBytes( r.Amount, tempBuff, ref offset ); 
						Converter.ToBytes( r.Model, tempBuff, ref offset ); 
					} 
				} 
				else 
					Converter.ToBytes( 0, tempBuff, ref offset ); 
			} 
			else 
				Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Send( OpCodes.SMSG_QUESTGIVER_OFFER_REWARD, tempBuff, offset );
			*/
			#endregion
		}
Beispiel #2
0
		/// <summary>
		/// Responce Quest Details
		/// With emotes
		/// </summary>
		public void ResponseQuestDetails( Mobile m, int questId, string title, string desc, string details, qEmote[] emoteList  ) 
		{ 
			BaseQuest bq = World.CreateQuestById( questId );
			int i = 4; 
			Converter.ToBytes( (ulong)m.Guid,			tempBuff, ref i );			// ( Mobile.Guid )
			Converter.ToBytes( (int)questId,			tempBuff, ref i );			// ( Quest Id )
			Converter.ToBytes( (string)title,			tempBuff, ref i );			// ( Title )
			Converter.ToBytes( (byte)0,					tempBuff, ref i ); 
			Converter.ToBytes( (string)desc,			tempBuff, ref i );			// ( Description )
			Converter.ToBytes( (byte)0,					tempBuff, ref i ); 
			Converter.ToBytes( (string)details,			tempBuff, ref i );			// ( Details )
			Converter.ToBytes( (byte)0,					tempBuff, ref i ); 
			Converter.ToBytes( (int)1,					tempBuff, ref i );			// Unknown
			//Choice Rewards .. Ok
			if ( bq.HasRewardChoice() ) 
			{ 
				Reward[] list = bq.RewardChoice.Items; 
				Converter.ToBytes( (int)list.Length,		tempBuff, ref i );		// ( count Choice rewards )
				for ( int ind=0; ind<list.Length; ind++ ) 
				{ 
					Reward rew = list[ind]; 
					Converter.ToBytes( (int)rew.Id,			tempBuff, ref i );		// ( id )
					Converter.ToBytes( (int)rew.Amount,		tempBuff, ref i );		// ( amount )
					Converter.ToBytes( (int)rew.Model,		tempBuff, ref i );		// ( model )
				} 
			} 
			else Converter.ToBytes( (int)0,				tempBuff, ref i );
			//Rewards .. Ok
			if ( bq.HasReward() ) 
			{ 
				Reward[] list = bq.Reward.Items; 
				Converter.ToBytes( (int)list.Length,		tempBuff, ref i );		// ( count rewards )
				for ( int ind=0; ind<list.Length; ind++ ) 
				{ 
					Reward rew = list[ind]; 
					Converter.ToBytes( (int)rew.Id,			tempBuff, ref i );		// ( id )
					Converter.ToBytes( (int)rew.Amount,		tempBuff, ref i );		// ( amount )
					Converter.ToBytes( (int)rew.Model,		tempBuff, ref i );		// ( model )
				} 
			} 
			else Converter.ToBytes( (int)0,				tempBuff, ref i );
			//Other Rewards
			Converter.ToBytes( (int)bq.RewardGold,			tempBuff, ref i );		// ( reward gold )
			Converter.ToBytes( (int)bq.RewardSpell,			tempBuff, ref i );		// ( reward spell )
			//Emotes .. Ok
			if ( emoteList!=null )
			{
				Converter.ToBytes(  (int)emoteList.Length,	tempBuff, ref i);		// ( count emotes )
				for ( int ind=0; ind<emoteList.Length; ind++ ) 
				{
					qEmote em = emoteList[ ind ];
					Converter.ToBytes(  (int)em.Delay,		tempBuff, ref i);		// ( Delay Msecs )
					Converter.ToBytes(  (int)em.emote,		tempBuff, ref i);		// ( Emote )
				}
			}
			else Converter.ToBytes(  (int)0,			tempBuff, ref i); 

			Send( OpCodes.SMSG_QUESTGIVER_QUEST_DETAILS, tempBuff, i ); 

			#region Old code
			/* 
			int offset = 4; 
			Converter.ToBytes( m.Guid, tempBuff, ref offset ); 
			Converter.ToBytes( id, tempBuff, ref offset ); 

			Converter.ToBytes( title, tempBuff, ref offset ); 
			Converter.ToBytes( (byte)0, tempBuff, ref offset ); 
			Converter.ToBytes( desc, tempBuff, ref offset ); 
			Converter.ToBytes( (byte)0, tempBuff, ref offset ); 
			Converter.ToBytes( details, tempBuff, ref offset ); 
			Converter.ToBytes( (byte)0, tempBuff, ref offset ); 

			Converter.ToBytes( 1, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Converter.ToBytes( 0, tempBuff, ref offset ); 
			Send( OpCodes.SMSG_QUESTGIVER_QUEST_DETAILS, tempBuff, offset );*/ 
			#endregion
		} 
Beispiel #3
0
		/// <summary>
		/// Quest List
		/// changed: 04.10.05
		/// </summary>
		public void QuestList( Mobile from, string text, qEmote e, BaseQuest[] quests )
		{
			int offset = 4;
			Converter.ToBytes( (ulong)from.Guid,		tempBuff, ref offset );			// npcGuId
			Converter.ToBytes( (string)text,			tempBuff, ref offset );			// HeaderText
			Converter.ToBytes( (byte)0,					tempBuff, ref offset );
			Converter.ToBytes( (int)e.Delay,			tempBuff, ref offset );			// Delay To Play Emote (mili secs)
			Converter.ToBytes( (int)e.emote,			tempBuff, ref offset );			// Emote (Wad use EMOTE_ONESHOT_)
			Converter.ToBytes( (byte)quests.Length,		tempBuff, ref offset );			// Amount of quests only 15 allowed
			foreach ( BaseQuest bq in quests )
			{
				Converter.ToBytes( (int)bq.Id,			tempBuff, ref offset );			// QuestId
				
				int _qStatus = HaveQuest( bq ) ? 0x03 : 0x05;
				Converter.ToBytes( (int)_qStatus,		tempBuff, ref offset );			// QuestStatus, need test
				Converter.ToBytes( (int)0,				tempBuff, ref offset );			// Unknown
				Converter.ToBytes( (string)bq.Name,		tempBuff, ref offset );			// QuestName
				Converter.ToBytes( (byte)0,				tempBuff, ref offset );
			}
			Send( OpCodes.SMSG_QUESTGIVER_QUEST_LIST, tempBuff, offset );
		}