Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.09 KB | None | 0 0
  1. #region GuildDirector
  2. case 10003:
  3. {
  4. dialog.Avatar(7);
  5. switch (npcRequest.OptionID)
  6. {
  7. case 0:
  8. {
  9. dialog.Text("Greetings! I am the guild director, in charge of administrating and managing guilds. What business do you have with me?");
  10. dialog.Text("Guild leaders can post up a guild recruitment ad to recruit new blood for their guilds! Soldiers without a guild can get the latest guild recruitment information from me, and then find a good guild to join!");
  11. dialog.Option("Create~a~guild", 1);
  12. dialog.Option("Disband~my~guild", 6);
  13. dialog.Option("Inquire~about~a~guild", 4);
  14. dialog.Option("Guild~Recruitment", 3);
  15. dialog.Option("Change~my~Guild`s~name.", 8);
  16. if (client.Union == null)
  17. {
  18. //dialog.Option("Union~Operation.", 51);
  19. }
  20. else
  21. {
  22. //dialog.Option("Change~my~Union`s~name.", 67);
  23. }
  24. dialog.Option("Close.", 255);
  25. dialog.Send();
  26. break;
  27. }
  28. case 51:
  29. {
  30. if (client.Union == null && client.Guild != null && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Guild.Level >= 1 && client.Entity.ConquerPoints >= 3000)
  31. {
  32. dialog.Text("A great war which involves millions of heroes is about to fire. If you have a Level 9+ Guild ranking Top 8 in Capture the Flag of your server,");
  33. dialog.Text("~you can pay me 1,000,000 CPs to create a Union. It`s time to gather the elites and picture a new world in your hands.");
  34.  
  35. dialog.Option("Create~a~Union.", 66);
  36. dialog.Option("It`s~time~to~strike!", 0);
  37. dialog.Avatar(7);
  38. dialog.Send();
  39. }
  40. else
  41. {
  42. dialog.Text("Sorry, you don`t have 3,000 CPs or Guild Level 1 or Have Union to create a Union.");
  43.  
  44. dialog.Option("Hard~times...", 255);
  45. dialog.Avatar(7);
  46. dialog.Send();
  47. }
  48. break;
  49. }
  50. case 67:
  51. {
  52. if (client.Guild != null && client.Union != null && client.Union.LeaderUID == client.Entity.UID && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Entity.ConquerPoints >= 3000)
  53. {
  54. client.Entity.ConquerPoints -= 3000;
  55. client.Union.SengGui(client, 6);
  56. }
  57. else
  58. {
  59. dialog.Text("Sorry, you don`t have 3,000 CPs to Change Name Of a Union.");
  60.  
  61. dialog.Option("Hard~times...", 255);
  62. dialog.Avatar(7);
  63. dialog.Send();
  64. }
  65. break;
  66. }
  67. case 66:
  68. {
  69. client.Entity.ConquerPoints -= 3000;
  70. client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.OpenWindow, dwParam = 693, wParam1 = client.Entity.X, wParam2 = client.Entity.Y });
  71. break;
  72. }
  73. case 1:
  74. {
  75. if (client.Entity.Level < 90)
  76. {
  77. dialog.Text("Sorry,~you~cannot~create~a~guild~before~you~reach~level~90.~Please~train~harder.");
  78. dialog.Option("I~see.", 255);
  79. dialog.Send();
  80. }
  81. else if (client.Entity.Money < 1000000)
  82. {
  83. dialog.Text("To~create~a~guild,~1,000,000~silver~will~be~charged.~You~do~not~have~the~required~money.");
  84. dialog.Option("I~see.", 255);
  85. dialog.Send();
  86. }
  87. else
  88. {
  89. dialog.Text("What~would~you~like~to~name~your~guild?~A~good~name~is~better~than~great~riches.");
  90. dialog.Input("I name my guild...", 2, 16);
  91. dialog.Option("Let~me~think~it~over.", 255);
  92. dialog.Send();
  93. }
  94. break;
  95. }
  96. case 2:
  97. {
  98. if (client.Guild == null && client.Entity.Level >= 90)
  99. {
  100. if (npcRequest.Input != "" && npcRequest.Input.Length > 3 && npcRequest.Input.Length < 16)
  101. {
  102. if (!Guild.CheckNameExist(npcRequest.Input))
  103. {
  104. Guild guild = new Guild(client.Entity.Name);
  105. guild.ID = Guild.GuildCounter.Next;
  106. guild.SilverFund = 1000000;
  107. client.AsMember = new MrAlzwawy.Game.ConquerStructures.Society.Guild.Member(guild.ID)
  108. {
  109. SilverDonation = 500000,
  110. ID = client.Entity.UID,
  111. Level = client.Entity.Level,
  112. Name = client.Entity.Name,
  113. Rank = MrAlzwawy.Game.Enums.GuildMemberRank.GuildLeader,
  114. };
  115. if (client.NobilityInformation != null)
  116. {
  117. client.AsMember.Gender = client.NobilityInformation.Gender;
  118. client.AsMember.NobilityRank = client.NobilityInformation.Rank;
  119. }
  120.  
  121. client.Entity.GuildID = (ushort)guild.ID;
  122. client.Entity.GuildRank = (ushort)MrAlzwawy.Game.Enums.GuildMemberRank.GuildLeader;
  123. guild.Leader = client.AsMember;
  124. client.Guild = guild;
  125. guild.Create(npcRequest.Input);
  126. guild.Name = npcRequest.Input;
  127. guild.MemberCount++;
  128. guild.SendGuild(client);
  129. guild.SendName(client);
  130. Database.GuildArsenalTable.Insert(guild.ID);
  131. client.Screen.FullWipe();
  132. client.Screen.Reload(null);
  133. }
  134. else
  135. {
  136. dialog.Text("There is a Guild Already with this Name i'm sorry.");
  137. dialog.Option("Choose another Name", 1);
  138. dialog.Option("Ok Sorry.", 255);
  139. dialog.Send();
  140. }
  141. }
  142. }
  143. break;
  144. }
  145. case 3:
  146. {
  147. Data data = new Data(true);
  148. data.UID = client.Entity.UID;
  149. data.ID = Data.OpenCustom;
  150. data.dwParam = 3274;
  151. client.Send(data);
  152. break;
  153. }
  154. case 4:
  155. {
  156. dialog.Text("Which~guild~would~you~like~to~inquire~about?");
  157. dialog.Input("I wnat to inquire about -", 5, 16);
  158. dialog.Option("Let~me~think~it~over.", 255);
  159. dialog.Send();
  160. break;
  161. }
  162. case 5:
  163. {
  164. if (!Guild.CheckNameExist(npcRequest.Input))
  165. {
  166. dialog.Text("This~guild~does~not~exist.");
  167. dialog.Option("Thanks.", 255);
  168. dialog.Send();
  169. }
  170. else
  171. {
  172. var selectedguild = Kernel.Guilds.Values.Where(p => p.Name == npcRequest.Input).FirstOrDefault();
  173. if (selectedguild != null)
  174. {
  175. dialog.Text(" Guild~Name: " + selectedguild.Name + ";");
  176. dialog.Text(" Guild~Leader: " + selectedguild.LeaderName + ";");
  177. dialog.Text(" Guild~Members: " + selectedguild.MemberCount + ";");
  178. dialog.Text(" Guild~Fund: " + selectedguild.SilverFund + ";");
  179. dialog.Option("I see.", 255);
  180. dialog.Send();
  181. }
  182. }
  183. break;
  184. }
  185. case 6:
  186. {
  187. dialog.Text("Disbanding your guild is a decision not to be taken lightly. When armies fall apart, a period of chaos ensues?");
  188. dialog.Option("I~decide~to~disband..", 7);
  189. dialog.Option("I~changed~my~mind.", 255);
  190. dialog.Send();
  191. break;
  192. }
  193. case 7:
  194. {
  195. if (client.Guild != null && client.AsMember.Rank == Game.Enums.GuildMemberRank.GuildLeader)
  196. {
  197. client.Guild.Disband();
  198. }
  199. else if (client.Guild == null)
  200. {
  201. client.MessageBox("You haven't joined any guild now.", null, null, 0);
  202. }
  203. break;
  204. }
  205. case 8:
  206. {
  207. dialog.Text("Only the Guild Leader can change the Guild`s name, which will take effect after the server maintenance on the second day. It`ll cost you 1075 CPs. Deal?");
  208. dialog.Option("Deal!", 9);
  209. dialog.Option("Wait~a~minute.", 255);
  210. break;
  211. }
  212. case 9:
  213. {
  214. dialog.Text("Please enter a new name for your Guild.");
  215. dialog.Input("Name:", 10, 16);
  216. dialog.Option("Cancel.", 255);
  217. break;
  218. }
  219. case 10:
  220. {
  221. if (client.Guild == null || client.AsMember.Rank != Enums.GuildMemberRank.GuildLeader)
  222. {
  223. dialog.Text("Sorry, you`re not the Guild Leader.");
  224. dialog.Option("My~bad.", 255);
  225. }
  226. else if (client.Entity.ConquerPoints < 1075)
  227. {
  228. dialog.Text("Sorry, you don`t have enough CPs.");
  229. dialog.Option("My~bad.", 255);
  230. }
  231. else if (client.Guild != null && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Entity.ConquerPoints >= 1075)
  232. {
  233. if (npcRequest.Input != "" && npcRequest.Input.Length > 3 && npcRequest.Input.Length < 16)
  234. {
  235. if (!Guild.CheckNameExist(npcRequest.Input))
  236. {
  237. Database.GuildTable.ChangeName(client, npcRequest.Input);
  238. client.Guild.Name = npcRequest.Input;
  239. client.Guild.SendGuild(client);
  240. client.Guild.SendName(client);
  241. client.Entity.ConquerPoints -= 1075;
  242. client.Screen.FullWipe();
  243. client.Screen.Reload(null);
  244. }
  245. else
  246. {
  247. dialog.Text("There is a Guild Already with this Name i'm sorry.");
  248. dialog.Option("Choose another Name", 9);
  249. dialog.Option("Ok Sorry.", 255);
  250. dialog.Send();
  251. }
  252. }
  253. else
  254. {
  255. dialog.Text("There is a Guild bad Name i'm sorry.");
  256. dialog.Option("Try Again", 9);
  257. dialog.Option("Ok Sorry.", 255);
  258. dialog.Send();
  259. }
  260. }
  261. break;
  262. }
  263. }
  264. break;
  265. }
  266. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement