public static void RequestCastSpell(WorldClient client, string packet) { if (client.Character.Fighter != null) { string[] data = packet.Split(';'); int spellID = int.Parse(data[0]); int cellID = int.Parse(data[1]); if (client.Character.Spells.HaveSpell(spellID)) { if (client.Character.Fighter.Team.Fight.TimeLine.CurrentFighter.Character.ID == client.Character.ID) { //Checking turn OK and spellbook OK, the player was ready to cast the spell Game.Spells.WorldSpell spellData = client.Character.Spells.GetSpell(spellID); //Try to cast spell in fight engine client.Character.Fighter.Team.Fight.CastSpell (client.Character.Fighter, spellData, spellData.Level, cellID); } } } else { client.Close(); } }
public static void MoveSpell(Network.WorldClient client, string packet) { string[] data = packet.Substring(2).Split('|'); int spellID = int.Parse(data[0]); int newPos = int.Parse(data[1]); if (client.Character.Spells.HaveSpell(spellID)) { Game.Spells.WorldSpell spell = client.Character.Spells.GetSpell(spellID); Game.Spells.WorldSpell spellAtPos = client.Character.Spells.GetSpellAtPos(newPos); if (spellAtPos != null) { spellAtPos.Position = -1; } spell.Position = newPos; } }
public static void BoostSpell(Network.WorldClient client, string packet) { int spellID = int.Parse(packet.Substring(2)); if (client.Character.Spells.HaveSpell(spellID)) { Game.Spells.WorldSpell spell = client.Character.Spells.GetSpell(spellID); if (spell.Level < 6 && client.Character.SpellPoint >= spell.Level) { if (spell.Level == 5 && client.Character.Level < (spell.Level + 100)) { return; } client.Character.SpellPoint -= spell.Level; spell.Level++; client.Send("SUK" + spellID + "~" + spell.Level); client.Character.Stats.RefreshStats(); } } }