Advertisement
k7host

ارشر

May 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.18 KB | None | 0 0
  1. #region Assassin skills
  2. case 11650:
  3. {
  4. if (CanUseSpell(spell, attacker.Owner))
  5. {
  6. if (attacker.MapID == 1844)
  7. return;
  8. PrepareSpell(spell, attacker.Owner);
  9. ShekoProject.Network.GamePackets.SpellUse suse = new ShekoProject.Network.GamePackets.SpellUse(true);
  10. suse.Attacker = attacker.UID;
  11. suse.SpellID = spell.ID;
  12. suse.SpellLevel = spell.Level;
  13. suse.X = X;
  14. suse.Y = Y;
  15. attack.X = X;
  16. attack.Y = Y;
  17. attack.Attacker = attacker.UID;
  18. attack.AttackType = 53;
  19. attack.X = X;
  20. attack.Y = Y;
  21. Writer.WriteUInt16(spell.ID, 24, attack.ToArray());
  22. Writer.WriteByte(spell.Level, 26, attack.ToArray());
  23. attacker.Owner.SendScreen(attack, true);
  24. attacker.X = X;
  25. attacker.Y = Y;
  26.  
  27. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
  28. {
  29. foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  30. {
  31. if (_obj == null)
  32. continue;
  33. if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  34. {
  35. attacked = _obj as Entity;
  36.  
  37. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  38. {
  39. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  40. {
  41. attack.Effect1 = Attack.AttackEffects1.None;
  42. //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
  43. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
  44. damage = (damage * 30) / 100;
  45. suse.Effect1 = attack.Effect1;
  46. if (attacked.EntityFlag == EntityFlag.Monster)
  47. {
  48. if (!(attacked.Name.Contains("TeratoDragon") || attacked.Name.Contains("SnowBanshee") || attacked.Name.Contains("BabyiFranko") || attacked.Name.Contains("Guard") || attacked.Name.Contains("ThrillingSpook")))
  49. damage = (damage * 5);
  50. }
  51. else
  52. {
  53. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 5)
  54. damage = (damage * 20) / 100;
  55. else { continue; }
  56. }
  57.  
  58.  
  59. ReceiveAttack(attacker, attacked, attack, damage, spell);
  60. suse.Targets.Add(attacked.UID, damage);
  61.  
  62. }
  63. }
  64. }
  65. else if (_obj.MapObjType == MapObjectType.SobNpc)
  66. {
  67. attackedsob = _obj as SobNpcSpawn;
  68. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
  69. {
  70. if (CanAttack(attacker, attackedsob, spell))
  71. {
  72. attack.Effect1 = Attack.AttackEffects1.None;
  73. //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
  74. uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  75. damage = (damage * 30) / 100;
  76. ////if (ServerBase.Kernel.Rate((attacker.CriticalStrike) / 100)) { uint calc = (uint)(damage * 1.5F); attack.Damage = (uint)(damage * 1.5F); damage = calc; attack.Effect1 = ShekoProject.Network.GamePackets.Attack.AttackEffects1.CriticalStrike; }
  77. damage = (uint)(damage * spell.PowerPercent);
  78. ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  79. suse.Effect1 = attack.Effect1;
  80. suse.Targets.Add(attackedsob.UID, damage);
  81.  
  82. }
  83. }
  84. }
  85. }
  86. }
  87. else
  88. {
  89. attacker.AttackPacket = null;
  90. }
  91. attacker.Owner.SendScreen(suse, true);
  92.  
  93. }
  94. break;
  95.  
  96. }
  97. case 11610: //BladeFlurry
  98. {
  99.  
  100. if (CanUseSpell(spell, attacker.Owner))
  101. {
  102. if (attacker.MapID == 1844)
  103. return;
  104. PrepareSpell(spell, attacker.Owner);
  105.  
  106. SpellUse suse = new SpellUse(true);
  107. suse.Attacker = attacker.UID;
  108. suse.SpellID = spell.ID;
  109. suse.SpellLevel = spell.Level;
  110. suse.X = X;
  111. suse.Y = Y;
  112. if (!attacker.ContainsFlag3(Update.Flags3.BladeFlurry))
  113. {
  114. // attacker.RemoveFlag(Update.Flags.XPList);
  115. attacker.BladeFlurryStamp = Time32.Now;
  116. attacker.BladeFlurry = 43;
  117. attacker.AddFlag3(Update.Flags3.BladeFlurry);
  118. }
  119.  
  120. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 10)
  121. {
  122. for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
  123. {
  124. //For a multi threaded application, while we go through the collection
  125. //the collection might change. We will make sure that we wont go off
  126. //the limits with a check.
  127. if (c >= attacker.Owner.Screen.Objects.Count())
  128. break;
  129. Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
  130. if (_obj == null)
  131. continue;
  132. if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  133. {
  134. attacked = _obj as Entity;
  135. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 10)
  136. {
  137. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  138. {
  139. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  140. if (spell.Power > 0)
  141. damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
  142. if (spell.ID == 8030)
  143. damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  144. ReceiveAttack(attacker, attacked, attack, damage, spell);
  145. suse.Targets.Add(attacked.UID, damage);
  146. //attacked.AddFlag(Update.Effects.CannonBarrage);
  147. }
  148. }
  149. }
  150. else if (_obj.MapObjType == MapObjectType.SobNpc)
  151. {
  152. attackedsob = _obj as SobNpcSpawn;
  153. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 10)
  154. {
  155. if (CanAttack(attacker, attackedsob, spell))
  156. {
  157. uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  158. if (spell.Power > 0)
  159. damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
  160. if (spell.ID == 8030)
  161. damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  162. ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  163. suse.Targets.Add(attackedsob.UID, damage);
  164. //attacked.AddFlag(Update.Effects.CannonBarrage);
  165. }
  166. }
  167. }
  168. }
  169. }
  170. else
  171. {
  172. attacker.AttackPacket = null;
  173. }
  174. attacker.Owner.SendScreen(suse, true);
  175. }
  176. break;
  177. }
  178. case 11660:
  179. {
  180.  
  181. if (CanUseSpell(spell, attacker.Owner))
  182. {
  183. if (attacker.MapID == 1844)
  184. return;
  185. PrepareSpell(spell, attacker.Owner);
  186.  
  187. TryTrip suse = new TryTrip(true);
  188. suse.Attacker = attacker.UID;
  189. suse.SpellID = spell.ID;
  190. suse.SpellLevel = spell.Level;
  191.  
  192. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
  193. {
  194. if (attackedsob != null)
  195. {
  196. if (CanAttack(attacker, attackedsob, spell))
  197. {
  198. PrepareSpell(spell, attacker.Owner);
  199. uint power = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  200. power = (uint)(power * spell.PowerPercent);
  201. ReceiveAttack(attacker, attackedsob, attack, power, spell);
  202. suse.Damage = power;
  203. suse.Attacked = attackedsob.UID;
  204. }
  205. }
  206. else
  207. {
  208. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  209. {
  210. PrepareSpell(spell, attacker.Owner);
  211. uint power = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
  212. power = (power * 10) / 100;
  213. ReceiveAttack(attacker, attacked, attack, power, spell);
  214. suse.Damage = power;
  215. suse.Attacked = attacked.UID;
  216. }
  217. }
  218. attacker.AttackPacket = null;
  219. }
  220. else
  221. {
  222. attacker.AttackPacket = null;
  223. }
  224. attacker.Owner.SendScreen(suse, true);
  225. }
  226. attacker.AttackPacket = null;
  227. break;
  228. }
  229. case 11670://SpiritFocus
  230. {
  231. if (CanUseSpell(spell, this.attacker.Owner))
  232. {
  233. PrepareSpell(spell, this.attacker.Owner);
  234. if (this.attacker.ContainsFlag3(Update.Flags.Intensify))
  235. {
  236. this.attacker.RemoveFlag3(Update.Flags.Intensify);
  237. break;
  238. }
  239. this.attacker.AddFlag3(Update.Flags.Intensify);
  240. SpellUse spellUse = new SpellUse(true);
  241. spellUse.Attacker = this.attacker.UID;
  242. spellUse.SpellID = spell.ID;
  243. spellUse.SpellLevel = spell.Level;
  244. spellUse.X = X;
  245. spellUse.Y = Y;
  246. spellUse.Targets.Add(this.attacker.UID, 0);
  247. this.attacker.Owner.SendScreen(spellUse, true);
  248. }
  249. break;
  250. }
  251. case 11620:
  252. {//pathofshadow
  253. if (CanUseSpell(spell, attacker.Owner))
  254. {
  255. if (attacker.MapID == 1844)
  256. return;
  257. PrepareSpell(spell, attacker.Owner);
  258. if (attacker.ContainsFlag3(Update.Flags3.PathOfShadow))
  259. {
  260. attacker.RemoveFlag3(Update.Flags3.PathOfShadow);
  261. break;
  262. }
  263. _String str = new _String(true);
  264. str.UID = attacker.UID;
  265. str.TextsCount = 1;
  266. str.Type = _String.Effect;
  267. str.Texts.Add("superxp2");
  268. attacker.Owner.SendScreen(str, true);
  269. attacker.AddFlag3(Update.Flags3.PathOfShadow);
  270. SpellUse spellUse = new SpellUse(true);
  271. spellUse.Attacker = attacker.UID;
  272. spellUse.SpellID = spell.ID;
  273. spellUse.SpellLevel = spell.Level;
  274. spellUse.X = X;
  275. spellUse.Y = Y;
  276. spellUse.Targets.Add(attacker.UID, 0);
  277. attacker.Owner.SendScreen(spellUse, true);
  278. }
  279. break;
  280. }
  281.  
  282. case 11590:
  283. {//KineticSpark
  284. if (CanUseSpell(spell, attacker.Owner))
  285. {
  286. if (attacker.MapID == 1844)
  287. return;
  288. PrepareSpell(spell, attacker.Owner);
  289. if (attacker.ContainsFlag3(Update.Flags3.KineticSpark))
  290. {
  291. attacker.RemoveFlag3(Update.Flags3.KineticSpark);
  292. if (attacker.CriticalStrike >= 2000)
  293. {
  294. attacker.CriticalStrike -= 2000;
  295. }
  296. break;
  297. }
  298. attacker.AddFlag3(Update.Flags3.KineticSpark);
  299. attacker.CriticalStrike += 2000;
  300. SpellUse spellUse = new SpellUse(true);
  301. spellUse.Attacker = attacker.UID;
  302. spellUse.SpellID = spell.ID;
  303. spellUse.SpellLevel = spell.Level;
  304. spellUse.X = X;
  305. spellUse.Y = Y;
  306. spellUse.Targets.Add(attacker.UID, 0);
  307. attacker.Owner.SendScreen(spellUse, true);
  308. }
  309. break;
  310. }
  311. #region daggerstorm
  312. case 11600: // Scurvey Bomb
  313. {
  314.  
  315. if (CanUseSpell(spell, attacker.Owner))
  316. {
  317. PrepareSpell(spell, attacker.Owner);
  318. SpellUse suse = new SpellUse(true);
  319. suse.Attacker = attacker.UID;
  320. suse.SpellID = spell.ID;
  321. suse.SpellLevel = spell.Level;
  322. spell.UseStamina = 50;
  323. spell.UseMana = 0;
  324. suse.X = X;
  325. suse.Y = Y;
  326. suse.Effect1 = 0;
  327. bool sheko = false;
  328.  
  329. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
  330. {
  331. foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  332. foreach (Client.GameState clients in Kernel.GamePool.Values)
  333. {
  334.  
  335. if (_obj == null)
  336. continue;
  337. if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  338. {
  339. attacked = _obj as Entity;
  340. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  341. {
  342. if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  343. {
  344. clients.Entity.DaggerTimeStamp = DateTime.Now;
  345. clients.Entity.DaggerTimeTime = 45;
  346. attacker.AddFlag3(1UL << 20);
  347. attack.Effect1 = Attack.AttackEffects1.None;
  348. PrepareSpell(spell, attacker.Owner);
  349. //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
  350. uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  351. suse.Effect1 = attack.Effect1;
  352. Database.SpellInformation spell2 = null;
  353. if (attacked.EntityFlag == EntityFlag.Player)
  354. {
  355. if (attacked.Action == Enums.ConquerAction.Sit)
  356. if (attacked.Stamina > 20)
  357. attacked.Stamina -= 20;
  358. else
  359. attacked.Stamina = 0;
  360. attacked.Action = Enums.ConquerAction.None;
  361. //Console.WriteLine("ssS");
  362. }
  363. spell2 = Database.SpellTable.SpellInformations[11600][attacker.Owner.Spells[11600].Level];
  364. damage = (uint)(damage + spell2.Power);
  365. ReceiveAttack(attacker, attacked, attack, damage, spell);
  366. suse.Targets.Add(attacked.UID, damage);
  367.  
  368. attacked.Update(_String.Effect, "Ia_appear", true);
  369. attacked.Update(_String.Effect, "Ia_appear", true);
  370. attacked.Update(_String.Effect, "Ia_appear", true);
  371. attacked.Update(_String.Effect, "Ia_appear", true);
  372. }
  373. }
  374. }
  375. else if (_obj.MapObjType == MapObjectType.SobNpc)
  376. {
  377. attackedsob = _obj as SobNpcSpawn;
  378. if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
  379. {
  380. if (CanAttack(attacker, attackedsob, spell))
  381. {
  382. attack.Effect1 = Attack.AttackEffects1.None;
  383. //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
  384. sheko = attacked.BlackSpots;
  385. PrepareSpell(spell, attacker.Owner);
  386. uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);////if (ServerBase.Kernel.Rate((attacker.CriticalStrike) / 100)) { uint calc = (uint)(damage * 1.5F); attack.Damage = (uint)(damage * 1.5F); damage = calc; attack.Effect1 = ShekoProject.Network.GamePackets.Attack.AttackEffects1.CriticalStrike; }
  387. damage = (damage * 65) / 100;
  388. suse.Effect1 = attack.Effect1;
  389. ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  390. suse.Targets.Add(attackedsob.UID, damage);
  391.  
  392. }
  393. }
  394. }
  395. }
  396. }
  397. else
  398. {
  399. attacker.AttackPacket = null;
  400. }
  401. attacker.Owner.SendScreen(suse, true);
  402. }
  403.  
  404. break;
  405. }
  406. #endregion
  407. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement