コード例 #1
0
        /// <summary>
        /// Handles the Gump's responses
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="info"></param>
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            m_InTime.Stop();

            switch (info.ButtonID)
            {
            case 0:
            {
                m_Stone.refreshDuel();
                break;
            }

            case 1:
            {
                if (m_Acceptor.BankBox.TotalGold < (m_Stone.Wager))
                {
                    m_Acceptor.SendMessage("You have insufficient funds.");
                    m_Stone.refreshDuel();
                }
                else
                {
                    DuelTimer timer = new DuelTimer(m_Requester, m_Acceptor, m_Stone);
                    timer.Start();
                }
                break;
            }
            }
        }
コード例 #2
0
ファイル: Character.cs プロジェクト: karliky/wowwow
		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 } );
		}
コード例 #3
0
ファイル: Character.cs プロジェクト: karliky/wowwow
/*		public void CancelDuel()
		{
			if ( flag != 0 )
				CancelDuel( flag );
			else
			{
				int offset = 4;
				Converter.ToBytes( (byte)0, tempBuff, ref offset );
				Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
				gu.Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
				guowner = null;
				gu.guowner = null;
				gu.gu = null;
				gu = null;
			}
		}*/

		void CancelDuel( UInt64 g )
		{
			int offset = 4;
			Converter.ToBytes( g, 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 );
			offset = 4;
			Converter.ToBytes( (byte)0, tempBuff, ref offset );
			Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
			gu.Send( OpCodes.SMSG_DUEL_COMPLETE, tempBuff, offset );
			Duel = gu.Duel = 0;
			guowner = null;
			gu.guowner = null;
			gu.gu = null;
			gu = null;
			dt = null;			
		}
コード例 #4
0
ファイル: Character.cs プロジェクト: karliky/wowwow
		void SendDuelArbitrer( UInt64 g )
		{
			int offset = 4;
			if ( guowner == this )
			{
				//	for the owner
				this.MakeThePacket( g, gu, guowner );
				
				Converter.ToBytes( g, tempBuff, ref offset );
				Send( OpCodes.SMSG_GAMEOBJECT_SPAWN_ANIM, tempBuff, offset );
				// for the target
				gu.MakeThePacket( g, guowner, gu );
				offset = 4;
				Converter.ToBytes( g, tempBuff, ref offset );
				gu.Send( OpCodes.SMSG_GAMEOBJECT_SPAWN_ANIM, tempBuff, offset );				
			}

			if ( guowner != this )
			{
				offset = 4;
				Converter.ToBytes( 0xbb8, tempBuff, ref offset );
				Send((OpCodes)695, tempBuff, offset );
				guowner.Send((OpCodes)695, tempBuff, offset );
				dt = new DuelTimer( guowner, this, g );
			}
		//	from.SendSmallUpdate( new int[] { 178, 179 }, new object[] { low, high } );

			/*byte []buf = new byte[] { 0, 0, 0, 0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x5C, 0x00, 0x00, 0x00, 0x10, 0x00, 0xF0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x00, 0x00, 0x00 };
			int offset = 10;
			Converter.ToBytes( g, buf, ref offset );
			Send( OpCodes.SMSG_UPDATE_OBJECT, buf, buf.Length );
			from.Send( OpCodes.SMSG_UPDATE_OBJECT, buf, buf.Length );*/
		}