private 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); if (m_Account.DebugMode.Checked) { m_Account.Log(new BotTextInformation("[SND] 1005 (GameActionFightCastRequestMessage)"), 0); } } }
public static void HandleGameActionFightSpellCastRequest(GameActionFightCastRequestMessage message, WorldClient client) { if (client.Character.Fighting) { CharacterSpell spell = client.Character.Fighter.GetSpell(message.spellId); if (spell != null) { client.Character.Fighter.CastSpell(spell.Template, spell.Grade, message.cellId); } } }
public void GameActionFightCastRequestMessageFrame(WorldClient client, GameActionFightCastRequestMessage gameActionFightCastRequestMessage) { var fight = client.ActiveCharacter.Fight; if (fight == null) { return; } if (fight.ActualFighter is CharacterFighter && fight.ActualFighter.Id == client.ActiveCharacter.Id) { fight.CastSpellRequestSequence(gameActionFightCastRequestMessage.cellId, (int)gameActionFightCastRequestMessage.spellId); } }
/// <summary> /// LaunchSpell() permet de lancer un sort. /// </summary> /// <param name="spellId">ID du sort à lancer</param> /// <param name="cellId">Cell ID cible</param> private void LaunchSpell(int spellId, int cellId) { using (BigEndianWriter writer = new BigEndianWriter()) { GameActionFightCastRequestMessage msg = new GameActionFightCastRequestMessage((short)spellId, (short)cellId); msg.Serialize(writer); writer.Content = Account.HumanCheck.hash_function(writer.Content); MessagePackaging pack = new MessagePackaging(writer); pack.Pack((int)msg.ProtocolID); Account.SocketManager.Send(pack.Writer.Content); Account.Log(new ActionTextInformation("Lancement d'un sort en " + cellId), 5); if (Account.DebugMode.Checked) { Account.Log(new BotTextInformation("[SND] 1005 (GameActionFightCastRequestMessage)"), 0); } } }
public static void HandleGameActionFightCastRequestMessage(WorldClient client, GameActionFightCastRequestMessage message) { if (!client.Character.IsFighting()) { return; } var fighter = client.Character.Fighter; var spell = fighter.IsSlaveTurn() ? fighter.GetSlave().GetSpell(message.spellId) : fighter.GetSpell(message.spellId); if (spell == null) { return; } if (fighter.IsSlaveTurn()) { fighter.GetSlave().CastSpell(spell, client.Character.Fight.Map.Cells[message.cellId]); } else { fighter.CastSpell(spell, client.Character.Fight.Map.Cells[message.cellId]); } }
public static void HandleSpellCast(GameActionFightCastRequestMessage message, WorldClient client) { client.Character.FighterInstance.CastSpellOnCell(message.spellId, message.cellId); }
public static void HandleGameActionFightCastRequestMessage(WorldClient client, GameActionFightCastRequestMessage message) { if (client.Character.IsFighting()) { CharacterSpell spell = client.Character.Spells.GetSpell((int)message.spellId); if (spell != null) { client.Character.Fighter.CastSpell(spell, client.Character.Fight.Map.Cells[(int)message.cellId]); } else { var summons = client.Character.Fighter.GetSummons(); var caster = summons.Where(x => x.GetSpell((int)message.spellId) != null).FirstOrDefault(); if (caster != null) { Spell sp = caster.GetSpell(message.spellId); caster.CastSpell(sp, client.Character.Fight.Map.Cells[(int)message.cellId]); } } } }