Advertisement
Guest User

Skill Soul

a guest
Mar 22nd, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.95 KB | None | 0 0
  1. #region Skill Soul
  2. case 3570754:
  3. {
  4. switch (npcRequest.OptionID)
  5. {
  6. case 0:
  7. {
  8. dialog.Text("Hello friend. I am the Skill Souls master! Have you imagine if u could change your SkillS look.");
  9. dialog.Option("Okay, go a head", 1);
  10. dialog.Option("Sorry", 255);
  11. dialog.Send();
  12. break;
  13. }
  14. case 1:
  15. {
  16. dialog.Text("Choose its new style.");
  17. dialog.Option("Upgrade My Skill Souls", 25);
  18. dialog.Option("I'll think about it!", 255);
  19. dialog.Send();
  20. break;
  21. }
  22. #region edited
  23. case 25:
  24. {
  25. dialog.Text("Choose Skill you want.");
  26. foreach (var s in client.Spells.Values)
  27. {
  28. if (SkillSoul_Allowed.Contains(s.ID))
  29. {
  30. byte ID = (byte)(SkillSoul_Allowed.IndexOf(s.ID) + 2);
  31. #region New skill Soul
  32. // else
  33. {
  34. switch (s.ID)
  35. {
  36. default:
  37. {
  38. if (s.Souls < Spell.Soul_Level.Level_Two)
  39. {
  40. if (SpellTable.SpellInformations.ContainsKey(s.ID))
  41. {
  42. if (SpellTable.SpellInformations[s.ID].ContainsKey(s.Level))
  43. {
  44. if (SpellTable.SpellInformations[s.ID][s.Level].Name != "")
  45. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  46. else
  47. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  48. }
  49. else
  50. {
  51. if (SpellTable.SpellInformations[s.ID][0].Name != "")
  52. dialog.Option(SpellTable.SpellInformations[s.ID][0].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  53. else
  54. dialog.Option(SpellTable.SpellInformations[s.ID][0].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  55. }
  56. }
  57. }
  58. break;
  59. }
  60. case 10381:
  61. {
  62. if (s.Souls < Spell.Soul_Level.Level_Four)
  63. {
  64. if (SpellTable.SpellInformations.ContainsKey(s.ID))
  65. {
  66. if (SpellTable.SpellInformations[s.ID].ContainsKey(s.Level))
  67. {
  68. if (SpellTable.SpellInformations[s.ID][s.Level].Name != "")
  69. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  70. else
  71. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  72. }
  73. else
  74. {
  75. if (SpellTable.SpellInformations[s.ID][0].Name != "")
  76. dialog.Option(SpellTable.SpellInformations[s.ID][0].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  77. else
  78. dialog.Option(SpellTable.SpellInformations[s.ID][0].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  79. }
  80. }
  81. }
  82. }
  83. break;
  84. case 6001:
  85. case 1001:
  86. case 12080:
  87. {
  88. if (s.Souls < Spell.Soul_Level.Level_One)
  89. {
  90. if (SpellTable.SpellInformations.ContainsKey(s.ID))
  91. {
  92. if (SpellTable.SpellInformations[s.ID].ContainsKey(s.Level))
  93. {
  94. if (SpellTable.SpellInformations[s.ID][s.Level].Name != "")
  95. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  96. else
  97. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  98. }
  99. else
  100. {
  101. if (SpellTable.SpellInformations[s.ID][0].Name != "")
  102. dialog.Option(SpellTable.SpellInformations[s.ID][0].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  103. else
  104. dialog.Option(SpellTable.SpellInformations[s.ID][0].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  105. }
  106. }
  107. }
  108. }
  109. break;
  110. case 1046:
  111. case 1115:
  112. case 11190:
  113. case 10415:
  114. case 1002:
  115. {
  116. if (s.Souls < Spell.Soul_Level.Level_Three)
  117. {
  118. if (SpellTable.SpellInformations.ContainsKey(s.ID))
  119. {
  120. if (SpellTable.SpellInformations[s.ID].ContainsKey(s.Level))
  121. {
  122. if (SpellTable.SpellInformations[s.ID][s.Level].Name != "")
  123. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  124. else
  125. dialog.Option(SpellTable.SpellInformations[s.ID][s.Level].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  126. }
  127. else
  128. {
  129. if (SpellTable.SpellInformations[s.ID][0].Name != "")
  130. dialog.Option(SpellTable.SpellInformations[s.ID][0].Name + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  131. else
  132. dialog.Option(SpellTable.SpellInformations[s.ID][0].ID.ToString() + ", [Skill Soul Level] :" + s.Souls.ToString(), ID);
  133. }
  134. }
  135. }
  136. }
  137. break;
  138.  
  139. }
  140. }
  141. #endregion New skill Soul
  142. }
  143. }
  144. dialog.Option("Nevermind.", 255);
  145. dialog.Send();
  146. break;
  147. }
  148. default:
  149. {
  150. byte i = (byte)(npcRequest.OptionID - 2);
  151. ushort skill = SkillSoul_Allowed[i];
  152. if (client.Spells.ContainsKey(skill))
  153. {
  154. {
  155. switch (client.Spells[skill].Souls)
  156. {
  157. case Spell.Soul_Level.Default:
  158. case Spell.Soul_Level.Level_One:
  159. case Spell.Soul_Level.Level_Two:
  160. case Spell.Soul_Level.Level_Three:
  161. {
  162. int lvl = Spell.SkillSoul_values.IndexOf(client.Spells[skill].Souls);
  163. lvl++;
  164. uint cost = (uint)(lvl * 100);
  165. if (client.Player.ConquerPoints >= cost)
  166. {
  167. client.Player.ConquerPoints -= cost;
  168. client.Spells[skill].Souls = Spell.SkillSoul_values[lvl];
  169. }
  170. else
  171. {
  172. dialog.Text("You Don't Have " + cost + "Cps Come When You Have it ");
  173. dialog.Option("Sorry ", 255);
  174. dialog.Send();
  175. return;
  176. }
  177. }
  178. break;
  179. }
  180. Network.GamePackets.Data data = new Data(true);
  181. data.UID = client.Player.UID;
  182. data.dwParam = client.Spells[skill].ID;
  183. data.ID = 109;
  184. client.Send(data);
  185. client.Send(new Spell(true)
  186. {
  187. ID = client.Spells[skill].ID,
  188. Level = client.Spells[skill].Level,
  189. PreviousLevel = client.Spells[skill].PreviousLevel,
  190. Experience = 0,
  191. Souls = client.Spells[skill].Souls,
  192. Available = true
  193. }.ToArray());
  194. client.Spells[skill].Send(client);
  195.  
  196. SkillTable.SaveSpells(client);
  197. dialog.Text("you have upgraded your skills :" + client.Spells[skill].ID + " To SkillSoul level" + client.Spells[skill].Souls.ToString());
  198. dialog.Option("Good Job.", 255);
  199. dialog.Send();
  200. }
  201.  
  202. }
  203. }
  204. break;
  205. #endregion
  206. }
  207. break;
  208. }
  209. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement