예제 #1
0
파일: BFight.cs 프로젝트: Sadikk/BlueSheep
 /// <summary>
 /// Launch a spell on the specified cellId.
 /// </summary>
 private void LaunchSpell(int spellId, int cellId)
 {
     flag = 1;
     using (BigEndianWriter writer = new BigEndianWriter())
     {
         GameActionFightCastRequestMessage msg = new GameActionFightCastRequestMessage((short)spellId, (short)cellId);
         msg.Serialize(writer);
         writer.Content = m_Account.HumanCheck.hash_function(writer.Content);
         MessagePackaging pack = new MessagePackaging(writer);
         pack.Pack((int)msg.ProtocolID);
         m_Account.SocketManager.Send(pack.Writer.Content);
         m_Account.Log(new ActionTextInformation("Lancement d'un sort en " + cellId), 5);
         if (m_Account.DebugMode.Checked)
             m_Account.Log(new DebugTextInformation("[SND] 1005 (GameActionFightCastRequestMessage)"), 0);
     }
 }
예제 #2
0
 public void LaunchSpell(int spellId, int cellId)
 {
     foreach (BFighter fighter in Fighters)
     {
         if (fighter.CellId == cellId)
         {
             GameActionFightCastOnTargetRequestMessage msg = new GameActionFightCastOnTargetRequestMessage((short)spellId, fighter.Id);
             m_Account.SocketManager.Send(msg);
             m_Account.Log(new ActionTextInformation("Lancement d'un sort en " + cellId), 5);
             return;
         }
     }
     using (BigEndianWriter writer = new BigEndianWriter())
     {
         GameActionFightCastRequestMessage msg = new GameActionFightCastRequestMessage((short)spellId, (short)cellId);
         msg.Serialize(writer);
         writer.Content = m_Account.HumanCheck.hash_function(writer.Content);
         MessagePackaging pack = new MessagePackaging(writer);
         pack.Pack((int)msg.ProtocolID);
         m_Account.SocketManager.Send(pack.Writer.Content);
         m_Account.Log(new ActionTextInformation("Lancement d'un sort en " + cellId), 5);
     }
 }