/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Balloons /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void HandleBalloon(byte slot, int ItemID) { List <int> lis = Character.Spawn; //ItemBuff(ItemID); Send(lis, Packet.ActionPacket(1, 0, ItemID, Character.Information.UniqueID, Character.Action.CastingSkill, 0)); Send(lis, Packet.SkillIconPacket(Character.Information.UniqueID, ItemID, Character.Action.Buff.OverID[Character.Action.Buff.slot], false)); Send(lis, Packet.BalloonTicket(Character.Action.Buff.OverID[Character.Action.Buff.slot], rnd.Next(1, 999999))); client.Send(Packet.PlayerStat(Character)); }
///////////////////////////////////////////////////////////////////////////////// // Update set stats ///////////////////////////////////////////////////////////////////////////////// #region Set Stats public void SetStat() { //Wrap our function inside a catcher try { //Update stats hp / mp Character.Stat.Hp = Formule.gamePhp(Character.Information.Level, Character.Stat.Strength); Character.Stat.Mp = Formule.gamePmp(Character.Information.Level, Character.Stat.Intelligence); //Send visual update packet client.Send(Packet.PlayerStat(Character)); } catch (Exception ex) { Console.WriteLine("Set stats error {0}", ex); Systems.Debugger.Write(ex); } }
void Mastery_Skill_Up() { try { if (!Character.Action.upskilltimer) { Character.Action.upskilltimer = true; SkillUpTimer(250); PacketReader Reader = new PacketReader(PacketInformation.buffer); int skillid = Reader.Int32(); if (!(Character.Information.SkillPoint < Data.SkillBase[skillid].SkillPoint)) { Character.Information.SkillPoint -= Data.SkillBase[skillid].SkillPoint; client.Send(Packet.InfoUpdate(2, Character.Information.SkillPoint, 0)); client.Send(Packet.SkillUpdate(skillid)); client.Send(Packet.PlayerStat(Character)); SaveSkill(skillid); MsSQL ms = new MsSQL("SELECT * FROM saved_skills WHERE owner='" + Character.Information.CharacterID + "'"); using (SqlDataReader reader = ms.Read()) Character.Stat.Skill.AmountSkill = ms.Count(); int i = 1; using (SqlDataReader reader = ms.Read()) { while (reader.Read()) { Character.Stat.Skill.Skill[i] = reader.GetInt32(2); i++; } } ms.Close(); SkillGetOpened(skillid); } } } catch (Exception ex) { Systems.Debugger.Write(ex); } }
void InGameSuccess() { //Wrap our function inside a catcher try { //If character isnt ingame yet if (!Character.InGame) { //Load player data PlayerDataLoad(); //Load premium ticket LoadTicket(Character); //Load guild information LoadPlayerGuildInfo(true); //Load spawns ObjectSpawnCheck(); //Send stats packet client.Send(Packet.PlayerStat(Character)); //Send player state packet client.Send(Packet.StatePack(Character.Information.UniqueID, 0x04, 0x02, false)); //Send complete load packet client.Send(Packet.Completeload()); //Send player silk packet client.Send(Packet.Silk(Player.Silk, Player.SilkPrem)); //Set new movement stopwatch Character.Position.Movementwatch = new System.Diagnostics.Stopwatch(); //Load friends GetFriendsList(); //Set player online MsSQL.UpdateData("UPDATE character SET online='1' WHERE id='" + Character.Information.CharacterID + "'"); //Set ingame bool to true this.Character.InGame = true; //Load message welcome (Copyright message leave intact). LoadMessage(); //Load guild data GetGuildData(); //Update hp and mp UpdateHp(); UpdateMp(); //Set player to normal state (4 0) / Not attackable = (4 2) client.Send(Packet.StatePack(Character.Information.UniqueID, 0x04, 0x00, false)); //Disabled until fully reworked and updated and optimized. //Load transport //LoadTransport(); //Load grabpet if active //LoadGrabPet(); //Regen this.HPregen(4000); this.MPregen(4000); } } //Catch bad exception errors catch (Exception ex) { //Write information to the console Console.WriteLine("InGame Success Error: {0}", ex); //Write error to debug log Systems.Debugger.Write(ex); } }