private static void DisplayStorages(Player player, List <Storage> storages) { using (var dialog = new NpcDialog(10)) { dialog.Text(" Id Name Owner Access\n"); foreach (var storage in storages.TakeUpTo(10).OrderBy(s => s.StorageId)) { dialog.Text($"{storage.ToString(player)}\n"); } dialog.Input("Storage ID", 1); dialog.Finish(); player.Send(dialog); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(32)) { yi .Text("Do you want to get teleported to TwinCity?") .Link("Yes, please.", 1) .Link("No, thank you.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(400, 400, 1002); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(60)) { yi .Text("Modify me.") .Link("Link me.", 1) .Link("F**k me.", 255) .Finish(); player.Send(yi); } break; } case 1: { break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(7)) { yi .Text("This is the way to the Desert City. Although you are excellent, it is dangerous to go ahead.") .Link("I want to go.", 1) .Link("I think I will stay here.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(971, 666, 1000); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(9)) { yi .Text("Hello, I am the assistant of the mine union. If you want to enter the mine cave, I can send you.") .Link("Yes, please.", 1) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(155, 94, 1028); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text("Welcome to Twin City Furniture Store. Currently, you have limited selection but more furniture will come in soon.") .Link("I want to have a look.", 1) .Link("I am not interested.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(42, 42, 1511); break; } } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(79)) { yi .Text("Would you like to get teleported to StoneCity?") .Link("Yes, please", 1) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(435, 337, 1077); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.IsWaterTaoist()) { using (var yi = new NpcDialog(60)) { yi .Text("Hello " + player.Name.TrimEnd('\0') + ", I am here to sell you a WindSpell for 100 silver, are you interested?") .Link("Yes, I am.", 1) .Link("No, I am not.", 255) .Finish(); player.Send(yi); } } break; } case 1: { if (player.IsWaterTaoist() && player.Money >= 100) { player.Money -= 100; var windSpell = Item.Factory.Create(ItemNames.SpaceMark3); player.Inventory.AddItem(windSpell); } else { using (var yi = new NpcDialog(60)) { yi .Text("Sorry, you do not have enough silver.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(9)) { yi .Text( "Hello, I am the entrance to the Phoenix Castle mine. Would you like to be teleported there?") .Link("Yes, please.", 1) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Level >= 40) { player.Teleport(28, 71, 1025); } else { using (var yi = new NpcDialog(9)) { yi .Text( "Sorry, you must be at least level 40 to be able to enter this mine.") .Link("Sorry...", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(37)) { yi .Text("What can I do for you?") .Link("Visit the jail.", 1) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Money >= 1000) { player.Money -= 1000; player.Teleport(29, 72, 6000); } else { using (var yi = new NpcDialog(37)) { yi .Text("Sorry, you do not have 1000 silvers.") .Link("I see.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(32)) { yi .Text("The Ancient Devil was sealed in this island. The seal's power is very weak now. The Devil is gonna wake up. Can you help us?") .Link("How can I help you?", 1) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { using (var yi = new NpcDialog(32)) { yi .Text("First, get 5 Amulets. Each amulet is protected by a Guard of different profession. Only if you are of the same profession, you can challenge the Guard.") .Text(" So you had better ask your friend for help. After you gather the 5 Amulets, click on the yellow marks on the ground to bring out the devil and ") .Text("it is guards. Enable PK mode to kill them. Will you help us?") .Link("Yes, I shall try.", 2) .Link("Let me think it over.", 255) .Finish(); player.Send(yi); } break; } case 2: { player.Teleport(188, 232, 1082); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(60)) { yi .Text( "Hello my soldier, in order to proceed to the next stage you need to collect 5 SoulStones as a charge for my teleportation service.") .Link("I have collected them.", 1) .Link("That is ok.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Inventory.HasItem(ItemNames.SoulStone, 5)) { player.Teleport(230, 330, 2022); //TODO: Add the global message and stageone reward } else { using (var yi = new NpcDialog(60)) { yi .Text("Are you trying to fool me? You have NOT collected them yet.") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text("If you are level 20 or above, you may level up at the training grounds. it does not consume any durability, life and mana. Do you want me to teleport you there?") .Link("Please teleport me there.", 1) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Money >= 1000) { player.Money -= 1000; player.Teleport(215, 217, 1039); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, you do not have enough gold.") .Link("I see.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(32)) { yi .Text("Would you like to visit the BotJail?") .Link("Yes, please.", 1) .Link("No, thank you.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.PkPoints <= 30) { player.Teleport(29, 71, 6001); } else { using (var yi = new NpcDialog(32)) { yi .Text("Sorry, your PkPoints are above 30, so that I can not let you visit the BotJail.") .Link("No, thank you.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(32)) { yi .Text("Do you want to get teleported to the next floor?") .Link("Yes, please.", 1) .Link("No, thank you.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Inventory.HasItem(ItemNames.SkyToken)) { player.Inventory.RemoveItem(ItemNames.SkyToken); player.Teleport(104, 108, 1352); } else { using (var yi = new NpcDialog(32)) { yi .Text("Sorry, you do not have a SkyToken.") .Link("I am sorry.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(37)) { yi .Text("You can not leave here unless you have paid for your crimes.") .Link("Ok! Let me get out from here!", 1) .Link("I would rather rot in hell!", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.PkPoints >= 30) { using (var yi = new NpcDialog(37)) { yi .Text("You must stay and think about what you've done!") .Link("I shall..", 255) .Finish(); player.Send(yi); } } else { player.Teleport(517, 352, 1002); } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (!player.Reborn) { // if(Player.Level >=120 && Player.ProfessionLevel == 5 || (Player.Class == 135 && Player.Level >= 110)) using (var yi = new NpcDialog(35)) { yi .Text("Modify me.") .Link("Link me.", 1) .Link("F**k me.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(35)) { yi .Text("You are already a reborned character, I can not help you anymore.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } case 1: { break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(7)) { yi .Text("Our shop is famous for dyeing, you can have your equipment dyed there, you have a wide choice of colors. One Meteor will be charged before you try the colors. Would you like to try?") .Link("Yes, please.", 1) .Link("I am not interested.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Inventory.HasItem(ItemNames.Meteor)) { player.Inventory.RemoveItem(ItemNames.Meteor); player.Teleport(22, 26, 1008); } else { using (var yi = new NpcDialog(7)) { yi .Text("Sorry, you do not have a Meteor.") .Link("I am sorry.", 255) .Finish(); player.Send(yi); } } break; } } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.Inventory.HasItem(ItemNames.CommandToken)) { using (var yi = new NpcDialog(60)) { yi .Text("Would you like to leave this tactic?") .Link("Yes, please.", 1) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(60)) { yi .Text("Sorry, you do not have the token from this tactic.") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 1: { player.Teleport(025, 025, 1042); break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.Inventory.RemoveItem(ItemNames.SoulJade)) { using (var banzai = new NpcDialog(20)) { banzai .Text( "Thanks for helping me! I shall reward you with a MoonBox to show you my appreciation!") .Link("Oh! Thanks a lot!.", 255) .Finish(); player.Send(banzai); } var moonBox = Item.Factory.Create(ItemNames.Moonbox); player.Inventory.AddItem(moonBox); player.Teleport(025, 025, 1042); } else { using (var banzai = new NpcDialog(20)) { banzai .Text("Sorry, you do not have a SoulJade.") .Link("That is ok.", 255) .Finish(); player.Send(banzai); } player.Teleport(025, 025, 1042); } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text("Hello " + player.Name.TrimEnd('\0') + ", would you like to enter the PK arena? Be careful you there are a lot of PKers!") .Link("Yes, please.", 1) .Link("Teleport me to the infinity stamina arena!", 2) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } break; } case 1: { player.Teleport(51, 71, 1005); break; } case 2: { // Player.Teleport(51, 71, 1005); break; } } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(22)) { yi .Text("Hello " + player.Name.TrimEnd('\0') + ", Welcome to Yi!") .Text("Please select a Face - free of charge - from the guy next to me") .Link("Will do!", 1) .Finish(); player.Send(yi); } break; } case 1: { using (var yi = new NpcDialog(22)) { yi .Text("Great! See you around!") .Link("Yea! See you later!", 255) .Finish(); player.Send(yi); } break; } } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text("Hello world from the first Yi Script!") .Link("Omfg that's soo cool!", 1) .Finish(); player.Send(yi); } break; } case 1: { using (var yi = new NpcDialog(20)) { yi .Text("I know right ?!") .Link("Yea! See you later!", 255) .Finish(); player.Send(yi); } break; } } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { Console.WriteLine("control:" + control); switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text($"Hello {player.Name.TrimEnd('\0')}, do you have anything for me?") .Link("Yes!", 1) .Link("No.", 255) .Finish(); player.Send(yi); } break; } case 1: Console.WriteLine("Opening Tradewindow"); Npc found; if (GameWorld.Find(player.CurrentNpcId, out found)) { player.Trade = new Trade(player, found); var packet = MsgTrade.Create(player.CurrentNpcId, TradeMode.ShowTradeWindow); player.ForceSend(packet, packet.Size); } break; } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.Level >= 70) { using (var yi = new NpcDialog(60)) { yi .Text( "We hope all can help each other. If you power level the newbies, we may reward you with Meteors or Dragonballs. Are you interested?") .Link("Tell me more details.", 1) .Link("Check my virtue points.", 5) .Link("Claim prize.", 6) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(60)) { yi .Text( "You must be level 70 at least or more in order to get virtue points and be able to exchange for am prize.") .Link("I see.", 255) .Finish(); player.Send(yi); } } break; } case 1: { using (var yi = new NpcDialog(60)) { yi .Text( "If you are above level 70 and try to power level the newbies (at least 20 levels lower than you), you may gain virtue points.") .Link("What are the virtue points?", 2) .Finish(); player.Send(yi); } break; } case 2: { using (var yi = new NpcDialog(60)) { yi .Text( "The more newbies you power level, the more virtue points you gain. I shall give you a good reward for a certain virtue points.") .Link("How can I gain virtue points?", 3) .Link("What prize can I expect?", 4) .Finish(); player.Send(yi); } break; } case 3: { using (var yi = new NpcDialog(60)) { yi .Text( "Once the newbies are one level up, the team captain can gain virtue points accordingly.") .Link("I see.", 255) .Finish(); player.Send(yi); } break; } case 4: { using (var yi = new NpcDialog(60)) { yi .Text( "I shall reward you a Meteor for 5,000 virtue points and a DragonBall for 150.000 virtue points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } break; } case 5: { using (var yi = new NpcDialog(60)) { yi .Text("You currently have " + player.VirturePoints + " virtue points, please try to gain more.") .Link("Great, I will!", 255) .Finish(); player.Send(yi); } break; } case 6: { using (var yi = new NpcDialog(60)) { yi .Text("You currently have" + player.VirturePoints + " virtue points, what prize do you prefer?") .Link("Meteor - 5,000 ", 7) .Link("Meteor - 150.000 ", 8) .Finish(); player.Send(yi); } break; } case 7: { if (player.VirturePoints >= 5000) { player.VirturePoints -= 5000; var item = Item.Factory.Create(ItemNames.Meteor); player.Inventory.AddItem(item); using (var yi = new NpcDialog(60)) { yi .Text("There you go, check your inventory. " + " You currently have" + player.VirturePoints + "virtue points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(60)) { yi .Text("You do not have enough virtue points, " + " you currently have" + player.VirturePoints + "virtue points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } case 8: { if (player.VirturePoints >= 150000) { player.VirturePoints -= 150000; var item = Item.Factory.Create(ItemNames.Dragonball); player.Inventory.AddItem(item); using (var yi = new NpcDialog(60)) { yi .Text("There you go, check your inventory. " + " You currently have" + player.VirturePoints + "virtue points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(60)) { yi .Text("You do not have enough virtue points, " + " you currently have" + player.VirturePoints + "virtue points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(40)) { yi .Text("Great rewards will attract many brave people. I am looking for brave people to help me take my patrimony back. Can you help? The rewards are handsome.") .Link("Please tell me more.", 1) .Link("I got SunDiamonds.", 7) .Link("I got MoonDiamonds.", 9) .Link("I got StarDiamonds.", 11) .Link("I got CloudDiamonds.", 13) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { using (var yi = new NpcDialog(40)) { yi .Text("My ancestors built a Labyrinth long before. Many treasures were stored there like SunDiamonds, MoonDiamonds, Start Diamonds and so on. But it was occupied by fiece monsters soon. They expelled our clansmen and kept the treasures.") .Link("It is a pity", 2) .Link("I have no interest.", 255) .Finish(); player.Send(yi); } break; } case 2: { using (var yi = new NpcDialog(40)) { yi .Text("I have always been here waiting for brave people to help me. Of course I can not trust in those who do not have 2000 Virtue points.") .Link("How about me?", 3) .Link("Sorry. That is too tough for me.", 255) .Finish(); player.Send(yi); } break; } case 3: { if (player.VirturePoints >= 2000) { using (var yi = new NpcDialog(40)) { yi .Text("It seems that you have the 2000 Virtue, do you want me to teleport you?") .Link("Yes, please", 4) .Link("I am not interested.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Sorry, you do not have enough Virtue Points") .Link("Sigh...", 255) .Finish(); player.Send(yi); } } break; } case 4: { player.VirturePoints -= 2000; player.Teleport(016, 128, 1351); break; } case 5: { using (var yi = new NpcDialog(40)) { yi .Text("SunDiamond, MoonDiamonds, StartDiamond and CloudDimaond are kept by different monsters. If you get them for me, I will give you some rewards.") .Link("What rewards?", 6) .Finish(); player.Send(yi); } break; } case 6: { using (var yi = new NpcDialog(40)) { yi .Text("xxx for 17 SunDiamonds, xx for 17 MoonDiamonds, xx for 17 StarDiamonds and an AncestorBox for 17 CloudDiamonds. If you are lucky enough, you will get a big surprise from the box.") .Link("I see. Thank you.", 255) .Finish(); player.Send(yi); } break; } case 7: { if (player.Inventory.HasItem(ItemNames.SunDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text( "You have the required amount of SunDiamonds, would you like to receive your reward?") .Link("Yes, please.", 8) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text( "You gotta be kidding me. How dare you come here to claim prize with so few SunDiamonds?") .Link("Wait. I will get more!", 255) .Finish(); player.Send(yi); } } break; } case 8: { if (player.Inventory.HasItem(ItemNames.SunDiamond, 17)) { player.Inventory.RemoveItem(ItemNames.SunDiamond, 17); var item = Item.Factory.Create(ItemNames.Meteor); player.Inventory.AddItem(item, 5); using (var yi = new NpcDialog(40)) { yi .Text("Congratulations! Check your inventory to see the awesome reward!") .Link("Thank you.", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.SunDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 9: { if (player.Inventory.HasItem(ItemNames.MoonDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text( "You have the required amount of MoonDiamonds, would you like to receive your reward?") .Link("Yes, please.", 10) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.MoonDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 10: { if (player.Inventory.HasItem(ItemNames.MoonDiamond, 17)) { player.Inventory.RemoveItem(ItemNames.MoonDiamond, 17); var item = Item.Factory.Create(ItemNames.Meteor); player.Inventory.AddItem(item, 7); using (var yi = new NpcDialog(40)) { yi .Text("Congratulations! Check your inventory to see the awesome reward!") .Link("Thank you.", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.MoonDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 11: { if (player.Inventory.HasItem(ItemNames.StarDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text( "You have the required amount of StarDiamonds, would you like to receive your reward?") .Link("Yes, please", 12) .Link("No, thanks", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.StarDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 12: { if (player.Inventory.HasItem(ItemNames.StarDiamond, 17)) { player.Inventory.RemoveItem(ItemNames.StarDiamond, 17); var item = Item.Factory.Create(ItemNames.Panacea); // var random = new System.Random(); // var gemType = (byte) random.Next(0, 7); /* item += (gemType*10) + 1; * if(item != 700000)*/ player.Inventory.AddItem(item); using (var yi = new NpcDialog(40)) { yi .Text("Congratulations! Check your inventory to see the awesome reward!") .Link("Thank you.", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.StarDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 13: { if (player.Inventory.HasItem(ItemNames.CloudDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text( "You have the required amount of CloudDiamonds, would you like to receive your reward?") .Link("Yes, please", 14) .Link("No, thanks", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.CloudDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } case 14: { if (player.Inventory.HasItem(ItemNames.CloudDiamond, 17)) { player.Inventory.RemoveItem(ItemNames.CloudDiamond, 17); var item = Item.Factory.Create(ItemNames.Salpeter); player.Inventory.AddItem(item); using (var yi = new NpcDialog(40)) { yi .Text("Congratulations! Check your inventory to see the awesome reward!") .Link("Thank you.", 255) .Finish(); player.Send(yi); } } else if (player.Inventory.Count > 35 && player.Inventory.HasItem(ItemNames.CloudDiamond, 17)) { using (var yi = new NpcDialog(40)) { yi .Text("You need more space in inventory to be able to receive the reward.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(40)) { yi .Text("Are you trying to fool me? You do not have enough Diamonds!") .Link("I am sorry...", 255) .Finish(); player.Send(yi); } } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { using (var yi = new NpcDialog(20)) { yi .Text("Hello " + player.Name.TrimEnd('\0') + ", I shall charge you 100 gold to teleport you.") .Link("Phoenix Castle", 1) .Link("Ape Mountain", 2) .Link("Desert City", 3) .Link("Bird Island", 4) .Link("Mine Cave", 6) .Link("Market", 5) .Link("Just passing by.", 255) .Finish(); player.Send(yi); } break; } case 1: { if (player.Money >= 100) { player.Money -= 100; player.Teleport(958, 556, 1002); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } case 2: { if (player.Money >= 100) { player.Money -= 100; player.Teleport(555, 957, 1002); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } case 3: { if (player.Money >= 100) { player.Money -= 100; player.Teleport(062, 463, 1002); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } case 4: { if (player.Money >= 100) { player.Money -= 100; player.Teleport(228, 198, 1002); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } case 5: { if (player.Money >= 100) { player.Money -= 100; player.Teleport(212, 196, 1036); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } case 6: if (player.Money >= 100) { player.Money -= 100; player.Teleport(056, 399, 1002); } else { using (var yi = new NpcDialog(20)) { yi .Text("Sorry, but you do not have enough gold.") .Link("Alright.", 255) .Finish(); player.Send(yi); } } break; } return(true); } catch { return(false); } }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.Inventory.HasItem(ItemNames.EuxeniteOre, 10)) { using (var yi = new NpcDialog(14)) { yi .Text( "Since you take 10 EuxeniteOres. I will refine Saltpeter for you.") .Link("Yes, please.", 1) .Link("No, thanks.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(14)) { yi .Text( "Norbert recommened me to you, did he?") .Link("Yes, I come for Saltpeter..", 2) .Link("No, just passing by", 255) .Finish(); player.Send(yi); } } break; } case 1: { player.Inventory.RemoveItem(ItemNames.EuxeniteOre, 10); var item = Item.Factory.Create(ItemNames.Salpeter); player.Inventory.AddItem(item); using (var yi = new NpcDialog(14)) { yi .Text( "My pleasure. Here you are.") .Link("Thank you.", 255) .Finish(); player.Send(yi); } break; } case 2: { using (var yi = new NpcDialog(14)) { yi .Text( "Let's make long story short. 10 EuxeniteOres are required for a piece of Saltpeter. You can dig EuxeniteOres in the plain mine.") .Link("I will get some.", 255) .Finish(); player.Send(yi); } break; } } } catch { return(false); } return(true); }
public static bool Execute(Player player, int npcId, byte control, string input) { try { switch (control) { case 0: { if (player.Reborn && player.Level >= 70) { using (var yi = new NpcDialog(22)) { yi .Text( "The DragonBall is really a precious item.You can use it to reallot your attribute points after you have been reborned.") .Text( "After reborning at 70 or above you can reallot your attribute points freely. Well, if you have a DragonBall, I can help you do that.") .Link("Please help me.", 1) .Link("Definitely.", 255) .Finish(); player.Send(yi); } } else if (!player.Reborn) { using (var yi = new NpcDialog(22)) { yi .Text("Please come back when you have been reborned at least once in your lifetime.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else if (player.Level < 70) { using (var yi = new NpcDialog(22)) { yi .Text("You must be above level 70 to be able to reallot your attribute points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } else { using (var yi = new NpcDialog(22)) { yi .Text( "You need to be reborn and above level 70 to be able to reallot your attribute points.") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } case 1: { if (player.Inventory.HasItem(ItemNames.Dragonball)) { player.Inventory.RemoveItem(ItemNames.Dragonball); var playerAttributePoints = (ushort)(player.Vitality + player.Strength + player.Spirit + player.Agility + player.Statpoints); player.Vitality = player.Strength = player.Agility = player.Spirit = 0; player.Statpoints = playerAttributePoints; } else { using (var yi = new NpcDialog(22)) { yi .Text("Sorry, but you must pay one DragonBall come back when you have one!") .Link("That is ok.", 255) .Finish(); player.Send(yi); } } break; } } return(true); } catch { return(false); } }
private static async void Process(Player player, int npcIdoverride = 0) { if (Control == 255 && player.Online) { player.CurrentNpcId = 0; } if (player.CurrentNpcId == 0) { return; } var id = player.CurrentNpcId; if (npcIdoverride != 0) { id = npcIdoverride; } switch (id) { case 1337: { switch (Control) { case 255: player.CurrentNpcId = 1337; using (var packet = new NpcDialog(10)) { packet .Text("Select Char") .Link("Next", 1) .Link("Select", 10) .Link("New", 100) .Finish(); player.Send(packet); } break; case 1: var players = SelectorSystem.GetPlayersFor(player.AccountId).ToList(); var index = players.IndexOf(player); if (index + 1 > players.Count - 1) { index = 0; } else { index++; } player = SelectorSystem.SwapCharacter(player, players[index]); player.Send(LegacyPackets.CharacterInformation(player)); player.Send(MsgAction.MapShowPacket(player)); player.AddStatusEffect(StatusEffect.Frozen); ScreenSystem.Create(player); ScreenSystem.Update(player); break; case 10: player.RemoveStatusEffect(StatusEffect.Frozen); ScreenSystem.Create(player); player.AddSpawnProtection(); player.IncrementXp(); foreach (var kvp in player.Skills) { player.Send(MsgSkill.Create(kvp.Value)); } foreach (var prof in player.Profs) { player.Send(MsgProf.Create(prof.Value)); } EntityLogic.Recalculate(player); player.CurrentHp = player.MaximumHp; player.CurrentMp = player.MaximumMp; GameWorld.Maps[player.MapId].Enter(player); player.Send(MsgAction.Create(player, (int)player.PkMode, MsgActionType.ChangePkMode)); player.Send(MsgUpdate.Create(player, player.Stamina, MsgUpdateType.Stamina)); player.Send(MsgUpdate.Create(player, player.Class, MsgUpdateType.Class)); player.Online = true; if (player.HasFlag(StatusEffect.SuperMan)) { BuffSystem.Create(player); BuffSystem.AddBuff(player, new Buff(player, SkillId.Superman, TimeSpan.FromSeconds(10))); } if (player.HasFlag(StatusEffect.Cyclone)) { BuffSystem.Create(player); BuffSystem.AddBuff(player, new Buff(player, SkillId.Cyclone, TimeSpan.FromSeconds(10))); } if (player.PkPoints > 1) { player.PkPJob = new Job(TimeSpan.FromSeconds(15), () => player.PkPoints--); YiScheduler.Instance.Do(player.PkPJob); } ScreenSystem.Send(player, MsgAction.Create(player, player.UniqueId, MsgActionType.EntityRemove)); ScreenSystem.Send(player, MsgSpawn.Create(player)); break; case 100: SelectorSystem.CreateNewCharacterFor(player.AccountId); player.Disconnect(); break; } break; } default: { if (!await ScriptEngine.ActivateNpc(player, NpcId, (byte)Control, Input)) { if (GameWorld.Find(NpcId, out Npc npc) && Control == 0) { ConquerActionProcessor.ExecuteAction(npc, player, Control); } //Message.SendTo(player, $"[{player.CurrentNpcId}] Npc has no script.", MsgTextType.Talk); } break; } } }