public void JoinFormedParty() { try { PacketReader Reader = new PacketReader(PacketInformation.buffer); //Packet reader party id int PartyID = Reader.Int32(); Reader.Close(); //Checks if (PartyID == 0) { return; } //Get character id from the party id int Playerid = Helpers.GetInformation.GetPartyleader(PartyID); //Get character information PlayerMgr sys = Helpers.GetInformation.GetPlayer(Playerid); //Open the invite sys.client.Send(Packet.JoinFormedRequest(Character, sys.Character)); } catch (Exception ex) { Console.WriteLine("Formed party join error {0}", ex); } }
///////////////////////////////////////////////////////////////////////// // Union Apply ///////////////////////////////////////////////////////////////////////// public void unionapply() { try { //Open our packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); //Get target id (Targeted). int Target = Reader.Int32(); //Close reader Reader.Close(); //Get target details PlayerMgr targetplayer = Helpers.GetInformation.GetPlayer(Target); //Make sure the target is still there if (targetplayer != null) { //If allready in union if (targetplayer.Character.Network.Guild.UnionActive) { return; } //Set bools for both players targetplayer.Character.State.UnionApply = true; Character.State.UnionApply = true; //Set target player to us targetplayer.Character.Network.TargetID = Character.Information.UniqueID; //Send request to targeted player targetplayer.client.Send(Packet.PartyRequest(6, Character.Information.UniqueID, 0)); } } catch (Exception ex) { Log.Exception(ex); } }
///////////////////////////////////////////////////////////////////////////////// // Add new friend ///////////////////////////////////////////////////////////////////////////////// public void FriendAdd() { try { PacketReader reader = new PacketReader(PacketInformation.buffer); short namelenght = reader.Int16(); string name = reader.String(namelenght); reader.Close(); if (name == Character.Information.Name) { return; } PlayerMgr sys = Helpers.GetInformation.GetPlayerName(name); if (sys != null) { sys.client.Send(Packet.FriendInviteTarget(sys.Character)); } else { //Packet cannot find user } } catch (Exception ex) { Console.WriteLine("Friend Add error {0}", ex); Log.Exception(ex); } }
///////////////////////////////////////////////////////////////////////////////// // Friend add response ///////////////////////////////////////////////////////////////////////////////// public void FriendAddResponse() { try { PacketReader reader = new PacketReader(PacketInformation.buffer); int Inviterid = reader.Int32(); int Myid = reader.Int32(); byte State = reader.Byte(); reader.Close(); PlayerMgr sys = Helpers.GetInformation.GetPlayer(Inviterid); if (sys != null) { if (State == 0) { //Declined client.Send(Packet.FriendDecline(Character.Information.Name)); sys.client.Send(Packet.FriendDecline(Character.Information.Name)); } else { //Accepted sys.client.Send(Packet.FriendData(Myid, 2, Character.Information.Name, Character, false)); client.Send(Packet.FriendData(Inviterid, 2, sys.Character.Information.Name, sys.Character, false)); DB.query("INSERT INTO friends (owner,friend_name,model_info) VALUES ('" + Character.Information.CharacterID + "','" + sys.Character.Information.CharacterID + "','" + sys.Character.Information.Model + "')"); DB.query("INSERT INTO friends (owner,friend_name,model_info) VALUES ('" + sys.Character.Information.CharacterID + "','" + Character.Information.CharacterID + "','" + Character.Information.Model + "')"); } } } catch (Exception ex) { Console.WriteLine("Friend Add Response Error {0}", ex); Log.Exception(ex); } }
void CleanUp(PlayerMgr c) { c.Character.Network.Guild.MembersClient.Remove(c.client); c.Character.Network.Guild.Members.Remove(c.Character.Information.CharacterID); c.Character.Network.Guild.Name = null; c.Character.Network.Guild.Level = 0; c.Character.Network.Guild.PointsTotal = 0; c.Character.Network.Guild.NewsTitle = null; c.Character.Network.Guild.NewsMessage = null; c.Character.Network.Guild.StorageSlots = 0; c.Character.Network.Guild.Wargold = 0; c.Character.Network.Guild.StorageGold = 0; c.Character.Network.Guild.GuildOwner = 0; c.Character.Network.Guild.Guildid = 0; c.Character.Network.Guild.GrantName = null; c.Character.Network.Guild.FWrank = 0; c.Character.Network.Guild.DonateGP = 0; c.Character.Network.Guild.LastDonate = 0; c.Character.Network.Guild.joinRight = false; c.Character.Network.Guild.withdrawRight = false; c.Character.Network.Guild.unionRight = false; c.Character.Network.Guild.guildstorageRight = false; c.Character.Network.Guild.noticeeditRight = false; c.Character.Network.Guild.MembersClient = null; c.Character.Network.Guild.MembersClient = null; }
///////////////////////////////////////////////////////////////////////////////// // Remove Friends ///////////////////////////////////////////////////////////////////////////////// public void FriendRemoval() { try { //Read client packet data PacketReader reader = new PacketReader(PacketInformation.buffer); int target = reader.Int32(); reader.Close(); //Get player information PlayerMgr sys = Helpers.GetInformation.GetPlayerid(target); //Remove friend from our list query DB.query("DELETE FROM friends WHERE owner='" + Character.Information.CharacterID + "' AND friend_name='" + target + "'"); DB.query("DELETE FROM friends WHERE owner='" + target + "' AND friend_name='" + Character.Information.CharacterID + "'"); //Remove friend from our list packet client.Send(Packet.FriendData(target, 3, "", Character, false)); client.Send(Packet.FriendRemovalTarget(target)); //Remove friend from friend id packet if (sys != null) { sys.Send(Packet.FriendData(sys.Character.Information.UniqueID, 3, "", Character, false)); } } catch (Exception ex) { Console.WriteLine("Friend removal error {0}", ex); Log.Exception(ex); } }
public void EnterStall() { try { if (Character.Information.Scroll) { return; } PacketReader Reader = new PacketReader(PacketInformation.buffer); PlayerMgr staller = Helpers.GetInformation.GetPlayer(Reader.Int32()); Character.Network.Stall = staller.Character.Network.Stall; staller.Character.Network.Stall.Members.Add(Character.Information.UniqueID); staller.Character.Network.Stall.MembersClient.Add(client); client.Send(Packet.EnterStall(Character.Information.UniqueID, staller.Character.Network.Stall)); staller.Character.Network.Stall.Send(Packet.StallPlayerUpdate(Character.Information.UniqueID, 2), client); Character.Stall.Stallactive = true; } catch (Exception ex) { Log.Exception(ex); } }
void Request() { try { PacketReader Reader = new PacketReader(PacketInformation.buffer); if (Reader.Byte() == 1 && Reader.Byte() == 0) { PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID); sys.client.Send(Packet.Exchange_Cancel()); } else { PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID); sys.client.Send(Packet.OpenExhangeWindow(1, Character.Information.UniqueID)); client.Send(Packet.OpenExhangeWindow(sys.Character.Information.UniqueID)); Character.Network.Exchange.Window = true; Character.Network.Exchange.ItemList = new List <ObjData.slotItem>(); sys.Character.Network.Exchange.Window = true; sys.Character.Network.Exchange.ItemList = new List <ObjData.slotItem>(); } } catch (Exception ex) { Log.Exception(ex); } }
public void Exchange_Close() { try { PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID); client.Send(Packet.Exchange_Cancel()); client.Send(Packet.CloseExhangeWindow()); Character.Network.Exchange.Window = false; Character.Network.Exchange.ItemList = null; if (sys != null) { sys.client.Send(Packet.Exchange_Cancel()); sys.client.Send(Packet.CloseExhangeWindow()); sys.Character.Network.Exchange.Window = false; sys.Character.Network.Exchange.ItemList = null; Character.State.Exchanging = false; sys.Character.State.Exchanging = false; } Character.State.Exchanging = false; sys.Character.State.Exchanging = false; } catch (Exception ex) { Console.WriteLine(ex); } }
public static void RemoveOnDisconnect(WorldMgr.party p, PlayerMgr c) { //Remove client and member if it contains our removing character if (p.Members.Contains(c.Character.Information.UniqueID)) { p.Members.Remove(c.Character.Information.UniqueID); p.MembersClient.Remove(c.client); } //Send packet to each player foreach (int member in p.Members) { PlayerMgr playerdetail = Helpers.GetInformation.GetPlayer(member); if (p.Members.Count > 1) { playerdetail.client.Send(Packet.Party_Data(1, 0)); } else { //Send removal of party playerdetail.client.Send(Packet.Party_Data(3, playerdetail.Character.Information.UniqueID)); //Remove party state playerdetail.Character.Network.Party = null; } } }
public static void RemoveOnDisconnect(WorldMgr.party p, PlayerMgr c) { //Remove client and member if it contains our removing character if (p.Members.Contains(c.Character.Information.UniqueID)) { p.Members.Remove(c.Character.Information.UniqueID); p.MembersClient.Remove(c.client); } //Send packet to each player foreach (int member in p.Members) { PlayerMgr playerdetail = Helpers.GetInformation.GetPlayer(member); if (p.Members.Count > 1) { playerdetail.client.Send(Packet.Party_Data(1, 0)); } else { //Send removal of party playerdetail.client.Send(Packet.Party_Data(3, playerdetail.Character.Information.UniqueID)); //Remove party state playerdetail.Character.Network.Party = null; } } }
///////////////////////////////////////////////////////////////////////////////// // Move item to exchange slot (Will come when fixing exchange system). ///////////////////////////////////////////////////////////////////////////////// void ItemMoveToExhangePage(byte f_slot) { #region Move to exchange try { PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID); if (Character.Network.Exchange.ItemList.Count < 12 && sys.GetFreeSlotMax() > (byte)Character.Network.Exchange.ItemList.Count) { ObjData.slotItem newitem = GetItem((uint)Character.Information.CharacterID, f_slot, 0); LoadBluesid(newitem.dbID); if (newitem.Amount <= ObjData.Manager.ItemBase[newitem.ID].Max_Stack) { Character.Network.Exchange.ItemList.Add(newitem); client.Send(Packet.Exchange_ItemPacket(Character.Information.UniqueID, Character.Network.Exchange.ItemList, true)); sys.Send(Packet.Exchange_ItemPacket(sys.Character.Information.UniqueID, sys.Character.Network.Exchange.ItemList, true)); client.Send(Packet.Exchange_ItemSlot(4, f_slot)); sys.Send(Packet.Exchange_ItemSlot(4, f_slot)); } else { return; } } } catch (Exception ex) { Log.Exception("Exchange add item error: ", ex); } #endregion }
public void PartyAddmembers() { try { //Create new packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); //Read target id int targetid = Reader.Int32(); //Close packet reader Reader.Close(); //Get detailed information from target PlayerMgr InvitedPlayer = Helpers.GetInformation.GetPlayer(targetid); //Check if the targeted player allready is in a party. if (InvitedPlayer.Character.Network.Party == null) { //Set target id of target player to our id InvitedPlayer.Character.Network.TargetID = this.Character.Information.UniqueID; //Send request InvitedPlayer.client.Send(Packet.PartyRequest(2, Character.Information.UniqueID, Character.Network.Party.Type)); } } //Write bad exception errors catch (Exception ex) { //Write error to the console. Console.WriteLine(ex); //Write error to the debug log } }
void GetGuildData() { //Wrap our function inside a catcher try { //If the player is in a guild if (Character.Network.Guild.Guildid > 0) { if (!CheckGuildMemberAdd(Character)) { Character.Network.Guild.Members.Add(Character.Information.CharacterID); Character.Network.Guild.MembersClient.Add(client); } //Send data begin opcode client.Send(Packet.SendGuildStart()); //Send date client.Send(Packet.SendGuildInfo(Character.Network.Guild)); //Send end data client.Send(Packet.SendGuildEnd()); //Send detail information Send(Packet.SendGuildInfo2(Character)); //Update to all guild members (online state). if (Character.Network.Guild.Guildid != 0) { Character.Information.Online = 1; //Send packets to network and spawned players foreach (int member in Character.Network.Guild.Members) { //Make sure the member is there if (member != 0) { //We dont send this info to the invited user. if (member != Character.Information.CharacterID) { //If the user is not the newly invited member get player info PlayerMgr tomember = Helpers.GetInformation.GetPlayerMainid(member); //Send guild update packet if (tomember != null) { tomember.client.Send(Packet.GuildUpdate(Character, 6, Character.Information.CharacterID, 0, 0)); } } } } } } //Get union data LoadUnions(); } catch (Exception ex) { Log.Exception(ex); } }
public void GuildInvite() { //Wrap our code into a catcher try { //Create new packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); //Read lenght of invited character name Int16 InvitedCharacterLEN = Reader.Int16(); //Read invited character name string InvitedCharacter = Reader.String(InvitedCharacterLEN); //Close packet reader Reader.Close(); //Get information for target PlayerMgr sys = Helpers.GetInformation.GetPlayerName(InvitedCharacter); //Set targetid information Character.Network.TargetID = sys.Character.Information.UniqueID; //If player allready has a guild if (sys.Character.Network.Guild.Guildid != 0) { client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_MEMBER_OF_ANOTHER_GUILD)); return; } //If player has to wait before the player can join another guild if (sys.Character.Information.GuildPenalty) { client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILD_PENALTY)); return; } //If the guild has max members if (Character.Network.Guild.TotalMembers >= Character.Network.Guild.MaxMembers) { client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_MEMBER_FULL)); } //If the character doesnt have join rights if (!Character.Network.Guild.joinRight) { //This should not happen unless hack attempt, because button should be grayed out return; } //Set targetid to the invited player sys.Character.Network.TargetID = this.Character.Information.UniqueID; //Send guild request packet sys.client.Send(Packet.PartyRequest(5, this.Character.Information.UniqueID, 0)); //Set bools active Character.State.GuildInvite = true; sys.Character.State.GuildInvite = true; } //Catch bad exception errors catch (Exception ex) { Log.Exception(ex); } }
public void GuildLeave() { //Write our function inside a catcher try { //Send required packets to network foreach (int member in Character.Network.Guild.Members) { //Make sure member s not null if (member != 0) { //Get information for the guildmember PlayerMgr guildmember = Helpers.GetInformation.GetPlayerMainid(member); //Make sure the guildmember isnt null if (guildmember != null) { //Send update packet guildmember.client.Send(Packet.GuildUpdate(Character, 12, 0, 0, 0)); } } } //Send public packet to in range players (removal guild name). Send(Packet.GuildKick(Character.Information.UniqueID)); //Removal from guild client.Send(Packet.GuildLeave()); //Send normal state packet client.Send(Packet.StatePack(Character.Information.UniqueID, 0x04, 0x00, false)); //Count new members minus 1 int Membercount = Character.Network.Guild.Members.Count - 1; //Update database DB.query("UPDATE guild SET guild_members_t='" + Membercount + "' WHERE guild_name='" + Character.Network.Guild.Name + "'"); //Remove the player from database DB.query("DELETE from guild_members where guild_member_id='" + Character.Information.CharacterID + "'"); //If the guild has a union if (Character.Network.Guild.UniqueUnion != 0) { //Set boolean unionactive to false Character.Network.Guild.UnionActive = false; //Remove the member from union member list Character.Network.Guild.UnionMembers.Remove(Character.Information.CharacterID); } //Cleanup character CleanUp(this); //Reload information LoadPlayerGuildInfo(true); } //Catch bad exception errors catch (Exception ex) { //Write information the the debug log } }
/* * public static void StartEffectDamage(int intval, int HitPower, byte e_index, object target) * { * try * { * if (target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index] != null) target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index].Dispose(); * * target.sys.Character.Action.DeBuff.Effect.EffectImpactTimer[e_index] = new Timer( * new TimerCallback( * delegate(object e) * { * if (target.type == true) // player * { * if (!target.sys.Character.State.Die) * { * target.HP(HitPower); * target.sys.Send(Packet.Effects2Dmg(target.sys.Character.Information.UniqueID, HitPower)); * } * else return; * } * else if (target.type == false) // mob * { * if (!target.os.Die) * { * target.HP(HitPower); * target.os.Send(Packet.Effects2Dmg(target.ID, HitPower)); * } * else return; * } * } * ), null, 0, intval); * } * catch (Exception ex) * { * Log.Exception(ex); * Console.WriteLine("StartEffectDamage() Error {0}", ex); * } * } */ /////////////////////////////////////////////////////////////////////////// // Shock state /////////////////////////////////////////////////////////////////////////// public static void GenerateEffect_es(object target, int skillid) { // Get effects parameters int Power = ObjData.Manager.SkillBase[skillid].Properties1["es"]; int Probability = ObjData.Manager.SkillBase[skillid].Properties2["es"]; int Random = Rnd.Next(1, 100); byte slot; // if effect succeeded if (Random <= Probability) { if (target.GetType().ToString() == "CLGameServer.PlayerMgr") // player { PlayerMgr sys = target as PlayerMgr; if (sys.Character.State.Die == true) { return; } slot = sys.DeBuffGetFreeSlot(); sys.Character.Action.DeBuff.Effect.EffectID[slot] = EffectNumbers.SHOCKED; sys.Character.Action.DeBuff.Effect.SkillID[slot] = skillid; sys.StartEffectTimer(Power * 100, slot); sys.client.Send(Packet.EffectUpdate(sys.Character.Information.UniqueID, EffectNumbers.SHOCKED, true)); // Timer for burn state } else if (target.GetType().ToString() == "CLGameServer.WorldMgr.Monsters") // mob { WorldMgr.Monsters os = target as WorldMgr.Monsters; if (os.Die == true) { return; } slot = os.DeBuffGetFreeSlot(); os.DeBuff.Effect.EffectID[slot] = EffectNumbers.SHOCKED; os.DeBuff.Effect.SkillID[slot] = skillid; os.StartEffectTimer(Power * 100, slot); os.Send(Packet.EffectUpdate(os.UniqueID, EffectNumbers.SHOCKED, true)); // Burn timer // Add (character details). } } }
public void GuildTransferLeaderShip() { try { //Create new packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); //Read guild id int Guildid = Reader.Int32(); //Read guild member id to transfer to int GuildMemberID = Reader.Int32(); //Close reader Reader.Close(); //Get detailed player information PlayerMgr NewLeader = Helpers.GetInformation.GetPlayerid(GuildMemberID); //Update database DB.query("UPDATE guild_members SET guild_rank='10',guild_perm_join='0',guild_perm_withdraw='0',guild_perm_union='0',guild_perm_storage='0',guild_perm_notice='0' WHERE guild_member_id='" + Character.Information.CharacterID + "'"); DB.query("UPDATE guild_members SET guild_rank='0',guild_perm_join='1',guild_perm_withdraw='1',guild_perm_union='1',guild_perm_storage='1',guild_perm_notice='1' WHERE guild_member_id='" + GuildMemberID + "'"); //Repeat for each member in our guild foreach (int member in Character.Network.Guild.Members) { //Make sure member is not null if (member != 0) { //Get information for the guildmember PlayerMgr guildmember = Helpers.GetInformation.GetPlayerMainid(member); //Make sure the guildmember isnt null if (guildmember != null) { //Send update packet of new leader guildmember.client.Send(Packet.GuildUpdate(Character, 3, GuildMemberID, 0, 0)); } } } //Send message to old owner PacketWriter Writer = new PacketWriter(); //Add opcode Writer.Create(OperationCode.SERVER_GUILD_TRANSFER_MSG); //Static byte 1 Writer.Byte(1); //Send bytes to client client.Send(Writer.GetBytes()); } //If a bad exception error happens catch (Exception ex) { Log.Exception(ex); } }
public static void _OnClientDisconnect(object o) { try { if (o != null) { PlayerMgr s = (PlayerMgr)o; s.PrintLastPack(); s.Disconnect("normal"); } } catch (Exception) { } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Player Disconnect /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void KickPlayer(PlayerMgr Target) { try { Target.client.Send((Packet.ChatPacket(7, Target.Character.Information.UniqueID, "You Have been kicked!", ""))); if (Player != null) { DB.query("UPDATE users SET online='" + 0 + "' WHERE id='" + Target.Player.AccountName + "'"); Target.Player.Dispose(); Target.Player = null; } if (Target.Character != null) { if (Target.Character.Transport.Right) { Target.Character.Transport.Horse.DeSpawnMe(); } if (Target.Character.Grabpet.Active) { Target.Character.Grabpet.Details.DeSpawnMe(); } if (Target.Character.Network.Exchange.Window) { Target.Exchange_Close(); } if (Target.Character.State.Sitting) { Target.StopMPRegen(); Target.StopHPRegen(); } Target.StopAttackTimer(); Target.BuffAllClose(); Target.DeSpawnMe(); Target.StopMPRegen(); Target.StopHPRegen(); Target.SavePlayerPosition(); Target.SavePlayerInfo(); Target.Character.InGame = false; client.Disconnect(Target.client.clientSocket); Target.client.Close(); } } catch (Exception ex) { Log.Exception(ex); } }
///////////////////////////////////////////////////////////////////////////////// // Spawn system (Spawn our char to others). ///////////////////////////////////////////////////////////////////////////////// void ObjectPlayerSpawn(PlayerMgr s) { try { if (!s.Character.Spawned(Character.Information.UniqueID) && Character.Information.UniqueID != 0 && !s.Character.Spawning) { //We loop the spawn check for the player that needs it. s.ObjectSpawnCheck(); } } catch (Exception ex) { Console.WriteLine("Object player spawn error {0}", ex); Log.Exception(ex); } }
void GMblocklogout(string name, byte type) { //Type one we will use for kicking a user (disconnect). if (type == 1) { PlayerMgr playerid = Helpers.GetInformation.GetPlayerName(name); if (playerid.Character != null) { KickPlayer(playerid); } } //Type two not sure but we can use more types if needed else if (type == 2) { } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Private Message Send /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void PrivateMessageSend() { try { ///////////////////////////////////////////////////////////////////////////////////// PacketReader Reader = new PacketReader(PacketInformation.buffer); ///////////////////////////////////////////////////////////////////////////////////// short touser = Reader.Int16(); string tousername = Reader.String(touser); short messagel = Reader.Int16(); string message = Reader.String(messagel); Reader.Close(); ///////////////////////////////////////////////////////////////////////////////////// int count = DB.GetRowsCount("SELECT * FROM character WHERE name='" + tousername + "'"); int charid = Convert.ToInt32(Convert.ToInt32(DB.GetData("SELECT id FROM character WHERE name='" + tousername + "'", "id"))); ///////////////////////////////////////////////////////////////////////////////////// if (count == 0)//Check username { client.Send(Packet.PrivateMessageMsg(1)); return; } if (count > 0)//Excisting username { DB ms = new DB("SELECT * FROM message WHERE receiver='" + tousername + "' ORDER BY idinfo DESC"); int msgcount = ms.Count(); PlayerMgr sys = Helpers.GetInformation.GetPlayerMainid(charid); if (msgcount == 0) { DB.query("INSERT INTO message (sender, receiver, message, status, time, idinfo) VALUES ('" + Character.Information.Name + "','" + tousername + "','" + message + "','0','10/10/2010 12:00:00 AM','0')"); client.Send(Packet.PrivateMessageMsg(2)); sys.Send(Packet.FriendData(sys.Character.Information.UniqueID, 5, tousername, Character, false)); } if (msgcount > 0) { int messagenewid = msgcount + 1; DB.query("INSERT INTO message (sender, receiver, message, status, time, idinfo) VALUES ('" + Character.Information.Name + "','" + tousername + "','" + message + "','0','10/10/2010 12:00:00 AM','" + Convert.ToByte(messagenewid) + "')"); client.Send(Packet.PrivateMessageMsg(2)); sys.Send(Packet.FriendData(sys.Character.Information.UniqueID, 5, tousername, Character, false)); } } } catch (Exception ex) { Log.Exception(ex); } }
public static void DeleteEffect_fb(object target, byte EffectSlot) { try { if (target.GetType().ToString() == "CLGameServer.PlayerMgr") // player { PlayerMgr sys = target as PlayerMgr; sys.Send(Packet.EffectUpdate(sys.Character.Information.UniqueID, sys.Character.Action.DeBuff.Effect.EffectID[EffectSlot], false)); sys.Character.Action.DeBuff.Effect.EffectID[EffectSlot] = 0; sys.Character.Action.DeBuff.Effect.SkillID[EffectSlot] = 0; //sys.Character.Speed.AttackSpeedModifier = 1; sys.Character.Speed.RunSpeed *= 2; sys.Character.Speed.WalkSpeed *= 2; sys.Character.Speed.BerserkSpeed *= 2; sys.Send(Packet.SetSpeed(sys.Character.Information.UniqueID, sys.Character.Speed.WalkSpeed, sys.Character.Speed.RunSpeed)); } else if (target.GetType().ToString() == "CLGameServer.WorldMgr.Monsters") // mob { WorldMgr.Monsters os = target as WorldMgr.Monsters; os.Send(Packet.EffectUpdate(os.UniqueID, os.DeBuff.Effect.EffectID[EffectSlot], false)); os.DeBuff.Effect.EffectID[EffectSlot] = 0; os.DeBuff.Effect.SkillID[EffectSlot] = 0; // attack speed os.AttackSpeed = 1; // movement speed os.RunningSpeed *= 2; os.WalkingSpeed *= 2; //Set bool to false again os.Frostbite = false; os.Send(Packet.SetSpeed(os.UniqueID, os.WalkingSpeed, os.RunningSpeed)); } } catch (Exception ex) { Log.Exception(ex); } }
public void GuildMessage() { //Wrap our function inside a catcher try { //Create new packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); //Read short int16 for title lenght short TitleL = Reader.Int16(); //Read string for title string Title = Reader.String(TitleL); //Read short Message lenght short MessageL = Reader.Int16(); //Read message string Message = Reader.String(MessageL); //Close reader Reader.Close(); //Update database guild message title and message DB.query("UPDATE guild SET guild_news_t='" + Title + "',guild_news_m='" + Message + "' WHERE guild_name='" + Character.Network.Guild.Name + "'"); //Set new message info to current member for sending packet update. Character.Network.Guild.NewsTitle = Title; Character.Network.Guild.NewsMessage = Message; //Repeat for each member in our guild foreach (int member in Character.Network.Guild.Members) { //Make sure the member is there if (member != 0) { //Get detailed information from member main id PlayerMgr characterinformation = Helpers.GetInformation.GetPlayerid(member); //Set the current member news title and message information characterinformation.Character.Network.Guild.NewsMessage = Message; characterinformation.Character.Network.Guild.NewsTitle = Title; //Send packet to the member to update guild message. characterinformation.client.Send(Packet.GuildUpdate(characterinformation.Character, 11, 0, 0, 0)); } } } //Catch any bad exception error catch (Exception ex) { Log.Exception(ex); } }
public void SelectObject() { try { if (Character.Information.Scroll) { return; } PacketReader Reader = new PacketReader(PacketInformation.buffer); int objectid = Reader.Int32(); if (objectid == 0) { return; } //Character.Action.Target = objectid; //if (Character.Position.Walking) StopPlayerMovementO(objectid); if (objectid == Character.Information.UniqueID) { return; } WorldMgr.Monsters o = Helpers.GetInformation.GetObject(objectid); if (o != null) { byte[] bb = Packet.SelectObject(objectid, o.ID, o.LocalType, o.HP); if (bb == null) { return; } client.Send(bb); //Character.Action.Object = o; return; } PlayerMgr sys = Helpers.GetInformation.GetPlayers(objectid); if (o == null && sys != null) { client.Send(Packet.SelectObject(objectid, 0, 5, sys.Character.Stat.Hp)); Character.Action.Object = sys; return; } Reader.Close(); } catch (Exception ex) { Console.WriteLine("Selectobject error: {0}", ex); } }
public void ListPartyMatching(List <WorldMgr.party> pt) { //Create new packet writer PacketWriter Writer = new PacketWriter(); //Add opcode Writer.Create(OperationCode.SERVER_SEND_PARTYLIST); //Write static bytes Writer.Byte(1); Writer.Byte(4); Writer.Byte(0); //Write total count of partys Writer.Byte(pt.Count); //If party count higher is then zero if (pt.Count > 0) { //Repeat for each party in list of party's foreach (WorldMgr.party currpt in pt) { //Get player information using leaderid PlayerMgr s = Helpers.GetInformation.GetPlayer(currpt.LeaderID); //Write party id Writer.DWord(currpt.ptid); //Write leader id Writer.DWord(currpt.LeaderID); //Write charactername Writer.Text(s.Character.Information.Name); //Write static byte 1 Writer.Byte(currpt.Race); //Write current party players count Writer.Byte(currpt.Members.Count); //Write party type Writer.Byte(currpt.Type); //Write party purpose Writer.Byte(currpt.ptpurpose); //Write min level required Writer.Byte(currpt.minlevel); //Write max level to join the party Writer.Byte(currpt.maxlevel); //Write party name Writer.Text3(currpt.partyname); } } //Send bytes to the client client.Send(Writer.GetBytes()); }
///////////////////////////////////////////////////////////////////////////////// // DE-Spawn system (Spawn our char to others). ///////////////////////////////////////////////////////////////////////////////// void ObjectDePlayerSpawn(PlayerMgr s) { try { if (s.Character.Spawned(Character.Information.UniqueID) && !s.Character.deSpawning) { if (s.Character.Information.UniqueID != 0) { s.ObjectDeSpawnCheck(); } } } catch (Exception ex) { Console.WriteLine("Systems despawn error {0}", ex); Log.Exception(ex); } }
public void Exchange_Accept() { try { PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID); client.Send(Packet.Exchange_ItemPacket(Character.Information.UniqueID, Character.Network.Exchange.ItemList, true)); client.Send(Packet.Exchange_Accept()); sys.client.Send(Packet.Exchange_ItemPacket(Character.Information.UniqueID, Character.Network.Exchange.ItemList, false)); sys.client.Send(Packet.Exchange_Gold(Character.Network.Exchange.Gold)); sys.client.Send(Packet.Exchange_Accept2()); } catch (Exception ex) { Log.Exception(ex); } }
void GetFriendsList() { //Wrap our function inside a catcher try { //Set new sql query to get friend information DB ms = new DB("SELECT * FROM friends WHERE owner='" + Character.Information.CharacterID + "'"); //Count our friends int count = ms.Count(); //If we have a friend in the list if (count > 0) { //Send our packet client.Send(Packet.SendFriendList(Convert.ToByte(count), Character)); //Open new sql data reader using (SqlDataReader reader = ms.Read()) { //While our sql data reader is reading while (reader.Read()) { //Get player id information of friend int getid = reader.GetInt32(2); //Get detailed information for our friend PlayerMgr sys = Helpers.GetInformation.GetPlayerid(getid); //If the character is online if (sys != null) { //We send online state change packet sys.client.Send(Packet.FriendData(Character.Information.CharacterID, 4, Character.Information.Name, Character, false)); } } } //Close our sql reader ms.Close(); } } catch (Exception ex) { Log.Exception(ex); } }
public void Exchange_Request() { try { PacketReader Reader = new PacketReader(PacketInformation.buffer); int targetid = Reader.Int32(); Reader.Close(); PlayerMgr sys = Helpers.GetInformation.GetPlayer(targetid); Character.Network.TargetID = targetid; sys.Character.Network.TargetID = Character.Information.UniqueID; sys.client.Send(Packet.PartyRequest(1, Character.Information.UniqueID, 0)); Character.State.Exchanging = true; sys.Character.State.Exchanging = true; } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeMaxMP_mpi(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["mpi"] != 0) // point inc { int amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["mpi"]; Target.Character.Action.Buff.UpdatedStats[slot].Mp = amount; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["mpi"] != 0) // %inc { int amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["mpi"]; Target.Character.Action.Buff.UpdatedStats[slot].Mp = (Target.Character.Stat.Hp / 100) * (amount); } Target.Character.Stat.Mp += Target.Character.Action.Buff.UpdatedStats[slot].Mp; Target.Character.Stat.SecondMP += Target.Character.Action.Buff.UpdatedStats[slot].Mp; if ((Target.Character.Stat.SecondMP + Target.Character.Action.Buff.UpdatedStats[slot].Mp) > Target.Character.Stat.Mp) { Target.Character.Stat.SecondMP = Target.Character.Stat.Mp; } else { Target.Character.Stat.SecondMP += Target.Character.Action.Buff.UpdatedStats[slot].Mp; } } else { // sub it Target.Character.Stat.Mp -= Target.Character.Action.Buff.UpdatedStats[slot].Mp; // dont want negative mana if (Target.Character.Stat.SecondMP - Target.Character.Action.Buff.UpdatedStats[slot].Mp < 1) { Target.Character.Stat.SecondMP = 1; } else { Target.Character.Stat.SecondMP -= Target.Character.Action.Buff.UpdatedStats[slot].Mp; } Target.Character.Action.Buff.UpdatedStats[slot].Mp = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeMaxHP_hpi(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hpi"] != 0) // point inc { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hpi"]; Target.Character.Action.Buff.UpdatedStats[slot].Hp = amount; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["hpi"] != 0) // %inc { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["hpi"]; Target.Character.Action.Buff.UpdatedStats[slot].Hp = (Target.Character.Stat.Hp / 100) * (amount); } // add it Target.Character.Stat.Hp += Target.Character.Action.Buff.UpdatedStats[slot].Hp; Target.Character.Stat.SecondHp += Target.Character.Action.Buff.UpdatedStats[slot].Hp; if ((Target.Character.Stat.SecondHp + Target.Character.Action.Buff.UpdatedStats[slot].Hp) > Target.Character.Stat.Hp) { Target.Character.Stat.SecondHp = Target.Character.Stat.Hp; } else { Target.Character.Stat.SecondHp += Target.Character.Action.Buff.UpdatedStats[slot].Hp; } } else { // sub it Target.Character.Stat.Hp -= Target.Character.Action.Buff.UpdatedStats[slot].Hp; // dont kill him :) if (Target.Character.Stat.SecondHp - Target.Character.Action.Buff.UpdatedStats[slot].Hp < 1) { Target.Character.Stat.SecondHp = 1; } else { Target.Character.Stat.SecondHp -= Target.Character.Action.Buff.UpdatedStats[slot].Hp; } Target.Character.Action.Buff.UpdatedStats[slot].Hp = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Player Disconnect /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void KickPlayer(PlayerMgr Target) { try { Target.client.Send((Packet.ChatPacket(7, Target.Character.Information.UniqueID, "You Have been kicked!", ""))); if (Player != null) { DB.query("UPDATE users SET online='" + 0 + "' WHERE id='" + Target.Player.AccountName + "'"); Target.Player.Dispose(); Target.Player = null; } if (Target.Character != null) { if (Target.Character.Transport.Right) Target.Character.Transport.Horse.DeSpawnMe(); if (Target.Character.Grabpet.Active) Target.Character.Grabpet.Details.DeSpawnMe(); if (Target.Character.Network.Exchange.Window) Target.Exchange_Close(); if (Target.Character.State.Sitting) { Target.StopMPRegen(); Target.StopHPRegen(); } Target.StopAttackTimer(); Target.BuffAllClose(); Target.DeSpawnMe(); Target.StopMPRegen(); Target.StopHPRegen(); Target.SavePlayerPosition(); Target.SavePlayerInfo(); Target.Character.InGame = false; client.Disconnect(Target.client.clientSocket); Target.client.Close(); } } catch (Exception ex) { Log.Exception(ex); } }
public static void _OnClientConnect(ref object de, SRClient net) { de = new PlayerMgr(net); }
public void Change_spda(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { double amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1.ContainsKey("spda")) //Phydef decrease? { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["spda"]; Target.Character.Action.Buff.UpdatedStats[slot].uPhyDef = (Target.Character.Stat.PhyDef / 100) * (amount); Target.Character.Stat.PhyDef -= Target.Character.Action.Buff.UpdatedStats[slot].uPhyDef; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2.ContainsKey("spda")) //Phy attack inc? { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["spda"]; Target.Character.Stat.UpdatededPhyAttack = (Target.Character.Stat.MaxPhyAttack / 100) * (amount); Target.Character.Stat.MaxPhyAttack += Target.Character.Stat.UpdatededPhyAttack; } } else { Target.Character.Stat.PhyDef += Target.Character.Action.Buff.UpdatedStats[slot].uPhyDef; Target.Character.Stat.MaxPhyAttack -= Target.Character.Stat.UpdatededPhyAttack; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeStr_stri(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["stri"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["stri"]; Target.Character.Action.Buff.UpdatedStats[slot].Strength = (short)amount; } /*if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2.ContainsKey("stri")) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["stri"]; Target.Character.Action.Buff.UpdatedStats[slot].Strength = (short)((Target.Character.Stat.Strength / 100) * (amount)); }*/ Target.Character.Stat.Strength += Target.Character.Action.Buff.UpdatedStats[slot].Strength; } else { Target.Character.Stat.Strength -= Target.Character.Action.Buff.UpdatedStats[slot].Strength; Target.Character.Action.Buff.UpdatedStats[slot].Strength = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeRange_ru(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["ru"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["ru"]; Target.Character.Action.Buff.UpdatedStats[slot].EkstraMetre = (byte)amount; Target.Character.Stat.EkstraMetre += Target.Character.Action.Buff.UpdatedStats[slot].EkstraMetre; } } else { Target.Character.Stat.EkstraMetre -= Target.Character.Action.Buff.UpdatedStats[slot].EkstraMetre; Target.Character.Action.Buff.UpdatedStats[slot].EkstraMetre = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeCriticalParry_dcri(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { int amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["dcri"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["dcri"]; Target.Character.Stat.CritParryRatio += amount; } } else { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["dcri"]; Target.Character.Stat.CritParryRatio -= amount; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeBlockingRatio_br(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { int amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["br"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["br"]; Target.Character.Action.Buff.UpdatedStats[slot].BlockRatio = amount; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["br"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["br"]; Target.Character.Action.Buff.UpdatedStats[slot].BlockRatio = (Target.Character.Stat.BlockRatio / 100) * (amount); } Target.Character.Stat.BlockRatio += Target.Character.Action.Buff.UpdatedStats[slot].BlockRatio; } else { Target.Character.Stat.BlockRatio -= Target.Character.Action.Buff.UpdatedStats[slot].BlockRatio; Target.Character.Action.Buff.UpdatedStats[slot].BlockRatio = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
// dgmp stat ellenőrzése hogy mire jó?? public void ChangeAbsorbMP_dgmp(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["dgmp"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["dgmp"]; Target.Character.Stat.Absorb_mp = amount; } } else { Target.Character.Stat.Absorb_mp = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public static void HealHPMP(PlayerMgr Target, int slot, int skillid, bool delete, bool UpdatePacket) { try { int amount; int sid; // get skillid from parameters if (skillid == -1) sid = Target.Character.Action.Buff.SkillID[slot]; else sid = skillid; if (!delete) { // if hp full if (Target.Character.Stat.SecondHp == Target.Character.Stat.Hp) return; if (ObjData.Manager.SkillBase[sid].Properties1["heal"] != 0) { amount = ObjData.Manager.SkillBase[sid].Properties1["heal"]; // add the calculated amount if (Target.Character.Stat.SecondHp + amount < Target.Character.Stat.Hp) Target.Character.Stat.SecondHp += amount; else if (Target.Character.Stat.SecondHp != Target.Character.Stat.Hp) Target.Character.Stat.SecondHp += Target.Character.Stat.Hp - Target.Character.Stat.SecondHp; if (UpdatePacket) Target.UpdateHp(); } if (ObjData.Manager.SkillBase[sid].Properties2["heal"] != 0) { amount = ObjData.Manager.SkillBase[sid].Properties2["heal"]; amount = (Target.Character.Stat.Hp / 100) * amount; // add the calculated amount if (Target.Character.Stat.SecondHp + amount < Target.Character.Stat.Hp) Target.Character.Stat.SecondHp += amount; else if (Target.Character.Stat.SecondHp != Target.Character.Stat.Hp) Target.Character.Stat.SecondHp += Target.Character.Stat.Hp - Target.Character.Stat.SecondHp; if (UpdatePacket) Target.UpdateHp(); } if (ObjData.Manager.SkillBase[sid].Properties3["heal"] != 0) { amount = ObjData.Manager.SkillBase[sid].Properties3["heal"]; // add the calculated amount if (Target.Character.Stat.SecondMP + amount < Target.Character.Stat.Mp) Target.Character.Stat.SecondMP += amount; else if (Target.Character.Stat.SecondMP != Target.Character.Stat.Mp) Target.Character.Stat.SecondMP += Target.Character.Stat.Mp - Target.Character.Stat.SecondMP; if (UpdatePacket) Target.UpdateMp(); } if (ObjData.Manager.SkillBase[sid].Properties3["heal"] != 0) { amount = ObjData.Manager.SkillBase[sid].Properties4["heal"]; amount = (Target.Character.Stat.Mp / 100) * amount; // add the calculated amount if (Target.Character.Stat.SecondMP + amount < Target.Character.Stat.Mp) Target.Character.Stat.SecondMP += amount; else if (Target.Character.Stat.SecondMP != Target.Character.Stat.Mp) Target.Character.Stat.SecondMP += Target.Character.Stat.Mp - Target.Character.Stat.SecondMP; if (UpdatePacket) Target.UpdateMp(); } } else { //dunno.... } } catch (Exception ex) { Log.Exception(ex); } }
public void AddRemoveBlues(PlayerMgr ch, ObjData.slotItem item, bool add) { try { LoadBluesid(item.dbID); string name; if (ObjData.Manager.ItemBlue.ContainsKey(item.dbID)) { for (int k = 0; k < ObjData.Manager.ItemBlue[item.dbID].totalblue; k++) { name = Convert.ToString(ObjData.Manager.ItemBlue[item.dbID].blue[k]); switch (name) { case "MATTR_INT": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_INT")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_STR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_STR")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_LUCK": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_LUCK")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_HP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_HP")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_MP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_MP")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_REGENHPMP": // hp/mp regen inc(%) if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_REGENHPMP")) { if (add) { ch.Character.Blues.mpregen += Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Blues.hpregen += Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.mpregen -= Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Blues.hpregen -= Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_RESIST_FROSTBITE": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_FROSTBITE")) { if (add) ch.Character.Blues.Resist_Frostbite += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Frostbite -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_ESHOCK": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_ESHOCK")) { if (add) ch.Character.Blues.Resist_Eshock += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Eshock -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_BURN": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_BURN")) { if (add) ch.Character.Blues.Resist_Burn += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Burn -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_POISON": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_POISON")) { if (add) ch.Character.Blues.Resist_Poison += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Poison -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_ZOMBIE": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_ZOMBIE")) { if (add) ch.Character.Blues.Resist_Zombie += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Zombie -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_STR_3JOB": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_STR_3JOB")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_INT_3JOB": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_INT_3JOB")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_STR_AVATAR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_STR_AVATAR")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_INT_AVATAR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_INT_AVATAR")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_STR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_STR")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_INT": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_INT")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_HR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_HR")) { if (add) { ch.Character.Blues.UpdatedStats[item.dbID].Hit = (ch.Character.Stat.Hit / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.Hit += ch.Character.Blues.UpdatedStats[item.dbID].Hit; } else { ch.Character.Stat.Hit -= ch.Character.Blues.UpdatedStats[item.dbID].Hit; ch.Character.Blues.UpdatedStats[item.dbID].Hit = 0; } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_ER": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_ER")) { if (add) { ch.Character.Blues.UpdatedStats[item.dbID].Parry = (ch.Character.Stat.Parry / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.Parry += ch.Character.Blues.UpdatedStats[item.dbID].Parry; } else { ch.Character.Stat.Parry -= ch.Character.Blues.UpdatedStats[item.dbID].Parry; ch.Character.Blues.UpdatedStats[item.dbID].Parry = 0; } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_ER": //parry rate inc if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_ER")) { if (add) { ch.Character.Blues.UpdatedStats[item.dbID].Parry = (ch.Character.Stat.Parry / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.Parry += ch.Character.Blues.UpdatedStats[item.dbID].Parry; } else { ch.Character.Stat.Parry -= ch.Character.Blues.UpdatedStats[item.dbID].Parry; ch.Character.Blues.UpdatedStats[item.dbID].Parry = 0; } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_HR": //attack rate inc (%) if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_HR")) { if (add) { ch.Character.Blues.UpdatedStats[item.dbID].Hit = (ch.Character.Stat.Hit / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.Hit += ch.Character.Blues.UpdatedStats[item.dbID].Hit; } else { ch.Character.Stat.Hit -= ch.Character.Blues.UpdatedStats[item.dbID].Hit; ch.Character.Blues.UpdatedStats[item.dbID].Hit = 0; } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_HP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_HP")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_MP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MP")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_DRUA": // damage increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_DRUA")) { if (add) { ch.Character.Blues.UpdatedStats[item.dbID].MinPhyAttack = (ch.Character.Stat.MinPhyAttack / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Blues.UpdatedStats[item.dbID].MaxPhyAttack = (ch.Character.Stat.MaxPhyAttack / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Blues.UpdatedStats[item.dbID].MinMagAttack = (ch.Character.Stat.MinMagAttack / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Blues.UpdatedStats[item.dbID].MaxMagAttack = (ch.Character.Stat.MaxMagAttack / 100) * Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.MinPhyAttack += ch.Character.Blues.UpdatedStats[item.dbID].MinPhyAttack; ch.Character.Stat.MaxPhyAttack += ch.Character.Blues.UpdatedStats[item.dbID].MaxPhyAttack; ch.Character.Stat.MinMagAttack += ch.Character.Blues.UpdatedStats[item.dbID].MinMagAttack; ch.Character.Stat.MaxMagAttack += ch.Character.Blues.UpdatedStats[item.dbID].MaxMagAttack; } else { ch.Character.Stat.MinPhyAttack -= ch.Character.Blues.UpdatedStats[item.dbID].MinPhyAttack; ch.Character.Stat.MaxPhyAttack -= ch.Character.Blues.UpdatedStats[item.dbID].MaxPhyAttack; ch.Character.Stat.MinMagAttack -= ch.Character.Blues.UpdatedStats[item.dbID].MinMagAttack; ch.Character.Stat.MaxMagAttack -= ch.Character.Blues.UpdatedStats[item.dbID].MaxMagAttack; ch.Character.Blues.UpdatedStats[item.dbID].MinPhyAttack = 0; ch.Character.Blues.UpdatedStats[item.dbID].MaxPhyAttack = 0; ch.Character.Blues.UpdatedStats[item.dbID].MinMagAttack = 0; ch.Character.Blues.UpdatedStats[item.dbID].MaxMagAttack = 0; } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_DARA": // damage absorption if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_DARA")) { if (add) { //ch.Character.Stat.phy_Absorb += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); //ch.Character.Stat.mag_Absorb += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { //ch.Character.Stat.phy_Absorb -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); //ch.Character.Stat.mag_Absorb -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_MDIA": // ignore monster defense if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MDIA")) { if (add) { ch.Character.Blues.MonsterIgnorance += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.MonsterIgnorance -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_HPRG": //hp recovery increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_HPRG")) { if (add) { ch.Character.Blues.hpregen += Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.hpregen -= Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_MPRG": //mp recovery increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MPRG")) { if (add) { ch.Character.Blues.mpregen += Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.mpregen -= Convert.ToDouble(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_RESIST_STUN": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_STUN")) { if (add) ch.Character.Blues.Resist_Stun += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Stun -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_CSMP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_CSMP")) { if (add) ch.Character.Blues.Resist_CSMP += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_CSMP -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_DISEASE": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_DISEASE")) { if (add) ch.Character.Blues.Resist_Disease += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Disease -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_SLEEP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_SLEEP")) { if (add) ch.Character.Blues.Resist_Sleep += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Sleep -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_FEAR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_FEAR")) { if (add) ch.Character.Blues.Resist_Fear += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_Fear -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_NASRUN_UMDU": //damage increase(only @ uniques) if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_NASRUN_UMDU")) { if (add) { ch.Character.Blues.UniqueDMGInc += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.UniqueDMGInc += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_NASRUN_HPNA": //maximum hp increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_NASRUN_HPNA")) { if (add) { ch.Character.Stat.Hp += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.SecondHp += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Stat.Hp -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.SecondHp -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_NASRUN_MPNA": //maximum mp increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_NASRUN_MPNA")) { if (add) { ch.Character.Stat.Mp += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.SecondMP += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Stat.Mp -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.Character.Stat.SecondMP -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_NASRUN_BLOCKRATE": //blocking rate increase if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_NASRUN_BLOCKRATE")) { if (add) { ch.Character.Stat.BlockRatio += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Stat.BlockRatio -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } ch.client.Send(Packet.PlayerStat(ch.Character)); ch.SavePlayerInfo(); } break; case "MATTR_STR_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_STR_SET")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_INT_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_INT_SET")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_ER_SET": break; case "MATTR_HP_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_HP_SET")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_MP_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_MP_SET")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_LUCK_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_LUCK_SET")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_AVATAR_STR_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_STR_2")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_STR_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_STR_3")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_STR_4": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_STR_4")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_INT_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_INT_2")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_INT_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_INT_3")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_INT_4": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_INT_4")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_AVATAR_MDIA_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MDIA_2")) { if (add) { ch.Character.Blues.MonsterIgnorance += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.MonsterIgnorance -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_MDIA_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MDIA_3")) { if (add) { ch.Character.Blues.MonsterIgnorance += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.MonsterIgnorance -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_MDIA_4": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_MDIA_4")) { if (add) { ch.Character.Blues.MonsterIgnorance += Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } else { ch.Character.Blues.MonsterIgnorance -= Convert.ToInt32(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } } break; case "MATTR_AVATAR_LUCK": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_LUCK")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_AVATAR_LUCK_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_LUCK_2")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_AVATAR_LUCK_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_LUCK_4")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_AVATAR_LUCK_4": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_AVATAR_LUCK_4")) { if (add) ch.Character.Blues.Luck += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Luck -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_RESIST_ALL_SET": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_RESIST_ALL_SET")) { if (add) ch.Character.Blues.Resist_All += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Blues.Resist_All -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); } break; case "MATTR_TRADE_STR": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_STR")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_STR_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_STR_2")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_STR_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_STR_3")) { if (add) { ch.Character.Stat.Strength += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } else { ch.Character.Stat.Strength -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateStrengthMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateHp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_INT": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_INT")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_INT_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_INT_2")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_INT_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_INT_3")) { if (add) { ch.Character.Stat.Intelligence += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceInfo(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } else { ch.Character.Stat.Intelligence -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.UpdateIntelligenceMinus(Convert.ToSByte(ObjData.Manager.ItemBlue[item.dbID].blueamount[k])); ch.SetStat(); ch.UpdateMp(); } ch.SavePlayerInfo(); } break; case "MATTR_TRADE_HP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_HP")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_TRADE_HP_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_HP_2")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_TRADE_HP_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_HP_3")) { if (add) ch.Character.Stat.Hp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Hp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateHp(); ch.SavePlayerInfo(); } break; case "MATTR_TRADE_MP": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_MP")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_TRADE_MP_2": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_MP_2")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; case "MATTR_TRADE_MP_3": if (ObjData.Manager.ItemBlue[item.dbID].blue.Contains("MATTR_TRADE_MP_3")) { if (add) ch.Character.Stat.Mp += Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); else ch.Character.Stat.Mp -= Convert.ToInt16(ObjData.Manager.ItemBlue[item.dbID].blueamount[k]); ch.client.Send(Client.Packet.PlayerStat(ch.Character)); ch.UpdateMp(); ch.SavePlayerInfo(); } break; } } } else { Console.WriteLine("[BlueSystem] ItemBlue for ID {0} not found", item.dbID); } } catch (Exception ex) { Console.WriteLine("Blue add/remove error {0}", ex); Log.Exception(ex); } }
void CleanUp(PlayerMgr c) { c.Character.Network.Guild.MembersClient.Remove(c.client); c.Character.Network.Guild.Members.Remove(c.Character.Information.CharacterID); c.Character.Network.Guild.Name = null; c.Character.Network.Guild.Level = 0; c.Character.Network.Guild.PointsTotal = 0; c.Character.Network.Guild.NewsTitle = null; c.Character.Network.Guild.NewsMessage = null; c.Character.Network.Guild.StorageSlots = 0; c.Character.Network.Guild.Wargold = 0; c.Character.Network.Guild.StorageGold = 0; c.Character.Network.Guild.GuildOwner = 0; c.Character.Network.Guild.Guildid = 0; c.Character.Network.Guild.GrantName = null; c.Character.Network.Guild.FWrank = 0; c.Character.Network.Guild.DonateGP = 0; c.Character.Network.Guild.LastDonate = 0; c.Character.Network.Guild.joinRight = false; c.Character.Network.Guild.withdrawRight = false; c.Character.Network.Guild.unionRight = false; c.Character.Network.Guild.guildstorageRight = false; c.Character.Network.Guild.noticeeditRight = false; c.Character.Network.Guild.MembersClient = null; c.Character.Network.Guild.MembersClient = null; }
public void ChangeParry_er(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["er"] != 0) // parry inc { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["er"]; Target.Character.Action.Buff.UpdatedStats[slot].Parry = amount; Target.Character.Stat.Parry += Target.Character.Action.Buff.UpdatedStats[slot].Parry; } else if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["er"] != 0) // parry %inc? { } } else { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["er"] != 0) // parry inc { Target.Character.Stat.Parry -= Target.Character.Action.Buff.UpdatedStats[slot].Parry; Target.Character.Action.Buff.UpdatedStats[slot].Parry = 0; } else if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["er"] != 0) // parry %inc? { } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeCrit_cr(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { if (!delete) { } }
public void ChangePhyAtk_E2SA(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { int amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2SA"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2SA"]; Target.Character.Action.Buff.UpdatedStats[slot].MinPhyAttack = (Target.Character.Stat.MinPhyAttack / 100) * amount; Target.Character.Action.Buff.UpdatedStats[slot].MaxPhyAttack = (Target.Character.Stat.MaxPhyAttack / 100) * amount; Target.Character.Stat.MinPhyAttack += Target.Character.Action.Buff.UpdatedStats[slot].MinPhyAttack; Target.Character.Stat.MaxPhyAttack += Target.Character.Action.Buff.UpdatedStats[slot].MaxPhyAttack; } } else { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2SA"] != 0) { Target.Character.Stat.MinPhyAttack -= Target.Character.Action.Buff.UpdatedStats[slot].MinPhyAttack; Target.Character.Stat.MaxPhyAttack -= Target.Character.Action.Buff.UpdatedStats[slot].MaxPhyAttack; Target.Character.Action.Buff.UpdatedStats[slot].MinPhyAttack = 0; Target.Character.Action.Buff.UpdatedStats[slot].MaxPhyAttack = 0; } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeDefPower_defp(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { int amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["defp"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["defp"]; Target.Character.Action.Buff.UpdatedStats[slot].PhyDef = amount; Target.Character.Stat.PhyDef += Target.Character.Action.Buff.UpdatedStats[slot].PhyDef; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["defp"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["defp"]; Target.Character.Action.Buff.UpdatedStats[slot].MagDef = amount; Target.Character.Stat.MagDef += Target.Character.Action.Buff.UpdatedStats[slot].MagDef; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties3["defp"] != 0) { //nemtudjuk } } else { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["defp"] != 0) { Target.Character.Stat.PhyDef -= Target.Character.Action.Buff.UpdatedStats[slot].PhyDef; Target.Character.Action.Buff.UpdatedStats[slot].PhyDef = 0; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["defp"] != 0) { Target.Character.Stat.MagDef -= Target.Character.Action.Buff.UpdatedStats[slot].MagDef; Target.Character.Action.Buff.UpdatedStats[slot].MagDef = 0; } if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties3["defp"] != 0) { //nemtudjuk } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeSpeed_hste(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hste"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hste"]; Target.Character.Speed.INC += amount; Character.Speed.INC = amount; } } else { Target.Character.Speed.INC -= ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hste"]; } if (UpdatePacket) Target.client.Send(Packet.SetSpeed(Target.Character.Information.UniqueID, Target.Character.Speed.WalkSpeed, Target.Character.Speed.RunSpeed)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeHitRate_E2AH(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2AH"] != 0) { int amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2AH"]; Target.Character.Action.Buff.UpdatedStats[slot].Hit = amount; Target.Character.Stat.Hit += Target.Character.Action.Buff.UpdatedStats[slot].Hit; } } else { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["E2AH"] != 0) { Target.Character.Stat.Hit -= Target.Character.Action.Buff.UpdatedStats[slot].Hit; Target.Character.Action.Buff.UpdatedStats[slot].Hit = 0; } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeTargetHp_cmcr(PlayerMgr Target, int slot, bool delete, bool UpdatePacket) { try { if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["cmcr"] != 0) { int amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["cmcr"]; Target.Character.Action.Buff.UpdatedStats[slot].Mp = amount; Target.Character.Stat.Mp -= Target.Character.Action.Buff.UpdatedStats[slot].Mp; Target.Character.Stat.SecondMP -= Target.Character.Action.Buff.UpdatedStats[slot].Mp; } } else { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["cmcr"] != 0) { Target.Character.Stat.Mp += Target.Character.Action.Buff.UpdatedStats[slot].Mp; Target.Character.Stat.SecondMP += Target.Character.Action.Buff.UpdatedStats[slot].Mp; Target.Character.Action.Buff.UpdatedStats[slot].Mp = 0; } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public void ChangeHitrate_hr(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { //AttackRate = HitRate ??? int amount; if (!delete) { if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1.ContainsKey("hr")) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["hr"]; } } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
public bool SkillAdd_Properties(PlayerMgr Target, string PropertiesName, bool UpdatePacket, byte slot = 255, int skillid = -1) { try { switch (PropertiesName) { case "hpi": ChangeMaxHP_hpi(Target, slot, false, UpdatePacket); break; case "mpi": ChangeMaxMP_mpi(Target, slot, false, UpdatePacket); break; case "dru": ChangeAtk_dru(Target, slot, false,UpdatePacket); break; case "er": ChangeParry_er(Target, slot, false,UpdatePacket); break; case "stri": ChangeStr_stri(Target, slot, false,UpdatePacket); break; case "inti": ChangeInt_inti(Target, slot, false, UpdatePacket); break; case "cr": ChangeCrit_cr(Target, slot, false,UpdatePacket); break; case "br": ChangeBlockingRatio_br(Target, slot, false,UpdatePacket); break; case "spda": Change_spda(Target, slot, false,UpdatePacket); break; case "ru": ChangeRange_ru(Target, slot, false,UpdatePacket); break; case "dgmp": ChangeAbsorbMP_dgmp(Target, slot, false,UpdatePacket); break; case "defp": ChangeDefPower_defp(Target, slot, false, UpdatePacket); break; case "hste": ChangeSpeed_hste(Target,slot,false,UpdatePacket); break; case "drci": ChangeCriticalParry_dcri(Target, slot, false, UpdatePacket); break; case "heal": HealHPMP(Target, slot, skillid, false, UpdatePacket); break; case "E1SA": // setvaluek ( valószínű ) nem így lesznek ChangePhyAtk_E1SA(Target, slot, false, UpdatePacket); break; case "E2SA": ChangePhyAtk_E2SA(Target, slot, false, UpdatePacket); break; case "E2AH": ChangeHitRate_E2AH(Target, slot, false, UpdatePacket); break; case "terd": ChangeParry_terd(Target, slot, false, UpdatePacket); break; case "chcr": ChangeTargetHp_chcr(Target, slot, false, UpdatePacket); break; case "cmcr": ChangeTargetHp_cmcr(Target, slot, false, UpdatePacket); break; case "thrd": ChangeDecAttkRate_thrd(Target, slot, false, UpdatePacket); break; } } catch (Exception ex) { Log.Exception(ex); } return false; }
public void ChangeInt_inti(PlayerMgr Target, int slot, bool delete,bool UpdatePacket) { try { if (!delete) { int amount; if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["inti"] != 0) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties1["inti"]; Target.Character.Action.Buff.UpdatedStats[slot].Intelligence = (short)amount; } //TODO majd uncomment. /*if (ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2.ContainsKey("inti")) { amount = ObjData.Manager.SkillBase[Target.Character.Action.Buff.SkillID[slot]].Properties2["inti"]; Target.Character.Action.Buff.UpdatedStats[slot].Intelligence = (short)((Target.Character.Stat.Intelligence / 100) * (amount)); }*/ Target.Character.Stat.Intelligence += Target.Character.Action.Buff.UpdatedStats[slot].Intelligence; } else { Target.Character.Stat.Intelligence -= Target.Character.Action.Buff.UpdatedStats[slot].Intelligence; Target.Character.Action.Buff.UpdatedStats[slot].Intelligence = 0; } if (UpdatePacket) Target.client.Send(Packet.PlayerStat(Target.Character)); } catch (Exception ex) { Log.Exception(ex); } }
///////////////////////////////////////////////////////////////////////////////// // DE-Spawn system (Spawn our char to others). ///////////////////////////////////////////////////////////////////////////////// void ObjectDePlayerSpawn(PlayerMgr s) { try { if (s.Character.Spawned(Character.Information.UniqueID) && !s.Character.deSpawning) { if (s.Character.Information.UniqueID != 0) { s.ObjectDeSpawnCheck(); } } } catch (Exception ex) { Console.WriteLine("Systems despawn error {0}", ex); Log.Exception(ex); } }
///////////////////////////////////////////////////////////////////////////////// // Spawn system (Spawn our char to others). ///////////////////////////////////////////////////////////////////////////////// void ObjectPlayerSpawn(PlayerMgr s) { try { if (!s.Character.Spawned(Character.Information.UniqueID) && Character.Information.UniqueID != 0 && !s.Character.Spawning) { //We loop the spawn check for the player that needs it. s.ObjectSpawnCheck(); } } catch (Exception ex) { Console.WriteLine("Object player spawn error {0}", ex); Log.Exception(ex); } }