public static void HandleSpellUpgrade(SpellUpgradeRequestMessage message, WorldClient client) { if (client.Character.IsFighting) { client.Character.Reply("Vous ne pouvez pas effectuer cette action en combat."); return; } else { client.Character.BoostSpell(message.spellId, message.spellLevel); } }
public static void HandleSpellUpgradeRequestMessage(Client client, SpellUpgradeRequestMessage message) { CharacterSpellRecord spellRecord = client.Character.Spells.FirstOrDefault(spell => spell.SpellId == message.spellId); if (spellRecord != null && client.Character.SpellsPoints > 0) { client.Character.SpellsPoints--; client.Send(new SpellUpgradeSuccessMessage(spellRecord.SpellId, spellRecord.Level++)); CharacterHandler.SendCharacterStatsListMessage(client); InventoryHandler.SendSpellListMessage(client); } else { client.Send(new SpellUpgradeFailureMessage()); } }
public static void HandleSpellUpgradeRequestMessage(WorldClient client, SpellUpgradeRequestMessage message) { client.Character.Spells.BoostSpell((int)message.spellId, message.spellLevel); client.Character.RefreshStats(); }