private static void Process_Item(Player client, string[] command) { if (client.Account.Permission < PlayerPermission.GM) return; uint uid; if(command.Length < 2 || !uint.TryParse(command[1], out uid)) { client.SendMessage("Error: Format should be /item {id}"); return; } var info = Database.ServerDatabase.Context.ItemInformation.GetById(uid); if (info == null) { client.SendMessage("Error: No such item ID as " + uid); return; } var item = new ConquerItem((uint)Common.ItemGenerator.Counter, info); byte val; if (command.Length > 2) if (byte.TryParse(command[2], out val)) item.Plus = val; else client.SendMessage("Error: Format should be /item {id} {+}"); if(command.Length > 3) if(byte.TryParse(command[3], out val)) item.Bless = val; else client.SendMessage("Error: Format should be /item {id} {+} {-}"); if (command.Length > 4) if (byte.TryParse(command[4], out val)) item.Enchant = val; else client.SendMessage("Error: Format should be /item {id} {+} {-} {hp}"); if (command.Length > 5) if (byte.TryParse(command[5], out val)) item.Gem1 = val; else client.SendMessage("Error: Format should be /item {id} {+} {-} {hp} {gem1}"); if (command.Length > 6) if (byte.TryParse(command[6], out val)) item.Gem2 = val; else client.SendMessage("Error: Format should be /item {id} {+} {-} {hp} {gem1} {gem2}"); item.SetOwner(client); if(client.AddItem(item)) client.Send(ItemInformationPacket.Create(item)); else client.SendMessage("Error adding item"); }
private static void Process_Down(Player client, string[] command) { if (client.Account.Permission < PlayerPermission.GM) return; try { for (ItemLocation location = ItemLocation.Helmet; location < ItemLocation.Garment; location++) { Structures.ConquerItem item; item = client.Equipment.GetItemBySlot(location); if (item != null) { item.DownLevelItem(); client.Send(ItemInformationPacket.Create(item, ItemInfoAction.Update)); } } } catch (Exception p) { Console.WriteLine(p); } }
public void Process_WarehouseActionPacket(WarehouseActionPacket _packet) { switch (_packet.Action) { case WarehouseAction.ListItems: SendContents(_packet.UID); break; case WarehouseAction.AddItem: if (owner.Inventory.ContainsKey(_packet.Value)) { var item = owner.GetItemByUID(_packet.Value); if (item != null && item.IsStoreable) { item.Location = (ItemLocation)_packet.UID; item.Save(); owner.RemoveItem(item); LoadItem(item); owner.Send(ItemActionPacket.Create(item.UniqueID, 0, ItemAction.SellToNPC)); SendContents(_packet.UID); } } break; case WarehouseAction.RemoveItem: { ConquerItem item; TryGetItem(_packet.UID, _packet.Value, out item); if (item != null) { item.Location = ItemLocation.Inventory; item.Save(); owner.AddItem(item); RemoveItem(_packet.UID, _packet.Value); owner.Send(ItemInformationPacket.Create(item)); SendContents(_packet.UID); } break; } default: Console.WriteLine("Unhandled warehouse action type {0} for client {1}", _packet.Action, owner.Name); break; } }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { AddText("Hello, I can upgrade your items past level 120 for the cost of 1 DragonBall."); AddText("The upgrade is guaranteed to work!"); AddOption("Yes, Let's do it!", 2); AddOption("Maybe later.", 255); break; } case 2: { AddText("Each upgrade requires 1 DragonBall and there is no turning back! "); AddText("What item would you like me to upgrade?"); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Necklace/Bag ", 12); AddOption("Ring/Bracelet ", 16); AddOption("Right Weapon ", 14); AddOption("Shield/Left Weapon ", 15); AddOption("Armor ", 13); AddOption("Boots ", 18); AddOption("I changed my mind. ", 255); break; } case 11: case 12: case 13: case 14: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake. You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(1088000)) { AddText("There must be some mistake. You must pay an DragonBall before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.EquipmentLevel <= 0) { AddText("There must be some mistake."); AddOption("Nevermind", 255); } else if (equipment.GetNextItemLevel() == equipment.StaticID) { AddText("There must be some mistake. Your item can't be upgraded anymore !"); AddOption("Nevermind", 255); } else if (_client.Level < equipment.GetDBItemByStaticID(equipment.GetNextItemLevel()).LevelReq) { AddText("There must be some mistake. You are not high level enough to wear the item after upgrade!"); AddOption("Nevermind", 255); } else { equipment.ChangeItemID(equipment.GetNextItemLevel()); _client.DeleteItem(1088000); _client.Send(ItemInformationPacket.Create(equipment, Enum.ItemInfoAction.Update)); equipment.Save(); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: AddText("A good set of equipment can help you a lot in future battles.I can help you by upgrading blessed attribute."); AddText("Keep in mind that each upgrade costs TortoiseGems witch are rare and expensive."); AddOption("Upgrade blessed attribute.", 1); AddOption("Nothing right now, thanks.", 255); break; case 1: { AddText("I see, upgrading an items blessed attribute will help you receive less damage. "); AddText("What item would you like me upgrade?"); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Necklace/Bag ", 12); AddOption("Ring/Bracelet ", 16); AddOption("Right Weapon ", 14); AddOption("Shield/Left Weapon ", 15); AddOption("Armor ", 13); AddOption("Boots ", 18); AddOption("I changed my mind. ", 255); break; } case 11: case 12: case 13: case 14: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake. You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); break; } cost = equipment.Bless; if (equipment.Bless == 0) { AddText("Your item must be blessed in order to upgrade this attribute!"); AddOption("Nevermind", 255); break; } if (equipment.Bless == 7) { AddText("Your item has maximum bless attribute!"); AddOption("Nevermind", 255); break; } if (hasAgreed && !_client.HasItem(700073, cost)) { AddText("To upgrade this item you need to pay " + cost + " Super TortoiseGems witch you don't have!"); AddOption("I see.", 255); } else if (hasAgreed && _client.HasItem(700073, cost)) { equipment.Bless += 2; for (var i = 0; i < cost; i++) { _client.DeleteItem(700073); } _client.Send(ItemInformationPacket.Create(equipment, Enum.ItemInfoAction.Update)); equipment.Save(); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.System, "Congratulations you have upgraded you items blessed attribute!")); } else { hasAgreed = true; AddText("To upgrade this item you need to pay " + cost + " Super TortoiseGems! Are you sure?"); AddOption("Yes.", (byte)_linkback); AddOption("No thanks.", 255); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { if (_client.Inventory.Count < 39) { if (!_client.Tasks.ContainsKey(TaskType.Lottery)) { _client.Tasks.TryAdd(TaskType.Lottery, new Task(_client.UID, TaskType.Lottery, DateTime.Now.AddHours(24))); } if (_client.Tasks[TaskType.Lottery].Count >= 10) { AddText("I'm afraid you already played the lottery 10 times today"); AddOption("i was just getting started!", 255); break; } else if (!_client.HasItem(710212)) { AddText("Sorry i can't help you unless you buy a ticket!"); AddOption("No thanks", 255); break; } else { if (_client.HasItem(710212)) { var ItemInfo = Common.QurryLotteryItem(); var ItemID = ItemInfo.Item1; var ItemName = ItemInfo.Item3; ItemID.SetOwner(_client); if (_client.HasItem(710212) && _client.AddItem(ItemID)) { _client.Tasks[TaskType.Lottery].Count++; _client.DeleteItem(710212); _client.Send(ItemInformationPacket.Create(ItemID)); } else { _client.SendMessage("Error adding item"); } _client.Save(); string pre = ""; switch (ItemInfo.Item3) { case LotteryItemType.Elite1Socket: pre = " Elite 1 socket "; break; case LotteryItemType.Elite2Socket: pre = " Elite 2 socket "; break; case LotteryItemType.ElitePlus8: pre = " Elite +8 "; break; case LotteryItemType.Super1Socket: pre = " Super 1 socket "; break; case LotteryItemType.SuperNoSocket: pre = " Super "; break; } PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " was so lucky and won a/an " + pre + ItemInfo.Item2 + " in the lottery")); } } } else { AddText("I'm afraid your Inventory is full, please free some space.."); AddOption("Thank you i will", 255); break; } break; } } AddFinish(); Send(); _client.Save(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: AddText("I am the master of all colors. What equipment would you like to dye today?"); AddOption("Helmet", 1); AddOption("Armor", 2); AddOption("Shield", 3); AddOption("Nevermind", 255); break; case 1: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.Helmet, out equipment) && equipment.EquipmentSort == 1) { AddText("What color would you like?"); AddOption("White", 13); AddOption("Blue", 14); AddOption("Red", 15); AddOption("Purple", 16); AddOption("Yellow", 17); AddOption("Nevermind", 255); } else { AddText("You are not wearing a helmet. I don't do hair!"); AddOption("Sorry", 255); } } break; case 2: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.Armor, out equipment) && equipment.EquipmentSort == 3) { AddText("What color would you like?"); AddOption("White", 33); AddOption("Blue", 34); AddOption("Red", 35); AddOption("Purple", 36); AddOption("Yellow", 37); AddOption("Nevermind", 255); } else { AddText("You are not wearing armor. I don't do tattoos!"); AddOption("Sorry", 255); } break; } case 3: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.WeaponL, out equipment) && equipment.EquipmentType == 900) { AddText("What color would you like?"); AddOption("White", 43); AddOption("Blue", 44); AddOption("Red", 45); AddOption("Purple", 46); AddOption("Yellow", 47); AddOption("Nevermind", 255); } else { AddText("You are not wearing a Shield."); AddOption("Sorry", 255); } break; } case 13: case 14: case 15: case 16: case 17: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.Helmet, out equipment) && equipment.EquipmentSort == 1) { equipment.Color = (byte)(_linkback % 10); equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update)); _client.SendToScreen(SpawnEntityPacket.Create(_client)); } else { AddText("You are not wearing a helmet. I don't do hair!"); AddOption("Sorry", 255); } break; } case 33: case 34: case 35: case 36: case 37: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.Armor, out equipment) && equipment.EquipmentSort == 3) { equipment.Color = (byte)(_linkback % 10); equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update)); _client.SendToScreen(SpawnEntityPacket.Create(_client)); } else { AddText("You are not wearing armor. I don't do tattoos!"); AddOption("Sorry", 255); } break; } case 43: case 44: case 45: case 46: case 47: { ConquerItem equipment; if (_client.TryGetEquipmentByLocation(ItemLocation.WeaponL, out equipment) && equipment.EquipmentType == 900) { equipment.Color = (byte)(_linkback % 10); equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update)); _client.SendToScreen(SpawnEntityPacket.Create(_client)); } else { AddText("You are not wearing a Shield."); AddOption("Sorry", 255); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { AddText("Hello , did you knew that an socketed equipment is better than one without sockets?"); AddText("It costs DragonBalls or ToughDrills/StarDrills depending on the item."); AddOption("Socket my weapon", 1); AddOption("Socket my gears", 2); AddOption("No. I like it this way.", 255); break; } case 1: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); } else { var cost = (uint)(equipment.Gem1 == 0 ? 1 : 5); AddText("It will cost " + cost + " DragonBall(s) to socket this weapon. Are you positive you wish to continue?"); AddOption("I'm Sure!", 10); } AddOption("Nevermind", 255); break; } case 2: { AddText("It costs 12 DragonBalls for the first socket and 7 StarDrills for second.If you consider yourself lucky try ToughDrill! "); AddOption("Make the first socket ", 3); AddOption("Make the second socket ", 4); AddOption("No. I like it this way.", 255); break; } case 3: { AddText("The first socket requires 12 DragonBalls and there is no turning back! "); AddText("What item would you like me to socket?"); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Necklace/Bag ", 12); AddOption("Ring/Bracelet ", 16); AddOption("Shield ", 15); AddOption("Armor ", 13); AddOption("Boots ", 18); AddOption("I changed my mind. ", 255); break; } case 4: { AddText("Opening the second socket is a delicate matter. I can guarentee an upgrade by using 7 StarDrills "); AddText("or you can try your luck using a ToughDrill."); AddOption("Use ToughDrill", 5); AddOption("Use 7 StarDrills", 6); AddOption("No. I like it this way.", 255); break; } case 5: { AddText("There is no guarentee this upgrade will be a success. Each attempt will require a ToughDrill. "); AddText("What item would you like to try to socket?"); AddOption("Helmet/Earrings/TaoCap ", 21); AddOption("Necklace/Bag ", 22); AddOption("Ring/Bracelet ", 26); AddOption("Shield ", 25); AddOption("Armor ", 23); AddOption("Boots ", 28); AddOption("I changed my mind. ", 255); break; } case 6: { AddText("This upgrade is guarenteed to work but requires 7 StarDrills. "); AddText("What item would you like to try to socket?"); AddOption("Helmet/Earrings/TaoCap ", 31); AddOption("Necklace/Bag ", 32); AddOption("Ring/Bracelet ", 36); AddOption("Shield ", 35); AddOption("Armor ", 33); AddOption("Boots ", 38); AddOption("I changed my mind. ", 255); break; } case 10: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); AddOption("Nevermind", 255); } else { var cost = equipment.Gem1 == 0 ? 1 : 5; if (_client.HasItem(Constants.DRAGONBALL_ID, (uint)cost)) { if (cost == 1) { equipment.Gem1 = 255; } else { equipment.Gem2 = 255; } for (var i = 0; i < cost; i++) { _client.DeleteItem(Constants.DRAGONBALL_ID); } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); AddOption("Thanks!", 255); } else { AddText("There must be some mistake. Your do not have the " + cost + " DragonBall(s) required"); AddOption("Nevermind", 255); } } break; } case 11: case 12: case 13: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem1 != 0) { AddText("There must be some mistake. This item already has a socket!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.DRAGONBALL_ID, 12)) { AddText("There must be some mistake. You do not have the 12 DragonBalls required to socket this item!"); AddOption("Nevermind", 255); } else { for (var i = 0; i < 12; i++) { _client.DeleteItem(Constants.DRAGONBALL_ID); } equipment.Gem1 = 255; equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); AddOption("Thanks!", 255); } break; } case 21: case 22: case 23: case 25: case 26: case 28: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem1 == 0) { AddText("There must be some mistake. You must open the first socket before you may attempt the second!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 != 0) { AddText("There must be some mistake. This item already has two sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(1200005)) { AddText("There must be some mistake. You do not have a ToughDrill!"); AddOption("Nevermind", 255); } else { _client.DeleteItem(1200005); if (Common.PercentSuccess(12)) { equipment.Gem2 = 255; equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); AddOption("Thanks!", 255); } else { _client.CreateItem(1200006); AddText("I was not able to open the second socket for you. I will give you a StarDrill for future use."); AddOption("Damn...", 255); } } break; } case 31: case 32: case 33: case 35: case 36: case 38: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem1 == 0) { AddText("There must be some mistake. You must open the first socket before you may attempt the second!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 != 0) { AddText("There must be some mistake. This item already has two sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(1200006, 7)) { AddText("There must be some mistake. You do not have the required 7 StarDrills!"); AddOption("Nevermind", 255); } else { for (var i = 0; i < 7; i++) { _client.DeleteItem(1200006); } equipment.Gem2 = 255; equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); AddOption("Thanks!", 255); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { AddText("Hello! I can always succeed in upgrading item quality. But I`ll ask for a few more dragon balls than Artisan Wind. I can also upgrade item levels. How can I help you?"); AddOption("Upgrade Quality", 1); AddOption("Upgrade Level", 2); AddOption("No thanks", 255); break; } case 1: { AddText("What item would you like me to upgrade the quality of?"); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Necklace/Bag ", 12); AddOption("Ring/Bracelet ", 16); AddOption("Weapon", 14); AddOption("Shield ", 15); AddOption("Armor ", 13); AddOption("Boots ", 18); AddOption("I changed my mind. ", 255); break; } case 2: { AddText("What item would you like me to upgrade the level of?"); AddOption("Helmet/Earrings/TaoCap ", 31); AddOption("Necklace/Bag ", 32); AddOption("Ring/Bracelet ", 36); AddOption("Weapon", 34); AddOption("Shield ", 35); AddOption("Armor ", 33); AddOption("Boots ", 38); AddOption("I changed my mind. ", 255); break; } case 11: case 12: case 13: case 14: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.StaticID == equipment.GetNextItemQuality()) { AddText("There must be some mistake. This item cannot be upgraded further!"); AddOption("Nevermind", 255); } else { var dbCost = 1 + 100 / equipment.ChanceToUpgradeQuality(); AddText("It will take " + dbCost + " DragonBalls to upgrade the quality of this item."); AddOption("Upgrade it", (byte)(_linkback % 10 + 20)); AddOption("Never mind", 255); } break; } case 21: case 22: case 23: case 24: case 25: case 26: case 28: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.StaticID == equipment.GetNextItemQuality()) { AddText("There must be some mistake. This item cannot be upgraded!"); AddOption("Nevermind", 255); } else { var dbCost = 1 + 100 / equipment.ChanceToUpgradeQuality(); if (!_client.HasItem(Constants.DRAGONBALL_ID, (uint)dbCost)) { AddText("You do not have the required " + dbCost + " DragonBalls to upgrade quality!"); AddOption("Sorry", 255); } else { for (var i = 0; i < dbCost; i++) { _client.DeleteItem(Constants.DRAGONBALL_ID); } equipment.ChangeItemID(equipment.GetNextItemQuality()); if (Common.PercentSuccess(Constants.SOCKET_RATE * 2)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the first socket to his/her " + equipment.BaseItem.Name)); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the second socket to his/her " + equipment.BaseItem.Name)); } } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update)); _client.Recalculate(); AddText("The quality has been upgraded! Enjoy your new item."); AddOption("Thanks!", 255); } } break; } case 31: case 32: case 33: case 34: case 35: case 36: case 38: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.StaticID == equipment.GetNextItemLevel() || equipment.BaseItem.LevelReq >= 120) { AddText("There must be some mistake. I cannot upgrade this item further."); AddOption("Nevermind", 255); } else { var metCost = 1 + 100 / equipment.ChanceToUpgradeLevel(); if (metCost > 40) { metCost = 40; } AddText("It will take " + metCost + " Meteors to upgrade the level of this item."); AddOption("Upgrade it", (byte)(_linkback % 10 + 40)); AddOption("Never mind", 255); } break; } case 41: case 42: case 43: case 44: case 45: case 46: case 48: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake., You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.StaticID == equipment.GetNextItemLevel() || equipment.BaseItem.LevelReq >= 120) { AddText("There must be some mistake. I cannot upgrade this item further."); AddOption("Nevermind", 255); } else if (_client.Level < equipment.GetDBItemByStaticID(equipment.GetNextItemLevel()).LevelReq) { AddText("You are too low level to wear the upgraded item!"); AddOption("Oops", 255); } else { var metCost = 1 + 100 / equipment.ChanceToUpgradeLevel(); if (metCost > 40) { metCost = 40; } if (!_client.HasItem(Constants.METEOR_ID, (uint)metCost)) { AddText("You do not have the required " + metCost + " Meteors to upgrade this item's level!"); AddOption("Sorry", 255); } else { for (var i = 0; i < metCost; i++) { _client.DeleteItem(Constants.METEOR_ID); } equipment.ChangeItemID(equipment.GetNextItemLevel()); if (Common.PercentSuccess(Constants.SOCKET_RATE)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the first socket to his/her " + equipment.BaseItem.Name)); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "As a very lucky player, " + _client.Name + " has added the second socket to his/her " + equipment.BaseItem.Name)); } } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment, ItemInfoAction.Update)); _client.Recalculate(); AddText("The level has been upgraded! Enjoy your new item."); AddOption("Thanks!", 255); } } break; } } AddFinish(); Send(); }
public override void Run(Player _client, ConquerItem _item) { if (_client.Inventory.Count > 37) { return; } _client.DeleteItem(_item); for (var i = 0; i < 3; i++) { int randomNumber = Common.Random.Next(10000); if (randomNumber == 0) { switch (Common.Random.Next(34)) { case 0: _client.CreateItem((uint)(181305)); break; case 1: _client.CreateItem((uint)(181315)); break; case 2: _client.CreateItem((uint)(181325)); break; case 3: _client.CreateItem((uint)(181335)); break; case 4: _client.CreateItem((uint)(181345)); break; case 5: _client.CreateItem((uint)(181355)); break; case 6: _client.CreateItem((uint)(181365)); break; case 7: _client.CreateItem((uint)(181375)); break; case 8: _client.CreateItem((uint)(181385)); break; case 9: _client.CreateItem((uint)(181405)); break; case 10: _client.CreateItem((uint)(181415)); break; case 11: _client.CreateItem((uint)(181425)); break; case 12: _client.CreateItem((uint)(181505)); break; case 13: _client.CreateItem((uint)(181515)); break; case 14: _client.CreateItem((uint)(181525)); break; case 15: _client.CreateItem((uint)(181605)); break; case 16: _client.CreateItem((uint)(181615)); break; case 17: _client.CreateItem((uint)(181625)); break; case 18: _client.CreateItem((uint)(181705)); break; case 19: _client.CreateItem((uint)(181715)); break; case 20: _client.CreateItem((uint)(181725)); break; case 21: _client.CreateItem((uint)(181805)); break; case 22: _client.CreateItem((uint)(181815)); break; case 23: _client.CreateItem((uint)(181825)); break; case 24: _client.CreateItem((uint)(181905)); break; case 25: _client.CreateItem((uint)(181915)); break; case 26: _client.CreateItem((uint)(181925)); break; case 27: _client.CreateItem((uint)(182305)); break; case 28: _client.CreateItem((uint)(182315)); break; case 29: _client.CreateItem((uint)(182325)); break; case 30: _client.CreateItem((uint)(182385)); break; case 31: _client.CreateItem((uint)(182365)); break; case 32: _client.CreateItem((uint)(182345)); break; case 33: _client.CreateItem((uint)(182335)); break; } } else if ((randomNumber > 0) && (randomNumber <= 5000)) { _client.CreateItem((uint)(Constants.METEOR_ID)); } else if ((randomNumber > 5000) && (randomNumber <= 7500)) { _client.CreateItem((uint)(Constants.DRAGONBALL_ID)); } else { //Codigo Gears int randomLevel = Common.Random.Next(125); int randomQuality = Common.Random.Next(100); uint id; if (randomQuality == 0) { id = DropManager.GenerateDropID((byte)randomLevel, (ushort)9); //SUPER } else if ((randomQuality > 0) && (randomQuality <= 5)) { id = DropManager.GenerateDropID((byte)randomLevel, (ushort)8); //ELITE } else if ((randomQuality > 5) && (randomQuality <= 35)) { id = DropManager.GenerateDropID((byte)randomLevel, (ushort)7); //UNIQUE } else { id = DropManager.GenerateDropID((byte)randomLevel, (ushort)6); //REFINED } var itemInfo = Database.ServerDatabase.Context.ItemInformation.GetById(id); var coItem = new ConquerItem((uint)Common.ItemGenerator.Counter, itemInfo); if ((coItem.EquipmentSort == 1 || coItem.EquipmentSort == 3 || coItem.EquipmentSort == 4) && coItem.BaseItem.TypeDesc != "Earring") { coItem.Color = (byte)Common.Random.Next(3, 7); } if (coItem.IsWeapon) //Socket Weapons { if (Common.PercentSuccess(7)) { coItem.Gem1 = 255; if (Common.PercentSuccess(7)) { coItem.Gem2 = 255; } } } else //Socket other Equipment { if (Common.PercentSuccess(0.01)) { coItem.Gem1 = 255; if (Common.PercentSuccess(0.01)) { coItem.Gem2 = 255; } } } coItem.SetOwner(_client); if (_client.AddItem(coItem)) { _client.Send(ItemInformationPacket.Create(coItem)); } } } }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: AddText("A good set of equipment can help you a lot in battle. I can help you upgrade your equipment"); AddText("all the way to +9."); AddOption("Enchant HP", 1); AddOption("Composing Upgrade", 3); AddOption("No thanks.", 255); break; case 1: _client.Send(GeneralActionPacket.Create(_client.UID, Enum.DataAction.OpenCustom, 1091)); break; /*case 2: * AddText("There are two ways of composing from +1 to +9 with +n stones or +n items and from +9 to +12 with DragonBalls."); * AddText("Whitch one would you want?"); * AddOption("Compose +1 to +9.", 3); * AddOption("Compose +9 to +12.", 4); * AddOption("How does composing +9 to +12 works?", 5); * AddOption("Thanks.", 255); * * break;*/ case 3: _client.Send(GeneralActionPacket.Create(_client.UID, Enum.DataAction.OpenWindow, 1)); break; case 4: // Everything else can stay. There's no way to access anything further than +9 AddText("What a glorious day! I belive it's the best weather to refine equipment in. Do you need my help with anything?"); AddOption("Compose +9 Equipment to +10.", 6); AddOption("Compose +10 Equipment to +11.", 7); AddOption("Compose +11 Equipment to +12.", 8); AddOption("Nothing right now, thanks.", 255); break; case 5: AddText("If you have any +9 items, you may use DragonBalls to refine it and upgrade its bonus level up to +12."); AddOption("Are there any limits to equipment refining?", 9); AddOption("How many DragonBalls would I need?", 17); break; case 9: AddText("When your level reaches 130, I can help you upgrade the bonus level of your equiment and weapons."); AddText("However, there are limitations.Only right-Handed weapons can be refined. Whereas, there are no limits to equipment refining."); AddOption("Thanks. I never knew.", 255); break; case 17: AddText("12 DragonBalls are required for refining +9 items to +10, "); AddText("25 DragonBalls are required for refining +10 items to +11, "); AddText("4 DBScrolls are required for refining +11 items to +12,"); AddOption("Got it, thanks.", 255); break; #region +9 to +10 case 6: AddText("Choose the equipment you want to upgrade from +9 to +10 from the list below. "); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Ring/Bracelet ", 16); AddOption("Necklace/Bag ", 12); AddOption("Boots ", 18); AddOption("Armor ", 13); AddOption("Shield ", 15); AddOption("Weapon ", 14); AddOption("I changed my mind. ", 255); break; case 11: case 12: case 13: case 14: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake.... You must be wearing the items in order to refine it!"); } else if (equipment.Plus != 9) { AddText("It seems that your items is not +9, in this case i can not help you."); } else if (!_client.HasItem(1088000, 12)) { AddText("There must be some mistake. You do not have the 12 DragonBalls required to refine this item!"); } else { for (var i = 0; i < 12; i++) { _client.DeleteItem(1088000); } equipment.Plus++; _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " upgraded his " + equipment.BaseItem.Name + " to +10 . Congratulations!")); _client.Save(); } AddOption("Nevermind", 255); break; } #endregion #region +10 to +11 case 7: AddText("Choose the equipment you want to upgrade from +10 to +11 from the list below. "); AddOption("Helmet/Earrings/TaoCap ", 21); AddOption("Ring/Bracelet ", 26); AddOption("Necklace/Bag ", 22); AddOption("Boots ", 28); AddOption("Armor ", 23); AddOption("Shield ", 25); AddOption("Weapon ", 24); AddOption("I changed my mind. ", 255); break; case 21: case 22: case 23: case 24: case 25: case 26: case 28: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 20)); if (equipment == null) { AddText("There must be some mistake.... You must be wearing the items in order to refine it!"); } else if (equipment.Plus != 10) { AddText("It seems that your items is not +10, in this case I can not help you."); } else if (!_client.HasItem(1088000, 25)) { AddText("There must be some mistake. You do not have the 25 DragonBalls required to refine this item!"); } else { for (var i = 0; i < 25; i++) { _client.DeleteItem(1088000); } equipment.Plus++; _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " upgraded his " + equipment.BaseItem.Name + " to +11 . Congratulations!")); _client.Save(); } AddOption("Nevermind", 255); break; } #endregion #region +11 to +12 case 8: AddText("Choose the equipment you want to upgrade from +11 to +12 from the list below. "); AddOption("Helmet/Earrings/TaoCap ", 31); AddOption("Ring/Bracelet ", 36); AddOption("Necklace/Bag ", 32); AddOption("Boots ", 38); AddOption("Armor ", 33); AddOption("Shield ", 35); AddOption("Weapon ", 34); AddOption("I changed my mind. ", 255); break; case 31: case 32: case 33: case 34: case 35: case 36: case 38: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 30)); if (equipment == null) { AddText("There must be some mistake.... You must be wearing the items in order to refine it!"); } else if (equipment.Plus != 11) { AddText("It seems that your items is not +11, in this case I can not help you."); } else if (!_client.HasItem(720028, 4)) { AddText("There must be some mistake. You do not have the 4 DBScrolls required to refine this item!"); } else { for (var i = 0; i < 4; i++) { _client.DeleteItem(720028); } equipment.Plus++; _client.Send(ItemInformationPacket.Create(equipment)); AddText("It is done! Please enjoy your new equipment."); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " upgraded his " + equipment.BaseItem.Name + " to +12 . Congratulations!")); _client.Save(); } AddOption("Nevermind", 255); break; } #endregion } AddFinish(); Send(); }
public void ProcessTradePacket(Player sender, TradePacket packet) { switch (packet.Subtype) { #region Trade Request case TradeType.Request: if (Target == null) //No request has already been sent! { if (PlayerManager.Players.ContainsKey(packet.Target)) { Target = PlayerManager.GetUser(packet.Target); } else //Target is not a client { Owner.SendMessage("Invalid target for trade!", ChatType.System); Owner.Trade = null; return; } if (Target.Trade == null) //Target is not trading! Lets send request { packet.Target = Owner.UID; Target.Send(packet); Target.Trade = this; } else //Target is trading, Shut down this request! { Owner.SendMessage(Target.Name + " is already trading, please try later", ChatType.System); Owner.Trade = null; return; } } else { packet.Subtype = TradeType.ShowTable; packet.Target = Target.UID; Owner.Send(packet); packet.Target = Owner.UID; Target.Send(packet); } break; #endregion #region Trade Timeout case TradeType.TimeOut: Owner.Trade = null; if (Target != null) { Target.Trade = null; } break; #endregion #region AddItem case TradeType.AddItem: { var _item = sender.GetItemByUID(packet.Target); if (_item != null && _item.IsTradeable) { if (sender == Owner) { if (Target.Inventory.Count + OwnerItems.Count < 40) { OwnerItems.Add(_item); Target.Send(ItemInformationPacket.Create(_item, ItemInfoAction.Trade)); } else //full inv on Target { Owner.SendMessage(Target.Name + " cannot hold more items", ChatType.System); } } else if (sender == Target) { if (Owner.Inventory.Count + TargetItems.Count < 40) { TargetItems.Add(_item); Owner.Send(ItemInformationPacket.Create(_item, ItemInfoAction.Trade)); } else //full inv on Target { Owner.SendMessage(Target.Name + " cannot hold more items", ChatType.System); } } } break; } #endregion #region Accept case TradeType.Accept: { if (!Accepted) { if (sender == Owner) { packet.Target = Owner.UID; Target.Send(packet); } else if (sender == Target) { packet.Target = Target.UID; Owner.Send(packet); } Accepted = true; } else { bool success = true; foreach (Structures.ConquerItem _item in OwnerItems) { if (!Owner.Inventory.ContainsKey(_item.UniqueID)) { success = false; break; } } foreach (Structures.ConquerItem _item in TargetItems) { if (!Target.Inventory.ContainsKey(_item.UniqueID)) { success = false; break; } } if (Owner.Money < OwnerMoney) { success = false; } if (Target.Money < TargetMoney) { success = false; } if (Owner.CP < OwnerCP) { success = false; } if (Target.CP < TargetCP) { success = false; } packet.Subtype = TradeType.HideTable; Owner.Send(packet); Target.Send(packet); if (success) { foreach (Structures.ConquerItem _item in TargetItems) { Owner.AddItem(_item); Owner.Send(ItemInformationPacket.Create(_item, ItemInfoAction.AddItem)); _item.SetOwner(Owner); Target.Send(new ItemActionPacket { ActionType = ItemAction.RemoveInventory, //might be wrong UID = _item.UniqueID, }); //Target.Send(ItemActionPacket.Create(_item.UniqueID, _item.StaticID, ItemAction.RemoveInventory)); if (!Target.RemoveItem(_item)) { Console.WriteLine("Error with removing player item. " + Target.Name); } } foreach (Structures.ConquerItem _item in OwnerItems) { Target.AddItem(_item); Target.Send(ItemInformationPacket.Create(_item, ItemInfoAction.AddItem)); _item.SetOwner(Target); Owner.Send(new ItemActionPacket { ActionType = ItemAction.RemoveInventory, //might be wrong UID = _item.UniqueID, }); //Owner.Send(ItemActionPacket.Create(_item.UniqueID, _item.StaticID, ItemAction.RemoveInventory)); if (!Owner.RemoveItem(_item)) { Console.WriteLine("Error with removing player item. " + Owner.Name); } } Owner.Money -= OwnerMoney; Target.Money += OwnerMoney; Target.Money -= TargetMoney; Owner.Money += TargetMoney; Target.CP -= TargetCP; Owner.CP += TargetCP; Owner.CP -= OwnerCP; Target.CP += OwnerCP; Target.SendMessage("Trade Successful", ChatType.System); Owner.SendMessage("Trade Successful", ChatType.System); } else { Target.SendMessage("Trade Failed", ChatType.System); Owner.SendMessage("Trade Failed", ChatType.System); } Owner.Trade = null; Target.Trade = null; } break; } #endregion #region AddCp case TradeType.SetConquerPoints: { packet.Subtype = TradeType.ShowConquerPoints; if (sender.CP >= packet.Target) { if (Owner == sender) { OwnerCP = packet.Target; Target.Send(packet); } else if (Target == sender) { TargetCP = packet.Target; Owner.Send(packet); } } else { Console.WriteLine("not enough cp"); } break; } #endregion #region AddMoney case TradeType.SetMoney: { packet.Subtype = TradeType.ShowMoney; if (sender.Money >= packet.Target) { if (Owner == sender) { OwnerMoney = packet.Target; Target.Send(packet); } else if (Target == sender) { TargetMoney = packet.Target; Owner.Send(packet); } } else { Console.WriteLine("not enough gold"); } break; } #endregion #region Close Trade case TradeType.Close: Owner.Trade = null; if (Target != null) { packet.Subtype = TradeType.HideTable; packet.Target = Target.UID; Owner.Send(packet); packet.Target = Owner.UID; Target.Send(packet); Target.Trade = null; } break; #endregion default: Console.WriteLine("Unhandled Trade Type: " + packet.Subtype); break; } }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { AddText("Hello, did you noticed that MagicArtisan can only level items up to 120?"); AddText("I can upgrade it above 120 up to 130 ,but it costs 1 DragonBall Scroll for each upgrade."); AddOption("Yes, I want.", 2); AddOption("No. I like it this way.", 255); break; } case 2: { AddText("It costs 1 DragonBall Scroll for any item above level 110.Are you really sure you want to do that?! "); AddOption("Yeah, upgrade it! ", 3); AddOption("No. I like it this way.", 255); break; } case 3: { AddText("Each upgrade requires 1 DragonBall Scroll and there is no turning back! "); AddText("What item would you like me to upgrade?"); AddOption("Helmet/Earrings/TaoCap ", 11); AddOption("Necklace/Bag ", 12); AddOption("Ring/Bracelet ", 16); AddOption("Right Weapon ", 14); AddOption("Shield/Left Weapon ", 15); AddOption("Armor ", 13); AddOption("Boots ", 18); AddOption("I changed my mind. ", 255); break; } case 11: case 12: case 13: case 14: case 15: case 16: case 18: { var equipment = _client.Equipment.GetItemBySlot((Enum.ItemLocation)(_linkback % 10)); if (equipment == null) { AddText("There must be some mistake. You must be wearing an item before you may upgrade it!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.DB_SCROLL_ID)) { AddText("There must be some mistake. You must pay an DragonBall Scroll before you may upgrade it!"); AddOption("Nevermind", 255); } else if (equipment.EquipmentLevel <= 110) { AddText("There must be some mistake. Your item is not above level 110!"); AddOption("Nevermind", 255); } else if (equipment.GetNextItemLevel() == equipment.StaticID) { AddText("There must be some mistake. Your item can't be upgraded anymore !"); AddOption("Nevermind", 255); } else if (_client.Level < equipment.GetDBItemByStaticID(equipment.GetNextItemLevel()).LevelReq) { AddText("There must be some mistake. You are not high level enough to wear the item after upgrade!"); AddOption("Nevermind", 255); } else { equipment.ChangeItemID(equipment.GetNextItemLevel()); _client.DeleteItem(Constants.DB_SCROLL_ID); _client.Send(ItemInformationPacket.Create(equipment, Enum.ItemInfoAction.Update)); equipment.Save(); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { AddText("Hello , did you knew that an socketed equipment is better than one without sockets?"); AddText("I can try to socket like Twin City Artisan but without leveling up"); AddOption("Try Socket my weapon 1 time (1 Meteor)", 1); AddOption("Try Socket my weapon 10 times (1 Meteor Scroll)", 2); AddOption("Try Socket my weapon (All Meteors)", 3); AddOption("Try Socket my weapon (All Meteor Scrolls)", 4); AddOption("No. I like it this way.", 255); break; } case 1: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.METEOR_ID, 1)) { AddText("There must be some mistake. You do not have 1 Meteor required to socket this item!"); AddOption("Nevermind", 255); } else { _client.DeleteItem(Constants.METEOR_ID); if (Common.PercentSuccess(Constants.SOCKET_UPGRADE)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); } } break; } case 2: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.METEOR_SCROLL_ID, 1)) { AddText("There must be some mistake. You do not have 1 Meteor Scroll required to socket this item!"); AddOption("Nevermind", 255); } else { _client.DeleteItem(Constants.METEOR_SCROLL_ID); for (int i = 0; i < 10; i++) { if (Common.PercentSuccess(Constants.SOCKET_UPGRADE)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); } } } break; } case 3: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.METEOR_ID, 1)) { AddText("There must be some mistake. You do not have 1 Meteor required to socket this item!"); AddOption("Nevermind", 255); } else { while (_client.DeleteItem(Constants.METEOR_ID)) { if (Common.PercentSuccess(Constants.SOCKET_UPGRADE)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); } } } break; } case 4: { var equipment = _client.Equipment.GetItemBySlot(Enum.ItemLocation.WeaponR); if (equipment == null) { AddText("There must be some mistake. You must be wearing a weapon before I can help you socket it!"); AddOption("Nevermind", 255); } else if (equipment.Gem2 > 0) { AddText("There must be some mistake. Your weapon already has the maximum number of sockets!"); AddOption("Nevermind", 255); } else if (!_client.HasItem(Constants.METEOR_SCROLL_ID, 1)) { AddText("There must be some mistake. You do not have 1 Meteor Scroll required to socket this item!"); AddOption("Nevermind", 255); } else { while (_client.DeleteItem(Constants.METEOR_SCROLL_ID)) { for (int i = 0; i < 10; i++) { if (Common.PercentSuccess(Constants.SOCKET_UPGRADE)) { if (equipment.Gem1 == 0) { equipment.Gem1 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } else if (equipment.Gem2 == 0) { equipment.Gem2 = 255; _client.SendMessage("You have successfully socketed your " + equipment.BaseItem.Name, ChatType.System); } equipment.Save(); _client.Send(ItemInformationPacket.Create(equipment)); } } } } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: { if (!_client.Tasks.ContainsKey(TaskType.Lottery)) { _client.Tasks.TryAdd(TaskType.Lottery, new Task(_client.UID, TaskType.Lottery, DateTime.Now.AddHours(24))); } if (_client.Tasks[TaskType.Lottery].Count >= 10) { AddText("I'm afraid you already played the lottery 10 times today"); AddOption("i was just getting started!", 255); break; } else if (!_client.HasItem(710212)) { AddText("You do not have a lottery ticket! I cannot help you unless you have one."); AddText("You can buy one from LadyLuck in the Market."); AddOption("No, thanks.", 255); } else { _client.Tasks[TaskType.Lottery].Count++; _client.DeleteItem(710212); var ItemInfo = Common.QurryLotteryItem(); var item = ItemInfo.Item1; item.SetOwner(_client); if (_client.AddItem(item)) { _client.Send(ItemInformationPacket.Create(item)); } else { _client.SendMessage("Error adding item"); } string pre = ""; switch (ItemInfo.Item3) { case LotteryItemType.Elite1Socket: pre = " Elite 1 socket "; break; case LotteryItemType.Elite2Socket: pre = " Elite 2 socket "; break; case LotteryItemType.ElitePlus8: pre = " Elite +8 "; break; case LotteryItemType.Super1Socket: pre = " Super 1 socket "; break; case LotteryItemType.SuperNoSocket: pre = " Super "; break; } /*AddText("Here is some info about the item. "); * AddText("Character: " + _client.Name + " - Item1: " + ItemInfo.Item1 + " - Item2: " + ItemInfo.Item2 + " - Item3: " + ItemInfo.Item3 + " "); * AddText("Just item: " + item + " - UniqueID: " + item.UniqueID); * AddOption("Close window", 255);*/ PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " was so lucky and won a/an " + pre + ItemInfo.Item2 + " in the lottery")); } break; } } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: AddText("I can help you to divorce your spouse. You just will have to agree to a divorce. I will also need a MeteorTear. If you have this item and you really want to get divorced, we will do it soon."); AddOption("Yes, I want a divorce.", 1); AddOption("Just passing by.", 255); break; case 1: if (_client.Spouse == Constants.DEFAULT_MATE) { AddText("You really sure you want to divorce your spouse now? You will not regret later?"); AddOption("No I'll not. Let's do this.", 2); AddOption("I prefer to remain married.", 255); } else { AddText("Sorry, I can not divorce you if you are not married."); AddOption("Okay.", 255); } break; case 2: AddText("Are you ready? Be sure you're with MeteorTear, I really need it."); AddOption("Yeah. I am ready.", 3); AddOption("Let me think it over.", 255); break; case 3: if (_client.Spouse == Constants.DEFAULT_MATE && _client.HasItem(Constants.METEOR_TEAR_ID)) { var dbSpouse = Database.ServerDatabase.Context.Characters.GetByName(_client.Spouse); if (dbSpouse != null) { dbSpouse.Spouse = Constants.DEFAULT_MATE; Database.ServerDatabase.Context.Characters.AddOrUpdate(dbSpouse); var meteorTear = _client.GetItemByID(Constants.METEOR_TEAR_ID); _client.RemoveItem(meteorTear); meteorTear.DbItem.Owner = dbSpouse.UID; meteorTear.Save(); var spouse = Managers.PlayerManager.GetUser(_client.Spouse); if (spouse != null) { spouse.AddItem(meteorTear); spouse.Send(ItemInformationPacket.Create(meteorTear)); //sanity check incase they log out while it's being saved above or something weird spouse.Spouse = Constants.DEFAULT_MATE; spouse.Send((StringsPacket.Create(spouse.UID, StringAction.Mate, Constants.DEFAULT_MATE))); } Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, "Unfortunately! " + _client.Name + " and " + _client.Spouse + " got divorced.")); _client.Spouse = Constants.DEFAULT_MATE; _client.Save(); AddText("Done, you are now divorced. You are free to find another passion around. Be happy my friend."); AddOption("Thank you.", 255); } } else { AddText("Sorry, I can not divorce you if you don't have a MeteorTear."); AddOption("Okay.", 255); } break; } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: if (_client.RebornCount == 0) { if (_client.ProfessionLevel == 5 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { AddText("Even bold adventurers eventually grow tired of their journeys. I help these heroes by offering them life anew."); AddOption("I wish to reborn.", 1); AddOption("I'm not tired!", 255); } else { AddText("Hello young one! I help people seek the ultimate goal of rebirth. "); AddText("You are not yet experienced enough to undertake this adventure. Please come back later."); AddOption("I will.", 255); } } else { AddText("I have helped you as much as I can. Even heroes have their limits."); AddOption("Thanks", 255); } break; case 1: if (_client.RebornCount == 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { AddText("By accepting the gift of rebirth, you will start your life again. "); AddText("You can unlock great strength as well as new skills in the process! "); AddText("Are you sure you're ready to give up your current life? "); AddOption("I'm ready.", 2); AddOption("Not yet!", 255); } else { AddText("Ooh my! Lets not get ahead of ourselves. You are not yet ready to become reborn."); AddOption("Sorry.", 255); } break; case 2: if (_client.HasItem(Constants.CELESTIAL_STONE_ID)) { AddText("You can choose to either receive a gem of great power or bless your equipment for even greater strength. Which would you like?"); AddOption("Blessed Rebirth", 3); AddOption("Gem Rebirth", 5); AddOption("I'm not sure...", 255); } else { AddText("Rebirth requires the unlocking of great power. Please make sure you have a CelestialStone before coming to me."); AddOption("Sorry.", 255); } break; case 3: case 4: isBlessedRebirth = _linkback == 3; AddText("What profession would you like in your new life?"); AddOption("Trojan", 11); AddOption("Warrior", 12); AddOption("Water Taoist", 13); AddOption("Fire Taoist", 14); AddOption("Archer", 15); AddOption("I'm not sure...", 255); break; case 5: AddText("What type of gem would you like?"); AddOption("Phoenix Gem", 20); AddOption("Dragon Gem", 21); AddOption("Fury Gem", 22); AddOption("Rainbow Gem", 23); AddOption("More Options", 6); AddOption("I'm not sure...", 255); break; case 6: AddText("What type of gem would you like?"); AddOption("Kylin Gem", 24); AddOption("Violet Gem", 25); AddOption("Moon Gem", 26); AddOption("Previous Options", 5); AddOption("I'm not sure...", 255); break; case 20: case 21: case 22: case 23: case 24: case 25: case 26: baseGemRequest = (byte)(_linkback % 10); _linkback = 4; goto case 4; case 11: case 12: case 13: case 14: case 15: if (_client.ProfessionLevel == 5 && _client.RebornCount == 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { if (_client.HasItem(Constants.CELESTIAL_STONE_ID)) { _client.DeleteItem(Constants.CELESTIAL_STONE_ID); if (isBlessedRebirth) //Bless random item. { Structures.ConquerItem item; for (var tries = 0; tries < 50; tries++) { var loc = (ItemLocation)(Common.Random.Next(10)); item = _client.Equipment.GetItemBySlot(loc); if (item != null && item.Bless == 0) { item.Bless = 1; break; } } } else //Give Super Gem { _client.CreateItem((uint)(BASE_GEM_ID + baseGemRequest * 10)); } var path = (uint)_client.ProfessionType % 10 * 10 + (uint)_linkback % 10; if (_client.ProfessionType == ProfessionType.Archer) { path = 50 + (uint)_linkback % 10; } foreach (var pathData in Database.ServerDatabase.Context.RebornPaths.GetRebornByPath(path)) { if (pathData.IsForget) { _client.CombatManager.TryRemoveSkill(pathData.SkillId); } else { _client.CombatManager.AddOrUpdateSkill(pathData.SkillId, 0); } } foreach (var skill in _client.CombatManager.skills.Values) { skill.Database.PreviousLevel = skill.Database.Level; skill.Database.Level = 0; skill.Database.Experience = 0; skill.Save(); skill.Send(_client); } _client.Character.Profession1 = _client.Character.Profession; switch (_linkback % 10) { case 1: _client.Character.Profession = 11; break; case 2: _client.Character.Profession = 21; break; case 3: _client.Character.Profession = 132; break; case 4: _client.Character.Profession = 142; break; case 5: _client.Character.Profession = 41; break; } #region Down Level Items for (ItemLocation location = ItemLocation.Helmet; location < ItemLocation.Garment; location++) { Structures.ConquerItem item; item = _client.Equipment.GetItemBySlot(location); if (item != null) { item.DownLevelItem(); _client.Send(ItemInformationPacket.Create(item, ItemInfoAction.Update)); } } #endregion #region Set Bonus Stats _client.Character.Strength = 0; _client.Character.Vitality = 8; _client.Character.Agility = 2; _client.Character.Spirit = 0; switch (_client.Level) { case 110: case 111: _client.ExtraStats = 20; break; case 112: case 113: _client.ExtraStats = 21; break; case 114: case 115: _client.ExtraStats = 23; break; case 116: case 117: _client.ExtraStats = 26; break; case 118: case 119: _client.ExtraStats = 30; break; case 120: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 35 : 20); break; case 121: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 35 : 21); break; case 122: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 41 : 23); break; case 123: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 41 : 26); break; case 124: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 48 : 30); break; case 125: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 48 : 35); break; case 126: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 56 : 41); break; case 127: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 56 : 48); break; case 128: _client.ExtraStats = (ushort)(_client.ProfessionType == ProfessionType.WaterTaoist ? 65 : 56); break; case 129: _client.ExtraStats = 65; break; case 130: _client.ExtraStats = 75; break; } #endregion _client.RebornCount = 1; _client.Send(new UpdatePacket(_client.UID, UpdateType.Profession, _client.Character.Profession)); _client.Send(new UpdatePacket(_client.UID, UpdateType.Reborn, _client.RebornCount)); _client.SpawnPacket.RebornCount = 1; _client.SendToScreen(_client.SpawnPacket, true); _client.SetLevel(15); _client.Experience = 0; _client.Recalculate(true); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " has been reborned successfully. Congratulations!")); _client.Save(); } else { AddText("Rebirth requires the unlocking of great power. Please make sure you have a CelestialStone before coming to me."); AddOption("Sorry.", 255); } } else { AddText("Lets not get ahead of ourselves! You are not ready to achieve rebirth. Please come back later."); AddOption("Sorry.", 255); } break; } AddFinish(); Send(); }
public override void Run(Game_Server.Player _client, ushort _linkback) { Responses = new List <NpcDialogPacket>(); AddAvatar(); switch (_linkback) { case 0: if (_client.RebornCount != 0 && _client.Character.SecondQuest > 0 && _client.RebornCount < 2 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { if (_client.Character.SecondQuest > 0 && _client.RebornCount < 2 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { AddText("Even bold adventurers eventually grow tired of their journeys. I help these heroes by offering them life anew."); AddOption("I wish to reborn.", 1); AddOption("I'm not tired!", 255); break; } else { AddText("Hello young one! I help people seek the ultimate goal of rebirth. "); AddText("You are not yet experienced enough to undertake this adventure. "); AddOption("I will.", 255); } break; } else { if (_client.RebornCount != 0 && _client.Character.SecondQuest == 0) { AddText("I cannot do the rebirth ritual if you do not open the gates of hell. Go talk to alex he will show you how.."); AddOption("Okay Thanks", 255); break; } else { AddText("I have helped you as much as I can. Even heroes have their limits."); AddOption("Thanks", 255); break; } } case 1: if (_client.RebornCount < 2 && _client.Character.SecondQuest > 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { AddText("By accepting the gift of rebirth, you will start your life again. "); AddText("You can unlock great strength as well as new skills in the process! "); AddText("Are you sure you're ready to give up your current life? "); AddOption("I'm ready.", 2); AddOption("Not yet!", 255); break; } else { AddText("Ooh my! Lets not get ahead of ourselves. You are not yet ready to become reborn."); AddOption("Sorry.", 255); } break; case 2: if (_client.HasItem(Constants.EXEMPTION_TOKEN_ID)) { AddText("Are you sure you want to get second reborn and unlock new powers?"); AddOption("Yeah.", 5); AddOption("I'm not sure...", 255); break; } else { AddText("Rebirth requires the unlocking of great power. Please make sure you have a ExemptionToken before coming to me."); AddOption("Sorry.", 255); } break; case 5: AddText("What profession would you like in your new life?"); AddOption("Trojan", 11); AddOption("Warrior", 12); AddOption("Water Taoist", 13); AddOption("Fire Taoist", 14); AddOption("Archer", 15); AddOption("I'm not sure...", 255); break; case 11: case 12: case 13: case 14: case 15: if (_client.RebornCount < 2 && _client.Character.SecondQuest > 0 && _client.Level >= (_client.ProfessionType == Enum.ProfessionType.WaterTaoist ? 110 : 120)) { if (_client.HasItem(Constants.EXEMPTION_TOKEN_ID)) { _client.DeleteItem(Constants.EXEMPTION_TOKEN_ID); var path = (((uint)_client.Character.Profession1 - 5) / 10) * 100 + (((uint)_client.Character.Profession - 5)) + (uint)_linkback % 10; foreach (var pathData in Database.ServerDatabase.Context.RebornPaths.GetRebornByPath(path)) { if (pathData.IsForget) { _client.CombatManager.TryRemoveSkill(pathData.SkillId); } else { _client.CombatManager.AddOrUpdateSkill(pathData.SkillId, 0); } } foreach (var skill in _client.CombatManager.skills.Values) { skill.Database.PreviousLevel = skill.Database.Level; skill.Database.Level = 0; skill.Database.Experience = 0; skill.Save(); skill.Send(_client); } _client.CombatManager.AddOrUpdateSkill(9876, 0); _client.Character.Profession2 = _client.Character.Profession; switch (_linkback % 10) { case 1: _client.Character.Profession = 11; break; case 2: _client.Character.Profession = 21; break; case 3: _client.Character.Profession = 132; break; case 4: _client.Character.Profession = 142; break; case 5: _client.Character.Profession = 41; break; } _client.RebornCount = 2; _client.Send(new UpdatePacket(_client.UID, UpdateType.Profession, _client.Character.Profession)); _client.Send(new UpdatePacket(_client.UID, UpdateType.Reborn, _client.RebornCount)); _client.SpawnPacket.RebornCount = 1; _client.SendToScreen(_client.SpawnPacket, true); #region Down Level Items for (ItemLocation location = ItemLocation.Helmet; location < ItemLocation.Garment; location++) { Structures.ConquerItem item; item = _client.Equipment.GetItemBySlot(location); if (item != null) { item.DownLevelItem(); _client.Send(ItemInformationPacket.Create(item, ItemInfoAction.Update)); } } #endregion #region Set Bonus Stats _client.Character.Strength = 0; _client.Character.Vitality = 8; _client.Character.Agility = 2; _client.Character.Spirit = 0; switch (_client.Level) { case 120: _client.ExtraStats = (ushort)(20 + _client.ExtraStats); break; case 121: _client.ExtraStats = (ushort)(21 + _client.ExtraStats); break; case 122: _client.ExtraStats = (ushort)(23 + _client.ExtraStats); break; case 123: _client.ExtraStats = (ushort)(26 + _client.ExtraStats); break; case 124: _client.ExtraStats = (ushort)(30 + _client.ExtraStats); break; case 125: _client.ExtraStats = (ushort)(35 + _client.ExtraStats); break; case 126: _client.ExtraStats = (ushort)(41 + _client.ExtraStats); break; case 127: _client.ExtraStats = (ushort)(48 + _client.ExtraStats); break; case 128: _client.ExtraStats = (ushort)(56 + _client.ExtraStats); break; case 129: _client.ExtraStats = (ushort)(65 + _client.ExtraStats); break; case 130: _client.ExtraStats = (ushort)(75 + _client.ExtraStats); break; } #endregion if (_client.Level > 120) { _client.Character.PreviousLevel = _client.Level; } _client.SetLevel(15); _client.Experience = 0; _client.Recalculate(true); Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, _client.Name + " has been reborned successfully. Congratulations!")); _client.Save(); } else { AddText("Rebirth requires the unlocking of great power. Please make sure you have a ExemptionToken before coming to me."); AddOption("Sorry.", 255); } } else { AddText("Lets not get ahead of ourselves! You are not ready to achieve second rebirth. Please come back later."); AddOption("Sorry.", 255); } break; } AddFinish(); Send(); }