MOHAMEDELKASSER

حصريا على تيم اكسور شخصية الجديدة كاملة

Mar 8th, 2017
1,800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 451.90 KB | None | 0 0
  1. هتروح باكت هندل
  2. فويد  EquipItem
  3.  
  4. هتنزل لحد دى if (client.Entity.Class >= 80 && client.Entity.Class <= 85)
  5.  
  6. فوقيها هتحط دى
  7.  
  8. if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  9.                 {
  10.                     can2hand = true;
  11.                     can2wpn = true;
  12.                 }
  13.  
  14. هتنزل هتلاقى سطر بالشكل دة if (client.Entity.Class >= 100
  15.  
  16. هتعملو بالشكل دة
  17.  
  18. if (client.Entity.Class >= 100 && client.Entity.Class <= 145)
  19.  
  20.  
  21. هتروح ل فويد دة EquipPassJobReq
  22.  
  23. هتحط دة
  24.  
  25.  #region Windwalker
  26.                 case 160: if (client.Entity.Class <= 165 && client.Entity.Class >= 160) return true; break;
  27.                 case 161: if (client.Entity.Class <= 165 && client.Entity.Class >= 161) return true; break;
  28.                 case 162: if (client.Entity.Class <= 165 && client.Entity.Class >= 162) return true; break;
  29.                 case 163: if (client.Entity.Class <= 165 && client.Entity.Class >= 163) return true; break;
  30.                 case 164: if (client.Entity.Class <= 165 && client.Entity.Class >= 164) return true; break;
  31.                 case 165: if (client.Entity.Class == 165) return true; break;
  32.                 #endregion
  33.  
  34. هتروح ل فويد دة  public static ushort ItemPosition(uint ID)
  35.  
  36. تحت دى هتحط دول  UInt32 iType = ID / 1000;
  37.  
  38. if (ID >= 170000 && ID <= 170309)
  39.                 return ConquerItem.Head;
  40.  if (ID >= 101000 && ID <= 101309)
  41.                 return ConquerItem.Armor;
  42.  if (ID >= 626003 && ID <= 626439)
  43.                 return ConquerItem.RightWeapon;
  44.             if (ID >= 626003 && ID <= 626439)
  45.                 return ConquerItem.LeftWeapon;
  46.  
  47. هتروح ل فويد دة GetPositionFromID
  48.  
  49. تحت دى UInt32 iType = itemid / 1000;
  50.  
  51. هتحط دول
  52.  
  53.  if (iType == 170)
  54.                 return Positions.Head;
  55.   if (iType == 101)
  56.                 return Positions.Armor;
  57. if (iType == 626)
  58.                 return Positions.Right;
  59.  
  60. وهتبدل دى من جوة انتى تيبول عندك
  61.  
  62.  switch (eC.Class)
  63.             {
  64.                 case 0:
  65.                 case 1: eC.Class = 100; break;
  66.                 case 2:
  67.                 case 3: eC.Class = 10; break;
  68.                 case 4:
  69.                 case 5: eC.Class = 40; break;
  70.                 case 6:
  71.                 case 7: eC.Class = 20; break;
  72.                 case 8:
  73.                 case 9: eC.Class = 50; break;
  74.                 case 10:
  75.                 case 11: eC.Class = 60; break;
  76.                 case 12:
  77.                 case 13: eC.Class = 70; break;
  78.                 case 14:
  79.                 case 15: eC.Class = 80; break;
  80.                 case 16:
  81.                 case 17:
  82.                     {
  83.                         eC.Class = 160;
  84.                         client.Entity.Windwalker = (byte)8;//Cshser    
  85.                         break;
  86.                     }
  87.                 case 18:
  88.                 case 19:
  89.                     {
  90.                         eC.Class = 160;
  91.                         client.Entity.Windwalker = (byte)0;//Stmper
  92.                         break;
  93.                     }
  94.                 default: { Console.WriteLine("Error Class = " + eC.Class); } break;
  95.             }
  96.  
  97. ودة الاوفسات الى زادت بتعت entity
  98.  
  99. public const ushort
  100.         TimeStamp = 4,
  101.         Mesh = 8,
  102.         UID = 12,
  103.         GuildID = 16,
  104.         GuildRank = 20,
  105.         Unknown = 24,
  106.         StatusFlag = 26,
  107.         StatusFlag2 = 34,
  108.         StatusFlag3 = 42,
  109.         StatusFlag4 = 50,
  110.         Appearance = 54,
  111.         Head = 56,
  112.         Garment = 60,
  113.         Armor = 64,
  114.         LeftWeapon = 68,
  115.         RightWeapon = 72,
  116.         LeftWeaponAccessory = 76,
  117.         RightWeaponAccessory = 80,
  118.         Steed = 84,
  119.         MountArmor = 88,
  120.         Wing = 92,
  121.         WingPlus = 96,
  122.         WingProgress = 97,
  123.         Hitpoints = 111,
  124.         MonsterLevel = 117,
  125.         X = 119,
  126.         Y = 121,
  127.         HairStyle = 123,
  128.         Facing = 125,
  129.         Action = 126,
  130.         Action2 = 128,
  131.         Reborn = 133,
  132.         Level = 134,
  133.         WindowSpawn = 136,
  134.         Away = 137,
  135.         ExtraBattlePower = 138,
  136.         Flower = 154,
  137.         NobilityRank = 158,
  138.         ArmorColor = 162,
  139.         LeftWeaponColor = 164,
  140.         HeadColor = 166,
  141.         QuizPoints = 168,
  142.         SteedPlus = 172,
  143.         SteedColor = 174,
  144.         Enlighten = 178,
  145.         TotalInnerScore = 182,
  146.         ClanUID = 194,
  147.         ClanRank = 198,
  148.         ClanSharedBp = 202,
  149.         TitleActivated = 206,
  150.         EntitySize = 208,
  151.         GuildSharedBp = 213,
  152.         ShowArenaGlow = 217,
  153.         Boss = 220,
  154.         HeadSoul = 221,
  155.         RaceItem = 222,
  156.         ArmorSoul = 225,
  157.         LeftWeaponSoul = 229,
  158.         RightWeaponSoul = 233,
  159.         SubPro = 237,
  160.         SubProActive = 238,
  161.         FirstRebornClass = 246,
  162.         SecondRebornClass = 248,
  163.         Class = 250,
  164.         CountryFlag = 252,
  165.         EquipmentColor = 258,
  166.         JiangHuTalen = 262,
  167.         JiangHuActive = 263,
  168.         ServerID = 265,
  169.         OwnerPet = 271,
  170.         OwnerPet1 = 272,
  171.         OwnerUID = 274,
  172.         UnionID = 278,
  173.         UnionExploits = 282,
  174.         Offical_Harem_Guards = 286,
  175.         UnionRank = 290,
  176.         UnionType = 291,
  177.         MyTitle = 292,
  178.         MyTitleScore = 296,
  179.         MyWing = 300,
  180.         Windwalker = 304,
  181.         Name = 312;
  182. هتروح باكت هندل هتبحث عن
  183.  
  184. شفرة الى بالشكل دة
  185.  
  186. case "class":
  187.                                 {
  188.                                     byte _class = client.Entity.Class;
  189.                                     byte.TryParse(Data[1], out _class);
  190.                                     _class = Math.Min((byte)145, Math.Max((byte)1, _class));
  191.                                     client.Entity.Class = _class;
  192.                                     if (client.Entity.Reborn == 0)
  193.                                     {
  194.                                         Database.DataHolder.GetStats(_class, client.Entity.Level, client);
  195.                                         client.CalculateStatBonus();
  196.                                         client.CalculateHPBonus();
  197.                                         client.GemAlgorithm();
  198.                                     }
  199.                                     break;
  200.                                 }
  201.  
  202. وهتبزبط سطر دة
  203.  
  204. _class = Math.Min((byte)145, Math.Max((byte)1, _class));
  205.  
  206. بدل ما هيا 145 اعملها 165
  207.  
  208. ودة شفرة متعدل عليها
  209.  
  210. case "class":
  211.                                 {
  212.                                     byte _class = client.Entity.Class;
  213.                                     byte.TryParse(Data[1], out _class);
  214.                                     _class = Math.Min((byte)165, Math.Max((byte)1, _class));
  215.                                     client.Entity.Class = _class;
  216.                                     if (client.Entity.Reborn == 0)
  217.                                     {
  218.                                         Database.DataHolder.GetStats(_class, client.Entity.Level, client);
  219.                                         client.CalculateStatBonus();
  220.                                         client.CalculateHPBonus();
  221.                                         client.GemAlgorithm();
  222.                                     }
  223.                                     break;
  224.                                 }
  225.  
  226.  
  227. هتروح انتى تيبول هتروح فويد
  228.  
  229. LoadEntity
  230.  
  231. تحت دة client.Entity.Class = reader.ReadByte("Class");
  232.  
  233. هتحط دة
  234.  
  235. if (reader.ReadByte("Class") >= 160 && reader.ReadByte("Class") <= 165)
  236.                         client.Entity.Windwalker = reader.ReadByte("Windwalker");
  237.  
  238. وهتروح فويد  SaveEntity
  239.  
  240. وهتحط دة جوة
  241.  
  242. .Set("Windwalker", e.Windwalker)
  243.  
  244. وهتروح فويد  CreateEntity
  245.  
  246. وتنزل لحد  switch (eC.Class)
  247.  
  248. هتنزل لحد using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
  249.  
  250. وتزود دة ف الاخر قبل كلمة .Execute();
  251.  
  252. .Insert("Windwalker", client.Entity.Windwalker)
  253.  
  254. بعدين هتدخل كلاس CharacterInfo
  255.  
  256. هتروح فويد public byte[] ToArray()
  257.  
  258. وضيف دى
  259.  
  260.  if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  261.                 Writer.WriteUInt32(this.client.Entity.Windwalker, 89, level);
  262.  
  263.  
  264.  
  265. وبعدين هتعمل عمود ف entities
  266. Windwalker  bigint  20  0   -1  0   0   0   0   0   0                   0   0
  267.  
  268. هتدخل ع كلاس DataHolder
  269.  
  270. تحت دى
  271.  
  272.  static SafeDictionary<byte, string> MonkStats = new SafeDictionary<byte, string>(130);
  273.  
  274. هتحط دى
  275.  
  276. static SafeDictionary<byte, string> WindwalkerStats = new SafeDictionary<byte, string>(130);
  277.  
  278. وتحت دى
  279.  
  280.   public static bool IsMonk(byte Job) { return Job >= 60 && Job <= 65; }
  281.  
  282. هتحط دى
  283.  
  284. public static bool IsWindwalker(byte Job) { return Job >= 160 && Job <= 165; }
  285.  
  286. وهتروح ع فويد  public static void ReadStats()
  287.  
  288. فوق دى job = "Monk[" + lvl + "]";
  289.  
  290. هتحط دى
  291.  
  292.  job = "Windwalker[" + lvl + "]";
  293.                     Data = IniFile.ReadString("Stats", job);
  294.                     WindwalkerStats.Add(lvl, Data);
  295.  
  296. وبعدين هتروح ع فويد دة
  297. public static void GetStats(
  298.  
  299. وتحت دى
  300.  
  301. case 60: Class = "Monk"; break;
  302.  
  303. هتحط دى
  304.  
  305.  case 160: Class = "Windwalker"; break;
  306.  
  307. وفوق دى
  308.  
  309. else if (Class == "Monk")
  310.  
  311. هتحط دى
  312.  
  313.  else if (Class == "Windwalker")
  314.                 Data = WindwalkerStats[inLevel].Split(',');
  315.  
  316. وهتعمل نقاط شخصية ف ملف Stats.ini
  317.  
  318. ف داتا بيز
  319.  
  320. دة نموذج
  321.  
  322. Windwalker[1]=5,3,2,0
  323. Windwalker[2]=3,6,4,0
  324. Windwalker[3]=4,7,5,0
  325. Windwalker[4]=4,9,6,0
  326. Windwalker[5]=5,10,7,0
  327. Windwalker[6]=6,10,9,0
  328. Windwalker[7]=7,11,10,0
  329. Windwalker[8]=7,13,11,0
  330. Windwalker[9]=8,14,12,0
  331. Windwalker[10]=9,15,13,0
  332. Windwalker[11]=10,16,14,0
  333. Windwalker[12]=10,17,15,0
  334. Windwalker[13]=11,19,16,0
  335. Windwalker[14]=12,20,17,0
  336. Windwalker[15]=13,21,18,0
  337. Windwalker[16]=13,23,19,0
  338. Windwalker[17]=14,24,20,0
  339. Windwalker[18]=15,25,21,0
  340. Windwalker[19]=16,25,23,0
  341. Windwalker[20]=17,26,24,0
  342. Windwalker[21]=18,28,25,0
  343. Windwalker[22]=18,29,26,0
  344. Windwalker[23]=19,30,27,0
  345. Windwalker[24]=19,32,28,0
  346. Windwalker[25]=20,33,29,0
  347. Windwalker[26]=21,34,30,0
  348. Windwalker[27]=22,35,31,0
  349. Windwalker[28]=22,37,32,0
  350. Windwalker[29]=23,38,33,0
  351. Windwalker[30]=24,39,34,0
  352. Windwalker[31]=24,40,36,0
  353. Windwalker[32]=25,41,37,0
  354. Windwalker[33]=26,42,38,0
  355. Windwalker[34]=27,43,39,0
  356. Windwalker[35]=28,44,40,0
  357. Windwalker[36]=28,46,41,0
  358. Windwalker[37]=29,47,42,0
  359. Windwalker[38]=30,48,43,0
  360. Windwalker[39]=31,49,44,0
  361. Windwalker[40]=32,50,45,0
  362. Windwalker[41]=32,52,46,0
  363. Windwalker[42]=33,53,47,0
  364. Windwalker[43]=33,54,48,0
  365. Windwalker[44]=34,55,50,0
  366. Windwalker[45]=35,56,51,0
  367. Windwalker[46]=36,57,52,0
  368. Windwalker[47]=37,58,53,0
  369. Windwalker[48]=37,60,54,0
  370. Windwalker[49]=38,61,55,0
  371. Windwalker[50]=39,62,56,0
  372. Windwalker[51]=40,63,57,0
  373. Windwalker[52]=40,65,58,0
  374. Windwalker[53]=41,66,59,0
  375. Windwalker[54]=42,67,60,0
  376. Windwalker[55]=43,68,61,0
  377. Windwalker[56]=43,69,63,0
  378. Windwalker[57]=44,70,64,0
  379. Windwalker[58]=45,71,65,0
  380. Windwalker[59]=46,72,66,0
  381. Windwalker[60]=46,74,67,0
  382. Windwalker[61]=47,75,68,0
  383. Windwalker[62]=48,76,69,0
  384. Windwalker[63]=49,77,70,0
  385. Windwalker[64]=49,79,71,0
  386. Windwalker[65]=50,80,72,0
  387. Windwalker[66]=51,81,73,0
  388. Windwalker[67]=52,82,74,0
  389. Windwalker[68]=52,84,75,0
  390. Windwalker[69]=53,84,77,0
  391. Windwalker[70]=54,85,78,0
  392. Windwalker[71]=55,86,79,0
  393. Windwalker[72]=55,88,80,0
  394. Windwalker[73]=56,89,81,0
  395. Windwalker[74]=57,90,82,0
  396. Windwalker[75]=58,91,83,0
  397. Windwalker[76]=58,93,84,0
  398. Windwalker[77]=59,94,85,0
  399. Windwalker[78]=60,95,86,0
  400. Windwalker[79]=61,96,87,0
  401. Windwalker[80]=61,98,88,0
  402. Windwalker[81]=62,98,90,0
  403. Windwalker[82]=63,99,91,0
  404. Windwalker[83]=64,100,92,0
  405. Windwalker[84]=64,102,93,0
  406. Windwalker[85]=65,103,94,0
  407. Windwalker[86]=66,104,95,0
  408. Windwalker[87]=67,105,96,0
  409. Windwalker[88]=67,107,97,0
  410. Windwalker[89]=68,108,98,0
  411. Windwalker[90]=69,109,99,0
  412. Windwalker[91]=70,110,100,0
  413. Windwalker[92]=70,112,101,0
  414. Windwalker[93]=71,113,102,0
  415. Windwalker[94]=72,113,104,0
  416. Windwalker[95]=73,114,105,0
  417. Windwalker[96]=73,116,106,0
  418. Windwalker[97]=74,117,107,0
  419. Windwalker[98]=75,118,108,0
  420. Windwalker[99]=76,119,109,0
  421. Windwalker[100]=76,121,110,0
  422. Windwalker[101]=77,122,111,0
  423. Windwalker[102]=78,123,112,0
  424. Windwalker[103]=79,124,113,0
  425. Windwalker[104]=79,126,114,0
  426. Windwalker[105]=80,127,115,0
  427. Windwalker[106]=81,127,117,0
  428. Windwalker[107]=82,128,118,0
  429. Windwalker[108]=82,130,119,0
  430. Windwalker[109]=83,131,120,0
  431. Windwalker[110]=84,132,121,0
  432. Windwalker[111]=85,133,122,0
  433. Windwalker[112]=85,135,123,0
  434. Windwalker[113]=86,136,124,0
  435. Windwalker[114]=87,137,125,0
  436. Windwalker[115]=88,138,126,0
  437. Windwalker[116]=88,140,127,0
  438. Windwalker[117]=89,141,128,0
  439. Windwalker[118]=90,142,129,0
  440. Windwalker[119]=91,142,131,0
  441. Windwalker[120]=91,144,132,0
  442.  
  443. عايز تبدء وتكملة تخمين كمل عايزو كامل زى اونلاين كلم هيما
  444.  
  445. هتدخل ع كلاس ابديت
  446. هضيف دة
  447. public class Flags4
  448.         {//By Mina
  449.             public const ulong
  450.             Omnipotence = 1UL << 192,
  451.             JusticeChant = 1UL << 194,
  452.             BlockFrostGaze = 1UL << 195,
  453.             HealingSnow = 1UL << 196,
  454.             ChillingSnow = 1UL << 197,
  455.             xChillingSnow = 1UL << 198,
  456.             FreezingPelter = 1UL << 200,
  457.             xFreezingPelter = 1UL << 201,
  458.             RevengeTaill = 1UL << 202,
  459.             WindwalkerTop = 1UL << 203,
  460.             ShadowofChaser = 1UL << 204;
  461.         }
  462.  
  463. هتبدل دول بالى عندك
  464. public void AppendFull(byte type, ulong val1, ulong val2, ulong val3, ulong val4)
  465.         {
  466.             UpdateCount = UpdateCount + 1;
  467.             ushort offset = (ushort)(16 + ((UpdateCount - 1) * 28));
  468.             WriteUInt32(type, offset, Buffer);
  469.             WriteUInt64(val1, offset + 4, Buffer);
  470.             WriteUInt64(val2, offset + 12, Buffer);
  471.             WriteUInt64(val3, offset + 20, Buffer);
  472.             WriteUInt64(val4, offset + 28, Buffer);
  473.         }
  474.  
  475.  
  476.  public void Append(ulong val1, ulong val2, ulong val3, uint val4, uint val5, uint val6, uint val7)
  477.         {
  478.             WriteUInt32(val4,  24, Buffer);
  479.             WriteUInt32(val6, 32, Buffer);
  480.         }
  481.  
  482. بعدين هضيف دول ف انتى
  483.  
  484.   private ulong _Stateff4 = 0;
  485.         public ulong StatusFlag4
  486.         {
  487.             get { return _Stateff4; }
  488.             set
  489.             {
  490.                 ulong OldV = StatusFlag4;
  491.                 if (value != OldV)
  492.                 {
  493.                     _Stateff4 = value;
  494.                     WriteUInt64(value, Offset.StatusFlag4, SpawnPacket);
  495.                     UpdateEffects(true);
  496.                 }
  497.             }
  498.         }
  499.         public void AddFlag4(ulong flag)
  500.         {
  501.             StatusFlag4 |= flag;
  502.         }
  503.         public void RemoveFlag4(ulong flag)
  504.         {
  505.             if (ContainsFlag4(flag))
  506.             {
  507.                 StatusFlag4 &= ~flag;
  508.             }
  509.         }
  510.         public bool ContainsFlag4(ulong flag)
  511.         {
  512.             ulong aux = StatusFlag4;
  513.             aux &= ~flag;
  514.             return !(aux == StatusFlag4);
  515.         }
  516.  
  517. وهتبحث عن public void UpdateEffects(bool screen)
  518.  
  519. تبدل دة بالسطر الى زيو
  520.  
  521.  update.AppendFull(0x19, StatusFlag, StatusFlag2, StatusFlag3, StatusFlag4);
  522. هنيجى بقى الاسكلات كاملة والكمال لله واحده هفنتح ملف الهاندل
  523. ونضيف دول
  524. #region WindWalker
  525.                                 #region Chaser
  526.                                 #region ThunderCloud(Passive)
  527.                                 case 12840:
  528.                                     {
  529.                                         if (Time64.Now >= attacker.TCSpellUse.AddSeconds(59))
  530.                                         {
  531.                                             if (CanUseSpell(spell, attacker.Owner))
  532.                                             {
  533.                                                 PrepareSpell(spell, attacker.Owner);
  534.                                                 SpellUse suse = new SpellUse(true);
  535.                                                 suse.Attacker = attacker.UID;
  536.                                                 suse.X = X;
  537.                                                 suse.Y = Y;
  538.                                                 suse.SpellID = spell.ID;
  539.                                                 attacker.Owner.SendScreen(suse, true);
  540.                                                 //////////////////////////////////////////////////
  541.                                                 ///////////////////////////////////////////////////
  542.                                                 uint UID = Kernel.Maps[attacker.MapID].EntityUIDCounter.Next;
  543.                                                 uint Mesh = 980;
  544.                                                 //////////////////////////////////////////////////////
  545.                                                 byte[] Buffer = new byte[68 + 8];
  546.                                                 Writer.Write(Buffer.Length - 8, 0, Buffer);
  547.                                                 Writer.Write(2035, 2, Buffer);//Packet ID
  548.                                                 Writer.Write(UID, 4, Buffer);//FlowerUID
  549.                                                 Writer.Write(4264, 8, Buffer);
  550.                                                 Buffer[12] = 3;
  551.                                                 Writer.Write(Mesh, 16, Buffer);//FloorItemID
  552.                                                 Buffer[24] = 14;//AttackRange
  553.                                                 Writer.Write(X, 26, Buffer);
  554.                                                 Writer.Write(Y, 28, Buffer);
  555.                                                 Writer.Write("Thundercloud", 30, Buffer);
  556.                                                 //////////////////////////////////////////////////
  557.                                                 ///////////////////////////////////////////////////
  558.                                                 //////////////////////////////////////////////////////
  559.                                                 Entity ThunderCloud = new Entity(Game.EntityFlag.Monster, true);
  560.                                                 ThunderCloud.Name = "Thundercloud";
  561.                                                 ThunderCloud.Mesh = Mesh;
  562.                                                 ThunderCloud.UID = UID;
  563.                                                 ThunderCloud.GuildID = attacker.GuildID;
  564.                                                 ThunderCloud.MaxHitpoints = attacker.MaxHitpoints;
  565.                                                 ThunderCloud.Level = 140;
  566.                                                 ThunderCloud.X = X;
  567.                                                 ThunderCloud.Y = Y;
  568.                                                 ThunderCloud.Facing = attacker.Facing;
  569.                                                 ThunderCloud.Boss = 1;
  570.                                                 ThunderCloud.MapID = attacker.MapID;
  571.                                                 Writer.Write(3, 308, ThunderCloud.SpawnPacket);
  572.                                                 Writer.Write(15, 272, ThunderCloud.SpawnPacket);
  573.                                                 Writer.Write(3, 271, ThunderCloud.SpawnPacket);//AttackUser
  574.                                                 //Writer.Write(attacker.Owner.UnionID, 278, ThunderCloud.SpawnPacket);//UnionID
  575.                                                 ThunderCloud.CUID = attacker.UID;
  576.                                                 ThunderCloud.Owner = new Client.GameClient(null);
  577.                                                 ThunderCloud.Owner.Entity = ThunderCloud;
  578.                                                 ThunderCloud.MonsterInfo = new MonsterInformation();
  579.                                                 ThunderCloud.MonsterInfo.AttackType = 24;
  580.                                                 ThunderCloud.MonsterInfo.AttackSpeed = 1000;
  581.                                                 ThunderCloud.MonsterInfo.AttackRange = 14;
  582.                                                 ThunderCloud.MonsterInfo.Boss = true;
  583.                                                 ThunderCloud.MonsterInfo.BoundX = X;
  584.                                                 ThunderCloud.Companion = true;
  585.                                                 ThunderCloud.MonsterInfo.Guard = false;
  586.                                                 ThunderCloud.MonsterInfo.BoundY = Y;
  587.                                                 ThunderCloud.MonsterInfo.Defence = attacker.Defence;
  588.                                                 ThunderCloud.MonsterInfo.Hitpoints = 10000;
  589.                                                 ThunderCloud.MonsterInfo.Mesh = 980;
  590.                                                 ThunderCloud.MonsterInfo.MoveSpeed = int.MaxValue;
  591.                                                 ThunderCloud.MonsterInfo.Name = "Thundercloud";
  592.                                                 ThunderCloud.MonsterInfo.Owner = attacker;
  593.                                                 ThunderCloud.MonsterInfo.ViewRange = 14;
  594.                                                 ThunderCloud.MonsterInfo.RespawnTime = 0;
  595.                                                 ThunderCloud.MonsterInfo.RunSpeed = int.MaxValue;
  596.                                                 ThunderCloud.MonsterInfo.SpellID = 13190;
  597.                                                 ThunderCloud.Hitpoints = 10000;
  598.                                                 Kernel.Maps[ThunderCloud.MapID].AddEntity(ThunderCloud);
  599.                                                 //////////////////////////////////////////////////////////////
  600.                                                 //////////////////////////////////////////////////////////
  601.                                                 //////////////////////////////////////////////////////////
  602.                                                 /////////////////////////////////////////////
  603.                                                 Network.GamePackets.Data d = new Data(true);
  604.                                                 d.UID = UID;
  605.                                                 d.ID = Data.AddEntity;
  606.                                                 d.Facing = attacker.Facing;
  607.                                                 d.X2 = ThunderCloud.X;
  608.                                                 d.Y2 = ThunderCloud.Y;
  609.                                                 ///////////////////////////////////////////////
  610.                                                 ////////////////////////////////////////////
  611.                                                 /////////////////////////////////////////
  612.                                                 attacker.Owner.SendScreen(Buffer, true);
  613.                                                 attacker.Owner.SendScreen(ThunderCloud.SpawnPacket, true);
  614.                                                 attacker.Owner.SendScreenSpawn(ThunderCloud, true);
  615.                                                 attacker.Owner.SendScreen(d, true);
  616.                                                 ThunderCloud.ThunderCloudStamp = Time64.Now;
  617.                                                 Program.World.Register(ThunderCloud);
  618.                                                 attacker.AttackPacket = null;
  619.                                             }
  620.                                         }
  621.                                         break;
  622.  
  623.                                     }
  624.                                 #endregion
  625.                                 #region ShadowofChaser(Active)
  626.                                 case 13090:
  627.                                     {
  628.                                         if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser))
  629.                                         {
  630.                                             attacker.RemoveFlag4(Update.Flags4.ShadowofChaser);
  631.                                             attacker.AttackPacket = null;
  632.                                             break;
  633.                                         }
  634.                                         if (CanUseSpell(spell, attacker.Owner))
  635.                                         {
  636.                                             PrepareSpell(spell, attacker.Owner);
  637.                                             SpellUse suse = new SpellUse(true);
  638.                                             suse.Attacker = attacker.UID;
  639.                                             suse.Attacker1 = attacker.UID;
  640.                                             suse.SpellID = spell.ID;
  641.                                             suse.SpellLevel = spell.Level;
  642.                                             suse.AddTarget(attacker.UID, 0, attack);
  643.                                             attack = new Attack(true);
  644.                                             attack.Attacker = attack.Attacked = attacker.UID;
  645.                                             attack.X = attacker.X; attack.Y = attacker.Y;
  646.                                             attack.AttackType = 24;
  647.                                             attack.SpellID = spell.ID;
  648.                                             attacker.Owner.SendScreen(suse, true);
  649.                                             attacker.AddFlag4(Update.Flags4.ShadowofChaser);
  650.                                             attacker.AttackPacket = null;
  651.                                         }
  652.                                         break;
  653.                                     }
  654.                                 #endregion
  655.                                 #region TripleBlasts(Passive)
  656.                                 case 12850:
  657.                                     {
  658.                                         if (CanUseSpell(spell, attacker.Owner))
  659.                                         {
  660.                                             PrepareSpell(spell, attacker.Owner);
  661.                                             SpellUse suse = new SpellUse(true);
  662.                                             suse.Attacker = attacker.UID;
  663.                                             suse.Attacker1 = attackedsob == null ? attacked.UID : attackedsob.UID;
  664.                                             suse.SpellID = spell.ID;
  665.                                             suse.SpellLevel = spell.Level;
  666.                                             suse.X = X;
  667.                                             suse.Y = Y;
  668.                                             if (attackedsob == null)
  669.                                             {
  670.                                                 if (CanAttack(attacker, attacked, spell, false))
  671.                                                 {
  672.                                                     if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
  673.                                                     {
  674.                                                         var spell2 = Database.SpellTable.GetSpell(13090, attacker.Owner);
  675.                                                         if (spell2 != null)
  676.                                                         {
  677.                                                             spell2.CanKill = true;
  678.                                                             if (Kernel.Rate(spell2.Percent))
  679.                                                             {
  680.                                                                 ShadowofChaser(attacker, attacked, attack, 1);
  681.                                                                 break;
  682.                                                             }
  683.                                                         }
  684.                                                     }
  685.  
  686.                                                     uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  687.                                                     damage = (uint)(damage * 0.2);
  688.  
  689.                                                     ReceiveAttack(attacker, attacked, attack,damage, spell);
  690.                                                     suse.AddTarget(attacked.UID, damage, attack);
  691.                                                     attacker.Owner.SendScreen(suse, true);
  692.                                                 }
  693.                                             }
  694.                                             else
  695.                                             {
  696.                                                 if (CanAttack(attacker, attackedsob, spell))
  697.                                                 {
  698.  
  699.                                                     uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  700.  
  701.                                                     ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  702.                                                     suse.AddTarget(attacked.UID, damage, attack);
  703.                                                     attacker.Owner.SendScreen(suse, true);
  704.                                                 }
  705.                                             }
  706.  
  707.                                         }
  708.                                         break;
  709.                                     }
  710.                                 #endregion
  711.                                 #region swirlingStor
  712.                                 case 12890:
  713.                                     {
  714.                                         if (CanUseSpell(spell, attacker.Owner))
  715.                                         {
  716.                                             PrepareSpell(spell, attacker.Owner);
  717.                                             SpellUse suse = new SpellUse(true);
  718.                                             spell.UseStamina = 40;
  719.                                             suse.Attacker = attacker.UID;
  720.                                             suse.SpellID = spell.ID;
  721.                                             suse.SpellLevel = spell.Level;
  722.                                             suse.X = X;
  723.                                             suse.Y = Y;
  724.                                             Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
  725.                                             sector.Arrange(spell.Sector, spell.Distance);
  726.                                             {
  727.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  728.                                                 {
  729.                                                     if (_obj == null)
  730.                                                         continue;
  731.                                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  732.                                                     {
  733.                                                         attacked = _obj as Entity;
  734.                                                         if (sector.Inside(attacked.X, attacked.Y))
  735.                                                         {
  736.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  737.                                                             {
  738.                                                                 attack.Effect = Attack.AttackEffects.None;
  739.                                                                 uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  740.                                                                 damage = (uint)(damage - spell.Power / 10);
  741.                                                                 suse.Effect = attack.Effect;
  742.                                                                 ReceiveAttack(attacker, attacked, attack, damage, spell);
  743.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  744.                                                             }
  745.                                                         }
  746.                                                     }
  747.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  748.                                                     {
  749.                                                         attackedsob = _obj as SobNpcSpawn;
  750.                                                         if (sector.Inside(attackedsob.X, attackedsob.Y))
  751.                                                         {
  752.                                                             if (CanAttack(attacker, attackedsob, spell))
  753.  
  754.                                                                 attack.Effect = Attack.AttackEffects.None;
  755.                                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  756.                                                             damage = (uint)(damage - spell.Power / 10);
  757.                                                             suse.Effect = attack.Effect;
  758.                                                             suse.AddTarget(attackedsob.UID, damage, attack);
  759.                                                             attacker.Owner.SendScreen(suse, true);
  760.                                                         }
  761.                                                     }
  762.                                                 }
  763.                                             }
  764.                                             attacker.Owner.SendScreen(suse, true);
  765.                                         }
  766.                                         break;
  767.                                     }
  768.                                 #endregion
  769.                                 #region ThunderBolt(Active)
  770.                                 case 12970:
  771.                                     {
  772.                                         if (!attacker.Owner.Spells.ContainsKey(12840)) break;
  773.                                         foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  774.                                         {
  775.                                             if (th.CUID == attacker.UID)
  776.                                             {
  777.                                                 if (Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) <= th.MonsterInfo.AttackRange)
  778.                                                 {
  779.                                                     if (CanUseSpell(spell, attacker.Owner))
  780.                                                     {
  781.                                                         PrepareSpell(spell, attacker.Owner);
  782.                                                         SpellUse suse = new SpellUse(true);
  783.                                                         suse.Attacker = attacker.UID;
  784.                                                         suse.X = X;
  785.                                                         suse.Y = Y;
  786.                                                         suse.SpellID = spell.ID;
  787.                                                         suse.AddTarget(th.UID, 0, null);
  788.                                                         Writer.Write(128, 50, th.SpawnPacket);//Flag4(128)
  789.                                                         attacker.Owner.SendScreen(suse, true);
  790.                                                         attacker.AttackPacket = null;
  791.                                                         foreach (var client in Kernel.GamePool.Values.Where(i => Kernel.GetDistance(th.X, th.Y, i.Entity.X, i.Entity.Y) < 17))
  792.                                                         {
  793.                                                             client.Send(th.SpawnPacket);
  794.                                                         }
  795.  
  796.                                                     }
  797.                                                 }
  798.                                             }
  799.                                         }
  800.                                         break;
  801.                                     }
  802.                                 #endregion
  803.                                 #region Omnipotence(XP)
  804.                                 case 12860:
  805.                                     {
  806.                                         SpellUse suse = new SpellUse(true);
  807.                                         suse.Attacker = attacker.UID;
  808.                                         suse.SpellID = spell.ID;
  809.                                         suse.SpellLevel = spell.Level;
  810.                                         suse.X = X;
  811.                                         suse.Y = Y;
  812.                                         if (attacker.ContainsFlag(Update.Flags.XPList))
  813.                                         {
  814.                                             attacker.AddFlag4(Update.Flags4.Omnipotence);
  815.                                             attacker.OmnipotenceStamp = Time64.Now;
  816.                                             attacker.RemoveFlag(Update.Flags.XPList);
  817.                                             attacker.Owner.SendScreen(suse, true);
  818.                                         }
  819.                                         else
  820.                                         {
  821.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
  822.                                             {
  823.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  824.                                                 {
  825.                                                     if (_obj == null) continue;
  826.                                                     if (_obj.MapObjType == MapObjectType.Player)
  827.                                                     {
  828.                                                         attacked = _obj as Entity;
  829.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  830.                                                         {
  831.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  832.                                                             {
  833.  
  834.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell) / 10;
  835.  
  836.                                                                 ReceiveAttack(attacker, attacked, attack,  damage, spell);
  837.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  838.                                                             }
  839.                                                         }
  840.                                                     }
  841.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  842.                                                     {
  843.                                                         attackedsob = _obj as SobNpcSpawn;
  844.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
  845.                                                         {
  846.                                                             if (CanAttack(attacker, attackedsob, spell))
  847.                                                             {
  848.  
  849.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * 350 / 100;
  850.  
  851.  
  852.                                                                 ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  853.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  854.                                                             }
  855.                                                         }
  856.                                                     }
  857.                                                     else if (_obj.MapObjType == MapObjectType.Monster)
  858.                                                     {
  859.                                                         attacked = _obj as Entity;
  860.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  861.                                                         {
  862.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  863.                                                             {
  864.  
  865.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * 350 / 100;
  866.  
  867.                                                                 ReceiveAttack(attacker, attacked, attack, damage, spell);
  868.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  869.                                                             }
  870.                                                         }
  871.                                                     }
  872.                                                 }
  873.                                             }
  874.                                         }
  875.                                         attacker.Owner.SendScreen(suse, true);
  876.                                         attacker.AttackPacket = null;
  877.                                         break;
  878.                                     }
  879.                                 #endregion
  880.                                 #region FrostGaze(I-II-III)
  881.                                 case 12830:
  882.                                 case 13070:
  883.                                 case 13080:
  884.                                     {
  885.                                         if (CanUseSpell(spell, attacker.Owner))
  886.                                         {
  887.                                             PrepareSpell(spell, attacker.Owner);
  888.                                             SpellUse suse = new SpellUse(true);
  889.                                             suse.Attacker = attacker.UID;
  890.                                             suse.SpellID = spell.ID;
  891.                                             suse.SpellLevel = spell.Level;
  892.                                             suse.X = X;
  893.                                             suse.Y = Y;
  894.                                             attacker.Owner.SendScreen(suse, true);
  895.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  896.                                             {
  897.                                                 if (_obj == null)
  898.                                                     continue;
  899.                                                 if (_obj.MapObjType == MapObjectType.Player)
  900.                                                 {
  901.                                                     attacked = _obj as Entity;
  902.  
  903.                                                     if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  904.                                                     {
  905.                                                         if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  906.                                                         {
  907.                                                             int Rate = 100;
  908.                                                             int diff = attacked.BattlePower - attacker.BattlePower;
  909.                                                             if (diff < 0) diff = 0;
  910.                                                             Rate -= (byte)(diff * 5);
  911.                                                             if (Rate < 0) Rate = 0;
  912.                                                             if (Kernel.Rate(Rate))
  913.                                                             {
  914.                                                                 if (attacked.Stamina >= (byte)spell.Power)
  915.                                                                     attacked.Stamina -= (byte)spell.Power;
  916.                                                                 else attacked.Stamina = 0;
  917.                                                             }
  918.                                                         }
  919.                                                     }
  920.                                                 }
  921.                                             }
  922.                                         }
  923.                                         break;
  924.                                     }
  925.                                 #endregion
  926.                                 #endregion
  927.                                 #region Stomper
  928.                                 #region ChillingSnow(Active)
  929.                                 case 12960:
  930.                                     {
  931.                                         if (attacker.ContainsFlag4(Update.Flags4.ChillingSnow))
  932.                                         {
  933.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  934.                                             attacker.AttackPacket = null;
  935.                                             break;
  936.                                         }
  937.                                         if (CanUseSpell(spell, attacker.Owner))
  938.                                         {
  939.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  940.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  941.                                             PrepareSpell(spell, attacker.Owner);
  942.                                             SpellUse suse = new SpellUse(true);
  943.                                             suse.Attacker = attacker.UID;
  944.                                             suse.Attacker1 = attacker.UID;
  945.                                             suse.SpellID = spell.ID;
  946.                                             suse.SpellLevel = spell.Level;
  947.                                             suse.X = X;
  948.                                             suse.Y = Y;
  949.                                             suse.AddTarget(attacker.UID, 0, attack);
  950.                                             attacker.Owner.SendScreen(suse, true);
  951.                                             attacker.AddFlag4(Update.Flags4.ChillingSnow);
  952.                                             attacker.AttackPacket = null;
  953.                                         }
  954.                                         break;
  955.                                     }
  956.                                 #endregion
  957.                                 #region HealingSnow(Active)
  958.                                 case 12950:
  959.                                     {
  960.                                         if (attacker.ContainsFlag4(Update.Flags4.HealingSnow))
  961.                                         {
  962.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  963.                                             attacker.AttackPacket = null;
  964.                                             break;
  965.                                         }
  966.                                         if (CanUseSpell(spell, attacker.Owner))
  967.                                         {
  968.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  969.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  970.                                             PrepareSpell(spell, attacker.Owner);
  971.                                             SpellUse suse = new SpellUse(true);
  972.                                             suse.Attacker = attacker.UID;
  973.                                             suse.Attacker1 = attacker.UID;
  974.                                             suse.SpellID = spell.ID;
  975.                                             suse.SpellLevel = spell.Level;
  976.                                             suse.X = X;
  977.                                             suse.Y = Y;
  978.                                             suse.AddTarget(attacker.UID, 0, attack);
  979.                                             attacker.Owner.SendScreen(suse, true);
  980.                                             attacker.AddFlag4(Update.Flags4.HealingSnow);
  981.                                             attacker.AttackPacket = null;
  982.                                         }
  983.                                         break;
  984.                                     }
  985.                                 #endregion
  986.                                 #region FreezingPelter(Active)
  987.                                 case 13020:
  988.                                     {
  989.                                         if (attacker.ContainsFlag4(Update.Flags4.FreezingPelter))
  990.                                         {
  991.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  992.                                             attacker.Owner.LoadItemStats();
  993.                                             attacker.AttackPacket = null;
  994.                                             break;
  995.                                         }
  996.                                         if (CanUseSpell(spell, attacker.Owner))
  997.                                         {
  998.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  999.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  1000.                                             PrepareSpell(spell, attacker.Owner);
  1001.                                             SpellUse suse = new SpellUse(true);
  1002.                                             suse.Attacker = attacker.UID;
  1003.                                             suse.Attacker1 = attacker.UID;
  1004.                                             suse.SpellID = spell.ID;
  1005.                                             suse.SpellLevel = spell.Level;
  1006.                                             suse.X = X;
  1007.                                             suse.Y = Y;
  1008.                                             suse.AddTarget(attacker.UID, 0, attack);
  1009.                                             attacker.Owner.SendScreen(suse, true);
  1010.                                             attacker.AddFlag4(Update.Flags4.FreezingPelter);
  1011.                                             attacker.Owner.LoadItemStats();
  1012.                                             attacker.AttackPacket = null;
  1013.                                         }
  1014.                                         break;
  1015.                                     }
  1016.                                 #endregion
  1017.                                 #region RevengeTail(Active)
  1018.                                 case 13030:
  1019.                                     {
  1020.                                         if (CanUseSpell(spell, attacker.Owner))
  1021.                                         {
  1022.                                             PrepareSpell(spell, attacker.Owner);
  1023.                                             SpellUse suse = new SpellUse(true);
  1024.                                             suse.Attacker = attacker.UID;
  1025.                                             suse.Attacker1 = attacker.UID;
  1026.                                             suse.SpellID = spell.ID;
  1027.                                             suse.SpellLevel = spell.Level;
  1028.                                             suse.X = X;
  1029.                                             suse.Y = Y;
  1030.                                             suse.AddTarget(attacker.UID, 0, attack);
  1031.                                             attacker.Owner.SendScreen(suse, true);
  1032.                                             attacker.AddFlag4(Update.Flags4.RevengeTaill);
  1033.                                             attacker.RevengeTaillStamp = Time64.Now;
  1034.                                             attacker.AttackPacket = null;
  1035.                                         }
  1036.                                         break;
  1037.                                     }
  1038.                                 #endregion
  1039.                                 #region BurntFrost(Passive)
  1040.                                 case 12940:
  1041.                                     {
  1042.                                         if (CanUseSpell(spell, attacker.Owner))
  1043.                                         {
  1044.                                             PrepareSpell(spell, attacker.Owner);
  1045.  
  1046.  
  1047.                                             SpellUse suse = new SpellUse(true);
  1048.                                             suse.Attacker = attacker.UID;
  1049.                                             suse.SpellID = spell.ID;
  1050.                                             suse.SpellLevel = spell.Level;
  1051.                                             suse.X = X;
  1052.                                             suse.Y = Y;
  1053.                                             Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  1054.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
  1055.                                             {
  1056.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1057.                                                 {
  1058.                                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1059.                                                     {
  1060.                                                         if (_obj == null)
  1061.                                                             continue;
  1062.                                                         attacked = _obj as Entity;
  1063.                                                         if (attacked == null) continue;
  1064.                                                         if (sector.IsInFan(attacked.X, attacked.Y))
  1065.                                                         {
  1066.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  1067.                                                             {
  1068.  
  1069.                                                                 uint damage = Calculate.Melee(attacker, attacked, ref attack, spell);
  1070.                                                                 damage = (uint)(damage * 0.6);
  1071.                                                                 ReceiveAttack(attacker, attacked, attack,damage, spell);
  1072.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  1073.                                                             }
  1074.                                                         }
  1075.                                                     }
  1076.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  1077.                                                     {
  1078.                                                         if (_obj == null)
  1079.                                                             continue;
  1080.                                                         attackedsob = _obj as SobNpcSpawn;
  1081.                                                         if (attackedsob == null) continue;
  1082.                                                         if (sector.IsInFan(attackedsob.X, attackedsob.Y))
  1083.                                                         {
  1084.                                                             if (CanAttack(attacker, attackedsob, spell))
  1085.                                                             {
  1086.  
  1087.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  1088.  
  1089.                                                                 ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1090.                                                                 suse.AddTarget(attackedsob.UID, damage, attack);
  1091.                                                             }
  1092.                                                         }
  1093.                                                     }
  1094.                                                 }
  1095.                                             }
  1096.                                             attacker.Owner.SendScreen(suse, true);
  1097.                                             attacker.AttackPacket = null;
  1098.                                         }
  1099.                                         break;
  1100.                                     }
  1101.                                 #endregion
  1102.                                 #region RageofWar(Passive)
  1103.                                 case 12930:
  1104.                                     {
  1105.                                         if (CanUseSpell(spell, attacker.Owner))
  1106.                                         {
  1107.                                             PrepareSpell(spell, attacker.Owner);
  1108.                                             Game.Attacking.InLineAlgorithm ila = new Game.Attacking.InLineAlgorithm(attacker.X,
  1109.                                         X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  1110.                                             SpellUse suse = new SpellUse(true);
  1111.                                             suse.Attacker = attacker.UID;
  1112.                                             suse.SpellID = SpellID;
  1113.                                             suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
  1114.                                             suse.X = X;
  1115.                                             suse.Y = Y;
  1116.                                             attacker.Owner.SendScreen(suse, true);
  1117.                                             bool first = false;
  1118.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1119.                                             {
  1120.                                                 if (_obj == null)
  1121.                                                     continue;
  1122.                                                 if (_obj.MapObjType == MapObjectType.Player)
  1123.                                                 {
  1124.                                                     attacked = _obj as Entity;
  1125.                                                     if (ila.InLine(attacked.X, attacked.Y))
  1126.                                                     {
  1127.                                                         if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  1128.                                                             continue;
  1129.                                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue;
  1130.                                                         if (!first)
  1131.                                                         {
  1132.                                                             var map = Kernel.Maps[attacker.MapID];
  1133.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  1134.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1135.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  1136.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1137.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  1138.                                                             flooritem.X = attacked.X;
  1139.                                                             flooritem.MapID = map.ID;
  1140.                                                             flooritem.Y = attacked.Y;
  1141.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  1142.                                                             flooritem.Type = FloorItem.Effect;
  1143.                                                             flooritem.mColor = 15;
  1144.                                                             flooritem.OwnerUID = attacker.UID;
  1145.                                                             flooritem.OnFloor = Time64.Now;
  1146.                                                             flooritem.Owner = attacker.Owner;
  1147.                                                             flooritem.Name2 = "RageofWarTrap";
  1148.                                                             map.AddFloorItem(flooritem);
  1149.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  1150.                                                             first = true;
  1151.                                                         }
  1152.                                                         uint damage = Calculate.Melee(attacker, attacked, ref attack, spell);
  1153.                                                         damage = (uint)(damage * 0.6);
  1154.                                                         attack.Damage = damage;
  1155.                                                         ReceiveAttack(attacker, attacked, attack,damage, spell);
  1156.  
  1157.                                                         suse.AddTarget(attacked.UID, damage, attack);
  1158.                                                     }
  1159.                                                 }
  1160.                                                 else if (_obj.MapObjType == MapObjectType.Monster)
  1161.                                                 {
  1162.                                                     attacked = _obj as Entity;
  1163.                                                     if (ila.InLine(attacked.X, attacked.Y))
  1164.                                                     {
  1165.                                                         if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  1166.                                                             continue;
  1167.                                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue;
  1168.                                                         if (!first)
  1169.                                                         {
  1170.                                                             var map = Kernel.Maps[attacker.MapID];
  1171.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  1172.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1173.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  1174.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1175.  
  1176.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  1177.                                                             flooritem.X = attacked.X;
  1178.                                                             flooritem.MapID = map.ID;
  1179.                                                             flooritem.Y = attacked.Y;
  1180.                                                             flooritem.Type = FloorItem.Effect;
  1181.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  1182.                                                             flooritem.mColor = 15;
  1183.                                                             flooritem.OwnerUID = attacker.UID;
  1184.                                                             flooritem.OnFloor = Time64.Now;
  1185.                                                             flooritem.Owner = attacker.Owner;
  1186.                                                             flooritem.Name2 = "RageofWarTrap";
  1187.                                                             map.AddFloorItem(flooritem);
  1188.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  1189.                                                             first = true;
  1190.                                                         }
  1191.  
  1192.                                                         uint damage = (uint)(Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) * (spell.Power - 30000) / 100);
  1193.  
  1194.  
  1195.                                                         attack.Damage = damage;
  1196.  
  1197.                                                         ReceiveAttack(attacker, attacked, attack,damage, spell);
  1198.  
  1199.                                                         suse.AddTarget(attacked.UID, damage, attack);
  1200.                                                     }
  1201.  
  1202.  
  1203.                                                 }
  1204.                                                 else if (_obj.MapObjType == MapObjectType.SobNpc)
  1205.                                                 {
  1206.                                                     attackedsob = _obj as SobNpcSpawn;
  1207.                                                     if (attackedsob == null) continue;
  1208.                                                     if (ila.InLine(attackedsob.X, attackedsob.Y))
  1209.                                                     {
  1210.                                                         if (!CanAttack(attacker, attackedsob, spell))
  1211.                                                             continue;
  1212.                                                         if (Kernel.GetDistance(attackedsob.X, attackedsob.Y, attacker.X, attacker.Y) > 11) continue;
  1213.                                                         if (!first)
  1214.                                                         {
  1215.                                                             var map = Kernel.Maps[attacker.MapID];
  1216.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  1217.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1218.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  1219.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1220.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  1221.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  1222.                                                             flooritem.X = attackedsob.X;
  1223.                                                             flooritem.MapID = map.ID;
  1224.                                                             flooritem.Y = attackedsob.Y;
  1225.                                                             flooritem.Type = FloorItem.Effect;
  1226.                                                             flooritem.mColor = 15;
  1227.                                                             flooritem.OwnerUID = attacker.UID;
  1228.                                                             flooritem.OnFloor = Time64.Now;
  1229.                                                             flooritem.Owner = attacker.Owner;
  1230.                                                             flooritem.Name2 = "RageofWarTrap";
  1231.                                                             map.AddFloorItem(flooritem);
  1232.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  1233.                                                             first = true;
  1234.                                                         }
  1235.  
  1236.                                                         uint damage = (uint)(Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * (spell.Power - 30000) / 100);
  1237.  
  1238.  
  1239.                                                         attack.Damage = damage;
  1240.  
  1241.                                                         ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1242.  
  1243.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1244.                                                     }
  1245.  
  1246.  
  1247.                                                 }
  1248.                                             }
  1249.                                             attacker.Owner.SendScreen(suse, true);
  1250.                                             attacker.AttackPacket = null;
  1251.                                         }
  1252.                                         break;
  1253.                                     }
  1254.                                 #endregion
  1255.                                 #endregion
  1256.                                 #endregion
  1257. هتيجى تقولى ايه ده ياعم فيه ايرورات ظاهرها هقولك تعالى لسه هنعمل سيرش على كود ده
  1258.   public static bool Allyss(Entity attacker, Entity attacked)
  1259. هنقفله بعلامة السالب وتحتية هنضيف كود ده
  1260.    public static void ShadowofChaser(Entity attacker, Entity attacked, Attack attack, byte oneortwo)
  1261.         {
  1262.             #region ShadowofChaser(Active)
  1263.             IMapObject lastAttacked = attacked;
  1264.             if (oneortwo == 1)
  1265.             {
  1266.                 if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
  1267.                 {
  1268.                     #region FloorItem
  1269.                     var map = Kernel.Maps[attacker.MapID];
  1270.                     Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  1271.                     flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1272.                     while (map.Npcs.ContainsKey(flooritem.UID))
  1273.                         flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1274.  
  1275.                     flooritem.ItemID = FloorItem.ShadowofChaser;
  1276.                     flooritem.X = lastAttacked.X;
  1277.                     flooritem.MapID = attacker.MapID;
  1278.                     flooritem.Y = lastAttacked.Y;
  1279.                     flooritem.Type = FloorItem.Effect;
  1280.                     flooritem.mColor = 14;
  1281.                     flooritem.FlowerType = 3;
  1282.                     flooritem.Unknown37 = 1;
  1283.                     flooritem.MapObjType = MapObjectType.FloorSpell;
  1284.                     flooritem.Attack = attack;
  1285.                     flooritem.OwnerUID = attacker.UID;
  1286.                     flooritem.Owner = attacker.Owner;
  1287.                     flooritem.OwnerGuildUID = attacker.GuildID;
  1288.                     flooritem.OnFloor = Time64.Now;
  1289.                     flooritem.Name2 = "ShadowofChaser";
  1290.                     flooritem.ShadowofChaserAttacked = attacked;
  1291.                     flooritem.ShadowofChaserAttacker = attacker;
  1292.                     attacker.Owner.Map.AddFloorItem(flooritem);
  1293.                     attacker.Owner.SendScreenSpawn(flooritem, true);
  1294.                     #endregion
  1295.                     return;
  1296.                 }
  1297.             }
  1298.             else if (oneortwo == 2)
  1299.             {
  1300.                 var spell = Database.SpellTable.GetSpell(13090, attacker.Owner);
  1301.                 SpellUse suse = new SpellUse(true);
  1302.                 suse.Attacker = attacker.UID;
  1303.                 suse.Attacker1 = attacker.UID;
  1304.                 suse.SpellID = spell.ID;
  1305.                 suse.SpellLevel = spell.Level;
  1306.                 if (CanAttack(attacker, attacked, spell, false))
  1307.                 {
  1308.                     lastAttacked = attacked;
  1309.                     var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  1310.                     Handle.ReceiveAttack(attacker, attacked, attack,damage, spell);
  1311.                     suse.AddTarget(attacked.UID, damage, null);
  1312.                 }
  1313.                 attacker.Owner.SendScreen(suse, true);
  1314.                 SpellUse suse2 = new SpellUse(true);
  1315.                 suse2.Attacker = attacker.UID;
  1316.                 suse2.SpellID = spell.ID;
  1317.                 suse2.SpellLevel = spell.Level;
  1318.                 suse2.X = attacked.X;
  1319.                 suse2.Y = attacked.Y;
  1320.                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1321.                 {
  1322.                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1323.                     {
  1324.                         if (_obj == null) continue;
  1325.                         var attacked1 = _obj as Entity;
  1326.                         if (lastAttacked.UID == attacked1.UID) continue;
  1327.                         if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 4)
  1328.                         {
  1329.                             if (CanAttack(attacker, attacked1, spell, false))
  1330.                             {
  1331.                                 var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  1332.                                 ReceiveAttack(attacker, attacked1, attack, damage, spell);
  1333.                                 suse2.AddTarget(attacked1.UID, damage, null);
  1334.                             }
  1335.                         }
  1336.                     }
  1337.                 }
  1338.                 attacker.Owner.SendScreen(suse2, true);
  1339.             }
  1340.             #endregion
  1341.             attacker.AttackPacket = null;
  1342.         }
  1343. بعدين هنعمل سيرش على كود ده
  1344.  #region Kinetic Spark
  1345. تحتيه
  1346.  #region ShadowofChaser
  1347.                             if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser))
  1348.                             {
  1349.                                 var spell = Database.SpellTable.GetSpell(13090, attacker.Owner);
  1350.                                 if (spell != null)
  1351.                                 {
  1352.                                     spell.CanKill = true;
  1353.                                     if (Kernel.Rate(spell.Percent))
  1354.                                     {
  1355.                                         SpellUse suse = new SpellUse(true);
  1356.                                         suse.Attacker = attacker.UID;
  1357.                                         suse.SpellID = spell.ID;
  1358.                                         suse.SpellLevel = spell.Level;
  1359.                                         suse.X = attacker.X;
  1360.                                         suse.Y = attacker.Y;
  1361.                                         IMapObject lastAttacked = attacker;
  1362.                                         /*****************/
  1363.                                         attacker.Owner.SendScreen(suse, true);
  1364.                                         ushort _X = attacker.X, _Y = attacker.Y;
  1365.                                         ushort _tX = X, _tY = Y;
  1366.                                         // byte dist = 18;
  1367.                                         var Array = attacker.Owner.Screen.Objects;
  1368.                                         var map = attacker.Owner.Map;
  1369.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  1370.                                         // return;
  1371.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  1372.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  1373.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  1374.                                         // InLineAlgorithm.Algorithm.DDA);
  1375.                                         var count = (double)algo.lcoords.Count / 1;
  1376.                                         for (int i = 0; i < 1; i++)
  1377.                                         {
  1378.                                             var selected = i * (int)count;
  1379.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  1380.                                             X = (ushort)algo.lcoords[selected].X;
  1381.                                             Y = (ushort)algo.lcoords[selected].Y;
  1382.                                             FloorItem floorItem = new FloorItem(true);
  1383.                                             floorItem.ItemID = 1550;
  1384.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  1385.                                             floorItem.MapID = attacker.MapID;
  1386.                                             floorItem.Type = FloorItem.Effect;
  1387.                                             floorItem.X = X;
  1388.                                             floorItem.Y = Y;
  1389.                                             floorItem.OnFloor = Time64.Now;
  1390.                                             floorItem.Owner = attacker.Owner;
  1391.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  1392.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1393.                                             map.AddFloorItem(floorItem);
  1394.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  1395.                                         }
  1396.                                         /****************/
  1397.                                         uint p = 0;
  1398.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  1399.                                         {
  1400.                                             lastAttacked = attacked;
  1401.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  1402.                                             suse.Effect = attack.Effect;
  1403.                                             damage = damage - damage * (p += 20) / 100;
  1404.                                             Handle.ReceiveAttack(attacker, attacked, attack,  damage, spell);
  1405.                                             suse.AddTarget(attacked.UID, damage, attack);
  1406.                                         }
  1407.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1408.                                         {
  1409.                                             if (_obj == null) continue;
  1410.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1411.                                             {
  1412.                                                 if (_obj.UID == attacked.UID) continue;
  1413.                                                 var attacked1 = _obj as Entity;
  1414.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  1415.                                                 {
  1416.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  1417.                                                     {
  1418.                                                         lastAttacked = attacked1;
  1419.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  1420.                                                         suse.Effect = attack.Effect;
  1421.                                                         damage = damage + damage * (p += 20) / 100;
  1422.                                                         if (damage == 0) break;
  1423.                                                         Handle.ReceiveAttack(attacker, attacked1, attack,  damage, spell);
  1424.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  1425.                                                     }
  1426.                                                 }
  1427.                                             }
  1428.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  1429.                                             {
  1430.                                                 attackedsob = _obj as SobNpcSpawn;
  1431.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  1432.                                                 {
  1433.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  1434.                                                     {
  1435.                                                         lastAttacked = attackedsob;
  1436.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  1437.                                                         suse.Effect = attack.Effect;
  1438.                                                         damage = damage + damage * (p += 20) / 100;
  1439.                                                         if (damage == 0) break;
  1440.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1441.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1442.                                                     }
  1443.                                                 }
  1444.                                             }
  1445.                                         }
  1446.                                         attacker.Owner.SendScreen(suse, true);
  1447.                                         return;
  1448.                                     }
  1449.                                 }
  1450.                             }
  1451.                             #endregion
  1452.                             #region  RageofWar
  1453.                             if (attacker.ContainsFlag4(Update.Flags4.RageofWar))
  1454.                             {
  1455.                                 var spell = Database.SpellTable.GetSpell(12930, attacker.Owner);
  1456.                                 if (spell != null)
  1457.                                 {
  1458.                                     spell.CanKill = true;
  1459.                                     if (Kernel.Rate(spell.Percent))
  1460.                                     {
  1461.                                         SpellUse suse = new SpellUse(true);
  1462.                                         suse.Attacker = attacker.UID;
  1463.                                         suse.SpellID = spell.ID;
  1464.                                         suse.SpellLevel = spell.Level;
  1465.                                         suse.X = attacker.X;
  1466.                                         suse.Y = attacker.Y;
  1467.                                         IMapObject lastAttacked = attacker;
  1468.                                         /*****************/
  1469.                                         attacker.Owner.SendScreen(suse, true);
  1470.                                         ushort _X = attacker.X, _Y = attacker.Y;
  1471.                                         ushort _tX = X, _tY = Y;
  1472.                                         // byte dist = 18;
  1473.                                         var Array = attacker.Owner.Screen.Objects;
  1474.                                         var map = attacker.Owner.Map;
  1475.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  1476.                                         // return;
  1477.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  1478.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  1479.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  1480.                                         // InLineAlgorithm.Algorithm.DDA);
  1481.                                         var count = (double)algo.lcoords.Count / 1;
  1482.                                         for (int i = 0; i < 1; i++)
  1483.                                         {
  1484.                                             var selected = i * (int)count;
  1485.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  1486.                                             X = (ushort)algo.lcoords[selected].X;
  1487.                                             Y = (ushort)algo.lcoords[selected].Y;
  1488.                                             FloorItem floorItem = new FloorItem(true);
  1489.                                             floorItem.ItemID = 1500;
  1490.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  1491.                                             floorItem.MapID = attacker.MapID;
  1492.                                             floorItem.Type = FloorItem.Effect;
  1493.                                             floorItem.X = X;
  1494.                                             floorItem.Y = Y;
  1495.                                             floorItem.OnFloor = Time64.Now;
  1496.                                             floorItem.Owner = attacker.Owner;
  1497.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  1498.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1499.                                             map.AddFloorItem(floorItem);
  1500.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  1501.                                         }
  1502.                                         /****************/
  1503.                                         uint p = 0;
  1504.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  1505.                                         {
  1506.                                             lastAttacked = attacked;
  1507.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  1508.                                             suse.Effect = attack.Effect;
  1509.                                             damage = damage - damage * (p += 20) / 100;
  1510.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  1511.                                             suse.AddTarget(attacked.UID, damage, attack);
  1512.                                         }
  1513.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1514.                                         {
  1515.                                             if (_obj == null) continue;
  1516.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1517.                                             {
  1518.                                                 if (_obj.UID == attacked.UID) continue;
  1519.                                                 var attacked1 = _obj as Entity;
  1520.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  1521.                                                 {
  1522.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  1523.                                                     {
  1524.                                                         lastAttacked = attacked1;
  1525.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  1526.                                                         suse.Effect = attack.Effect;
  1527.                                                         damage = damage + damage * (p += 20) / 100;
  1528.                                                         if (damage == 0) break;
  1529.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  1530.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  1531.                                                     }
  1532.                                                 }
  1533.                                             }
  1534.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  1535.                                             {
  1536.                                                 attackedsob = _obj as SobNpcSpawn;
  1537.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  1538.                                                 {
  1539.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  1540.                                                     {
  1541.                                                         lastAttacked = attackedsob;
  1542.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  1543.                                                         suse.Effect = attack.Effect;
  1544.                                                         damage = damage + damage * (p += 20) / 100;
  1545.                                                         if (damage == 0) break;
  1546.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1547.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1548.                                                     }
  1549.                                                 }
  1550.                                             }
  1551.                                         }
  1552.                                         attacker.Owner.SendScreen(suse, true);
  1553.                                         return;
  1554.                                     }
  1555.                                 }
  1556.                             }
  1557.                             #endregion
  1558.                             #region  HorrorOfStomper
  1559.                             if (attacker.ContainsFlag4(Update.Flags4.HorrorOfStomper))
  1560.                             {
  1561.                                 var spell = Database.SpellTable.GetSpell(12990, attacker.Owner);
  1562.                                 if (spell != null)
  1563.                                 {
  1564.                                     spell.CanKill = true;
  1565.                                     if (Kernel.Rate(spell.Percent))
  1566.                                     {
  1567.                                         SpellUse suse = new SpellUse(true);
  1568.                                         suse.Attacker = attacker.UID;
  1569.                                         suse.SpellID = spell.ID;
  1570.                                         suse.SpellLevel = spell.Level;
  1571.                                         suse.X = attacker.X;
  1572.                                         suse.Y = attacker.Y;
  1573.                                         IMapObject lastAttacked = attacker;
  1574.                                         /*****************/
  1575.                                         attacker.Owner.SendScreen(suse, true);
  1576.                                         ushort _X = attacker.X, _Y = attacker.Y;
  1577.                                         ushort _tX = X, _tY = Y;
  1578.                                         // byte dist = 18;
  1579.                                         var Array = attacker.Owner.Screen.Objects;
  1580.                                         var map = attacker.Owner.Map;
  1581.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  1582.                                         // return;
  1583.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  1584.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  1585.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  1586.                                         // InLineAlgorithm.Algorithm.DDA);
  1587.                                         var count = (double)algo.lcoords.Count / 1;
  1588.                                         for (int i = 0; i < 1; i++)
  1589.                                         {
  1590.                                             var selected = i * (int)count;
  1591.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  1592.                                             X = (ushort)algo.lcoords[selected].X;
  1593.                                             Y = (ushort)algo.lcoords[selected].Y;
  1594.                                             FloorItem floorItem = new FloorItem(true);
  1595.                                             floorItem.ItemID = 1530;
  1596.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  1597.                                             floorItem.MapID = attacker.MapID;
  1598.                                             floorItem.Type = FloorItem.Effect;
  1599.                                             floorItem.X = X;
  1600.                                             floorItem.Y = Y;
  1601.                                             floorItem.OnFloor = Time64.Now;
  1602.                                             floorItem.Owner = attacker.Owner;
  1603.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  1604.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1605.                                             map.AddFloorItem(floorItem);
  1606.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  1607.                                         }
  1608.                                         /****************/
  1609.                                         uint p = 0;
  1610.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  1611.                                         {
  1612.                                             lastAttacked = attacked;
  1613.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  1614.                                             suse.Effect = attack.Effect;
  1615.                                             damage = damage - damage * (p += 20) / 100;
  1616.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  1617.                                             suse.AddTarget(attacked.UID, damage, attack);
  1618.                                         }
  1619.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1620.                                         {
  1621.                                             if (_obj == null) continue;
  1622.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1623.                                             {
  1624.                                                 if (_obj.UID == attacked.UID) continue;
  1625.                                                 var attacked1 = _obj as Entity;
  1626.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  1627.                                                 {
  1628.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  1629.                                                     {
  1630.                                                         lastAttacked = attacked1;
  1631.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  1632.                                                         suse.Effect = attack.Effect;
  1633.                                                         damage = damage + damage * (p += 20) / 100;
  1634.                                                         if (damage == 0) break;
  1635.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  1636.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  1637.                                                     }
  1638.                                                 }
  1639.                                             }
  1640.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  1641.                                             {
  1642.                                                 attackedsob = _obj as SobNpcSpawn;
  1643.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  1644.                                                 {
  1645.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  1646.                                                     {
  1647.                                                         lastAttacked = attackedsob;
  1648.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  1649.                                                         suse.Effect = attack.Effect;
  1650.                                                         damage = damage + damage * (p += 20) / 100;
  1651.                                                         if (damage == 0) break;
  1652.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1653.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1654.                                                     }
  1655.                                                 }
  1656.                                             }
  1657.                                         }
  1658.                                         attacker.Owner.SendScreen(suse, true);
  1659.                                         return;
  1660.                                     }
  1661.                                 }
  1662.                             }
  1663.                             #endregion
  1664.                             #region  PeaceofStomper
  1665.                             if (attacker.ContainsFlag4(Update.Flags4.PeaceofStomper))
  1666.                             {
  1667.                                 var spell = Database.SpellTable.GetSpell(13000, attacker.Owner);
  1668.                                 if (spell != null)
  1669.                                 {
  1670.                                     spell.CanKill = true;
  1671.                                     if (Kernel.Rate(spell.Percent))
  1672.                                     {
  1673.                                         SpellUse suse = new SpellUse(true);
  1674.                                         suse.Attacker = attacker.UID;
  1675.                                         suse.SpellID = spell.ID;
  1676.                                         suse.SpellLevel = spell.Level;
  1677.                                         suse.X = attacker.X;
  1678.                                         suse.Y = attacker.Y;
  1679.                                         IMapObject lastAttacked = attacker;
  1680.                                         /*****************/
  1681.                                         attacker.Owner.SendScreen(suse, true);
  1682.                                         ushort _X = attacker.X, _Y = attacker.Y;
  1683.                                         ushort _tX = X, _tY = Y;
  1684.                                         // byte dist = 18;
  1685.                                         var Array = attacker.Owner.Screen.Objects;
  1686.                                         var map = attacker.Owner.Map;
  1687.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  1688.                                         // return;
  1689.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  1690.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  1691.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  1692.                                         // InLineAlgorithm.Algorithm.DDA);
  1693.                                         var count = (double)algo.lcoords.Count / 1;
  1694.                                         for (int i = 0; i < 1; i++)
  1695.                                         {
  1696.                                             var selected = i * (int)count;
  1697.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  1698.                                             X = (ushort)algo.lcoords[selected].X;
  1699.                                             Y = (ushort)algo.lcoords[selected].Y;
  1700.                                             FloorItem floorItem = new FloorItem(true);
  1701.                                             floorItem.ItemID = 1540;
  1702.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  1703.                                             floorItem.MapID = attacker.MapID;
  1704.                                             floorItem.Type = FloorItem.Effect;
  1705.                                             floorItem.X = X;
  1706.                                             floorItem.Y = Y;
  1707.                                             floorItem.OnFloor = Time64.Now;
  1708.                                             floorItem.Owner = attacker.Owner;
  1709.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  1710.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  1711.                                             map.AddFloorItem(floorItem);
  1712.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  1713.                                         }
  1714.                                         /****************/
  1715.                                         uint p = 0;
  1716.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  1717.                                         {
  1718.                                             lastAttacked = attacked;
  1719.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  1720.                                             suse.Effect = attack.Effect;
  1721.                                             damage = damage - damage * (p += 20) / 100;
  1722.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  1723.                                             suse.AddTarget(attacked.UID, damage, attack);
  1724.                                         }
  1725.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1726.                                         {
  1727.                                             if (_obj == null) continue;
  1728.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1729.                                             {
  1730.                                                 if (_obj.UID == attacked.UID) continue;
  1731.                                                 var attacked1 = _obj as Entity;
  1732.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  1733.                                                 {
  1734.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  1735.                                                     {
  1736.                                                         lastAttacked = attacked1;
  1737.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  1738.                                                         suse.Effect = attack.Effect;
  1739.                                                         damage = damage + damage * (p += 20) / 100;
  1740.                                                         if (damage == 0) break;
  1741.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  1742.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  1743.                                                     }
  1744.                                                 }
  1745.                                             }
  1746.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  1747.                                             {
  1748.                                                 attackedsob = _obj as SobNpcSpawn;
  1749.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  1750.                                                 {
  1751.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  1752.                                                     {
  1753.                                                         lastAttacked = attackedsob;
  1754.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  1755.                                                         suse.Effect = attack.Effect;
  1756.                                                         damage = damage + damage * (p += 20) / 100;
  1757.                                                         if (damage == 0) break;
  1758.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1759.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1760.                                                     }
  1761.                                                 }
  1762.                                             }
  1763.                                         }
  1764.                                         attacker.Owner.SendScreen(suse, true);
  1765.                                         return;
  1766.                                     }
  1767.                                 }
  1768.                             }
  1769.                             #endregion
  1770.                             #region TripleBeast
  1771.                             if (attacker.ContainsFlag3(Update.Flags4.TripleBeast))
  1772.                             {
  1773.                                 var spell = Database.SpellTable.GetSpell(12850, attacker.Owner);
  1774.                                 if (spell != null && Kernel.Rate(30))
  1775.                                 {
  1776.                                     spell.CanKill = true;
  1777.                                     {
  1778.                                         SpellUse suse = new SpellUse(true);
  1779.                                         suse.Attacker = attacker.UID;
  1780.                                         suse.SpellID = spell.ID;
  1781.                                         suse.SpellLevel = spell.Level;
  1782.                                         suse.X = attacker.X;
  1783.                                         suse.Y = attacker.Y;
  1784.                                         IMapObject lastAttacked = attacker;
  1785.                                         uint p = 0;
  1786.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  1787.                                         {
  1788.                                             lastAttacked = attacked;
  1789.                                             uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  1790.                                             damage = damage * 160 / 100;
  1791.                                             p++;
  1792.                                             suse.Effect = attack.Effect;
  1793.                                             attack.Damage = 0;
  1794.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  1795.                                             suse.AddTarget(attacked.UID, damage, attack);
  1796.                                             suse.Effect = attack.Effect = Attack.AttackEffects.None;
  1797.                                         }
  1798.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  1799.                                         {
  1800.                                             if (p > 5) break;
  1801.                                             if (_obj == null) continue;
  1802.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  1803.                                             {
  1804.                                                 if (_obj.UID == attacked.UID) continue;
  1805.                                                 var attacked1 = _obj as Entity;
  1806.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5 && attacked.UID != attacked1.UID)
  1807.                                                 {
  1808.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  1809.                                                     {
  1810.                                                         lastAttacked = attacked1;
  1811.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attacked1, ref attack, spell);
  1812.                                                         if (p == 1)
  1813.                                                         {
  1814.                                                             damage = damage * 80 / 100;
  1815.                                                         }
  1816.                                                         if (p == 2)
  1817.                                                         {
  1818.                                                             damage = damage * 60 / 100;
  1819.                                                         }
  1820.                                                         if (p == 3)
  1821.                                                         {
  1822.                                                             damage = damage * 40 / 100;
  1823.                                                         }
  1824.                                                         else if (p > 3)
  1825.                                                         {
  1826.                                                             damage = damage * 20 / 100;
  1827.                                                         }
  1828.                                                         suse.Effect = attack.Effect;
  1829.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  1830.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  1831.                                                         suse.Effect = attack.Effect = Attack.AttackEffects.None;
  1832.                                                         p++;
  1833.                                                     }
  1834.                                                 }
  1835.                                             }
  1836.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  1837.                                             {
  1838.                                                 attackedsob = _obj as SobNpcSpawn;
  1839.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  1840.                                                 {
  1841.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  1842.                                                     {
  1843.                                                         lastAttacked = attackedsob;
  1844.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  1845.                                                         suse.Effect = attack.Effect;
  1846.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  1847.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  1848.                                                         suse.Effect = attack.Effect = Attack.AttackEffects.None;
  1849.                                                     }
  1850.                                                 }
  1851.                                             }
  1852.                                         }
  1853.                                         attacker.Owner.SendScreen(suse, true);
  1854.                                         return;
  1855.                                     }
  1856.                                 }
  1857.                             }
  1858.                             #endregion
  1859. بعد كده هتعمل سيرش على كود ده
  1860.   public static void ReceiveAttack(Game.Entity attacker, Game.Entity attacked, Attack attack, uint damage, Database.SpellInformation spell)
  1861. تضيف تحتيه
  1862.   #region ThunderCloud
  1863.             if (attacked.Name == "Thundercloud")
  1864.             {
  1865.                 if (spell != null && spell.ID != 0)
  1866.                 {
  1867.                     if (Kernel.Rate(75)) damage = 1;
  1868.                     else damage = 0;
  1869.                 }
  1870.                 else if (spell == null || spell.ID == 0)
  1871.                 {
  1872.                     damage = 1;
  1873.                 }
  1874.             }
  1875.             foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  1876.             {
  1877.                 if (th.CUID == attacked.UID)
  1878.                 {
  1879.                     if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
  1880.                     th.MonsterInfo.InSight = attacker.UID;
  1881.                     break;
  1882.                 }
  1883.             }
  1884.             #endregion
  1885.             #region RevengeTaill
  1886.             if (attacked.ContainsFlag4(Network.GamePackets.Update.Flags4.RevengeTaill))
  1887.             {
  1888.                 if (attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
  1889.                 {
  1890.                     var spelll = Database.SpellTable.GetSpell(13030, attacked.Owner);
  1891.                     if (damage <= spelll.Power)
  1892.                     {
  1893.                         SpellUse suses = new SpellUse(true);
  1894.                         suses.Attacker = attacked.UID;
  1895.                         suses.Attacker1 = attacker.UID;
  1896.                         suses.SpellID = 13030;
  1897.                         suses.SpecialEffect = 1;
  1898.                         suses.AddTarget(attacker.UID, damage, null);
  1899.                         if (attacker.Hitpoints <= damage)
  1900.                         {
  1901.                             attacker.Die(attacked);
  1902.                         }
  1903.                         else
  1904.                         {
  1905.                             attacker.Hitpoints -= damage;
  1906.                         }
  1907.                         attacked.Owner.SendScreen(suses, true);
  1908.                     }
  1909.                 }
  1910.             }
  1911.             #endregion
  1912.             #region ChillingSnow
  1913.             if (attacked.ContainsFlag4(Update.Flags4.ChillingSnow) && attacked.IsStomper2() && attacker.EntityFlag == EntityFlag.Player)
  1914.             {
  1915.                 var spell1 = Database.SpellTable.GetSpell(12960, attacked.Owner);
  1916.                 int rate = 95;
  1917.                 int diff = attacker.BattlePower - attacked.BattlePower;
  1918.                 if (diff < 0) diff = 0;
  1919.                 rate -= (byte)(diff * 5);
  1920.                 if (rate < 0) rate = 0;
  1921.                 if (Kernel.Rate(rate))
  1922.                 {
  1923.                     attacker.AddFlag4(Update.Flags4.xChillingSnow);
  1924.                     attacker.ChillingSnowStamp = Time64.Now;
  1925.                     attacker.ChillingSnow = (byte)(spell1.Level + 1);
  1926.                 }
  1927.             }
  1928.             #endregion
  1929.             #region FreezingPelter
  1930.             if (attacked.ContainsFlag4(Update.Flags4.FreezingPelter) && attacked.IsStomper2() && attacker.EntityFlag == EntityFlag.Player)
  1931.             {
  1932.                 var spell1 = Database.SpellTable.GetSpell(13020, attacked.Owner);
  1933.                 int rate = 30;
  1934.                 int diff = attacker.BattlePower - attacked.BattlePower;
  1935.                 if (diff < 0) diff = 0;
  1936.                 rate -= (byte)(diff * 5);
  1937.                 if (rate < 0) rate = 0;
  1938.                 if (Kernel.Rate(rate))
  1939.                 {
  1940.                     attacker.AddFlag4(Update.Flags4.xFreezingPelter);
  1941.                     attacker.FreezingPelterStamp = Time64.Now;
  1942.                     byte num = 0;
  1943.                     if (spell1.Level == 0) num = 1;
  1944.                     if (spell1.Level == 1) num = 1;
  1945.                     if (spell1.Level == 2) num = 2;
  1946.                     if (spell1.Level == 3) num = 2;
  1947.                     if (spell1.Level == 4) num = 3;
  1948.                     if (spell1.Level == 5) num = 3;
  1949.                     if (spell1.Level == 5) num = 4;
  1950.                     attacker.FreezingPelter = num;
  1951.                 }
  1952.             }
  1953.             #endregion
  1954. وبعدين فى اخر الكود ده
  1955. attacker.AttackStamp = Time64.Now;
  1956. هضيف كود ده
  1957. #region ThunderCloud
  1958.             foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  1959.             {
  1960.                 if (th.CUID == attacker.UID)
  1961.                 {
  1962.                     if (attacked == null || Kernel.GetDistance(attacked.X, attacked.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacked.Dead) break;
  1963.                     th.MonsterInfo.InSight = attacked.UID;
  1964.                     break;
  1965.                 }
  1966.             }
  1967.             #endregion
  1968. بعدين هنعمل سيرش فى كود ده
  1969.  public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
  1970. هنضيف تحتيه كود ده
  1971. #region ThunderCloud
  1972.             if (attacked.Name == "Thundercloud")
  1973.             {
  1974.                 if (attacked.CUID == attacker.UID) return false;
  1975.                 if (!Constants.PKForbiddenMaps.Contains(attacker.MapID))
  1976.                 {
  1977.                     if (attacker.PKMode != Game.Enums.PKMode.PK &&
  1978.                      attacker.PKMode != Game.Enums.PKMode.Team)
  1979.                         return false;
  1980.                     else
  1981.                     {
  1982.                         attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
  1983.                         attacker.FlashingNameStamp = Time64.Now;
  1984.                         attacker.FlashingNameTime = 20;
  1985.  
  1986.                         return true;
  1987.                     }
  1988.                 }
  1989.                 else return false;
  1990.             }
  1991.             #endregion
  1992. بعدين نعمل سيرش على كود ده
  1993.   #region Monster -> Player \ Monster
  1994. هنضيف تحتيه كود ده
  1995.  if (attacked.EntityFlag == EntityFlag.Player)
  1996.                 {
  1997.                     if (attacker.Companion && attacker.Name != "Thundercloud")
  1998.                     {
  1999.                         if (Constants.PKForbiddenMaps.Contains(attacker.MapID))
  2000.                             return;
  2001.                     }
  2002. فيه نفس كود
  2003. هنضيف كود ده
  2004. #region ThunderCloud
  2005.                     if (attacker.Name == "Thundercloud")
  2006.                     {
  2007.                         if (Kernel.GamePool.ContainsKey(attacker.CUID))
  2008.                         {
  2009.                             var owner = Kernel.GamePool[attacker.CUID];
  2010.                             var spell = Database.SpellTable.GetSpell(12840, owner);
  2011.                             var spell2 = Database.SpellTable.GetSpell(12970, owner);
  2012.                             byte percent = 0;
  2013.                             if (spell2 != null)
  2014.                             {
  2015.                                 if (spell2.Level == 0) percent = 130;
  2016.                                 if (spell2.Level == 1) percent = 140;
  2017.                                 if (spell2.Level == 2) percent = 150;
  2018.                                 if (spell2.Level == 3) percent = 160;
  2019.                                 if (spell2.Level == 4) percent = 170;
  2020.                                 if (spell2.Level == 5) percent = 180;
  2021.                                 if (spell2.Level == 6) percent = 200;
  2022.                             }
  2023.                             attack = new Attack(true);
  2024.                             attack.Attacker = attacker.UID;
  2025.                             attack.Attacked = attacked.UID;
  2026.                             attack.AttackType = Network.GamePackets.Attack.Kill;
  2027.                             attack.X = attacked.X;
  2028.                             attack.Y = attacked.Y;
  2029.                             attack.Damage = 1;
  2030.                             uint damage2 = (uint)(Calculate.Melee(owner.Entity, attacked, ref attack) * spell.FirstDamage / 100);
  2031.                             if (attacker.SpawnPacket[50] == 128)//ThunderBolt
  2032.                                 damage2 = (uint)(damage2 * percent / 100);
  2033.                             SpellUse suse2 = new SpellUse(true);
  2034.                             suse2.Attacker = attacker.UID;
  2035.                             suse2.Attacker1 = attacked.UID;
  2036.                             suse2.SpellID = 13190;
  2037.                             suse2.X = attacked.X;
  2038.                             suse2.Y = attacked.Y;
  2039.                             suse2.AddTarget(attacked.UID, damage2, attack);
  2040.                             attacker.MonsterInfo.SendScreen(suse2);
  2041.                             if (attacked.Hitpoints <= damage2)
  2042.                             {
  2043.                                 attacked.Die(attacker);
  2044.                                 attack.ResponseDamage = damage2;
  2045.                                 attacker.MonsterInfo.SendScreen(attack);
  2046.                             }
  2047.                             else
  2048.                             {
  2049.                                 attacked.Hitpoints -= damage2;
  2050.                             }
  2051.                             return;
  2052.                         }
  2053.                         else
  2054.                             return;
  2055.                     }
  2056.                     #endregion
  2057. #region ThunderCloudSight
  2058.                     foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  2059.                     {
  2060.                         if (th.CUID == attacked.UID)
  2061.                         {
  2062.                             if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
  2063.                             th.MonsterInfo.InSight = attacker.UID;
  2064.                             break;
  2065.                         }
  2066.                     }
  2067.                     #endregion
  2068. بعدين هنعمل سيرش على كود ده
  2069.    attack.Effect = Attack.AttackEffects.None;
  2070. تحتيه هضيف كود ده
  2071.  
  2072. #region ThunderCloud
  2073.                         if (attacker.Name == "Thundercloud")
  2074.                         {
  2075.                             if (Kernel.GamePool.ContainsKey(attacker.CUID))
  2076.                             {
  2077.                                 var owner = Kernel.GamePool[attacker.CUID];
  2078.                                 var spell = Database.SpellTable.GetSpell(12840, owner);
  2079.                                 var spell2 = Database.SpellTable.GetSpell(12970, owner);
  2080.                                 uint damage2 = (uint)(Calculate.Melee(owner.Entity, attacked, ref attack) * (spell.Level < 8 ? spell.FirstDamage : 50) / 100);
  2081.                                 if (attacker.SpawnPacket[50] == 128)
  2082.                                     damage2 = (uint)(damage2 * spell2.FirstDamage);
  2083.                                 SpellUse suse2 = new SpellUse(true);
  2084.                                 suse2.Attacker = attacker.UID;
  2085.                                 suse2.Attacker1 = attacked.UID;
  2086.                                 suse2.SpellID = 13190;
  2087.                                 suse2.X = attacked.X;
  2088.                                 suse2.Y = attacked.Y;
  2089.                                 suse2.AddTarget(attacked.UID, damage2, attack);
  2090.                                 attacker.MonsterInfo.SendScreen(suse2);
  2091.                                 if (attacked.Hitpoints <= damage2)
  2092.                                 {
  2093.                                     attacked.Die(attacker);
  2094.                                     attack = new Attack(true);
  2095.                                     attack.Attacker = attacker.UID;
  2096.                                     attack.Attacked = attacked.UID;
  2097.                                     attack.AttackType = Network.GamePackets.Attack.Kill;
  2098.                                     attack.X = attacked.X;
  2099.                                     attack.Y = attacked.Y;
  2100.                                     attack.Damage = 1;
  2101.                                     attack.ResponseDamage = damage2;
  2102.                                     attacker.MonsterInfo.SendScreen(attack);
  2103.                                 }
  2104.                                 else
  2105.                                 {
  2106.                                     attacked.Hitpoints -= damage2;
  2107.                                 }
  2108.                                 return;
  2109.                             }
  2110.                             else
  2111.                                 return;
  2112.                         }
  2113.                         #endregion
  2114. بعدين هنعمل سيرش
  2115. #region Ranged
  2116. هنزل لحد كود ده
  2117.  if (weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613 && weapons.Item1.ID
  2118. هنبدلهبى الكود ده
  2119.   if (weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613 && weapons.Item1.ID / 1000 != 626) return;
  2120.  
  2121. هنعمل سيرش على نفس كود وهنضفهم تانى
  2122. كده خلصنا من ملف الهاندل نيجى بقى لى ملف اينتى
  2123. هنضيف دول فى ملف اينتى
  2124.  #region WindWalker
  2125.         public Time64 TCSpellUse;
  2126.         public Time64 SwirlingStamp;
  2127.         public bool IsStomper()
  2128.         {
  2129.             if (EntityFlag == Game.EntityFlag.Player)
  2130.             {
  2131.                 if (this.Class >= 160 && this.Class <= 165)
  2132.                     if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  2133.                         return true;
  2134.             }
  2135.             return false;
  2136.         }
  2137.         public bool IsStomper1()
  2138.         {
  2139.             if (EntityFlag == Game.EntityFlag.Player)
  2140.             {
  2141.                 var weapons = Owner.Weapons;
  2142.                 if (weapons.Item1 != null)
  2143.                     if (weapons.Item1.ID / 1000 == 626)
  2144.                         if (this.Class >= 160 && this.Class <= 165)
  2145.                             if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  2146.                                 return true;
  2147.             }
  2148.             return false;
  2149.         }
  2150.         public bool IsStomper2()
  2151.         {
  2152.             if (EntityFlag == Game.EntityFlag.Player)
  2153.             {
  2154.                 var weapons = Owner.Weapons;
  2155.                 if (weapons.Item2 != null)
  2156.                     if (weapons.Item2.ID / 1000 == 626)
  2157.                         if (this.Class >= 160 && this.Class <= 165)
  2158.                             if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  2159.                                 return true;
  2160.             }
  2161.             return false;
  2162.         }
  2163.         public bool IsChaser()
  2164.         {
  2165.             if (EntityFlag == Game.EntityFlag.Player)
  2166.             {
  2167.                 if (this.Class >= 160 && this.Class <= 165)
  2168.                     if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  2169.                         return true;
  2170.             }
  2171.             return false;
  2172.         }
  2173.         public bool IsChaser1()
  2174.         {
  2175.             if (EntityFlag == Game.EntityFlag.Player)
  2176.             {
  2177.                 var weapons = Owner.Weapons;
  2178.                 if (weapons.Item1 != null)
  2179.                     if (weapons.Item1.ID / 1000 == 626)
  2180.                         if (this.Class >= 160 && this.Class <= 165)
  2181.                             if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  2182.                                 return true;
  2183.             }
  2184.             return false;
  2185.         }
  2186.         public bool IsChaser2()
  2187.         {
  2188.             if (EntityFlag == Game.EntityFlag.Player)
  2189.             {
  2190.                 var weapons = Owner.Weapons;
  2191.                 if (weapons.Item2 != null)
  2192.                     if (weapons.Item2.ID / 1000 == 626)
  2193.                         if (this.Class >= 160 && this.Class <= 165)
  2194.                             if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  2195.                                 return true;
  2196.             }
  2197.             return false;
  2198.         }
  2199.         public Time64 OmnipotenceStamp, RevengeTaillStamp, StomperStaminaStamp, ChaserStaminaStamp, HealingSnowStamp, ThunderCloudStamp, ChillingSnowStamp, FreezingPelterStamp;
  2200.         public byte ChillingSnow = 0, FreezingPelter = 0;
  2201.         #endregion
  2202.         #region WindWalker.
  2203.         public String Branch = "";
  2204.         private byte _ChangeBranch;
  2205.         public byte ChangeBranch
  2206.         {
  2207.             get
  2208.             {
  2209.                 return _ChangeBranch;
  2210.             }
  2211.             set
  2212.             {
  2213.                 _ChangeBranch = value;
  2214.             }
  2215.         }
  2216.         public Time64 TripleBeastStamp = Time64.Now;
  2217.         public bool SwirlingStorm = false;
  2218.         public float SwirlingStormPercent;
  2219.         public byte _Windwalker;
  2220.         public byte Windwalker
  2221.         {
  2222.             get
  2223.             {
  2224.                 SpawnPacket[304] = _Windwalker;
  2225.                 return _Windwalker;
  2226.             }
  2227.             set
  2228.             {
  2229.                 _Windwalker = value;
  2230.                 SpawnPacket[304] = value;
  2231.                 if (value > 0)
  2232.                     AddFlag4(Network.GamePackets.Update.Flags4.JusticeChant);
  2233.             }
  2234.         }
  2235.         public bool PWindWalker()
  2236.         {
  2237.             if (EntityFlag == Game.EntityFlag.Player)
  2238.             {
  2239.                 var weapons = Owner.Weapons;
  2240.                 if (weapons.Item2 != null)
  2241.                     if (weapons.Item2.ID / 1000 == 626)
  2242.                         return true;
  2243.             }
  2244.             return false;
  2245.         }
  2246.         #endregion
  2247.  
  2248. بعد كده هنبدل ده بالى عندك
  2249.   public uint Mesh
  2250.         {
  2251.             get
  2252.             {
  2253.                 return BitConverter.ToUInt32(SpawnPacket, _Mesh);
  2254.             }
  2255.             set
  2256.             {
  2257.                 Writer.Write(value, _Mesh, SpawnPacket);
  2258.             }
  2259.  
  2260.         }
  2261. بعد كده هنفتح ملف فلور ايتم
  2262. هنضيف دول
  2263.   RageOfWarTrap = 1500,
  2264.   ShadowofChaser = 1550,
  2265. بعد كده هنضيف كوده ده
  2266.   public Game.Entity ShadowofChaserAttacker, ShadowofChaserAttacked;
  2267. public Attack Attack;
  2268. بعد كده هنضيف
  2269.  public byte Unknown37
  2270.         {
  2271.             get { return Buffer[37]; }
  2272.             set { Buffer[37] = value; }
  2273.         }
  2274.  
  2275.         public string Name2
  2276.         {
  2277.             get { return Program.Encoding.GetString(Buffer, 93, 16); }
  2278.             set { Writer.Write(value, 93, Buffer); }
  2279.         }
  2280.         public ushort X2
  2281.         {
  2282.             get { return BitConverter.ToUInt16(Buffer, 61); }
  2283.             set { Writer.Write(value, 61, Buffer); }
  2284.         }
  2285.  
  2286.         public ushort Y2
  2287.         {
  2288.             get { return BitConverter.ToUInt16(Buffer, 63); }
  2289.             set { Writer.Write(value, 63, Buffer); }
  2290.         }
  2291. هنفتح ملف Map.cs
  2292. اعمل سيرش
  2293.  public enum MapObjectType
  2294. ضيف فيه كود ده
  2295. FloorSpell,
  2296. هنفتح ملف Data.cs
  2297. هنضيف كود ده
  2298. public ushort X2
  2299.         {
  2300.             get
  2301.             {
  2302.                 return BitConverter.ToUInt16(Buffer, 28);
  2303.             }
  2304.             set
  2305.             {
  2306.                 Writer.Write(value, 28, Buffer);
  2307.             }
  2308.         }
  2309.         public ushort Y2
  2310.         {
  2311.             get
  2312.             {
  2313.                 return BitConverter.ToUInt16(Buffer, 30);
  2314.             }
  2315.             set
  2316.             {
  2317.                 Writer.Write(value, 30, Buffer);
  2318.             }
  2319.         }
  2320. هنفتح ملف world.cs
  2321. هنضيف فيه كود ده
  2322.  public bool Register(Entity ThunderCloudd)
  2323.         {
  2324.             if (ThunderCloudd.Owner.TimerSubscriptions == null)
  2325.             {
  2326.                 ThunderCloudd.Owner.TimerSyncRoot = new object();
  2327.                 ThunderCloudd.Owner.TimerSubscriptions = new IDisposable[]
  2328.                 {
  2329.                     ThunderCloud.Add(ThunderCloudd)
  2330.                 };
  2331.                 return true;
  2332.             }
  2333.             return false;
  2334.         }
  2335.         public void Unregister(Entity Thundercloud)
  2336.         {
  2337.             if (Thundercloud.Owner == null || Thundercloud.Owner.TimerSubscriptions == null) return;
  2338.             lock (Thundercloud.Owner.TimerSyncRoot)
  2339.             {
  2340.                 if (Thundercloud.Owner.TimerSubscriptions != null)
  2341.                 {
  2342.                     foreach (var timer in Thundercloud.Owner.TimerSubscriptions)
  2343.                         timer.Dispose();
  2344.                     Thundercloud.Owner.TimerSubscriptions = null;
  2345.                 }
  2346.             }
  2347.         }
  2348. طبعا هيظهرلك ايرور
  2349. هنضيف فى نفس ملف
  2350. كود ده
  2351.   public TimerRule<Entity> ThunderCloud;
  2352.         private void ThunderCloudTimer(Entity ThunderCloud, int time)
  2353.         {
  2354.             if (ThunderCloud == null) return;
  2355.             if (Time64.Now >= ThunderCloud.ThunderCloudStamp.AddSeconds(1))
  2356.             {
  2357.                 ThunderCloud.ThunderCloudStamp = Time64.Now;
  2358.                 if (ThunderCloud.Hitpoints > 400)
  2359.                     ThunderCloud.Hitpoints -= 400;
  2360.                 else
  2361.                 {
  2362.                     Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
  2363.                     Data data = new Data(true);
  2364.                     data.UID = ThunderCloud.UID;
  2365.                     data.ID = Data.RemoveEntity;
  2366.                     ThunderCloud.MonsterInfo.SendScreen(data);
  2367.                     ThunderCloud.MonsterInfo.SendScreen(data);
  2368.                     foreach (var client in Kernel.GamePool.Values)
  2369.                     {
  2370.                         if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Entity.X, client.Entity.Y) > 16) continue;
  2371.                         client.RemoveScreenSpawn(ThunderCloud, true);
  2372.                     }
  2373.                     Unregister(ThunderCloud);
  2374.                     return;
  2375.                 }
  2376.             }
  2377.             if ((ThunderCloud.SpawnPacket[50] == 0 && Time64.Now >= ThunderCloud.MonsterInfo.LastMove.AddMilliseconds(750)) || ThunderCloud.SpawnPacket[50] == 128)
  2378.             {
  2379.                 ThunderCloud.MonsterInfo.LastMove = Time64.Now;
  2380.                 if (ThunderCloud.MonsterInfo.InSight == 0)
  2381.                 {
  2382.                     foreach (var one in Kernel.Maps[ThunderCloud.MapID].Entities.Values.Where(i => Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, i.X, i.Y) <= ThunderCloud.MonsterInfo.AttackRange))
  2383.                     {
  2384.                         if (one == null || one.Dead || one.MonsterInfo.Guard || one.Companion) continue;
  2385.                         ThunderCloud.MonsterInfo.InSight = one.UID;
  2386.                         Entity insight = null;
  2387.                         if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  2388.                             insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
  2389.                         else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  2390.                             insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Entity;
  2391.                         if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
  2392.                         {
  2393.                             ThunderCloud.MonsterInfo.InSight = 0;
  2394.                             break;
  2395.                         }
  2396.                         new Game.Attacking.Handle(null, ThunderCloud, insight);
  2397.                         break;
  2398.                     }
  2399.                 }
  2400.                 else
  2401.                 {
  2402.                     Entity insight = null;
  2403.                     if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  2404.                         insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
  2405.                     else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  2406.                         insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Entity;
  2407.                     if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
  2408.                     {
  2409.                         ThunderCloud.MonsterInfo.InSight = 0;
  2410.                         return;
  2411.                     }
  2412.                     new Game.Attacking.Handle(null, ThunderCloud, insight);
  2413.                 }
  2414.             }
  2415.  
  2416.         }
  2417. هنيجى لاخر حاجة هنفتح ملف ان بى سى
  2418. نعمل سيرش على كود
  2419.  public Npcs(GameClient client)
  2420. هنضيف تحتيه
  2421.   public static string WindwalkerSkills(GameClient client, ushort spellid)
  2422.         {
  2423.             byte level = 0;
  2424.             if (spellid == 12830 || spellid == 13070 || spellid == 13080) level = 120;
  2425.             if (spellid == 12840 || spellid == 12960 || spellid == 13000) level = 70;
  2426.             if (spellid == 12850 || spellid == 12930 || spellid == 12990) level = 40;
  2427.             if (spellid == 12860 || spellid == 12870) level = 3;
  2428.             if (spellid == 12890 || spellid == 12940 || spellid == 12950 || spellid == 13090) level = 15;
  2429.             if (spellid == 12970 || spellid == 13020 || spellid == 13030) level = 100;
  2430.             var spell = Database.SpellTable.GetSpell(spellid, client);
  2431.             if (!client.Spells.ContainsKey(spellid) && client.Entity.Level >= level) return "Available";
  2432.             else if (client.Spells.ContainsKey(spellid)) return "Learned";
  2433.             else return "N/A";
  2434.         }
  2435. بعدين نضيف ان بى سى ده
  2436. #region WindwalkerLord
  2437.                                 case 5158:
  2438.                                     {
  2439.                                         switch (npcRequest.OptionID)
  2440.                                         {
  2441.                                             case 0:
  2442.                                                 {
  2443.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  2444.                                                     {
  2445.  
  2446.                                                         dialog.Text("Our Windwalker school was founded by Saint Wan on the principle of KINDNESS and JUSTICE. Once you decide to");
  2447.                                                         dialog.Text("~join us as a Windwalker, you take the responsibility for the security of the country against alien invaders and devils.");
  2448.                                                         if (client.Entity.Class != 165)
  2449.                                                         {
  2450.                                                             dialog.Option("I~want~to~get~promoted.", 1);
  2451.                                                         }
  2452.                                                         dialog.Option("Learn~skills.", 2);
  2453.                                                         dialog.Option("Switch~to~another~branch.", 4);
  2454.                                                         dialog.Option("I`ll~talk~to~you~later.", 255);
  2455.                                                         dialog.Send();
  2456.  
  2457.                                                     }
  2458.                                                     else
  2459.                                                     {
  2460.                                                         dialog.Text("You don`t look like a Windwalker. What`s the matter? If you were ever a Windwalker in either of the previous two lives, you can learn [Frost Gaze I] from me.");
  2461.  
  2462.                                                         dialog.Option("Learn~Frost~Gaze~I.", 3);
  2463.                                                         dialog.Send();
  2464.                                                     }
  2465.                                                     break;
  2466.                                                 }
  2467.                                             #region Promocion
  2468.                                             case 1:
  2469.                                                 {
  2470.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  2471.                                                     {
  2472.                                                         if (client.Entity.Class == 165)
  2473.                                                         {
  2474.                                                             dialog.Text("You cannot be promoted anymore. You have mastered your class.");
  2475.                                                             dialog.Option("Thank you master.", 255);
  2476.                                                             dialog.Send();
  2477.                                                         }
  2478.                                                         else
  2479.                                                         {
  2480.                                                             dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
  2481.                                                             dialog.Option("Promote me sir.", 7);
  2482.                                                             dialog.Send();
  2483.                                                         }
  2484.                                                     }
  2485.                                                     else
  2486.                                                     {
  2487.                                                         dialog.Text("I will not tell any of the Windwalker secrets to another class, so, good bye.");
  2488.                                                         dialog.Option("Alright.", 255);
  2489.                                                         dialog.Send();
  2490.                                                     }
  2491.                                                     break;
  2492.                                                 }
  2493.                                             case 7:
  2494.                                                 {
  2495.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  2496.                                                     {
  2497.                                                         if (client.Entity.Class == 165)
  2498.                                                         {
  2499.                                                             dialog.Text("You cannot be promoted anymore. You have mastered your class.");
  2500.                                                             dialog.Option("Thank you master.", 255);
  2501.                                                             dialog.Send();
  2502.                                                         }
  2503.                                                         else
  2504.                                                         {
  2505.                                                             if (client.PromoteItemNeed == 721020)
  2506.                                                             {
  2507.                                                                 if (client.Inventory.Remove("moonbox"))
  2508.                                                                 {
  2509.                                                                     client.Entity.Update(10, "end_task", true);
  2510.                                                                     client.Inventory.Add(client.PromoteItemGain, 0, 1);
  2511.                                                                     client.Entity.Class++;
  2512.                                                                     dialog.Text("Congratulations! You have been promoted.");
  2513.                                                                     dialog.Option("Thank you master.", 255);
  2514.                                                                     dialog.Send();
  2515.                                                                 }
  2516.                                                                 else
  2517.                                                                 {
  2518.                                                                     dialog.Text("You don't meet the requierments.");
  2519.                                                                     dialog.Option("Ahh.", 255);
  2520.                                                                     dialog.Send();
  2521.                                                                 }
  2522.                                                                 return;
  2523.                                                             }
  2524.                                                             if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
  2525.                                                             {
  2526.                                                                 client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
  2527.                                                                 client.Inventory.Add(client.PromoteItemGain, 0, 1);
  2528.                                                                 client.Entity.Class++;
  2529.                                                                 client.Entity.Update(10, "end_task", true);
  2530.                                                                 dialog.Text("Congratulations! You have been promoted.");
  2531.                                                                 dialog.Option("Thank you master.", 255);
  2532.                                                                 dialog.Send();
  2533.                                                             }
  2534.                                                             else
  2535.                                                             {
  2536.                                                                 dialog.Text("You don't meet the requierments.");
  2537.                                                                 dialog.Option("Ahh.", 255);
  2538.                                                                 dialog.Send();
  2539.                                                             }
  2540.                                                         }
  2541.                                                     }
  2542.                                                     else
  2543.                                                     {
  2544.                                                         dialog.Text("I will not tell any of the WindWalker secrets to another class, so, good bye.");
  2545.                                                         dialog.Option("Alright.", 255);
  2546.                                                         dialog.Send();
  2547.                                                     }
  2548.                                                     break;
  2549.                                                 }
  2550.                                             #endregion
  2551.                                             case 4:
  2552.                                                 {
  2553.                                                     if (client.Entity.IsChaser())
  2554.                                                     {
  2555.                                                         dialog.Text("                                       *Branches of Windwalker School*");
  2556.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  2557.                                                         dialog.Text("Stomper: Excels in melee combat with excellent attack range and remarkable recovery ability. Stomper`s exclusive skill");
  2558.                                                         dialog.Text("          can freeze enemies` blood to extend their skill cooldown time and response time.");
  2559.                                                         dialog.Text("Chaser: Excels in ranged combat. With a unique focusing skill, Chaser is able to control the power of wind to attack");
  2560.                                                         dialog.Text("         enemies far away.");
  2561.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  2562.                                                         dialog.Text("(You`re currently on the [RangedChaser] branch. Each Windwalker can switch his/her branch once every 30 days, free of charge.)");
  2563.                                                         dialog.Option("Switch~to~[MeleeStomper]~branch.", 5);
  2564.                                                         dialog.Option("I`ll~think~about~it.", 255);
  2565.                                                         dialog.Send();
  2566.                                                     }
  2567.                                                     else if (client.Entity.IsStomper())
  2568.                                                     {
  2569.                                                         dialog.Text("                                       *Branches of Windwalker School*");
  2570.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  2571.                                                         dialog.Text("Stomper: Excels in melee combat with excellent attack range and remarkable recovery ability. Stomper`s exclusive skill");
  2572.                                                         dialog.Text("          can freeze enemies` blood to extend their skill cooldown time and response time.");
  2573.                                                         dialog.Text("Chaser: Excels in ranged combat. With a unique focusing skill, Chaser is able to control the power of wind to attack");
  2574.                                                         dialog.Text("         enemies far away.");
  2575.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  2576.                                                         dialog.Text("(You`re currently on the [MeleeStomper] branch. Each Windwalker can switch his/her branch once every 30 days, free of charge.)");
  2577.                                                         dialog.Option("Switch~to~[RangedChaser]~branch.", 6);
  2578.                                                         dialog.Option("I`ll~think~about~it.", 255);
  2579.                                                         dialog.Send();
  2580.                                                     }
  2581.                                                     break;
  2582.                                                 }
  2583.                                             case 5:
  2584.                                                 {
  2585.                                                     if (client.Entity.IsStomper())
  2586.                                                         client.Entity.Windwalker = 0;
  2587.                                                     else if (client.Entity.IsChaser())
  2588.                                                         client.Entity.Windwalker = 8;
  2589.                                                     else break;
  2590.                                                     Update upd = new Update(true);
  2591.                                                     upd.UID = client.Entity.UID;
  2592.                                                     upd.UpdateCount = 1;
  2593.                                                     upd.SwitchWindwalker(3277209, 1);
  2594.                                                     client.SendScreen(upd, true);
  2595.                                                     Update upd2 = new Update(true);
  2596.                                                     upd2.UID = client.Entity.UID;
  2597.                                                     upd2.UpdateCount = 1;
  2598.                                                     upd2.SwitchWindwalker(71, client.Entity.Windwalker);
  2599.                                                     client.SendScreen(upd2, true);
  2600.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.JusticeChant);
  2601.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ChillingSnow);
  2602.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.FreezingPelter);
  2603.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.HealingSnow);
  2604.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.RevengeTaill);
  2605.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ShadowofChaser);
  2606.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.Omnipotence);
  2607.                                                     dialog.Text("Okay, I`ve changed your branch to [MeleeStomper].");
  2608.                                                     dialog.Option("Thanks!", 255);
  2609.                                                     dialog.Send();
  2610.                                                     break;
  2611.                                                 }
  2612.                                             case 6:
  2613.                                                 {
  2614.                                                     if (client.Entity.IsStomper())
  2615.                                                         client.Entity.Windwalker = 0;
  2616.                                                     else if (client.Entity.IsChaser())
  2617.                                                         client.Entity.Windwalker = 8;
  2618.                                                     else break;
  2619.                                                     Update upd = new Update(true);
  2620.                                                     upd.UID = client.Entity.UID;
  2621.                                                     upd.UpdateCount = 1;
  2622.                                                     upd.SwitchWindwalker(3277209, 1);
  2623.                                                     client.SendScreen(upd, true);
  2624.                                                     Update upd2 = new Update(true);
  2625.                                                     upd2.UID = client.Entity.UID;
  2626.                                                     upd2.UpdateCount = 1;
  2627.                                                     upd2.SwitchWindwalker(71, client.Entity.Windwalker);
  2628.                                                     client.SendScreen(upd2, true);
  2629.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.JusticeChant);
  2630.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ChillingSnow);
  2631.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.FreezingPelter);
  2632.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.HealingSnow);
  2633.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.RevengeTaill);
  2634.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ShadowofChaser);
  2635.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.Omnipotence);
  2636.                                                     dialog.Text("Okay, I`ve changed your branch to [RangedChaser].");
  2637.                                                     dialog.Option("Thanks!", 255);
  2638.                                                     dialog.Send();
  2639.                                                     break;
  2640.                                                 }
  2641.                                             case 3:
  2642.                                                 {
  2643.                                                     if (client.Entity.FirstRebornClass == 0)
  2644.                                                     {
  2645.                                                         client.AddSpell(LearnableSpell(12830));
  2646.                                                         break;
  2647.                                                     }
  2648.                                                     else if (client.Entity.FirstRebornClass == 165)
  2649.                                                     {
  2650.                                                         client.AddSpell(LearnableSpell(13070));
  2651.                                                         break;
  2652.                                                     }
  2653.                                                     else if (client.Entity.FirstRebornClass == 165 & client.Entity.SecondRebornClass == 165)
  2654.                                                     {
  2655.                                                         client.AddSpell(LearnableSpell(13080));
  2656.                                                         break;
  2657.                                                     }
  2658.                                                     else
  2659.                                                     {
  2660.                                                         client.MessageBox("You`re not qualified to learn this skill.");
  2661.                                                         break;
  2662.                                                     }
  2663.  
  2664.                                                 }
  2665.                                             case 2:
  2666.                                                 {
  2667.                                                     dialog.Text("Our Windwalker school is divided into two branches: Chaser and Stomper. Chaser focuses on");
  2668.                                                     dialog.Text("~ranged combat, while Stomper excels in melee combat. I`m here representing the Chief to");
  2669.                                                     dialog.Text("~impart distinctive skills to the Windwalkers.");
  2670.  
  2671.                                                     dialog.Option("Learn~skills~of~Stomper.", 10);
  2672.                                                     dialog.Option("Learn~skills~of~Chaser.", 11);
  2673.                                                     dialog.Option("Learn~rebirth~skill.", 12);
  2674.                                                     dialog.Option("Learn~universal~skills.", 13);
  2675.                                                     dialog.Send();
  2676.                                                     break;
  2677.                                                 }
  2678.                                             case 12:
  2679.                                                 {
  2680.                                                     dialog.Text("Frost Gaze is an exclusive rebirth skill for Windwalker. The heroes who got reborn to be Windwalker can learn Frost Gaze I. If both of your precious andd");
  2681.                                                     dialog.Text("~current Class are Windwalker, you can learn Frost Gaze II. While for Windwalkers who were also a Windwalker in previous two lives, they can learn Frost Gaze III.");
  2682.  
  2683.                                                     if (client.Entity.FirstRebornClass == 0)
  2684.                                                         dialog.Option("Frost~Gaze~I.", 3);
  2685.                                                     if (client.Entity.FirstRebornClass == 165)
  2686.                                                         dialog.Option("Frost~Gaze~II.", 3);
  2687.                                                     if (client.Entity.SecondRebornClass == 165)
  2688.                                                         dialog.Option("Frost~Gaze~III.", 3);
  2689.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  2690.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  2691.                                                     dialog.Send();
  2692.                                                     break;
  2693.                                                 }
  2694.                                             case 13:
  2695.                                                 {
  2696.                                                     dialog.Text("Omnipotence and Justice Chant are basic skills for Windwalker, which are available to both Chaser and Stomper learners. I`ll teach you if you want.");
  2697.  
  2698.                                                     dialog.Option("Omnipotence~[Lv.3].~(" + WindwalkerSkills(client, 12860) + ")", 40);
  2699.                                                     dialog.Option("JusticeChant~[Lv.3].~(" + WindwalkerSkills(client, 12870) + ")", 41);
  2700.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  2701.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  2702.                                                     dialog.Send();
  2703.                                                     break;
  2704.                                                 }
  2705.                                             case 40:
  2706.                                             case 41:
  2707.                                                 {
  2708.                                                     ushort spellid = 12800;
  2709.                                                     switch (npcRequest.OptionID)
  2710.                                                     {
  2711.                                                         case 40: { spellid += 60; break; }
  2712.                                                         case 41: { spellid += 70; break; }
  2713.                                                     }
  2714.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  2715.                                                     {
  2716.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  2717.  
  2718.                                                         dialog.Option("Okay.", 2);
  2719.                                                         dialog.Send();
  2720.                                                         break;
  2721.                                                     }
  2722.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  2723.                                                     {
  2724.                                                         client.AddSpell(LearnableSpell(spellid));
  2725.                                                     }
  2726.                                                     else
  2727.                                                     {
  2728.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  2729.  
  2730.                                                         dialog.Option("I`ll~see~you!", 2);
  2731.                                                         dialog.Send();
  2732.                                                     }
  2733.                                                     break;
  2734.                                                 }
  2735.                                             case 10:
  2736.                                                 {
  2737.                                                     dialog.Text("The Stomper branch has developed overwhelming melee skills which enable the caster to disable an enemy with swift and flexible fighting moves.");
  2738.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  2739.  
  2740.                                                     dialog.Option("AngerofStomper~[Lv.1].~(" + WindwalkerSkills(client, 12980) + ")", 20);
  2741.                                                     dialog.Option("BurntFrost~[Lv.15].~(" + WindwalkerSkills(client, 12940) + ")", 21);
  2742.                                                     dialog.Option("HealingSnow~[Lv.15].~(" + WindwalkerSkills(client, 12950) + ")", 22);
  2743.                                                     dialog.Option("RageofWar~[Lv.40].~(" + WindwalkerSkills(client, 12930) + ")", 23);
  2744.                                                     dialog.Option("HorrorofStomper~[Lv.40].~(" + WindwalkerSkills(client, 12990) + ")", 24);
  2745.                                                     dialog.Option("ChillingSnow~[Lv.70].~(" + WindwalkerSkills(client, 12960) + ")", 25);
  2746.                                                     dialog.Option("PeaceofStomper~[Lv.70].~(" + WindwalkerSkills(client, 13000) + ")", 26);
  2747.                                                     dialog.Option("Next.", 27);
  2748.                                                     dialog.Send();
  2749.                                                     break;
  2750.                                                 }
  2751.                                             case 27:
  2752.                                                 {
  2753.                                                     dialog.Text("The Stomper branch has developed overwhelming melee skills which enable the caster to disable an enemy with swift and flexible fighting moves.");
  2754.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  2755.  
  2756.                                                     dialog.Option("RevengeTail~[Lv.100].~(" + WindwalkerSkills(client, 13030) + ")", 28);
  2757.                                                     dialog.Option("FreezingPelter~[Lv.100].~(" + WindwalkerSkills(client, 13020) + ")", 29);
  2758.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  2759.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  2760.                                                     dialog.Option("Previous.", 10);
  2761.                                                     dialog.Send();
  2762.                                                     break;
  2763.                                                 }
  2764.                                             case 20:
  2765.                                             case 21:
  2766.                                             case 22:
  2767.                                             case 23:
  2768.                                             case 24:
  2769.                                             case 25:
  2770.                                             case 26:
  2771.                                             case 28:
  2772.                                             case 29:
  2773.                                                 {
  2774.                                                     ushort spellid = 12900;
  2775.                                                     switch (npcRequest.OptionID)
  2776.                                                     {
  2777.                                                         case 20: { spellid += 80; break; }
  2778.                                                         case 21: { spellid += 40; break; }
  2779.                                                         case 22: { spellid += 50; break; }
  2780.                                                         case 23: { spellid += 30; break; }
  2781.                                                         case 24: { spellid += 90; break; }
  2782.                                                         case 25: { spellid += 60; break; }
  2783.                                                         case 26: { spellid += 100; break; }
  2784.                                                         case 28: { spellid += 130; break; }
  2785.                                                         case 29: { spellid += 120; break; }
  2786.                                                     }
  2787.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  2788.                                                     {
  2789.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  2790.  
  2791.                                                         dialog.Option("Okay.", 2);
  2792.                                                         dialog.Send();
  2793.                                                         break;
  2794.                                                     }
  2795.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  2796.                                                     {
  2797.                                                         client.AddSpell(LearnableSpell(spellid));
  2798.                                                     }
  2799.                                                     else
  2800.                                                     {
  2801.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  2802.  
  2803.                                                         dialog.Option("I`ll~see~you!", 2);
  2804.                                                         dialog.Send();
  2805.                                                     }
  2806.                                                     break;
  2807.                                                 }
  2808.                                             case 11:
  2809.                                                 {
  2810.                                                     dialog.Text("The Chaser branch is famous for its ability to control wind and outstanding ranged attacks.");
  2811.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  2812.  
  2813.                                                     dialog.Option("SwirlingStorm~[Lv.15].~(" + WindwalkerSkills(client, 12890) + ")", 30);
  2814.                                                     dialog.Option("ShadowofChaser~[Lv.15].~(" + WindwalkerSkills(client, 13090) + ")", 31);
  2815.                                                     dialog.Option("TripleBlasts~[Lv.40].~(" + WindwalkerSkills(client, 12850) + ")", 32);
  2816.                                                     dialog.Option("Thundercloud~[Lv.70]~[" + WindwalkerSkills(client, 12840) + "]", 33);
  2817.                                                     dialog.Option("Thunderbolt~[Lv.100]~[" + WindwalkerSkills(client, 12970) + "]", 34);
  2818.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  2819.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  2820.                                                     dialog.Send();
  2821.                                                     break;
  2822.                                                 }
  2823.                                             case 30:
  2824.                                             case 31:
  2825.                                             case 32:
  2826.                                             case 33:
  2827.                                             case 34:
  2828.                                                 {
  2829.                                                     ushort spellid = 12800;
  2830.                                                     switch (npcRequest.OptionID)
  2831.                                                     {
  2832.                                                         case 30: { spellid += 90; break; }
  2833.                                                         case 31: { spellid += 290; break; }
  2834.                                                         case 32: { spellid += 50; break; }
  2835.                                                         case 33: { spellid += 40; break; }
  2836.                                                         case 34: { spellid += 170; break; }
  2837.                                                     }
  2838.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  2839.                                                     {
  2840.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  2841.  
  2842.                                                         dialog.Option("Okay.", 2);
  2843.                                                         dialog.Send();
  2844.                                                         break;
  2845.                                                     }
  2846.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  2847.                                                     {
  2848.                                                         client.AddSpell(LearnableSpell(spellid));
  2849.                                                     }
  2850.                                                     else
  2851.                                                     {
  2852.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  2853.  
  2854.                                                         dialog.Option("I`ll~see~you!", 2);
  2855.                                                         dialog.Send();
  2856.                                                     }
  2857.                                                     break;
  2858.                                                 }
  2859.                                         }
  2860.                                         break;
  2861.                                     }
  2862.                                 #endregion
  2863. بعدين ان بى سى ريبورن واسكند
  2864. هنبدله بى ده
  2865. #region RebirthMaster
  2866.                     case 59558:
  2867.                         {
  2868.                             dialog.Avatar(67);
  2869.                             switch (npcRequest.OptionID)
  2870.                             {
  2871.                                 case 0:
  2872.                                     {
  2873.  
  2874.                                         dialog.Text("I devote all my life to the research of eternity. And finally I Know the secret of");
  2875.                                         dialog.Text(" rebirth! Well, anything I can help you with?");
  2876.                                         dialog.Option("1st Rebirth.", 1);
  2877.                                         dialog.Option("2nd Rebirth.", 2);
  2878.                                         dialog.Option("Reincarnation.", 3);
  2879.                                         dialog.Option("Reallot my Attribute Points.", 4);
  2880.                                         dialog.Option("Just Passing By.", 255);
  2881.                                         dialog.Send();
  2882.                                         break;
  2883.                                     }
  2884.                                 case 175:
  2885.                                     {
  2886.                                         dialog.Text("It`s a magic stone which is required for the 1st rebirth. There`re 2 ways you can get it: a) Buy it from the Shopping Mall,");
  2887.                                         dialog.Text("~b) Collect 7 Normal gems and a bottle of Clean Water, swap them for a Celestial Stone from Celestine (Twin City 365,92).");
  2888.                                         dialog.Text("~Tips: You can dig for gems in Mine Caves in main cities. As to the Clean Water, you try your luck on the Water Devil in the Adventure Islands.");
  2889.  
  2890.                                         dialog.Option("I~see.", 255);
  2891.                                         dialog.Send();
  2892.                                         break;
  2893.                                     }
  2894.                                 case 176:
  2895.                                     {
  2896.                                         dialog.Text("After the rebirth, you`ll receive some extra attribute points and start from Level 15. Every time you level up, you`ll gain some attribute points, which you can allot to different attributes at your will.");
  2897.  
  2898.                                         dialog.Option("Back.", 1);
  2899.                                         dialog.Option("I~see.", 255);
  2900.                                         dialog.Send();
  2901.                                         break;
  2902.                                     }
  2903.                                 case 177:
  2904.                                     {
  2905.                                         dialog.Text("Some of the skills you`ve leant are completely forgotten after the rebirth, while the others are forgotten for the moment.");
  2906.                                         dialog.Text("~They can have an epiphany. The epiphany makes the skill leap, after it reaches to half of the former level before rebirth.");
  2907.  
  2908.                                         dialog.Option("Back.", 1);
  2909.                                         dialog.Option("I~see.", 255);
  2910.                                         dialog.Send();
  2911.                                         break;
  2912.                                     }
  2913.                                 case 190:
  2914.                                     {
  2915.                                         dialog.Text("It`s a magic stone which is required for the 1st rebirth. There`re 2 ways you can get it: a) Buy it from the Shopping Mall,");
  2916.                                         dialog.Text("~b) Collect 7 Normal gems and a bottle of Clean Water, swap them for a Celestial Stone from Celestine (Twin City 365,92).");
  2917.                                         dialog.Text("~Tips: You can dig for gems in Mine Caves in main cities. As to the Clean Water, you try your luck on the Water Devil in the Adventure Islands.");
  2918.  
  2919.                                         dialog.Option("I~see.", 255);
  2920.                                         dialog.Send();
  2921.                                         break;
  2922.                                     }
  2923.                                 case 1:
  2924.                                     {
  2925.                                         if (client.Entity.Reborn == 0)
  2926.                                         {
  2927.                                             if (client.Entity.Level >= 120 || client.Entity.Class > 100 && client.Entity.Level >= 110)
  2928.                                             {
  2929.                                                 if (client.Entity.Class % 10 == 5)
  2930.                                                 {
  2931.                                                     if (client.Inventory.Contains(721259, 1))
  2932.                                                     {
  2933.                                                         dialog.Text("If you want to get reborn, you should reach at least Level 120 (Level 110 if you`re a Water Taoist), and be promoted to the highest job title.");
  2934.                                                         dialog.Text("~Besides, you should give me a Celestial Stone. After rebirth, you`ll be able to freely allot your attribute points and learn more powerful skills.");
  2935.  
  2936.                                                         dialog.Option("Celestial~Stone?", 175);
  2937.                                                         dialog.Option("Allot~attribute~points?", 176);
  2938.                                                         dialog.Option("Powerful~skills?", 177);
  2939.                                                         dialog.Option("I~would~like~to~be~reborn.", 12);
  2940.                                                         dialog.Option("Let~me~think~it~over.", 255);
  2941.                                                         dialog.Send();
  2942.                                                     }
  2943.                                                     else
  2944.                                                     {
  2945.                                                         dialog.Text("I`m really sorry, but I can`t do anything without the Celestial Stone.");
  2946.  
  2947.                                                         dialog.Option("Celestial~Stone?", 190);
  2948.                                                         dialog.Send();
  2949.                                                     }
  2950.                                                 }
  2951.                                                 else
  2952.                                                 {
  2953.  
  2954.                                                     dialog.Text("You need to master your class. First!.");
  2955.  
  2956.                                                     dialog.Option("I~see.", 255);
  2957.                                                     dialog.Send();
  2958.  
  2959.                                                 }
  2960.                                             }
  2961.                                             else
  2962.                                             {
  2963.                                                 dialog.Text("Your~Level~is~lower~than~the~required.~Please~train~harder.");
  2964.  
  2965.                                                 dialog.Option("I~see.", 255);
  2966.                                                 dialog.Send();
  2967.                                             }
  2968.                                         }
  2969.                                         else
  2970.                                         {
  2971.                                             dialog.Text("You~have~been~reborn.~Please~work~harder.");
  2972.  
  2973.                                             dialog.Option("Oh,~I~see.", 255);
  2974.                                             dialog.Send();
  2975.                                         }
  2976.                                         break;
  2977.                                     }
  2978.                                 case 12:
  2979.                                     {
  2980.                                         if (client.Entity.Reborn == 0)
  2981.                                         {
  2982.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  2983.                                             {
  2984.                                                 dialog.Text("There`re 2 ways to get reborn. Attention: Only the items you equipped will be degraded during the rebirth.");
  2985.  
  2986.                                                 dialog.Option("Blessed~rebirth.", 181);
  2987.                                                 dialog.Option("Normal~rebirth.", 180);
  2988.                                                 dialog.Send();
  2989.                                             }
  2990.                                             else
  2991.                                             {
  2992.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  2993.                                                 dialog.Option("Ahh.", 255);
  2994.                                                 dialog.Send();
  2995.                                             }
  2996.                                         }
  2997.                                         else
  2998.                                         {
  2999.                                             dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  3000.                                             dialog.Option("Thank you.", 255);
  3001.                                             dialog.Send();
  3002.                                         }
  3003.                                         break;
  3004.                                     }
  3005.                                 case 181:
  3006.                                     {
  3007.                                         dialog.Text("I dedicate myself to studying the blessed force of eternity, which absorbs the essences of the universe.");
  3008.                                         dialog.Text("~During the rebirth, a random piece of your equipment will be added with blessed attribute.");
  3009.                                         dialog.Text("But please be noted that epic weapons can only be blessed when you get reborn into the same class (for instance: Trojan-Trojan, Ninja-Ninja).");
  3010.  
  3011.                                         dialog.Option("I~agree.", 13);
  3012.                                         dialog.Option("Back.", 12);
  3013.                                         dialog.Option("Let~me~think~it~over.", 255);
  3014.                                         dialog.Send();
  3015.                                         break;
  3016.                                     }
  3017.                                 case 180:
  3018.                                     {
  3019.                                         dialog.Text("Unlike blessed rebirth, you won`t get blessed attribute added to your equipment.");
  3020.                                         dialog.Text("~However, you will receive a Super gem, instead. So, select a class for your new life, first!");
  3021.  
  3022.                                         dialog.Option("Okay.", 15);
  3023.                                         dialog.Option("Back.", 12);
  3024.                                         dialog.Option("Let~me~think~it~over.", 255);
  3025.                                         dialog.Send();
  3026.                                         break;
  3027.                                     }
  3028.                                 case 15:
  3029.                                     {
  3030.                                         if (client.Entity.Reborn == 0)
  3031.                                         {
  3032.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  3033.                                             {
  3034.                                                 dialog.Text("Select the super gem you desire.");
  3035.                                                 dialog.Option("SuperPhoenixGem.", 203);
  3036.                                                 dialog.Option("SuperDragonGem.", 213);
  3037.                                                 dialog.Option("SuperFuryGem.", 223);
  3038.                                                 dialog.Option("SuperRainbowGem.", 233);
  3039.                                                 dialog.Option("SuperVioletGem.", 253);
  3040.                                                 dialog.Option("SuperMoonGem.", 254);
  3041.                                                 dialog.Option("SuperKylinGem.", 243);
  3042.                                                 dialog.Option("Nothing thank you.", 255);
  3043.                                                 dialog.Send();
  3044.                                             }
  3045.                                             else
  3046.                                             {
  3047.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  3048.                                                 dialog.Option("Ahh.", 255);
  3049.                                                 dialog.Send();
  3050.                                             }
  3051.                                             break;
  3052.                                         }
  3053.                                         else
  3054.                                         {
  3055.                                             dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  3056.                                             dialog.Option("Thank you.", 255);
  3057.                                             dialog.Send();
  3058.                                         }
  3059.                                         break;
  3060.                                     }
  3061.                                 case 185:
  3062.                                     {
  3063.                                         dialog.Text("You`ve reached the highest of the class. Now, you can select one of the followings as your new class:");
  3064.  
  3065.                                         dialog.Option("Pirate.", (byte)(70 + 13));
  3066.                                         dialog.Option("Wind.Guard.", (byte)(161 + npcRequest.OptionID));
  3067.                                         dialog.Option("Dragon-Warror.", (byte)(80 + 13));
  3068.                                         dialog.Option("Previous~page.", 13);
  3069.                                         dialog.Option("I`ll~think~about~it.", 255);
  3070.                                         dialog.Send();
  3071.                                         break;
  3072.                                     }
  3073.                                 case 13:
  3074.                                     {
  3075.                                         if (client.Entity.Reborn == 0)
  3076.                                         {
  3077.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  3078.                                             {
  3079.                                                 dialog.Text("You`ve reached the highest of the class. Now, you can select one of the followings as your new class:");
  3080.  
  3081.                                                 dialog.Option("Trojan.", (byte)(10 + npcRequest.OptionID));
  3082.                                                 dialog.Option("Warrior.", (byte)(20 + npcRequest.OptionID));
  3083.                                                 dialog.Option("Archer.", (byte)(40 + npcRequest.OptionID));
  3084.                                                 dialog.Option("WaterTaoist.", (byte)(132 + npcRequest.OptionID));
  3085.                                                 dialog.Option("FireTaoist.", (byte)(142 + npcRequest.OptionID));
  3086.                                                 dialog.Option("Ninja.", (byte)(50 + npcRequest.OptionID));
  3087.                                                 dialog.Option("Monk.", (byte)(60 + npcRequest.OptionID));
  3088.                                                 dialog.Option("More~choices.", 185);
  3089.                                                 dialog.Send();
  3090.                                             }
  3091.                                             else
  3092.                                             {
  3093.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  3094.                                                 dialog.Option("Ahh.", 255);
  3095.                                                 dialog.Send();
  3096.                                             }
  3097.                                             break;
  3098.                                         }
  3099.                                         else
  3100.                                         {
  3101.                                             dialog.Text("You have been reborn. Please work harder.");
  3102.                                             dialog.Option("Thank you.", 255);
  3103.                                             dialog.Send();
  3104.                                         }
  3105.                                         break;
  3106.                                     }
  3107.                                 #region Reincarnation
  3108.                                 case 3:
  3109.                                     {
  3110.                                         dialog.Text("From now on, have total control of your life! If you've been Reborn twice and are at least Level 110, just bring me some Oblivion Dew and I'll help you become Reincarnated! After the Reincarnation, your class skills will revert to level 0,");
  3111.                                         dialog.Text("~but they`ll return to their previous levels when you reach Level 110, again. If your classes have been the same for all three lives, including your current one, you can learn the Pure Skills from your class trainer,");
  3112.                                         dialog.Text("~in the job center.");
  3113.  
  3114.                                         dialog.Option("I~want~to~get~Reincarnated.", 5);
  3115.                                         dialog.Option("Where~can~I~get~the~Dew?", 6);
  3116.                                         dialog.Send();
  3117.                                         break;
  3118.                                     }
  3119.                                 case 5:
  3120.                                     {
  3121.                                         if (client.Entity.Reborn == 2 && client.Entity.Level >= 120)
  3122.                                         {
  3123.                                             client.Send(new Data(true)
  3124.                                             {
  3125.                                                 UID = client.Entity.UID,
  3126.                                                 ID = Data.OpenWindow,
  3127.                                                 dwParam = Data.WindowCommands.Reincarnation,
  3128.                                                 wParam1 = client.Entity.X,
  3129.                                                 wParam2 = client.Entity.Y
  3130.                                             });
  3131.                                         }
  3132.                                         else
  3133.                                         {
  3134.                                             dialog.Text("You have not been Reborn twice. I`m afraid you will not withstand the power of the Oblivion Dew. Come to me when you get stronger.");
  3135.  
  3136.                                             dialog.Option("Got~it!~Thanks!", 255);
  3137.                                             dialog.Send();
  3138.                                         }
  3139.                                         break;
  3140.                                     }
  3141.                                 case 6:
  3142.                                     {
  3143.                                         dialog.Text("Oblivion Dew is available in the Honor Store and the Horse Race Store. You can use your Honor Points or Horse Race Points to purchase one.");
  3144.  
  3145.                                         dialog.Option("Got~it!~Thanks!", 255);
  3146.                                         dialog.Send();
  3147.                                         break;
  3148.                                     }
  3149.                                 #endregion
  3150.                                 #region Reallot Attributes
  3151.                                 case 4:
  3152.                                     {
  3153.                                         dialog.Text("Reborn~level~70+~players~can~redistribute~their~attribute~points~at~the~cost~of~a~dragonball.");
  3154.  
  3155.                                         dialog.Option("I~will~reallot~my~points.", 8);
  3156.                                         dialog.Option("Let~me~think~it~over.", 255);
  3157.                                         dialog.Send();
  3158.                                         break;
  3159.                                     }
  3160.                                 case 8:
  3161.                                     {
  3162.                                         if (client.Entity.Reborn > 0)
  3163.                                         {
  3164.                                             if (client.Entity.Level >= 70)
  3165.                                             {
  3166.                                                 if (client.Inventory.Contains(1088000, 1))
  3167.                                                 {
  3168.                                                     client.Inventory.Remove(1088000, 1);
  3169.                                                     if (client.Entity.Reborn != 0)
  3170.                                                     {
  3171.                                                         client.Entity.Agility = 0;
  3172.                                                         client.Entity.Strength = 0;
  3173.                                                         client.Entity.Vitality = 1;
  3174.                                                         client.Entity.Spirit = 0;
  3175.                                                         if (client.Entity.Reborn == 1)
  3176.                                                         {
  3177.                                                             client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
  3178.                                                                 + 52 + 3 * (client.Entity.Level - 15));
  3179.                                                         }
  3180.                                                         else
  3181.                                                         {
  3182.                                                             client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
  3183.                                                                 client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
  3184.                                                         }
  3185.                                                     }
  3186.                                                 }
  3187.                                                 else
  3188.                                                 {
  3189.                                                     dialog.Text("Although~you~are~reborn,~you~have~not~reached~level~70.~Please~put~in~more~efforts.");
  3190.  
  3191.                                                     dialog.Option("I~see.", 255);
  3192.                                                     dialog.Send();
  3193.                                                 }
  3194.                                             }
  3195.                                             else
  3196.                                             {
  3197.                                                 dialog.Text("Sorry,~you~do~not~have~a~dragonball.");
  3198.  
  3199.                                                 dialog.Option("I~see.", 255);
  3200.                                                 dialog.Send();
  3201.                                             }
  3202.                                         }
  3203.                                         else
  3204.                                         {
  3205.                                             dialog.Text("You~cannot~reallot~your~ability~points~unless~you~are~reborn~and~above~level~70.");
  3206.  
  3207.                                             dialog.Option("I~see.", 255);
  3208.                                             dialog.Send();
  3209.                                         }
  3210.                                         break;
  3211.                                     }
  3212.                                 #endregion
  3213.                                 #region 2nd reborn
  3214.                                 case 2:
  3215.                                     {
  3216.                                         if (client.Entity.Reborn == 1)
  3217.                                         {
  3218.                                             dialog.Text("Good. You`ve met the requirements for the second rebirth. You`ll face ElmistRo challenges till you complete the big quest.");
  3219.                                             dialog.Text("~Once you manage to get reborn, you will receive unique aura, be able to learn Bless, and enjoy many benefits.");
  3220.                                             dialog.Text("~If you don`t want to bother with the quest, just go buy an Exemption Token!");
  3221.                                             dialog.Option("Exemption~Token?", 9);
  3222.                                             dialog.Option("Hear~about~the~quest.", 254);
  3223.                                             dialog.Option("Back.", 255);
  3224.                                             dialog.Option("Never~mind.~I~quit.", 255);
  3225.                                             dialog.Send();
  3226.                                         }
  3227.                                         else if (client.Entity.Reborn == 2)
  3228.                                         {
  3229.                                             dialog.Text("Impressive! You are already reborn twice!");
  3230.                                             dialog.Option("Take me to the Evil Abyss.", 254);
  3231.                                             dialog.Option("Yup!", 255);
  3232.                                             dialog.Send();
  3233.                                         }
  3234.                                         break;
  3235.                                     }
  3236.                                 case 9:
  3237.                                     {
  3238.                                         if (client.Entity.Reborn == 1)
  3239.                                         {
  3240.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  3241.                                             {
  3242.                                                 dialog.Text("Select the class you want to reborn in.");
  3243.                                                 dialog.Option("Trojan.", 11);
  3244.                                                 dialog.Option("Warrior.", 21);
  3245.                                                 dialog.Option("Archer.", 41);
  3246.                                                 dialog.Option("WaterTaoist.", 132);
  3247.                                                 dialog.Option("FireTaoist.", 142);
  3248.                                                 dialog.Option("Ninja.", 51);
  3249.                                                 dialog.Option("Monk.", 61);
  3250.                                                 dialog.Option("Pirate.", 71);
  3251.                                                 dialog.Option("Wind.Guard.", 161);
  3252.                                                 dialog.Option("Dragon-Warror", 81);
  3253.                                                 dialog.Send();
  3254.                                             }
  3255.                                             else
  3256.                                             {
  3257.                                                 dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
  3258.                                                 dialog.Option("I'll just leave", 255);
  3259.                                                 dialog.Send();
  3260.                                                 break;
  3261.                                             }
  3262.                                         }
  3263.                                         else
  3264.                                         {
  3265.                                             dialog.Text("Impressive! You are already reborn twice!");
  3266.                                             dialog.Option("Take me to the Evil Abyss.", 254);
  3267.                                             dialog.Option("Yup!", 255);
  3268.                                             dialog.Send();
  3269.                                             break;
  3270.                                         }
  3271.                                         break;
  3272.                                     }
  3273.                                 case 11:
  3274.                                 case 21:
  3275.                                 case 41:
  3276.                                 case 51:
  3277.                                 case 61:
  3278.                                 case 71:
  3279.                                 case 81:
  3280.                                 case 132:
  3281.                                 case 142:
  3282.                                 case 161:
  3283.                                     {
  3284.                                         if (npcRequest.OptionID == 255) return;
  3285.                                         if (client.Entity.Reborn == 1)
  3286.                                         {
  3287.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  3288.                                             {
  3289.                                                 if (client.Inventory.Contains(723701, 1) || client.Quests.GetQuest(QuestID.SecondQuestStageFour) != null && client.Quests.CheckQuest(QuestID.SecondQuestStageFour) == QuestPacket.QuestData.QuestStatus.Finished)
  3290.                                                 {
  3291.                                                     if (client.Reborn(npcRequest.OptionID))
  3292.                                                     {
  3293.                                                         client.Inventory.Remove(723701, 1);
  3294.                                                     }
  3295.                                                     else
  3296.                                                     {
  3297.                                                         dialog.Text("You need two free slots in your inventory.");
  3298.                                                         dialog.Option("I'll just leave", 255);
  3299.                                                         dialog.Send();
  3300.                                                         break;
  3301.                                                     }
  3302.                                                 }
  3303.                                             }
  3304.                                             else
  3305.                                             {
  3306.                                                 dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
  3307.                                                 dialog.Option("I'll just leave", 255);
  3308.                                                 dialog.Send();
  3309.                                                 break;
  3310.                                             }
  3311.                                         }
  3312.                                         else
  3313.                                         {
  3314.                                             dialog.Text("You need to be in the second life to be able to get the third life.");
  3315.                                             dialog.Option("I'll just leave", 255);
  3316.                                             dialog.Send();
  3317.                                             break;
  3318.                                         }
  3319.                                         break;
  3320.                                     }
  3321.                                 case 254:
  3322.                                     {
  3323.                                         if (client.Entity.Reborn == 1 && client.Quests.GetQuest(QuestID.SecondQuestStageFour) != null && client.Quests.CheckQuest(QuestID.SecondQuestStageFour) == QuestPacket.QuestData.QuestStatus.Finished)
  3324.                                         {
  3325.                                             dialog.Text("You have completed your quests with protect performance. you can take your");
  3326.                                             dialog.Text(" Second Rebirth now.");
  3327.                                             dialog.Option("I want second rebirth.", 9);
  3328.                                             dialog.Option("I don't want second rebirth.", 255);
  3329.                                             dialog.Send();
  3330.                                         }
  3331.                                         else
  3332.                                         {
  3333.                                             dialog.Text("It`s a really ElmistRo way to go... You`re going to meet many trials in the Evil Abyss. What`s more, after you get reborn,"); dialog.Text("~you will need to start over again and make triple efforts to level-up. You`d better think it over before making such a vital decision."); dialog.Text("~If you`ve made up your mind to accept this quest, I`ll send you to the Evil Abyss.");
  3334.                                             dialog.Option("Yes,~please!", 253);
  3335.                                             dialog.Option("I~don`t~want~to~risk~my~life.", 255);
  3336.                                             dialog.Send();
  3337.                                         }
  3338.                                         break;
  3339.                                     }
  3340.                                 case 253:
  3341.                                     {
  3342.                                         var coords = Kernel.Maps[1700].RandomCoordinates(692, 709, 40);
  3343.                                         client.Entity.TeleportTeam(1700, coords.Item1, coords.Item2);
  3344.                                         break;
  3345.                                     }
  3346.                                 #endregion
  3347.                                 default:
  3348.                                     {
  3349.                                         if (client.Entity.Reborn == 0)
  3350.                                         {
  3351.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  3352.                                             {
  3353.                                                 if (npcRequest.OptionID == 255)
  3354.                                                     return;
  3355.                                                 if (npcRequest.OptionID >= 200 && npcRequest.OptionID <= 254)
  3356.                                                 {
  3357.                                                     client.SelectedGem = (byte)(npcRequest.OptionID % 100);
  3358.                                                     if (client.SelectedGem == 54)
  3359.                                                         client.SelectedGem = 63;
  3360.                                                     if (client.Entity.Reborn == 0)
  3361.                                                     {
  3362.                                                         byte id = 4;
  3363.                                                         dialog.Text("Select the class you want to reborn in.");
  3364.                                                         dialog.Option("Trojan.", (byte)(10 + id));
  3365.                                                         dialog.Option("Warrior.", (byte)(20 + id));
  3366.                                                         dialog.Option("Archer.", (byte)(40 + id));
  3367.                                                         dialog.Option("WaterTaoist.", (byte)(132 + id));
  3368.                                                         dialog.Option("FireTaoist.", (byte)(142 + id));
  3369.                                                         dialog.Option("Ninja.", (byte)(50 + id));
  3370.                                                         dialog.Option("Monk.", (byte)(60 + id));
  3371.                                                         dialog.Option("Pirate.", (byte)(70 + id));
  3372.                                                         dialog.Option("Wind.Guard.", (byte)(161 + id));
  3373.                                                         dialog.Option("Dragon-Warror.", (byte)(80 + id));
  3374.                                                         dialog.Send();
  3375.                                                         break;
  3376.                                                     }
  3377.                                                     else
  3378.                                                     {
  3379.                                                         dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  3380.                                                         dialog.Option("Thank you.", 255);
  3381.                                                         dialog.Send();
  3382.                                                     }
  3383.                                                 }
  3384.                                                 else
  3385.                                                 {
  3386.                                                     if (client.Inventory.Contains(721259, 1))
  3387.                                                     {
  3388.                                                         byte _class = (byte)(npcRequest.OptionID - npcRequest.OptionID % 10);
  3389.                                                         if (_class > 100)
  3390.                                                             _class += 2;
  3391.                                                         byte type = (byte)(npcRequest.OptionID - _class);
  3392.                                                         if (_class < 100)
  3393.                                                             _class++;
  3394.                                                         if (type != 4)
  3395.                                                         {
  3396.                                                             _class -= 10;
  3397.                                                         }
  3398.                                                         if (client.Reborn(_class))
  3399.                                                         {
  3400.                                                             client.Inventory.Remove(721259, 1);
  3401.                                                             if (type == 4)
  3402.                                                             {
  3403.                                                                 if (client.SelectedGem != 0)
  3404.                                                                 {
  3405.                                                                     uint gemid = (uint)(client.SelectedGem + 700000);
  3406.                                                                     client.Inventory.Add(gemid, 0, 1);
  3407.                                                                 }
  3408.                                                             }
  3409.                                                             else
  3410.                                                             {
  3411.                                                                 int availableshots = 0;
  3412.                                                                 for (byte count = 0; count < 19; count++)
  3413.                                                                 {
  3414.                                                                     if (!client.Equipment.Free(count))
  3415.                                                                     {
  3416.                                                                         if (client.Equipment.TryGetItem(count).Bless == 0)
  3417.                                                                         {
  3418.                                                                             availableshots++;
  3419.                                                                         }
  3420.                                                                     }
  3421.                                                                 }
  3422.                                                                 if (availableshots != 0)
  3423.                                                                 {
  3424.                                                                     byte ex = (byte)Kernel.Random.Next(20);
  3425.                                                                     if (!client.Equipment.Free(ex) && client.Equipment.Objects[ex - 1].Position != (byte)PacketHandler.Positions.Steed)
  3426.                                                                     {
  3427.                                                                         if (client.Equipment.TryGetItem(ex).Bless == 0)
  3428.                                                                         {
  3429.                                                                             var item = client.Equipment.TryGetItem(ex);
  3430.                                                                             item.Bless = 1;
  3431.                                                                             item.Mode = ElmistRo.Game.Enums.ItemMode.Update;
  3432.                                                                             item.Send(client);
  3433.                                                                             ElmistRo.Database.ConquerItemTable.UpdateBless(item);
  3434.                                                                         }
  3435.                                                                     }
  3436.                                                                 }
  3437.                                                             }
  3438.                                                         }
  3439.                                                         else
  3440.                                                         {
  3441.                                                             dialog.Text("Sorry, but you need atleast 2 free spaces in your inventory.");
  3442.                                                             dialog.Option("Ohh.", 255);
  3443.                                                             dialog.Send();
  3444.                                                         }
  3445.                                                     }
  3446.                                                 }
  3447.                                             }
  3448.                                             else
  3449.                                             {
  3450.                                                 dialog.Text("You have been reborn. Please work harder.");
  3451.                                                 dialog.Option("Thank you.", 255);
  3452.                                                 dialog.Send();
  3453.                                             }
  3454.                                         }
  3455.                                         break;
  3456.                                     }
  3457.                             }
  3458.                             break;
  3459.                         }
  3460.                     #endregion
  3461. هتفتح فولدر
  3462. Game\Features\Reincarnation
  3463. وهنفتح ملف هاندل هنلاقيه جوه فولدر وهنبحث عن كود ده
  3464.  #region Remove Extra Skill
  3465. هنضيف فيه كود ده
  3466. if (client.Entity.FirstRebornClass == 165 && client.Entity.SecondRebornClass == 165 && client.Entity.Class == 165)
  3467.             {
  3468.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeI);
  3469.                
  3470.             }
  3471. وبعدين نفس ملف هنبحث عن كود ده
  3472. switch (client.Entity.FirstRebornClass)
  3473. هنضيف ده فيه تحتيه
  3474.  case 165:
  3475.                     {
  3476.                         Add(Game.Enums.SkillIDs.FrostGazeI);
  3477.                         Add(Game.Enums.SkillIDs.Thundercloud);
  3478.                         Add(Game.Enums.SkillIDs.TripleBlasts);
  3479.                         Add(Game.Enums.SkillIDs.Omnipotence);
  3480.                         Add(Game.Enums.SkillIDs.JusticeChant);
  3481.                         Add(Game.Enums.SkillIDs.BurntFrost);
  3482.                         Add(Game.Enums.SkillIDs.HealingSnow);
  3483.                         Add(Game.Enums.SkillIDs.ChillingSnow);
  3484.                         Add(Game.Enums.SkillIDs.Thunderbolt);
  3485.                         Add(Game.Enums.SkillIDs.AngerofStomper);
  3486.                         Add(Game.Enums.SkillIDs.HorrorofStomper);
  3487.                         Add(Game.Enums.SkillIDs.RageofWar);
  3488.                         Add(Game.Enums.SkillIDs.PeaceofStomper);
  3489.                         Add(Game.Enums.SkillIDs.FreezingPelter);
  3490.                         Add(Game.Enums.SkillIDs.RevengeTail);
  3491.                         Add(Game.Enums.SkillIDs.Circle);
  3492.                         Add(Game.Enums.SkillIDs.Rectangle);
  3493.                         Add(Game.Enums.SkillIDs.FrostGazeII);
  3494.                         Add(Game.Enums.SkillIDs.FrostGazeIII);
  3495.                         Add(Game.Enums.SkillIDs.ShadowofChaser);
  3496.                         Add(Game.Enums.SkillIDs.ThundercloudAttack);
  3497.                         Add(Game.Enums.SkillIDs.DestinyFire);
  3498.                         Add(Game.Enums.SkillIDs.FireShower);
  3499.                         Add(Game.Enums.SkillIDs.WheelOfDevastation);
  3500.                         break;
  3501.                     }
  3502.             }
  3503.  
  3504. طبعا هتقولى ايه ده ياعم ايه كمية الايرورات ديه تعالى نحلها مع بعض
  3505. شايفين كلمة SkillIDs هتدوسو عليها اف 12 وهتعملو ده
  3506. هضيفه تحت اى كود اسكل الاسكلات ديه
  3507.  FrostGazeI = 12830,
  3508.             Thundercloud = 12840,
  3509.             TripleBlasts = 12850,
  3510.             Omnipotence = 12860,
  3511.             JusticeChant = 12870,
  3512.             SwirlingStorm = 12890,
  3513.             RageofWar = 12930,
  3514.             BurntFrost = 12940,
  3515.             HealingSnow = 12950,
  3516.             ChillingSnow = 12960,
  3517.             Thunderbolt = 12970,
  3518.             AngerofStomper = 12980,
  3519.             HorrorofStomper = 12990,
  3520.             PeaceofStomper = 13000,
  3521.             FreezingPelter = 13020,
  3522.             RevengeTail = 13030,
  3523.             Circle = 13050,
  3524.             Rectangle = 13060,
  3525.             FrostGazeII = 13070,
  3526.             FrostGazeIII = 13080,
  3527.             ShadowofChaser = 13090,
  3528.             ThundercloudAttack = 13190,
  3529.             DestinyFire = 13362,
  3530.             FireShower = 13363,
  3531.             WheelOfDevastation = 13364,
  3532. بس كده الايرور اتحل بكده عملنا الفريست ريبورن تعالو نعمل السكند ريبورن
  3533. فى ملف الهاندل هنبحث عن كود ده
  3534.  switch (client.Entity.SecondRebornClass)
  3535. هنضيف ده تحتيه
  3536. case 165:
  3537.                     {
  3538.                         Add(Game.Enums.SkillIDs.FrostGazeI);
  3539.                         Add(Game.Enums.SkillIDs.Thundercloud);
  3540.                         Add(Game.Enums.SkillIDs.TripleBlasts);
  3541.                         Add(Game.Enums.SkillIDs.Omnipotence);
  3542.                         Add(Game.Enums.SkillIDs.JusticeChant);
  3543.                         Add(Game.Enums.SkillIDs.BurntFrost);
  3544.                         Add(Game.Enums.SkillIDs.HealingSnow);
  3545.                         Add(Game.Enums.SkillIDs.ChillingSnow);
  3546.                         Add(Game.Enums.SkillIDs.Thunderbolt);
  3547.                         Add(Game.Enums.SkillIDs.AngerofStomper);
  3548.                         Add(Game.Enums.SkillIDs.HorrorofStomper);
  3549.                         Add(Game.Enums.SkillIDs.RageofWar);
  3550.                         Add(Game.Enums.SkillIDs.PeaceofStomper);
  3551.                         Add(Game.Enums.SkillIDs.FreezingPelter);
  3552.                         Add(Game.Enums.SkillIDs.RevengeTail);
  3553.                         Add(Game.Enums.SkillIDs.Circle);
  3554.                         Add(Game.Enums.SkillIDs.Rectangle);
  3555.                         Add(Game.Enums.SkillIDs.FrostGazeII);
  3556.                         Add(Game.Enums.SkillIDs.FrostGazeIII);
  3557.                         Add(Game.Enums.SkillIDs.ShadowofChaser);
  3558.                         Add(Game.Enums.SkillIDs.ThundercloudAttack);
  3559.                         Add(Game.Enums.SkillIDs.DestinyFire);
  3560.                         Add(Game.Enums.SkillIDs.FireShower);
  3561.                         Add(Game.Enums.SkillIDs.WheelOfDevastation);
  3562.                         break;
  3563.                     }
  3564. وبعدين نبحث عن كود ده
  3565. #region Low level items
  3566. هنزل تحت لغايت ما نلاقى اسامى الشخصيات
  3567. هنضيف الشخصية الجديدة تحت اى شخصية
  3568. #region Windwalker
  3569.                 case 165:
  3570.                     {
  3571.                         switch (Second)
  3572.                         {
  3573.                             case 61: break;
  3574.                             default:
  3575.                                 WontAdd(Enums.SkillIDs.FrostGazeI);
  3576.                                 WontAdd(Enums.SkillIDs.Thundercloud);
  3577.                                 WontAdd(Enums.SkillIDs.TripleBlasts);
  3578.                                 WontAdd(Enums.SkillIDs.Omnipotence);
  3579.                                 WontAdd(Enums.SkillIDs.JusticeChant);
  3580.                                 WontAdd(Enums.SkillIDs.SwirlingStorm);
  3581.                                 WontAdd(Enums.SkillIDs.RageofWar);
  3582.                                 WontAdd(Enums.SkillIDs.BurntFrost);
  3583.                                 WontAdd(Enums.SkillIDs.HealingSnow);
  3584.                                 WontAdd(Enums.SkillIDs.ChillingSnow);
  3585.                                 WontAdd(Enums.SkillIDs.Thunderbolt);
  3586.                                 WontAdd(Enums.SkillIDs.AngerofStomper);
  3587.                                 WontAdd(Enums.SkillIDs.HorrorofStomper);
  3588.                                 WontAdd(Enums.SkillIDs.PeaceofStomper);
  3589.                                 WontAdd(Enums.SkillIDs.FreezingPelter);
  3590.                                 WontAdd(Enums.SkillIDs.RevengeTail);
  3591.                                 WontAdd(Enums.SkillIDs.Circle);
  3592.                                 WontAdd(Enums.SkillIDs.Rectangle);
  3593.                                 WontAdd(Enums.SkillIDs.FrostGazeII);
  3594.                                 WontAdd(Enums.SkillIDs.FrostGazeIII);
  3595.                                 WontAdd(Enums.SkillIDs.ShadowofChaser);
  3596.                                 WontAdd(Enums.SkillIDs.ThundercloudAttack);
  3597.                                 WontAdd(Enums.SkillIDs.DestinyFire);
  3598.                                 WontAdd(Enums.SkillIDs.FireShower);
  3599.                                 WontAdd(Enums.SkillIDs.WheelOfDevastation);
  3600.                                 break;
  3601.                         }
  3602.                         break;
  3603.                     }
  3604.                 #endregion
  3605. وبعدين فى نفس ملف هنبحث عن كود ده
  3606. #region Spells
  3607. تحتيه هنضيف شخصية الجديدة
  3608. #region Windwalker
  3609.  
  3610.                 if (PreviousClass == 165)
  3611.                 {
  3612.                     if (client.Entity.Class != 161)
  3613.                     {
  3614.                         switch (spell.ID)
  3615.                         {
  3616.                             case 12830:
  3617.                             case 12840:
  3618.                             case 12850:
  3619.                             case 12860:
  3620.                             case 12870:
  3621.                             case 12880:
  3622.                             case 12890:
  3623.                             case 12930:
  3624.                             case 12940:
  3625.                             case 12950:
  3626.                             case 12960:
  3627.                             case 12970:
  3628.                             case 12980:
  3629.                             case 12990:
  3630.                             case 13000:
  3631.                             case 13020:
  3632.                             case 13030:
  3633.                             case 13190:
  3634.                             case 13050:
  3635.                             case 13060:
  3636.                             case 13070:
  3637.                             case 13080:
  3638.                             case 13090:
  3639.                             case 13360:
  3640.                                 client.RemoveSpell(spell);
  3641.                                 break;
  3642.                         }
  3643.                     }
  3644.                 }
  3645.  
  3646.                 #endregion
  3647. بعدين هنبحث تانى
  3648.  #region Spells
  3649. هنضيف الشخصية الجديدة
  3650. #region Windwalker
  3651.                 if (PreviousClass == 165)
  3652.                 {
  3653.                     if (client.Entity.Class != 161)
  3654.                     {
  3655.                         switch (aspell.ID)
  3656.                         {
  3657.                             case 12830:
  3658.                             case 12840:
  3659.                             case 12850:
  3660.                             case 12860:
  3661.                             case 12870:
  3662.                             case 12880:
  3663.                             case 12890:
  3664.                             case 12930:
  3665.                             case 12940:
  3666.                             case 12950:
  3667.                             case 12960:
  3668.                             case 12970:
  3669.                             case 12980:
  3670.                             case 12990:
  3671.                             case 13000:
  3672.                             case 13020:
  3673.                             case 13030:
  3674.                             case 13190:
  3675.                             case 13050:
  3676.                             case 13060:
  3677.                             case 13070:
  3678.                             case 13080:
  3679.                             case 13090:
  3680.                             case 13360:
  3681.                                 client.RemoveSpell(aspell);
  3682.                                 break;
  3683.                         }
  3684.                     }
  3685.                 }
  3686.                 #endregion
  3687. بعدين هنبحث عن كود ده
  3688. #region Add Extra Skill
  3689. هنضيف فيه كود ده
  3690. if (client.Entity.FirstRebornClass == 165 && client.Entity.SecondRebornClass == 165 && client.Entity.Class == 165)
  3691.             {
  3692.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeI);
  3693.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeIII);
  3694.  
  3695.             }
  3696. بس كده معاك شخصية جديدة كاملة مكملة والكمال لله واحده
  3697. RAW Paste Data
  3698.  
  3699. هتروح باكت هندل
  3700. فويد  EquipItem
  3701.  
  3702. هتنزل لحد دى if (client.Entity.Class >= 80 && client.Entity.Class <= 85)
  3703.  
  3704. فوقيها هتحط دى
  3705.  
  3706. if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  3707.                 {
  3708.                     can2hand = true;
  3709.                     can2wpn = true;
  3710.                 }
  3711.  
  3712. هتنزل هتلاقى سطر بالشكل دة if (client.Entity.Class >= 100
  3713.  
  3714. هتعملو بالشكل دة
  3715.  
  3716. if (client.Entity.Class >= 100 && client.Entity.Class <= 145)
  3717.  
  3718.  
  3719. هتروح ل فويد دة EquipPassJobReq
  3720.  
  3721. هتحط دة
  3722.  
  3723.  #region Windwalker
  3724.                 case 160: if (client.Entity.Class <= 165 && client.Entity.Class >= 160) return true; break;
  3725.                 case 161: if (client.Entity.Class <= 165 && client.Entity.Class >= 161) return true; break;
  3726.                 case 162: if (client.Entity.Class <= 165 && client.Entity.Class >= 162) return true; break;
  3727.                 case 163: if (client.Entity.Class <= 165 && client.Entity.Class >= 163) return true; break;
  3728.                 case 164: if (client.Entity.Class <= 165 && client.Entity.Class >= 164) return true; break;
  3729.                 case 165: if (client.Entity.Class == 165) return true; break;
  3730.                 #endregion
  3731.  
  3732. هتروح ل فويد دة  public static ushort ItemPosition(uint ID)
  3733.  
  3734. تحت دى هتحط دول  UInt32 iType = ID / 1000;
  3735.  
  3736. if (ID >= 170000 && ID <= 170309)
  3737.                 return ConquerItem.Head;
  3738.  if (ID >= 101000 && ID <= 101309)
  3739.                 return ConquerItem.Armor;
  3740.  if (ID >= 626003 && ID <= 626439)
  3741.                 return ConquerItem.RightWeapon;
  3742.             if (ID >= 626003 && ID <= 626439)
  3743.                 return ConquerItem.LeftWeapon;
  3744.  
  3745. هتروح ل فويد دة GetPositionFromID
  3746.  
  3747. تحت دى UInt32 iType = itemid / 1000;
  3748.  
  3749. هتحط دول
  3750.  
  3751.  if (iType == 170)
  3752.                 return Positions.Head;
  3753.   if (iType == 101)
  3754.                 return Positions.Armor;
  3755. if (iType == 626)
  3756.                 return Positions.Right;
  3757.  
  3758. وهتبدل دى من جوة انتى تيبول عندك
  3759.  
  3760.  switch (eC.Class)
  3761.             {
  3762.                 case 0:
  3763.                 case 1: eC.Class = 100; break;
  3764.                 case 2:
  3765.                 case 3: eC.Class = 10; break;
  3766.                 case 4:
  3767.                 case 5: eC.Class = 40; break;
  3768.                 case 6:
  3769.                 case 7: eC.Class = 20; break;
  3770.                 case 8:
  3771.                 case 9: eC.Class = 50; break;
  3772.                 case 10:
  3773.                 case 11: eC.Class = 60; break;
  3774.                 case 12:
  3775.                 case 13: eC.Class = 70; break;
  3776.                 case 14:
  3777.                 case 15: eC.Class = 80; break;
  3778.                 case 16:
  3779.                 case 17:
  3780.                     {
  3781.                         eC.Class = 160;
  3782.                         client.Entity.Windwalker = (byte)8;//Cshser    
  3783.                         break;
  3784.                     }
  3785.                 case 18:
  3786.                 case 19:
  3787.                     {
  3788.                         eC.Class = 160;
  3789.                         client.Entity.Windwalker = (byte)0;//Stmper
  3790.                         break;
  3791.                     }
  3792.                 default: { Console.WriteLine("Error Class = " + eC.Class); } break;
  3793.             }
  3794.  
  3795. ودة الاوفسات الى زادت بتعت entity
  3796.  
  3797. public const ushort
  3798.         TimeStamp = 4,
  3799.         Mesh = 8,
  3800.         UID = 12,
  3801.         GuildID = 16,
  3802.         GuildRank = 20,
  3803.         Unknown = 24,
  3804.         StatusFlag = 26,
  3805.         StatusFlag2 = 34,
  3806.         StatusFlag3 = 42,
  3807.         StatusFlag4 = 50,
  3808.         Appearance = 54,
  3809.         Head = 56,
  3810.         Garment = 60,
  3811.         Armor = 64,
  3812.         LeftWeapon = 68,
  3813.         RightWeapon = 72,
  3814.         LeftWeaponAccessory = 76,
  3815.         RightWeaponAccessory = 80,
  3816.         Steed = 84,
  3817.         MountArmor = 88,
  3818.         Wing = 92,
  3819.         WingPlus = 96,
  3820.         WingProgress = 97,
  3821.         Hitpoints = 111,
  3822.         MonsterLevel = 117,
  3823.         X = 119,
  3824.         Y = 121,
  3825.         HairStyle = 123,
  3826.         Facing = 125,
  3827.         Action = 126,
  3828.         Action2 = 128,
  3829.         Reborn = 133,
  3830.         Level = 134,
  3831.         WindowSpawn = 136,
  3832.         Away = 137,
  3833.         ExtraBattlePower = 138,
  3834.         Flower = 154,
  3835.         NobilityRank = 158,
  3836.         ArmorColor = 162,
  3837.         LeftWeaponColor = 164,
  3838.         HeadColor = 166,
  3839.         QuizPoints = 168,
  3840.         SteedPlus = 172,
  3841.         SteedColor = 174,
  3842.         Enlighten = 178,
  3843.         TotalInnerScore = 182,
  3844.         ClanUID = 194,
  3845.         ClanRank = 198,
  3846.         ClanSharedBp = 202,
  3847.         TitleActivated = 206,
  3848.         EntitySize = 208,
  3849.         GuildSharedBp = 213,
  3850.         ShowArenaGlow = 217,
  3851.         Boss = 220,
  3852.         HeadSoul = 221,
  3853.         RaceItem = 222,
  3854.         ArmorSoul = 225,
  3855.         LeftWeaponSoul = 229,
  3856.         RightWeaponSoul = 233,
  3857.         SubPro = 237,
  3858.         SubProActive = 238,
  3859.         FirstRebornClass = 246,
  3860.         SecondRebornClass = 248,
  3861.         Class = 250,
  3862.         CountryFlag = 252,
  3863.         EquipmentColor = 258,
  3864.         JiangHuTalen = 262,
  3865.         JiangHuActive = 263,
  3866.         ServerID = 265,
  3867.         OwnerPet = 271,
  3868.         OwnerPet1 = 272,
  3869.         OwnerUID = 274,
  3870.         UnionID = 278,
  3871.         UnionExploits = 282,
  3872.         Offical_Harem_Guards = 286,
  3873.         UnionRank = 290,
  3874.         UnionType = 291,
  3875.         MyTitle = 292,
  3876.         MyTitleScore = 296,
  3877.         MyWing = 300,
  3878.         Windwalker = 304,
  3879.         Name = 312;
  3880. هتروح باكت هندل هتبحث عن
  3881.  
  3882. شفرة الى بالشكل دة
  3883.  
  3884. case "class":
  3885.                                 {
  3886.                                     byte _class = client.Entity.Class;
  3887.                                     byte.TryParse(Data[1], out _class);
  3888.                                     _class = Math.Min((byte)145, Math.Max((byte)1, _class));
  3889.                                     client.Entity.Class = _class;
  3890.                                     if (client.Entity.Reborn == 0)
  3891.                                     {
  3892.                                         Database.DataHolder.GetStats(_class, client.Entity.Level, client);
  3893.                                         client.CalculateStatBonus();
  3894.                                         client.CalculateHPBonus();
  3895.                                         client.GemAlgorithm();
  3896.                                     }
  3897.                                     break;
  3898.                                 }
  3899.  
  3900. وهتبزبط سطر دة
  3901.  
  3902. _class = Math.Min((byte)145, Math.Max((byte)1, _class));
  3903.  
  3904. بدل ما هيا 145 اعملها 165
  3905.  
  3906. ودة شفرة متعدل عليها
  3907.  
  3908. case "class":
  3909.                                 {
  3910.                                     byte _class = client.Entity.Class;
  3911.                                     byte.TryParse(Data[1], out _class);
  3912.                                     _class = Math.Min((byte)165, Math.Max((byte)1, _class));
  3913.                                     client.Entity.Class = _class;
  3914.                                     if (client.Entity.Reborn == 0)
  3915.                                     {
  3916.                                         Database.DataHolder.GetStats(_class, client.Entity.Level, client);
  3917.                                         client.CalculateStatBonus();
  3918.                                         client.CalculateHPBonus();
  3919.                                         client.GemAlgorithm();
  3920.                                     }
  3921.                                     break;
  3922.                                 }
  3923.  
  3924.  
  3925. هتروح انتى تيبول هتروح فويد
  3926.  
  3927. LoadEntity
  3928.  
  3929. تحت دة client.Entity.Class = reader.ReadByte("Class");
  3930.  
  3931. هتحط دة
  3932.  
  3933. if (reader.ReadByte("Class") >= 160 && reader.ReadByte("Class") <= 165)
  3934.                         client.Entity.Windwalker = reader.ReadByte("Windwalker");
  3935.  
  3936. وهتروح فويد  SaveEntity
  3937.  
  3938. وهتحط دة جوة
  3939.  
  3940. .Set("Windwalker", e.Windwalker)
  3941.  
  3942. وهتروح فويد  CreateEntity
  3943.  
  3944. وتنزل لحد  switch (eC.Class)
  3945.  
  3946. هتنزل لحد using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
  3947.  
  3948. وتزود دة ف الاخر قبل كلمة .Execute();
  3949.  
  3950. .Insert("Windwalker", client.Entity.Windwalker)
  3951.  
  3952. بعدين هتدخل كلاس CharacterInfo
  3953.  
  3954. هتروح فويد public byte[] ToArray()
  3955.  
  3956. وضيف دى
  3957.  
  3958.  if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  3959.                 Writer.WriteUInt32(this.client.Entity.Windwalker, 89, level);
  3960.  
  3961.  
  3962.  
  3963. وبعدين هتعمل عمود ف entities
  3964. Windwalker  bigint  20  0   -1  0   0   0   0   0   0                   0   0
  3965.  
  3966. هتدخل ع كلاس DataHolder
  3967.  
  3968. تحت دى
  3969.  
  3970.  static SafeDictionary<byte, string> MonkStats = new SafeDictionary<byte, string>(130);
  3971.  
  3972. هتحط دى
  3973.  
  3974. static SafeDictionary<byte, string> WindwalkerStats = new SafeDictionary<byte, string>(130);
  3975.  
  3976. وتحت دى
  3977.  
  3978.   public static bool IsMonk(byte Job) { return Job >= 60 && Job <= 65; }
  3979.  
  3980. هتحط دى
  3981.  
  3982. public static bool IsWindwalker(byte Job) { return Job >= 160 && Job <= 165; }
  3983.  
  3984. وهتروح ع فويد  public static void ReadStats()
  3985.  
  3986. فوق دى job = "Monk[" + lvl + "]";
  3987.  
  3988. هتحط دى
  3989.  
  3990.  job = "Windwalker[" + lvl + "]";
  3991.                     Data = IniFile.ReadString("Stats", job);
  3992.                     WindwalkerStats.Add(lvl, Data);
  3993.  
  3994. وبعدين هتروح ع فويد دة
  3995. public static void GetStats(
  3996.  
  3997. وتحت دى
  3998.  
  3999. case 60: Class = "Monk"; break;
  4000.  
  4001. هتحط دى
  4002.  
  4003.  case 160: Class = "Windwalker"; break;
  4004.  
  4005. وفوق دى
  4006.  
  4007. else if (Class == "Monk")
  4008.  
  4009. هتحط دى
  4010.  
  4011.  else if (Class == "Windwalker")
  4012.                 Data = WindwalkerStats[inLevel].Split(',');
  4013.  
  4014. وهتعمل نقاط شخصية ف ملف Stats.ini
  4015.  
  4016. ف داتا بيز
  4017.  
  4018. دة نموذج
  4019.  
  4020. Windwalker[1]=5,3,2,0
  4021. Windwalker[2]=3,6,4,0
  4022. Windwalker[3]=4,7,5,0
  4023. Windwalker[4]=4,9,6,0
  4024. Windwalker[5]=5,10,7,0
  4025. Windwalker[6]=6,10,9,0
  4026. Windwalker[7]=7,11,10,0
  4027. Windwalker[8]=7,13,11,0
  4028. Windwalker[9]=8,14,12,0
  4029. Windwalker[10]=9,15,13,0
  4030. Windwalker[11]=10,16,14,0
  4031. Windwalker[12]=10,17,15,0
  4032. Windwalker[13]=11,19,16,0
  4033. Windwalker[14]=12,20,17,0
  4034. Windwalker[15]=13,21,18,0
  4035. Windwalker[16]=13,23,19,0
  4036. Windwalker[17]=14,24,20,0
  4037. Windwalker[18]=15,25,21,0
  4038. Windwalker[19]=16,25,23,0
  4039. Windwalker[20]=17,26,24,0
  4040. Windwalker[21]=18,28,25,0
  4041. Windwalker[22]=18,29,26,0
  4042. Windwalker[23]=19,30,27,0
  4043. Windwalker[24]=19,32,28,0
  4044. Windwalker[25]=20,33,29,0
  4045. Windwalker[26]=21,34,30,0
  4046. Windwalker[27]=22,35,31,0
  4047. Windwalker[28]=22,37,32,0
  4048. Windwalker[29]=23,38,33,0
  4049. Windwalker[30]=24,39,34,0
  4050. Windwalker[31]=24,40,36,0
  4051. Windwalker[32]=25,41,37,0
  4052. Windwalker[33]=26,42,38,0
  4053. Windwalker[34]=27,43,39,0
  4054. Windwalker[35]=28,44,40,0
  4055. Windwalker[36]=28,46,41,0
  4056. Windwalker[37]=29,47,42,0
  4057. Windwalker[38]=30,48,43,0
  4058. Windwalker[39]=31,49,44,0
  4059. Windwalker[40]=32,50,45,0
  4060. Windwalker[41]=32,52,46,0
  4061. Windwalker[42]=33,53,47,0
  4062. Windwalker[43]=33,54,48,0
  4063. Windwalker[44]=34,55,50,0
  4064. Windwalker[45]=35,56,51,0
  4065. Windwalker[46]=36,57,52,0
  4066. Windwalker[47]=37,58,53,0
  4067. Windwalker[48]=37,60,54,0
  4068. Windwalker[49]=38,61,55,0
  4069. Windwalker[50]=39,62,56,0
  4070. Windwalker[51]=40,63,57,0
  4071. Windwalker[52]=40,65,58,0
  4072. Windwalker[53]=41,66,59,0
  4073. Windwalker[54]=42,67,60,0
  4074. Windwalker[55]=43,68,61,0
  4075. Windwalker[56]=43,69,63,0
  4076. Windwalker[57]=44,70,64,0
  4077. Windwalker[58]=45,71,65,0
  4078. Windwalker[59]=46,72,66,0
  4079. Windwalker[60]=46,74,67,0
  4080. Windwalker[61]=47,75,68,0
  4081. Windwalker[62]=48,76,69,0
  4082. Windwalker[63]=49,77,70,0
  4083. Windwalker[64]=49,79,71,0
  4084. Windwalker[65]=50,80,72,0
  4085. Windwalker[66]=51,81,73,0
  4086. Windwalker[67]=52,82,74,0
  4087. Windwalker[68]=52,84,75,0
  4088. Windwalker[69]=53,84,77,0
  4089. Windwalker[70]=54,85,78,0
  4090. Windwalker[71]=55,86,79,0
  4091. Windwalker[72]=55,88,80,0
  4092. Windwalker[73]=56,89,81,0
  4093. Windwalker[74]=57,90,82,0
  4094. Windwalker[75]=58,91,83,0
  4095. Windwalker[76]=58,93,84,0
  4096. Windwalker[77]=59,94,85,0
  4097. Windwalker[78]=60,95,86,0
  4098. Windwalker[79]=61,96,87,0
  4099. Windwalker[80]=61,98,88,0
  4100. Windwalker[81]=62,98,90,0
  4101. Windwalker[82]=63,99,91,0
  4102. Windwalker[83]=64,100,92,0
  4103. Windwalker[84]=64,102,93,0
  4104. Windwalker[85]=65,103,94,0
  4105. Windwalker[86]=66,104,95,0
  4106. Windwalker[87]=67,105,96,0
  4107. Windwalker[88]=67,107,97,0
  4108. Windwalker[89]=68,108,98,0
  4109. Windwalker[90]=69,109,99,0
  4110. Windwalker[91]=70,110,100,0
  4111. Windwalker[92]=70,112,101,0
  4112. Windwalker[93]=71,113,102,0
  4113. Windwalker[94]=72,113,104,0
  4114. Windwalker[95]=73,114,105,0
  4115. Windwalker[96]=73,116,106,0
  4116. Windwalker[97]=74,117,107,0
  4117. Windwalker[98]=75,118,108,0
  4118. Windwalker[99]=76,119,109,0
  4119. Windwalker[100]=76,121,110,0
  4120. Windwalker[101]=77,122,111,0
  4121. Windwalker[102]=78,123,112,0
  4122. Windwalker[103]=79,124,113,0
  4123. Windwalker[104]=79,126,114,0
  4124. Windwalker[105]=80,127,115,0
  4125. Windwalker[106]=81,127,117,0
  4126. Windwalker[107]=82,128,118,0
  4127. Windwalker[108]=82,130,119,0
  4128. Windwalker[109]=83,131,120,0
  4129. Windwalker[110]=84,132,121,0
  4130. Windwalker[111]=85,133,122,0
  4131. Windwalker[112]=85,135,123,0
  4132. Windwalker[113]=86,136,124,0
  4133. Windwalker[114]=87,137,125,0
  4134. Windwalker[115]=88,138,126,0
  4135. Windwalker[116]=88,140,127,0
  4136. Windwalker[117]=89,141,128,0
  4137. Windwalker[118]=90,142,129,0
  4138. Windwalker[119]=91,142,131,0
  4139. Windwalker[120]=91,144,132,0
  4140.  
  4141. عايز تبدء وتكملة تخمين كمل عايزو كامل زى اونلاين كلم هيما
  4142.  
  4143. هتدخل ع كلاس ابديت
  4144. هضيف دة
  4145. public class Flags4
  4146.         {
  4147.             public const ulong
  4148.             Omnipotence = 1UL << 192,
  4149.             JusticeChant = 1UL << 194,
  4150.             BlockFrostGaze = 1UL << 195,
  4151.             HealingSnow = 1UL << 196,
  4152.             ChillingSnow = 1UL << 197,
  4153.             xChillingSnow = 1UL << 198,
  4154.             FreezingPelter = 1UL << 200,
  4155.             xFreezingPelter = 1UL << 201,
  4156.             RevengeTaill = 1UL << 202,
  4157.             WindwalkerTop = 1UL << 203,
  4158.             ShadowofChaser = 1UL << 204;
  4159.         }
  4160. ثانيا هنبحث عن الفويد دا
  4161.  public void AppendFull(byte type, ulong val1, ulong val2, ulong val3)
  4162. هتلاقيه بالشكل دا
  4163.  public void AppendFull(byte type, ulong val1, ulong val2, ulong val3)
  4164.         {
  4165.             UpdateCount = UpdateCount + 1;
  4166.             ushort offset = (ushort)(16 + ((UpdateCount - 1) * 28));
  4167.             WriteUInt32(type, offset, Buffer);
  4168.             WriteUInt64(val1, offset + 4, Buffer);
  4169.             WriteUInt64(val2, offset + 12, Buffer);
  4170.             WriteUInt64(val3, offset + 20, Buffer);
  4171.         }
  4172. هنقفله من الساالب ونبدله بدا
  4173. public void AppendFull(byte type, ulong val1, ulong val2, ulong val3, ulong val4)
  4174.         {
  4175.             UpdateCount = UpdateCount + 1;
  4176.             ushort offset = (ushort)(16 + ((UpdateCount - 1) * 28));
  4177.             WriteUInt32(type, offset, Buffer);
  4178.             WriteUInt64(val1, offset + 4, Buffer);
  4179.             WriteUInt64(val2, offset + 12, Buffer);
  4180.             WriteUInt64(val3, offset + 20, Buffer);
  4181.             WriteUInt64(val4, offset + 28, Buffer);
  4182.         }
  4183. ثالثا هنبحث عن الفويد دا
  4184.  public void Append(ulong val1, ulong val2, ulong val3, uint val4, uint val5, uint val6, uint val7)
  4185. هتلاقيه بالشكل دا
  4186. public void Append(ulong val1, ulong val2, ulong val3, uint val4, uint val5, uint val6, uint val7)
  4187.         {
  4188.             UpdateCount = 2;
  4189.             WriteUInt32(0x19, 16, Buffer);
  4190.             WriteUInt64(val1, 20, Buffer);
  4191.             WriteUInt64(val2, 28, Buffer);
  4192.             WriteUInt64(val3, 36, Buffer);
  4193.             WriteUInt32(val4, 44, Buffer);
  4194.             WriteUInt32(val5, 48, Buffer);
  4195.             WriteUInt32(val6, 52, Buffer);
  4196.             WriteUInt32(val7, 56, Buffer);
  4197.         }
  4198. هنقفله من الساالب ونبدله بدا
  4199. public void Append(ulong val1, ulong val2, ulong val3, uint val4, uint val5, uint val6, uint val7)
  4200.         {
  4201.             WriteUInt32(val4, 24, Buffer);
  4202.             WriteUInt32(val6, 32, Buffer);
  4203.         }
  4204.  
  4205.  
  4206. بعدين هضيف دول ف انتى
  4207.  
  4208.   private ulong _Stateff4 = 0;
  4209.         public ulong StatusFlag4
  4210.         {
  4211.             get { return _Stateff4; }
  4212.             set
  4213.             {
  4214.                 ulong OldV = StatusFlag4;
  4215.                 if (value != OldV)
  4216.                 {
  4217.                     _Stateff4 = value;
  4218.                     WriteUInt64(value, Offset.StatusFlag4, SpawnPacket);
  4219.                     UpdateEffects(true);
  4220.                 }
  4221.             }
  4222.         }
  4223.         public void AddFlag4(ulong flag)
  4224.         {
  4225.             StatusFlag4 |= flag;
  4226.         }
  4227.         public void RemoveFlag4(ulong flag)
  4228.         {
  4229.             if (ContainsFlag4(flag))
  4230.             {
  4231.                 StatusFlag4 &= ~flag;
  4232.             }
  4233.         }
  4234.         public bool ContainsFlag4(ulong flag)
  4235.         {
  4236.             ulong aux = StatusFlag4;
  4237.             aux &= ~flag;
  4238.             return !(aux == StatusFlag4);
  4239.         }
  4240.  
  4241. وهتبحث عن public void UpdateEffects(bool screen)
  4242.  
  4243. تبدل دة بالسطر الى زيو
  4244.  
  4245.  update.AppendFull(0x19, StatusFlag, StatusFlag2, StatusFlag3, StatusFlag4);
  4246. هنيجى بقى الاسكلات كاملة والكمال لله واحده هفنتح ملف الهاندل
  4247. ونضيف دول
  4248. #region WindWalker
  4249.                                 #region Chaser
  4250.                                 #region ThunderCloud(Passive)
  4251.                                 case 12840:
  4252.                                     {
  4253.                                         if (Time64.Now >= attacker.TCSpellUse.AddSeconds(59))
  4254.                                         {
  4255.                                             if (CanUseSpell(spell, attacker.Owner))
  4256.                                             {
  4257.                                                 PrepareSpell(spell, attacker.Owner);
  4258.                                                 SpellUse suse = new SpellUse(true);
  4259.                                                 suse.Attacker = attacker.UID;
  4260.                                                 suse.X = X;
  4261.                                                 suse.Y = Y;
  4262.                                                 suse.SpellID = spell.ID;
  4263.                                                 attacker.Owner.SendScreen(suse, true);
  4264.                                                 //////////////////////////////////////////////////
  4265.                                                 ///////////////////////////////////////////////////
  4266.                                                 uint UID = Kernel.Maps[attacker.MapID].EntityUIDCounter.Next;
  4267.                                                 uint Mesh = 980;
  4268.                                                 //////////////////////////////////////////////////////
  4269.                                                 byte[] Buffer = new byte[68 + 8];
  4270.                                                 Writer.Write(Buffer.Length - 8, 0, Buffer);
  4271.                                                 Writer.Write(2035, 2, Buffer);//Packet ID
  4272.                                                 Writer.Write(UID, 4, Buffer);//FlowerUID
  4273.                                                 Writer.Write(4264, 8, Buffer);
  4274.                                                 Buffer[12] = 3;
  4275.                                                 Writer.Write(Mesh, 16, Buffer);//FloorItemID
  4276.                                                 Buffer[24] = 14;//AttackRange
  4277.                                                 Writer.Write(X, 26, Buffer);
  4278.                                                 Writer.Write(Y, 28, Buffer);
  4279.                                                 Writer.Write("Thundercloud", 30, Buffer);
  4280.                                                 //////////////////////////////////////////////////
  4281.                                                 ///////////////////////////////////////////////////
  4282.                                                 //////////////////////////////////////////////////////
  4283.                                                 Entity ThunderCloud = new Entity(Game.EntityFlag.Monster, true);
  4284.                                                 ThunderCloud.Name = "Thundercloud";
  4285.                                                 ThunderCloud.Mesh = Mesh;
  4286.                                                 ThunderCloud.UID = UID;
  4287.                                                 ThunderCloud.GuildID = attacker.GuildID;
  4288.                                                 ThunderCloud.MaxHitpoints = attacker.MaxHitpoints;
  4289.                                                 ThunderCloud.Level = 140;
  4290.                                                 ThunderCloud.X = X;
  4291.                                                 ThunderCloud.Y = Y;
  4292.                                                 ThunderCloud.Facing = attacker.Facing;
  4293.                                                 ThunderCloud.Boss = 1;
  4294.                                                 ThunderCloud.MapID = attacker.MapID;
  4295.                                                 Writer.Write(3, 308, ThunderCloud.SpawnPacket);
  4296.                                                 Writer.Write(15, 272, ThunderCloud.SpawnPacket);
  4297.                                                 Writer.Write(3, 271, ThunderCloud.SpawnPacket);//AttackUser
  4298.                                                 //Writer.Write(attacker.Owner.UnionID, 278, ThunderCloud.SpawnPacket);//UnionID
  4299.                                                 ThunderCloud.CUID = attacker.UID;
  4300.                                                 ThunderCloud.Owner = new Client.GameClient(null);
  4301.                                                 ThunderCloud.Owner.Entity = ThunderCloud;
  4302.                                                 ThunderCloud.MonsterInfo = new MonsterInformation();
  4303.                                                 ThunderCloud.MonsterInfo.AttackType = 24;
  4304.                                                 ThunderCloud.MonsterInfo.AttackSpeed = 1000;
  4305.                                                 ThunderCloud.MonsterInfo.AttackRange = 14;
  4306.                                                 ThunderCloud.MonsterInfo.Boss = true;
  4307.                                                 ThunderCloud.MonsterInfo.BoundX = X;
  4308.                                                 ThunderCloud.Companion = true;
  4309.                                                 ThunderCloud.MonsterInfo.Guard = false;
  4310.                                                 ThunderCloud.MonsterInfo.BoundY = Y;
  4311.                                                 ThunderCloud.MonsterInfo.Defence = attacker.Defence;
  4312.                                                 ThunderCloud.MonsterInfo.Hitpoints = 10000;
  4313.                                                 ThunderCloud.MonsterInfo.Mesh = 980;
  4314.                                                 ThunderCloud.MonsterInfo.MoveSpeed = int.MaxValue;
  4315.                                                 ThunderCloud.MonsterInfo.Name = "Thundercloud";
  4316.                                                 ThunderCloud.MonsterInfo.Owner = attacker;
  4317.                                                 ThunderCloud.MonsterInfo.ViewRange = 14;
  4318.                                                 ThunderCloud.MonsterInfo.RespawnTime = 0;
  4319.                                                 ThunderCloud.MonsterInfo.RunSpeed = int.MaxValue;
  4320.                                                 ThunderCloud.MonsterInfo.SpellID = 13190;
  4321.                                                 ThunderCloud.Hitpoints = 10000;
  4322.                                                 Kernel.Maps[ThunderCloud.MapID].AddEntity(ThunderCloud);
  4323.                                                 //////////////////////////////////////////////////////////////
  4324.                                                 //////////////////////////////////////////////////////////
  4325.                                                 //////////////////////////////////////////////////////////
  4326.                                                 /////////////////////////////////////////////
  4327.                                                 Network.GamePackets.Data d = new Data(true);
  4328.                                                 d.UID = UID;
  4329.                                                 d.ID = Data.AddEntity;
  4330.                                                 d.Facing = attacker.Facing;
  4331.                                                 d.X2 = ThunderCloud.X;
  4332.                                                 d.Y2 = ThunderCloud.Y;
  4333.                                                 ///////////////////////////////////////////////
  4334.                                                 ////////////////////////////////////////////
  4335.                                                 /////////////////////////////////////////
  4336.                                                 attacker.Owner.SendScreen(Buffer, true);
  4337.                                                 attacker.Owner.SendScreen(ThunderCloud.SpawnPacket, true);
  4338.                                                 attacker.Owner.SendScreenSpawn(ThunderCloud, true);
  4339.                                                 attacker.Owner.SendScreen(d, true);
  4340.                                                 ThunderCloud.ThunderCloudStamp = Time64.Now;
  4341.                                                 Program.World.Register(ThunderCloud);
  4342.                                                 attacker.AttackPacket = null;
  4343.                                             }
  4344.                                         }
  4345.                                         break;
  4346.  
  4347.                                     }
  4348.                                 #endregion
  4349.                                 #region ShadowofChaser(Active)
  4350.                                 case 13090:
  4351.                                     {
  4352.                                         if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser))
  4353.                                         {
  4354.                                             attacker.RemoveFlag4(Update.Flags4.ShadowofChaser);
  4355.                                             attacker.AttackPacket = null;
  4356.                                             break;
  4357.                                         }
  4358.                                         if (CanUseSpell(spell, attacker.Owner))
  4359.                                         {
  4360.                                             PrepareSpell(spell, attacker.Owner);
  4361.                                             SpellUse suse = new SpellUse(true);
  4362.                                             suse.Attacker = attacker.UID;
  4363.                                             suse.Attacker1 = attacker.UID;
  4364.                                             suse.SpellID = spell.ID;
  4365.                                             suse.SpellLevel = spell.Level;
  4366.                                             suse.AddTarget(attacker.UID, 0, attack);
  4367.                                             attack = new Attack(true);
  4368.                                             attack.Attacker = attack.Attacked = attacker.UID;
  4369.                                             attack.X = attacker.X; attack.Y = attacker.Y;
  4370.                                             attack.AttackType = 24;
  4371.                                             attack.SpellID = spell.ID;
  4372.                                             attacker.Owner.SendScreen(suse, true);
  4373.                                             attacker.AddFlag4(Update.Flags4.ShadowofChaser);
  4374.                                             attacker.AttackPacket = null;
  4375.                                         }
  4376.                                         break;
  4377.                                     }
  4378.                                 #endregion
  4379.                                 #region TripleBlasts(Passive)
  4380.                                 case 12850:
  4381.                                     {
  4382.                                         if (CanUseSpell(spell, attacker.Owner))
  4383.                                         {
  4384.                                             PrepareSpell(spell, attacker.Owner);
  4385.                                             SpellUse suse = new SpellUse(true);
  4386.                                             suse.Attacker = attacker.UID;
  4387.                                             suse.Attacker1 = attackedsob == null ? attacked.UID : attackedsob.UID;
  4388.                                             suse.SpellID = spell.ID;
  4389.                                             suse.SpellLevel = spell.Level;
  4390.                                             suse.X = X;
  4391.                                             suse.Y = Y;
  4392.                                             if (attackedsob == null)
  4393.                                             {
  4394.                                                 if (CanAttack(attacker, attacked, spell, false))
  4395.                                                 {
  4396.                                                     if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
  4397.                                                     {
  4398.                                                         var spell2 = Database.SpellTable.GetSpell(13090, attacker.Owner);
  4399.                                                         if (spell2 != null)
  4400.                                                         {
  4401.                                                             spell2.CanKill = true;
  4402.                                                             if (Kernel.Rate(spell2.Percent))
  4403.                                                             {
  4404.                                                                 ShadowofChaser(attacker, attacked, attack, 1);
  4405.                                                                 break;
  4406.                                                             }
  4407.                                                         }
  4408.                                                     }
  4409.  
  4410.                                                     uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  4411.                                                     damage = (uint)(damage * 0.2);
  4412.  
  4413.                                                     ReceiveAttack(attacker, attacked, attack,damage, spell);
  4414.                                                     suse.AddTarget(attacked.UID, damage, attack);
  4415.                                                     attacker.Owner.SendScreen(suse, true);
  4416.                                                 }
  4417.                                             }
  4418.                                             else
  4419.                                             {
  4420.                                                 if (CanAttack(attacker, attackedsob, spell))
  4421.                                                 {
  4422.  
  4423.                                                     uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  4424.  
  4425.                                                     ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  4426.                                                     suse.AddTarget(attacked.UID, damage, attack);
  4427.                                                     attacker.Owner.SendScreen(suse, true);
  4428.                                                 }
  4429.                                             }
  4430.  
  4431.                                         }
  4432.                                         break;
  4433.                                     }
  4434.                                 #endregion
  4435.                                 #region swirlingStor
  4436.                                 case 12890:
  4437.                                     {
  4438.                                         if (CanUseSpell(spell, attacker.Owner))
  4439.                                         {
  4440.                                             PrepareSpell(spell, attacker.Owner);
  4441.                                             SpellUse suse = new SpellUse(true);
  4442.                                             spell.UseStamina = 40;
  4443.                                             suse.Attacker = attacker.UID;
  4444.                                             suse.SpellID = spell.ID;
  4445.                                             suse.SpellLevel = spell.Level;
  4446.                                             suse.X = X;
  4447.                                             suse.Y = Y;
  4448.                                             Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
  4449.                                             sector.Arrange(spell.Sector, spell.Distance);
  4450.                                             {
  4451.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  4452.                                                 {
  4453.                                                     if (_obj == null)
  4454.                                                         continue;
  4455.                                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  4456.                                                     {
  4457.                                                         attacked = _obj as Entity;
  4458.                                                         if (sector.Inside(attacked.X, attacked.Y))
  4459.                                                         {
  4460.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4461.                                                             {
  4462.                                                                 attack.Effect = Attack.AttackEffects.None;
  4463.                                                                 uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  4464.                                                                 damage = (uint)(damage - spell.Power / 10);
  4465.                                                                 suse.Effect = attack.Effect;
  4466.                                                                 ReceiveAttack(attacker, attacked, attack, damage, spell);
  4467.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  4468.                                                             }
  4469.                                                         }
  4470.                                                     }
  4471.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  4472.                                                     {
  4473.                                                         attackedsob = _obj as SobNpcSpawn;
  4474.                                                         if (sector.Inside(attackedsob.X, attackedsob.Y))
  4475.                                                         {
  4476.                                                             if (CanAttack(attacker, attackedsob, spell))
  4477.  
  4478.                                                                 attack.Effect = Attack.AttackEffects.None;
  4479.                                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  4480.                                                             damage = (uint)(damage - spell.Power / 10);
  4481.                                                             suse.Effect = attack.Effect;
  4482.                                                             suse.AddTarget(attackedsob.UID, damage, attack);
  4483.                                                             attacker.Owner.SendScreen(suse, true);
  4484.                                                         }
  4485.                                                     }
  4486.                                                 }
  4487.                                             }
  4488.                                             attacker.Owner.SendScreen(suse, true);
  4489.                                         }
  4490.                                         break;
  4491.                                     }
  4492.                                 #endregion
  4493.                                 #region ThunderBolt(Active)
  4494.                                 case 12970:
  4495.                                     {
  4496.                                         if (!attacker.Owner.Spells.ContainsKey(12840)) break;
  4497.                                         foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  4498.                                         {
  4499.                                             if (th.CUID == attacker.UID)
  4500.                                             {
  4501.                                                 if (Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) <= th.MonsterInfo.AttackRange)
  4502.                                                 {
  4503.                                                     if (CanUseSpell(spell, attacker.Owner))
  4504.                                                     {
  4505.                                                         PrepareSpell(spell, attacker.Owner);
  4506.                                                         SpellUse suse = new SpellUse(true);
  4507.                                                         suse.Attacker = attacker.UID;
  4508.                                                         suse.X = X;
  4509.                                                         suse.Y = Y;
  4510.                                                         suse.SpellID = spell.ID;
  4511.                                                         suse.AddTarget(th.UID, 0, null);
  4512.                                                         Writer.Write(128, 50, th.SpawnPacket);//Flag4(128)
  4513.                                                         attacker.Owner.SendScreen(suse, true);
  4514.                                                         attacker.AttackPacket = null;
  4515.                                                         foreach (var client in Kernel.GamePool.Values.Where(i => Kernel.GetDistance(th.X, th.Y, i.Entity.X, i.Entity.Y) < 17))
  4516.                                                         {
  4517.                                                             client.Send(th.SpawnPacket);
  4518.                                                         }
  4519.  
  4520.                                                     }
  4521.                                                 }
  4522.                                             }
  4523.                                         }
  4524.                                         break;
  4525.                                     }
  4526.                                 #endregion
  4527.                                 #region Omnipotence(XP)
  4528.                                 case 12860:
  4529.                                     {
  4530.                                         SpellUse suse = new SpellUse(true);
  4531.                                         suse.Attacker = attacker.UID;
  4532.                                         suse.SpellID = spell.ID;
  4533.                                         suse.SpellLevel = spell.Level;
  4534.                                         suse.X = X;
  4535.                                         suse.Y = Y;
  4536.                                         if (attacker.ContainsFlag(Update.Flags.XPList))
  4537.                                         {
  4538.                                             attacker.AddFlag4(Update.Flags4.Omnipotence);
  4539.                                             attacker.OmnipotenceStamp = Time64.Now;
  4540.                                             attacker.RemoveFlag(Update.Flags.XPList);
  4541.                                             attacker.Owner.SendScreen(suse, true);
  4542.                                         }
  4543.                                         else
  4544.                                         {
  4545.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
  4546.                                             {
  4547.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  4548.                                                 {
  4549.                                                     if (_obj == null) continue;
  4550.                                                     if (_obj.MapObjType == MapObjectType.Player)
  4551.                                                     {
  4552.                                                         attacked = _obj as Entity;
  4553.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  4554.                                                         {
  4555.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4556.                                                             {
  4557.  
  4558.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell) / 10;
  4559.  
  4560.                                                                 ReceiveAttack(attacker, attacked, attack,  damage, spell);
  4561.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  4562.                                                             }
  4563.                                                         }
  4564.                                                     }
  4565.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  4566.                                                     {
  4567.                                                         attackedsob = _obj as SobNpcSpawn;
  4568.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
  4569.                                                         {
  4570.                                                             if (CanAttack(attacker, attackedsob, spell))
  4571.                                                             {
  4572.  
  4573.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * 350 / 100;
  4574.  
  4575.  
  4576.                                                                 ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  4577.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  4578.                                                             }
  4579.                                                         }
  4580.                                                     }
  4581.                                                     else if (_obj.MapObjType == MapObjectType.Monster)
  4582.                                                     {
  4583.                                                         attacked = _obj as Entity;
  4584.                                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  4585.                                                         {
  4586.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4587.                                                             {
  4588.  
  4589.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * 350 / 100;
  4590.  
  4591.                                                                 ReceiveAttack(attacker, attacked, attack, damage, spell);
  4592.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  4593.                                                             }
  4594.                                                         }
  4595.                                                     }
  4596.                                                 }
  4597.                                             }
  4598.                                         }
  4599.                                         attacker.Owner.SendScreen(suse, true);
  4600.                                         attacker.AttackPacket = null;
  4601.                                         break;
  4602.                                     }
  4603.                                 #endregion
  4604.                                 #region FrostGaze(I-II-III)
  4605.                                 case 12830:
  4606.                                 case 13070:
  4607.                                 case 13080:
  4608.                                     {
  4609.                                         if (CanUseSpell(spell, attacker.Owner))
  4610.                                         {
  4611.                                             PrepareSpell(spell, attacker.Owner);
  4612.                                             SpellUse suse = new SpellUse(true);
  4613.                                             suse.Attacker = attacker.UID;
  4614.                                             suse.SpellID = spell.ID;
  4615.                                             suse.SpellLevel = spell.Level;
  4616.                                             suse.X = X;
  4617.                                             suse.Y = Y;
  4618.                                             attacker.Owner.SendScreen(suse, true);
  4619.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  4620.                                             {
  4621.                                                 if (_obj == null)
  4622.                                                     continue;
  4623.                                                 if (_obj.MapObjType == MapObjectType.Player)
  4624.                                                 {
  4625.                                                     attacked = _obj as Entity;
  4626.  
  4627.                                                     if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
  4628.                                                     {
  4629.                                                         if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4630.                                                         {
  4631.                                                             int Rate = 100;
  4632.                                                             int diff = attacked.BattlePower - attacker.BattlePower;
  4633.                                                             if (diff < 0) diff = 0;
  4634.                                                             Rate -= (byte)(diff * 5);
  4635.                                                             if (Rate < 0) Rate = 0;
  4636.                                                             if (Kernel.Rate(Rate))
  4637.                                                             {
  4638.                                                                 if (attacked.Stamina >= (byte)spell.Power)
  4639.                                                                     attacked.Stamina -= (byte)spell.Power;
  4640.                                                                 else attacked.Stamina = 0;
  4641.                                                             }
  4642.                                                         }
  4643.                                                     }
  4644.                                                 }
  4645.                                             }
  4646.                                         }
  4647.                                         break;
  4648.                                     }
  4649.                                 #endregion
  4650.                                 #endregion
  4651.                                 #region Stomper
  4652.                                 #region ChillingSnow(Active)
  4653.                                 case 12960:
  4654.                                     {
  4655.                                         if (attacker.ContainsFlag4(Update.Flags4.ChillingSnow))
  4656.                                         {
  4657.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  4658.                                             attacker.AttackPacket = null;
  4659.                                             break;
  4660.                                         }
  4661.                                         if (CanUseSpell(spell, attacker.Owner))
  4662.                                         {
  4663.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  4664.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  4665.                                             PrepareSpell(spell, attacker.Owner);
  4666.                                             SpellUse suse = new SpellUse(true);
  4667.                                             suse.Attacker = attacker.UID;
  4668.                                             suse.Attacker1 = attacker.UID;
  4669.                                             suse.SpellID = spell.ID;
  4670.                                             suse.SpellLevel = spell.Level;
  4671.                                             suse.X = X;
  4672.                                             suse.Y = Y;
  4673.                                             suse.AddTarget(attacker.UID, 0, attack);
  4674.                                             attacker.Owner.SendScreen(suse, true);
  4675.                                             attacker.AddFlag4(Update.Flags4.ChillingSnow);
  4676.                                             attacker.AttackPacket = null;
  4677.                                         }
  4678.                                         break;
  4679.                                     }
  4680.                                 #endregion
  4681.                                 #region HealingSnow(Active)
  4682.                                 case 12950:
  4683.                                     {
  4684.                                         if (attacker.ContainsFlag4(Update.Flags4.HealingSnow))
  4685.                                         {
  4686.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  4687.                                             attacker.AttackPacket = null;
  4688.                                             break;
  4689.                                         }
  4690.                                         if (CanUseSpell(spell, attacker.Owner))
  4691.                                         {
  4692.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  4693.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  4694.                                             PrepareSpell(spell, attacker.Owner);
  4695.                                             SpellUse suse = new SpellUse(true);
  4696.                                             suse.Attacker = attacker.UID;
  4697.                                             suse.Attacker1 = attacker.UID;
  4698.                                             suse.SpellID = spell.ID;
  4699.                                             suse.SpellLevel = spell.Level;
  4700.                                             suse.X = X;
  4701.                                             suse.Y = Y;
  4702.                                             suse.AddTarget(attacker.UID, 0, attack);
  4703.                                             attacker.Owner.SendScreen(suse, true);
  4704.                                             attacker.AddFlag4(Update.Flags4.HealingSnow);
  4705.                                             attacker.AttackPacket = null;
  4706.                                         }
  4707.                                         break;
  4708.                                     }
  4709.                                 #endregion
  4710.                                 #region FreezingPelter(Active)
  4711.                                 case 13020:
  4712.                                     {
  4713.                                         if (attacker.ContainsFlag4(Update.Flags4.FreezingPelter))
  4714.                                         {
  4715.                                             attacker.RemoveFlag4(Update.Flags4.FreezingPelter);
  4716.                                             attacker.Owner.LoadItemStats();
  4717.                                             attacker.AttackPacket = null;
  4718.                                             break;
  4719.                                         }
  4720.                                         if (CanUseSpell(spell, attacker.Owner))
  4721.                                         {
  4722.                                             attacker.RemoveFlag4(Update.Flags4.ChillingSnow);
  4723.                                             attacker.RemoveFlag4(Update.Flags4.HealingSnow);
  4724.                                             PrepareSpell(spell, attacker.Owner);
  4725.                                             SpellUse suse = new SpellUse(true);
  4726.                                             suse.Attacker = attacker.UID;
  4727.                                             suse.Attacker1 = attacker.UID;
  4728.                                             suse.SpellID = spell.ID;
  4729.                                             suse.SpellLevel = spell.Level;
  4730.                                             suse.X = X;
  4731.                                             suse.Y = Y;
  4732.                                             suse.AddTarget(attacker.UID, 0, attack);
  4733.                                             attacker.Owner.SendScreen(suse, true);
  4734.                                             attacker.AddFlag4(Update.Flags4.FreezingPelter);
  4735.                                             attacker.Owner.LoadItemStats();
  4736.                                             attacker.AttackPacket = null;
  4737.                                         }
  4738.                                         break;
  4739.                                     }
  4740.                                 #endregion
  4741.                                 #region RevengeTail(Active)
  4742.                                 case 13030:
  4743.                                     {
  4744.                                         if (CanUseSpell(spell, attacker.Owner))
  4745.                                         {
  4746.                                             PrepareSpell(spell, attacker.Owner);
  4747.                                             SpellUse suse = new SpellUse(true);
  4748.                                             suse.Attacker = attacker.UID;
  4749.                                             suse.Attacker1 = attacker.UID;
  4750.                                             suse.SpellID = spell.ID;
  4751.                                             suse.SpellLevel = spell.Level;
  4752.                                             suse.X = X;
  4753.                                             suse.Y = Y;
  4754.                                             suse.AddTarget(attacker.UID, 0, attack);
  4755.                                             attacker.Owner.SendScreen(suse, true);
  4756.                                             attacker.AddFlag4(Update.Flags4.RevengeTaill);
  4757.                                             attacker.RevengeTaillStamp = Time64.Now;
  4758.                                             attacker.AttackPacket = null;
  4759.                                         }
  4760.                                         break;
  4761.                                     }
  4762.                                 #endregion
  4763.                                 #region BurntFrost(Passive)
  4764.                                 case 12940:
  4765.                                     {
  4766.                                         if (CanUseSpell(spell, attacker.Owner))
  4767.                                         {
  4768.                                             PrepareSpell(spell, attacker.Owner);
  4769.  
  4770.  
  4771.                                             SpellUse suse = new SpellUse(true);
  4772.                                             suse.Attacker = attacker.UID;
  4773.                                             suse.SpellID = spell.ID;
  4774.                                             suse.SpellLevel = spell.Level;
  4775.                                             suse.X = X;
  4776.                                             suse.Y = Y;
  4777.                                             Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  4778.                                             if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
  4779.                                             {
  4780.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  4781.                                                 {
  4782.                                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  4783.                                                     {
  4784.                                                         if (_obj == null)
  4785.                                                             continue;
  4786.                                                         attacked = _obj as Entity;
  4787.                                                         if (attacked == null) continue;
  4788.                                                         if (sector.IsInFan(attacked.X, attacked.Y))
  4789.                                                         {
  4790.                                                             if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4791.                                                             {
  4792.  
  4793.                                                                 uint damage = Calculate.Melee(attacker, attacked, ref attack, spell);
  4794.                                                                 damage = (uint)(damage * 0.6);
  4795.                                                                 ReceiveAttack(attacker, attacked, attack,damage, spell);
  4796.                                                                 suse.AddTarget(attacked.UID, damage, attack);
  4797.                                                             }
  4798.                                                         }
  4799.                                                     }
  4800.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  4801.                                                     {
  4802.                                                         if (_obj == null)
  4803.                                                             continue;
  4804.                                                         attackedsob = _obj as SobNpcSpawn;
  4805.                                                         if (attackedsob == null) continue;
  4806.                                                         if (sector.IsInFan(attackedsob.X, attackedsob.Y))
  4807.                                                         {
  4808.                                                             if (CanAttack(attacker, attackedsob, spell))
  4809.                                                             {
  4810.  
  4811.                                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  4812.  
  4813.                                                                 ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  4814.                                                                 suse.AddTarget(attackedsob.UID, damage, attack);
  4815.                                                             }
  4816.                                                         }
  4817.                                                     }
  4818.                                                 }
  4819.                                             }
  4820.                                             attacker.Owner.SendScreen(suse, true);
  4821.                                             attacker.AttackPacket = null;
  4822.                                         }
  4823.                                         break;
  4824.                                     }
  4825.                                 #endregion
  4826.                                 #region RageofWar(Passive)
  4827.                                 case 12930:
  4828.                                     {
  4829.                                         if (CanUseSpell(spell, attacker.Owner))
  4830.                                         {
  4831.                                             PrepareSpell(spell, attacker.Owner);
  4832.                                             Game.Attacking.InLineAlgorithm ila = new Game.Attacking.InLineAlgorithm(attacker.X,
  4833.                                         X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  4834.                                             SpellUse suse = new SpellUse(true);
  4835.                                             suse.Attacker = attacker.UID;
  4836.                                             suse.SpellID = SpellID;
  4837.                                             suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
  4838.                                             suse.X = X;
  4839.                                             suse.Y = Y;
  4840.                                             attacker.Owner.SendScreen(suse, true);
  4841.                                             bool first = false;
  4842.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  4843.                                             {
  4844.                                                 if (_obj == null)
  4845.                                                     continue;
  4846.                                                 if (_obj.MapObjType == MapObjectType.Player)
  4847.                                                 {
  4848.                                                     attacked = _obj as Entity;
  4849.                                                     if (ila.InLine(attacked.X, attacked.Y))
  4850.                                                     {
  4851.                                                         if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4852.                                                             continue;
  4853.                                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue;
  4854.                                                         if (!first)
  4855.                                                         {
  4856.                                                             var map = Kernel.Maps[attacker.MapID];
  4857.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  4858.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4859.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  4860.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4861.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  4862.                                                             flooritem.X = attacked.X;
  4863.                                                             flooritem.MapID = map.ID;
  4864.                                                             flooritem.Y = attacked.Y;
  4865.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  4866.                                                             flooritem.Type = FloorItem.Effect;
  4867.                                                             flooritem.mColor = 15;
  4868.                                                             flooritem.OwnerUID = attacker.UID;
  4869.                                                             flooritem.OnFloor = Time64.Now;
  4870.                                                             flooritem.Owner = attacker.Owner;
  4871.                                                             flooritem.Name2 = "RageofWarTrap";
  4872.                                                             map.AddFloorItem(flooritem);
  4873.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  4874.                                                             first = true;
  4875.                                                         }
  4876.                                                         uint damage = Calculate.Melee(attacker, attacked, ref attack, spell);
  4877.                                                         damage = (uint)(damage * 0.6);
  4878.                                                         attack.Damage = damage;
  4879.                                                         ReceiveAttack(attacker, attacked, attack,damage, spell);
  4880.  
  4881.                                                         suse.AddTarget(attacked.UID, damage, attack);
  4882.                                                     }
  4883.                                                 }
  4884.                                                 else if (_obj.MapObjType == MapObjectType.Monster)
  4885.                                                 {
  4886.                                                     attacked = _obj as Entity;
  4887.                                                     if (ila.InLine(attacked.X, attacked.Y))
  4888.                                                     {
  4889.                                                         if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
  4890.                                                             continue;
  4891.                                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue;
  4892.                                                         if (!first)
  4893.                                                         {
  4894.                                                             var map = Kernel.Maps[attacker.MapID];
  4895.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  4896.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4897.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  4898.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4899.  
  4900.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  4901.                                                             flooritem.X = attacked.X;
  4902.                                                             flooritem.MapID = map.ID;
  4903.                                                             flooritem.Y = attacked.Y;
  4904.                                                             flooritem.Type = FloorItem.Effect;
  4905.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  4906.                                                             flooritem.mColor = 15;
  4907.                                                             flooritem.OwnerUID = attacker.UID;
  4908.                                                             flooritem.OnFloor = Time64.Now;
  4909.                                                             flooritem.Owner = attacker.Owner;
  4910.                                                             flooritem.Name2 = "RageofWarTrap";
  4911.                                                             map.AddFloorItem(flooritem);
  4912.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  4913.                                                             first = true;
  4914.                                                         }
  4915.  
  4916.                                                         uint damage = (uint)(Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) * (spell.Power - 30000) / 100);
  4917.  
  4918.  
  4919.                                                         attack.Damage = damage;
  4920.  
  4921.                                                         ReceiveAttack(attacker, attacked, attack,damage, spell);
  4922.  
  4923.                                                         suse.AddTarget(attacked.UID, damage, attack);
  4924.                                                     }
  4925.  
  4926.  
  4927.                                                 }
  4928.                                                 else if (_obj.MapObjType == MapObjectType.SobNpc)
  4929.                                                 {
  4930.                                                     attackedsob = _obj as SobNpcSpawn;
  4931.                                                     if (attackedsob == null) continue;
  4932.                                                     if (ila.InLine(attackedsob.X, attackedsob.Y))
  4933.                                                     {
  4934.                                                         if (!CanAttack(attacker, attackedsob, spell))
  4935.                                                             continue;
  4936.                                                         if (Kernel.GetDistance(attackedsob.X, attackedsob.Y, attacker.X, attacker.Y) > 11) continue;
  4937.                                                         if (!first)
  4938.                                                         {
  4939.                                                             var map = Kernel.Maps[attacker.MapID];
  4940.                                                             Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  4941.                                                             flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4942.                                                             while (map.Npcs.ContainsKey(flooritem.UID))
  4943.                                                                 flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4944.                                                             flooritem.MapObjType = MapObjectType.FloorSpell;
  4945.                                                             flooritem.ItemID = FloorItem.RageOfWarTrap;
  4946.                                                             flooritem.X = attackedsob.X;
  4947.                                                             flooritem.MapID = map.ID;
  4948.                                                             flooritem.Y = attackedsob.Y;
  4949.                                                             flooritem.Type = FloorItem.Effect;
  4950.                                                             flooritem.mColor = 15;
  4951.                                                             flooritem.OwnerUID = attacker.UID;
  4952.                                                             flooritem.OnFloor = Time64.Now;
  4953.                                                             flooritem.Owner = attacker.Owner;
  4954.                                                             flooritem.Name2 = "RageofWarTrap";
  4955.                                                             map.AddFloorItem(flooritem);
  4956.                                                             attacker.Owner.SendScreenSpawn(flooritem, true);
  4957.                                                             first = true;
  4958.                                                         }
  4959.  
  4960.                                                         uint damage = (uint)(Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack) * (spell.Power - 30000) / 100);
  4961.  
  4962.  
  4963.                                                         attack.Damage = damage;
  4964.  
  4965.                                                         ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  4966.  
  4967.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  4968.                                                     }
  4969.  
  4970.  
  4971.                                                 }
  4972.                                             }
  4973.                                             attacker.Owner.SendScreen(suse, true);
  4974.                                             attacker.AttackPacket = null;
  4975.                                         }
  4976.                                         break;
  4977.                                     }
  4978.                                 #endregion
  4979.                                 #endregion
  4980.                                 #endregion
  4981. هتيجى تقولى ايه ده ياعم فيه ايرورات ظاهرها هقولك تعالى لسه هنعمل سيرش على كود ده
  4982.   public static bool Allyss(Entity attacker, Entity attacked)
  4983. هنقفله بعلامة السالب وتحتية هنضيف كود ده
  4984.    public static void ShadowofChaser(Entity attacker, Entity attacked, Attack attack, byte oneortwo)
  4985.         {
  4986.             #region ShadowofChaser(Active)
  4987.             IMapObject lastAttacked = attacked;
  4988.             if (oneortwo == 1)
  4989.             {
  4990.                 if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
  4991.                 {
  4992.                     #region FloorItem
  4993.                     var map = Kernel.Maps[attacker.MapID];
  4994.                     Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
  4995.                     flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4996.                     while (map.Npcs.ContainsKey(flooritem.UID))
  4997.                         flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  4998.  
  4999.                     flooritem.ItemID = FloorItem.ShadowofChaser;
  5000.                     flooritem.X = lastAttacked.X;
  5001.                     flooritem.MapID = attacker.MapID;
  5002.                     flooritem.Y = lastAttacked.Y;
  5003.                     flooritem.Type = FloorItem.Effect;
  5004.                     flooritem.mColor = 14;
  5005.                     flooritem.FlowerType = 3;
  5006.                     flooritem.Unknown37 = 1;
  5007.                     flooritem.MapObjType = MapObjectType.FloorSpell;
  5008.                     flooritem.Attack = attack;
  5009.                     flooritem.OwnerUID = attacker.UID;
  5010.                     flooritem.Owner = attacker.Owner;
  5011.                     flooritem.OwnerGuildUID = attacker.GuildID;
  5012.                     flooritem.OnFloor = Time64.Now;
  5013.                     flooritem.Name2 = "ShadowofChaser";
  5014.                     flooritem.ShadowofChaserAttacked = attacked;
  5015.                     flooritem.ShadowofChaserAttacker = attacker;
  5016.                     attacker.Owner.Map.AddFloorItem(flooritem);
  5017.                     attacker.Owner.SendScreenSpawn(flooritem, true);
  5018.                     #endregion
  5019.                     return;
  5020.                 }
  5021.             }
  5022.             else if (oneortwo == 2)
  5023.             {
  5024.                 var spell = Database.SpellTable.GetSpell(13090, attacker.Owner);
  5025.                 SpellUse suse = new SpellUse(true);
  5026.                 suse.Attacker = attacker.UID;
  5027.                 suse.Attacker1 = attacker.UID;
  5028.                 suse.SpellID = spell.ID;
  5029.                 suse.SpellLevel = spell.Level;
  5030.                 if (CanAttack(attacker, attacked, spell, false))
  5031.                 {
  5032.                     lastAttacked = attacked;
  5033.                     var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  5034.                     Handle.ReceiveAttack(attacker, attacked, attack,damage, spell);
  5035.                     suse.AddTarget(attacked.UID, damage, null);
  5036.                 }
  5037.                 attacker.Owner.SendScreen(suse, true);
  5038.                 SpellUse suse2 = new SpellUse(true);
  5039.                 suse2.Attacker = attacker.UID;
  5040.                 suse2.SpellID = spell.ID;
  5041.                 suse2.SpellLevel = spell.Level;
  5042.                 suse2.X = attacked.X;
  5043.                 suse2.Y = attacked.Y;
  5044.                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5045.                 {
  5046.                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5047.                     {
  5048.                         if (_obj == null) continue;
  5049.                         var attacked1 = _obj as Entity;
  5050.                         if (lastAttacked.UID == attacked1.UID) continue;
  5051.                         if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 4)
  5052.                         {
  5053.                             if (CanAttack(attacker, attacked1, spell, false))
  5054.                             {
  5055.                                 var damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  5056.                                 ReceiveAttack(attacker, attacked1, attack, damage, spell);
  5057.                                 suse2.AddTarget(attacked1.UID, damage, null);
  5058.                             }
  5059.                         }
  5060.                     }
  5061.                 }
  5062.                 attacker.Owner.SendScreen(suse2, true);
  5063.             }
  5064.             #endregion
  5065.             attacker.AttackPacket = null;
  5066.         }
  5067. بعدين هنعمل سيرش على كود ده
  5068.  #region Kinetic Spark
  5069. تحتيه
  5070.  #region ShadowofChaser
  5071.                             if (attacker.ContainsFlag4(Update.Flags4.ShadowofChaser))
  5072.                             {
  5073.                                 var spell = Database.SpellTable.GetSpell(13090, attacker.Owner);
  5074.                                 if (spell != null)
  5075.                                 {
  5076.                                     spell.CanKill = true;
  5077.                                     if (Kernel.Rate(spell.Percent))
  5078.                                     {
  5079.                                         SpellUse suse = new SpellUse(true);
  5080.                                         suse.Attacker = attacker.UID;
  5081.                                         suse.SpellID = spell.ID;
  5082.                                         suse.SpellLevel = spell.Level;
  5083.                                         suse.X = attacker.X;
  5084.                                         suse.Y = attacker.Y;
  5085.                                         IMapObject lastAttacked = attacker;
  5086.                                         /*****************/
  5087.                                         attacker.Owner.SendScreen(suse, true);
  5088.                                         ushort _X = attacker.X, _Y = attacker.Y;
  5089.                                         ushort _tX = X, _tY = Y;
  5090.                                         // byte dist = 18;
  5091.                                         var Array = attacker.Owner.Screen.Objects;
  5092.                                         var map = attacker.Owner.Map;
  5093.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  5094.                                         // return;
  5095.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  5096.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  5097.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  5098.                                         // InLineAlgorithm.Algorithm.DDA);
  5099.                                         var count = (double)algo.lcoords.Count / 1;
  5100.                                         for (int i = 0; i < 1; i++)
  5101.                                         {
  5102.                                             var selected = i * (int)count;
  5103.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  5104.                                             X = (ushort)algo.lcoords[selected].X;
  5105.                                             Y = (ushort)algo.lcoords[selected].Y;
  5106.                                             FloorItem floorItem = new FloorItem(true);
  5107.                                             floorItem.ItemID = 1550;
  5108.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  5109.                                             floorItem.MapID = attacker.MapID;
  5110.                                             floorItem.Type = FloorItem.Effect;
  5111.                                             floorItem.X = X;
  5112.                                             floorItem.Y = Y;
  5113.                                             floorItem.OnFloor = Time64.Now;
  5114.                                             floorItem.Owner = attacker.Owner;
  5115.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  5116.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  5117.                                             map.AddFloorItem(floorItem);
  5118.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  5119.                                         }
  5120.                                         /****************/
  5121.                                         uint p = 0;
  5122.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  5123.                                         {
  5124.                                             lastAttacked = attacked;
  5125.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  5126.                                             suse.Effect = attack.Effect;
  5127.                                             damage = damage - damage * (p += 20) / 100;
  5128.                                             Handle.ReceiveAttack(attacker, attacked, attack,  damage, spell);
  5129.                                             suse.AddTarget(attacked.UID, damage, attack);
  5130.                                         }
  5131.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5132.                                         {
  5133.                                             if (_obj == null) continue;
  5134.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5135.                                             {
  5136.                                                 if (_obj.UID == attacked.UID) continue;
  5137.                                                 var attacked1 = _obj as Entity;
  5138.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  5139.                                                 {
  5140.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  5141.                                                     {
  5142.                                                         lastAttacked = attacked1;
  5143.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  5144.                                                         suse.Effect = attack.Effect;
  5145.                                                         damage = damage + damage * (p += 20) / 100;
  5146.                                                         if (damage == 0) break;
  5147.                                                         Handle.ReceiveAttack(attacker, attacked1, attack,  damage, spell);
  5148.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  5149.                                                     }
  5150.                                                 }
  5151.                                             }
  5152.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  5153.                                             {
  5154.                                                 attackedsob = _obj as SobNpcSpawn;
  5155.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  5156.                                                 {
  5157.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  5158.                                                     {
  5159.                                                         lastAttacked = attackedsob;
  5160.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  5161.                                                         suse.Effect = attack.Effect;
  5162.                                                         damage = damage + damage * (p += 20) / 100;
  5163.                                                         if (damage == 0) break;
  5164.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  5165.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  5166.                                                     }
  5167.                                                 }
  5168.                                             }
  5169.                                         }
  5170.                                         attacker.Owner.SendScreen(suse, true);
  5171.                                         return;
  5172.                                     }
  5173.                                 }
  5174.                             }
  5175.                             #endregion
  5176.                             #region  RageofWar
  5177.                             if (attacker.ContainsFlag4(Update.Flags4.RageofWar))
  5178.                             {
  5179.                                 var spell = Database.SpellTable.GetSpell(12930, attacker.Owner);
  5180.                                 if (spell != null)
  5181.                                 {
  5182.                                     spell.CanKill = true;
  5183.                                     if (Kernel.Rate(spell.Percent))
  5184.                                     {
  5185.                                         SpellUse suse = new SpellUse(true);
  5186.                                         suse.Attacker = attacker.UID;
  5187.                                         suse.SpellID = spell.ID;
  5188.                                         suse.SpellLevel = spell.Level;
  5189.                                         suse.X = attacker.X;
  5190.                                         suse.Y = attacker.Y;
  5191.                                         IMapObject lastAttacked = attacker;
  5192.                                         /*****************/
  5193.                                         attacker.Owner.SendScreen(suse, true);
  5194.                                         ushort _X = attacker.X, _Y = attacker.Y;
  5195.                                         ushort _tX = X, _tY = Y;
  5196.                                         // byte dist = 18;
  5197.                                         var Array = attacker.Owner.Screen.Objects;
  5198.                                         var map = attacker.Owner.Map;
  5199.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  5200.                                         // return;
  5201.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  5202.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  5203.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  5204.                                         // InLineAlgorithm.Algorithm.DDA);
  5205.                                         var count = (double)algo.lcoords.Count / 1;
  5206.                                         for (int i = 0; i < 1; i++)
  5207.                                         {
  5208.                                             var selected = i * (int)count;
  5209.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  5210.                                             X = (ushort)algo.lcoords[selected].X;
  5211.                                             Y = (ushort)algo.lcoords[selected].Y;
  5212.                                             FloorItem floorItem = new FloorItem(true);
  5213.                                             floorItem.ItemID = 1500;
  5214.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  5215.                                             floorItem.MapID = attacker.MapID;
  5216.                                             floorItem.Type = FloorItem.Effect;
  5217.                                             floorItem.X = X;
  5218.                                             floorItem.Y = Y;
  5219.                                             floorItem.OnFloor = Time64.Now;
  5220.                                             floorItem.Owner = attacker.Owner;
  5221.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  5222.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  5223.                                             map.AddFloorItem(floorItem);
  5224.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  5225.                                         }
  5226.                                         /****************/
  5227.                                         uint p = 0;
  5228.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  5229.                                         {
  5230.                                             lastAttacked = attacked;
  5231.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  5232.                                             suse.Effect = attack.Effect;
  5233.                                             damage = damage - damage * (p += 20) / 100;
  5234.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  5235.                                             suse.AddTarget(attacked.UID, damage, attack);
  5236.                                         }
  5237.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5238.                                         {
  5239.                                             if (_obj == null) continue;
  5240.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5241.                                             {
  5242.                                                 if (_obj.UID == attacked.UID) continue;
  5243.                                                 var attacked1 = _obj as Entity;
  5244.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  5245.                                                 {
  5246.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  5247.                                                     {
  5248.                                                         lastAttacked = attacked1;
  5249.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  5250.                                                         suse.Effect = attack.Effect;
  5251.                                                         damage = damage + damage * (p += 20) / 100;
  5252.                                                         if (damage == 0) break;
  5253.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  5254.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  5255.                                                     }
  5256.                                                 }
  5257.                                             }
  5258.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  5259.                                             {
  5260.                                                 attackedsob = _obj as SobNpcSpawn;
  5261.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  5262.                                                 {
  5263.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  5264.                                                     {
  5265.                                                         lastAttacked = attackedsob;
  5266.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  5267.                                                         suse.Effect = attack.Effect;
  5268.                                                         damage = damage + damage * (p += 20) / 100;
  5269.                                                         if (damage == 0) break;
  5270.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  5271.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  5272.                                                     }
  5273.                                                 }
  5274.                                             }
  5275.                                         }
  5276.                                         attacker.Owner.SendScreen(suse, true);
  5277.                                         return;
  5278.                                     }
  5279.                                 }
  5280.                             }
  5281.                             #endregion
  5282.                             #region  HorrorOfStomper
  5283.                             if (attacker.ContainsFlag4(Update.Flags4.HorrorOfStomper))
  5284.                             {
  5285.                                 var spell = Database.SpellTable.GetSpell(12990, attacker.Owner);
  5286.                                 if (spell != null)
  5287.                                 {
  5288.                                     spell.CanKill = true;
  5289.                                     if (Kernel.Rate(spell.Percent))
  5290.                                     {
  5291.                                         SpellUse suse = new SpellUse(true);
  5292.                                         suse.Attacker = attacker.UID;
  5293.                                         suse.SpellID = spell.ID;
  5294.                                         suse.SpellLevel = spell.Level;
  5295.                                         suse.X = attacker.X;
  5296.                                         suse.Y = attacker.Y;
  5297.                                         IMapObject lastAttacked = attacker;
  5298.                                         /*****************/
  5299.                                         attacker.Owner.SendScreen(suse, true);
  5300.                                         ushort _X = attacker.X, _Y = attacker.Y;
  5301.                                         ushort _tX = X, _tY = Y;
  5302.                                         // byte dist = 18;
  5303.                                         var Array = attacker.Owner.Screen.Objects;
  5304.                                         var map = attacker.Owner.Map;
  5305.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  5306.                                         // return;
  5307.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  5308.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  5309.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  5310.                                         // InLineAlgorithm.Algorithm.DDA);
  5311.                                         var count = (double)algo.lcoords.Count / 1;
  5312.                                         for (int i = 0; i < 1; i++)
  5313.                                         {
  5314.                                             var selected = i * (int)count;
  5315.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  5316.                                             X = (ushort)algo.lcoords[selected].X;
  5317.                                             Y = (ushort)algo.lcoords[selected].Y;
  5318.                                             FloorItem floorItem = new FloorItem(true);
  5319.                                             floorItem.ItemID = 1530;
  5320.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  5321.                                             floorItem.MapID = attacker.MapID;
  5322.                                             floorItem.Type = FloorItem.Effect;
  5323.                                             floorItem.X = X;
  5324.                                             floorItem.Y = Y;
  5325.                                             floorItem.OnFloor = Time64.Now;
  5326.                                             floorItem.Owner = attacker.Owner;
  5327.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  5328.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  5329.                                             map.AddFloorItem(floorItem);
  5330.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  5331.                                         }
  5332.                                         /****************/
  5333.                                         uint p = 0;
  5334.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  5335.                                         {
  5336.                                             lastAttacked = attacked;
  5337.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  5338.                                             suse.Effect = attack.Effect;
  5339.                                             damage = damage - damage * (p += 20) / 100;
  5340.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  5341.                                             suse.AddTarget(attacked.UID, damage, attack);
  5342.                                         }
  5343.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5344.                                         {
  5345.                                             if (_obj == null) continue;
  5346.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5347.                                             {
  5348.                                                 if (_obj.UID == attacked.UID) continue;
  5349.                                                 var attacked1 = _obj as Entity;
  5350.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  5351.                                                 {
  5352.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  5353.                                                     {
  5354.                                                         lastAttacked = attacked1;
  5355.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  5356.                                                         suse.Effect = attack.Effect;
  5357.                                                         damage = damage + damage * (p += 20) / 100;
  5358.                                                         if (damage == 0) break;
  5359.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  5360.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  5361.                                                     }
  5362.                                                 }
  5363.                                             }
  5364.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  5365.                                             {
  5366.                                                 attackedsob = _obj as SobNpcSpawn;
  5367.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  5368.                                                 {
  5369.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  5370.                                                     {
  5371.                                                         lastAttacked = attackedsob;
  5372.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  5373.                                                         suse.Effect = attack.Effect;
  5374.                                                         damage = damage + damage * (p += 20) / 100;
  5375.                                                         if (damage == 0) break;
  5376.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  5377.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  5378.                                                     }
  5379.                                                 }
  5380.                                             }
  5381.                                         }
  5382.                                         attacker.Owner.SendScreen(suse, true);
  5383.                                         return;
  5384.                                     }
  5385.                                 }
  5386.                             }
  5387.                             #endregion
  5388.                             #region  PeaceofStomper
  5389.                             if (attacker.ContainsFlag4(Update.Flags4.PeaceofStomper))
  5390.                             {
  5391.                                 var spell = Database.SpellTable.GetSpell(13000, attacker.Owner);
  5392.                                 if (spell != null)
  5393.                                 {
  5394.                                     spell.CanKill = true;
  5395.                                     if (Kernel.Rate(spell.Percent))
  5396.                                     {
  5397.                                         SpellUse suse = new SpellUse(true);
  5398.                                         suse.Attacker = attacker.UID;
  5399.                                         suse.SpellID = spell.ID;
  5400.                                         suse.SpellLevel = spell.Level;
  5401.                                         suse.X = attacker.X;
  5402.                                         suse.Y = attacker.Y;
  5403.                                         IMapObject lastAttacked = attacker;
  5404.                                         /*****************/
  5405.                                         attacker.Owner.SendScreen(suse, true);
  5406.                                         ushort _X = attacker.X, _Y = attacker.Y;
  5407.                                         ushort _tX = X, _tY = Y;
  5408.                                         // byte dist = 18;
  5409.                                         var Array = attacker.Owner.Screen.Objects;
  5410.                                         var map = attacker.Owner.Map;
  5411.                                         // if (!map.Floor[X, Y, MapObjectType.Item, null])
  5412.                                         // return;
  5413.                                         Game.Attacking.InLineAlgorithm algo = new Game.Attacking.InLineAlgorithm(attacked.X,
  5414.                                         X, attacked.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
  5415.                                         // InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
  5416.                                         // InLineAlgorithm.Algorithm.DDA);
  5417.                                         var count = (double)algo.lcoords.Count / 1;
  5418.                                         for (int i = 0; i < 1; i++)
  5419.                                         {
  5420.                                             var selected = i * (int)count;
  5421.                                             selected = Math.Min(algo.lcoords.Count - 1, selected);
  5422.                                             X = (ushort)algo.lcoords[selected].X;
  5423.                                             Y = (ushort)algo.lcoords[selected].Y;
  5424.                                             FloorItem floorItem = new FloorItem(true);
  5425.                                             floorItem.ItemID = 1540;
  5426.                                             floorItem.ItemColor = (Enums.Color)(i + 1);
  5427.                                             floorItem.MapID = attacker.MapID;
  5428.                                             floorItem.Type = FloorItem.Effect;
  5429.                                             floorItem.X = X;
  5430.                                             floorItem.Y = Y;
  5431.                                             floorItem.OnFloor = Time64.Now;
  5432.                                             floorItem.Owner = attacker.Owner;
  5433.                                             while (map.Npcs.ContainsKey(floorItem.UID))
  5434.                                                 floorItem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
  5435.                                             map.AddFloorItem(floorItem);
  5436.                                             attacker.Owner.SendScreenSpawn(floorItem, true);
  5437.                                         }
  5438.                                         /****************/
  5439.                                         uint p = 0;
  5440.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  5441.                                         {
  5442.                                             lastAttacked = attacked;
  5443.                                             uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);
  5444.                                             suse.Effect = attack.Effect;
  5445.                                             damage = damage - damage * (p += 20) / 100;
  5446.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  5447.                                             suse.AddTarget(attacked.UID, damage, attack);
  5448.                                         }
  5449.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5450.                                         {
  5451.                                             if (_obj == null) continue;
  5452.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5453.                                             {
  5454.                                                 if (_obj.UID == attacked.UID) continue;
  5455.                                                 var attacked1 = _obj as Entity;
  5456.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  5457.                                                 {
  5458.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  5459.                                                     {
  5460.                                                         lastAttacked = attacked1;
  5461.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked1, spell, ref attack);
  5462.                                                         suse.Effect = attack.Effect;
  5463.                                                         damage = damage + damage * (p += 20) / 100;
  5464.                                                         if (damage == 0) break;
  5465.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  5466.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  5467.                                                     }
  5468.                                                 }
  5469.                                             }
  5470.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  5471.                                             {
  5472.                                                 attackedsob = _obj as SobNpcSpawn;
  5473.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  5474.                                                 {
  5475.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  5476.                                                     {
  5477.                                                         lastAttacked = attackedsob;
  5478.                                                         uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
  5479.                                                         suse.Effect = attack.Effect;
  5480.                                                         damage = damage + damage * (p += 20) / 100;
  5481.                                                         if (damage == 0) break;
  5482.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  5483.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  5484.                                                     }
  5485.                                                 }
  5486.                                             }
  5487.                                         }
  5488.                                         attacker.Owner.SendScreen(suse, true);
  5489.                                         return;
  5490.                                     }
  5491.                                 }
  5492.                             }
  5493.                             #endregion
  5494.                             #region TripleBeast
  5495.                             if (attacker.ContainsFlag3(Update.Flags4.TripleBeast))
  5496.                             {
  5497.                                 var spell = Database.SpellTable.GetSpell(12850, attacker.Owner);
  5498.                                 if (spell != null && Kernel.Rate(30))
  5499.                                 {
  5500.                                     spell.CanKill = true;
  5501.                                     {
  5502.                                         SpellUse suse = new SpellUse(true);
  5503.                                         suse.Attacker = attacker.UID;
  5504.                                         suse.SpellID = spell.ID;
  5505.                                         suse.SpellLevel = spell.Level;
  5506.                                         suse.X = attacker.X;
  5507.                                         suse.Y = attacker.Y;
  5508.                                         IMapObject lastAttacked = attacker;
  5509.                                         uint p = 0;
  5510.                                         if (Handle.CanAttack(attacker, attacked, spell, false))
  5511.                                         {
  5512.                                             lastAttacked = attacked;
  5513.                                             uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  5514.                                             damage = damage * 160 / 100;
  5515.                                             p++;
  5516.                                             suse.Effect = attack.Effect;
  5517.                                             attack.Damage = 0;
  5518.                                             Handle.ReceiveAttack(attacker, attacked, attack, damage, spell);
  5519.                                             suse.AddTarget(attacked.UID, damage, attack);
  5520.                                             suse.Effect = attack.Effect = Attack.AttackEffects.None;
  5521.                                         }
  5522.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  5523.                                         {
  5524.                                             if (p > 5) break;
  5525.                                             if (_obj == null) continue;
  5526.                                             if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  5527.                                             {
  5528.                                                 if (_obj.UID == attacked.UID) continue;
  5529.                                                 var attacked1 = _obj as Entity;
  5530.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5 && attacked.UID != attacked1.UID)
  5531.                                                 {
  5532.                                                     if (Handle.CanAttack(attacker, attacked1, spell, false))
  5533.                                                     {
  5534.                                                         lastAttacked = attacked1;
  5535.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attacked1, ref attack, spell);
  5536.                                                         if (p == 1)
  5537.                                                         {
  5538.                                                             damage = damage * 80 / 100;
  5539.                                                         }
  5540.                                                         if (p == 2)
  5541.                                                         {
  5542.                                                             damage = damage * 60 / 100;
  5543.                                                         }
  5544.                                                         if (p == 3)
  5545.                                                         {
  5546.                                                             damage = damage * 40 / 100;
  5547.                                                         }
  5548.                                                         else if (p > 3)
  5549.                                                         {
  5550.                                                             damage = damage * 20 / 100;
  5551.                                                         }
  5552.                                                         suse.Effect = attack.Effect;
  5553.                                                         Handle.ReceiveAttack(attacker, attacked1, attack, damage, spell);
  5554.                                                         suse.AddTarget(attacked1.UID, damage, attack);
  5555.                                                         suse.Effect = attack.Effect = Attack.AttackEffects.None;
  5556.                                                         p++;
  5557.                                                     }
  5558.                                                 }
  5559.                                             }
  5560.                                             else if (_obj.MapObjType == MapObjectType.SobNpc)
  5561.                                             {
  5562.                                                 attackedsob = _obj as SobNpcSpawn;
  5563.                                                 if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  5564.                                                 {
  5565.                                                     if (Handle.CanAttack(attacker, attackedsob, spell))
  5566.                                                     {
  5567.                                                         lastAttacked = attackedsob;
  5568.                                                         uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  5569.                                                         suse.Effect = attack.Effect;
  5570.                                                         Handle.ReceiveAttack(attacker, attackedsob, attack, damage, spell);
  5571.                                                         suse.AddTarget(attackedsob.UID, damage, attack);
  5572.                                                         suse.Effect = attack.Effect = Attack.AttackEffects.None;
  5573.                                                     }
  5574.                                                 }
  5575.                                             }
  5576.                                         }
  5577.                                         attacker.Owner.SendScreen(suse, true);
  5578.                                         return;
  5579.                                     }
  5580.                                 }
  5581.                             }
  5582.                             #endregion
  5583. بعد كده هتعمل سيرش على كود ده
  5584.   public static void ReceiveAttack(Game.Entity attacker, Game.Entity attacked, Attack attack, uint damage, Database.SpellInformation spell)
  5585. تضيف تحتيه
  5586.   #region ThunderCloud
  5587.             if (attacked.Name == "Thundercloud")
  5588.             {
  5589.                 if (spell != null && spell.ID != 0)
  5590.                 {
  5591.                     if (Kernel.Rate(75)) damage = 1;
  5592.                     else damage = 0;
  5593.                 }
  5594.                 else if (spell == null || spell.ID == 0)
  5595.                 {
  5596.                     damage = 1;
  5597.                 }
  5598.             }
  5599.             foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  5600.             {
  5601.                 if (th.CUID == attacked.UID)
  5602.                 {
  5603.                     if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
  5604.                     th.MonsterInfo.InSight = attacker.UID;
  5605.                     break;
  5606.                 }
  5607.             }
  5608.             #endregion
  5609.             #region RevengeTaill
  5610.             if (attacked.ContainsFlag4(Network.GamePackets.Update.Flags4.RevengeTaill))
  5611.             {
  5612.                 if (attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
  5613.                 {
  5614.                     var spelll = Database.SpellTable.GetSpell(13030, attacked.Owner);
  5615.                     if (damage <= spelll.Power)
  5616.                     {
  5617.                         SpellUse suses = new SpellUse(true);
  5618.                         suses.Attacker = attacked.UID;
  5619.                         suses.Attacker1 = attacker.UID;
  5620.                         suses.SpellID = 13030;
  5621.                         suses.SpecialEffect = 1;
  5622.                         suses.AddTarget(attacker.UID, damage, null);
  5623.                         if (attacker.Hitpoints <= damage)
  5624.                         {
  5625.                             attacker.Die(attacked);
  5626.                         }
  5627.                         else
  5628.                         {
  5629.                             attacker.Hitpoints -= damage;
  5630.                         }
  5631.                         attacked.Owner.SendScreen(suses, true);
  5632.                     }
  5633.                 }
  5634.             }
  5635.             #endregion
  5636.             #region ChillingSnow
  5637.             if (attacked.ContainsFlag4(Update.Flags4.ChillingSnow) && attacked.IsStomper2() && attacker.EntityFlag == EntityFlag.Player)
  5638.             {
  5639.                 var spell1 = Database.SpellTable.GetSpell(12960, attacked.Owner);
  5640.                 int rate = 95;
  5641.                 int diff = attacker.BattlePower - attacked.BattlePower;
  5642.                 if (diff < 0) diff = 0;
  5643.                 rate -= (byte)(diff * 5);
  5644.                 if (rate < 0) rate = 0;
  5645.                 if (Kernel.Rate(rate))
  5646.                 {
  5647.                     attacker.AddFlag4(Update.Flags4.xChillingSnow);
  5648.                     attacker.ChillingSnowStamp = Time64.Now;
  5649.                     attacker.ChillingSnow = (byte)(spell1.Level + 1);
  5650.                 }
  5651.             }
  5652.             #endregion
  5653.             #region FreezingPelter
  5654.             if (attacked.ContainsFlag4(Update.Flags4.FreezingPelter) && attacked.IsStomper2() && attacker.EntityFlag == EntityFlag.Player)
  5655.             {
  5656.                 var spell1 = Database.SpellTable.GetSpell(13020, attacked.Owner);
  5657.                 int rate = 30;
  5658.                 int diff = attacker.BattlePower - attacked.BattlePower;
  5659.                 if (diff < 0) diff = 0;
  5660.                 rate -= (byte)(diff * 5);
  5661.                 if (rate < 0) rate = 0;
  5662.                 if (Kernel.Rate(rate))
  5663.                 {
  5664.                     attacker.AddFlag4(Update.Flags4.xFreezingPelter);
  5665.                     attacker.FreezingPelterStamp = Time64.Now;
  5666.                     byte num = 0;
  5667.                     if (spell1.Level == 0) num = 1;
  5668.                     if (spell1.Level == 1) num = 1;
  5669.                     if (spell1.Level == 2) num = 2;
  5670.                     if (spell1.Level == 3) num = 2;
  5671.                     if (spell1.Level == 4) num = 3;
  5672.                     if (spell1.Level == 5) num = 3;
  5673.                     if (spell1.Level == 5) num = 4;
  5674.                     attacker.FreezingPelter = num;
  5675.                 }
  5676.             }
  5677.             #endregion
  5678. وبعدين فى اخر الكود ده
  5679. attacker.AttackStamp = Time64.Now;
  5680. هضيف كود ده
  5681. #region ThunderCloud
  5682.             foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  5683.             {
  5684.                 if (th.CUID == attacker.UID)
  5685.                 {
  5686.                     if (attacked == null || Kernel.GetDistance(attacked.X, attacked.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacked.Dead) break;
  5687.                     th.MonsterInfo.InSight = attacked.UID;
  5688.                     break;
  5689.                 }
  5690.             }
  5691.             #endregion
  5692. بعدين هنعمل سيرش فى كود ده
  5693.  public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
  5694. هنضيف تحتيه كود ده
  5695. #region ThunderCloud
  5696.             if (attacked.Name == "Thundercloud")
  5697.             {
  5698.                 if (attacked.CUID == attacker.UID) return false;
  5699.                 if (!Constants.PKForbiddenMaps.Contains(attacker.MapID))
  5700.                 {
  5701.                     if (attacker.PKMode != Game.Enums.PKMode.PK &&
  5702.                      attacker.PKMode != Game.Enums.PKMode.Team)
  5703.                         return false;
  5704.                     else
  5705.                     {
  5706.                         attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
  5707.                         attacker.FlashingNameStamp = Time64.Now;
  5708.                         attacker.FlashingNameTime = 20;
  5709.  
  5710.                         return true;
  5711.                     }
  5712.                 }
  5713.                 else return false;
  5714.             }
  5715.             #endregion
  5716. بعدين نعمل سيرش على كود ده
  5717.   #region Monster -> Player \ Monster
  5718. هنضيف تحتيه كود ده
  5719.  if (attacked.EntityFlag == EntityFlag.Player)
  5720.                 {
  5721.                     if (attacker.Companion && attacker.Name != "Thundercloud")
  5722.                     {
  5723.                         if (Constants.PKForbiddenMaps.Contains(attacker.MapID))
  5724.                             return;
  5725.                     }
  5726. فيه نفس كود
  5727. هنضيف كود ده
  5728. #region ThunderCloud
  5729.                     if (attacker.Name == "Thundercloud")
  5730.                     {
  5731.                         if (Kernel.GamePool.ContainsKey(attacker.CUID))
  5732.                         {
  5733.                             var owner = Kernel.GamePool[attacker.CUID];
  5734.                             var spell = Database.SpellTable.GetSpell(12840, owner);
  5735.                             var spell2 = Database.SpellTable.GetSpell(12970, owner);
  5736.                             byte percent = 0;
  5737.                             if (spell2 != null)
  5738.                             {
  5739.                                 if (spell2.Level == 0) percent = 130;
  5740.                                 if (spell2.Level == 1) percent = 140;
  5741.                                 if (spell2.Level == 2) percent = 150;
  5742.                                 if (spell2.Level == 3) percent = 160;
  5743.                                 if (spell2.Level == 4) percent = 170;
  5744.                                 if (spell2.Level == 5) percent = 180;
  5745.                                 if (spell2.Level == 6) percent = 200;
  5746.                             }
  5747.                             attack = new Attack(true);
  5748.                             attack.Attacker = attacker.UID;
  5749.                             attack.Attacked = attacked.UID;
  5750.                             attack.AttackType = Network.GamePackets.Attack.Kill;
  5751.                             attack.X = attacked.X;
  5752.                             attack.Y = attacked.Y;
  5753.                             attack.Damage = 1;
  5754.                             uint damage2 = (uint)(Calculate.Melee(owner.Entity, attacked, ref attack) * spell.FirstDamage / 100);
  5755.                             if (attacker.SpawnPacket[50] == 128)//ThunderBolt
  5756.                                 damage2 = (uint)(damage2 * percent / 100);
  5757.                             SpellUse suse2 = new SpellUse(true);
  5758.                             suse2.Attacker = attacker.UID;
  5759.                             suse2.Attacker1 = attacked.UID;
  5760.                             suse2.SpellID = 13190;
  5761.                             suse2.X = attacked.X;
  5762.                             suse2.Y = attacked.Y;
  5763.                             suse2.AddTarget(attacked.UID, damage2, attack);
  5764.                             attacker.MonsterInfo.SendScreen(suse2);
  5765.                             if (attacked.Hitpoints <= damage2)
  5766.                             {
  5767.                                 attacked.Die(attacker);
  5768.                                 attack.ResponseDamage = damage2;
  5769.                                 attacker.MonsterInfo.SendScreen(attack);
  5770.                             }
  5771.                             else
  5772.                             {
  5773.                                 attacked.Hitpoints -= damage2;
  5774.                             }
  5775.                             return;
  5776.                         }
  5777.                         else
  5778.                             return;
  5779.                     }
  5780.                     #endregion
  5781. #region ThunderCloudSight
  5782.                     foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(i => i.Name == "Thundercloud"))
  5783.                     {
  5784.                         if (th.CUID == attacked.UID)
  5785.                         {
  5786.                             if (attacker == null || Kernel.GetDistance(attacker.X, attacker.Y, th.X, th.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
  5787.                             th.MonsterInfo.InSight = attacker.UID;
  5788.                             break;
  5789.                         }
  5790.                     }
  5791.                     #endregion
  5792. بعدين هنعمل سيرش على كود ده
  5793.    attack.Effect = Attack.AttackEffects.None;
  5794. تحتيه هضيف كود ده
  5795.  
  5796. #region ThunderCloud
  5797.                         if (attacker.Name == "Thundercloud")
  5798.                         {
  5799.                             if (Kernel.GamePool.ContainsKey(attacker.CUID))
  5800.                             {
  5801.                                 var owner = Kernel.GamePool[attacker.CUID];
  5802.                                 var spell = Database.SpellTable.GetSpell(12840, owner);
  5803.                                 var spell2 = Database.SpellTable.GetSpell(12970, owner);
  5804.                                 uint damage2 = (uint)(Calculate.Melee(owner.Entity, attacked, ref attack) * (spell.Level < 8 ? spell.FirstDamage : 50) / 100);
  5805.                                 if (attacker.SpawnPacket[50] == 128)
  5806.                                     damage2 = (uint)(damage2 * spell2.FirstDamage);
  5807.                                 SpellUse suse2 = new SpellUse(true);
  5808.                                 suse2.Attacker = attacker.UID;
  5809.                                 suse2.Attacker1 = attacked.UID;
  5810.                                 suse2.SpellID = 13190;
  5811.                                 suse2.X = attacked.X;
  5812.                                 suse2.Y = attacked.Y;
  5813.                                 suse2.AddTarget(attacked.UID, damage2, attack);
  5814.                                 attacker.MonsterInfo.SendScreen(suse2);
  5815.                                 if (attacked.Hitpoints <= damage2)
  5816.                                 {
  5817.                                     attacked.Die(attacker);
  5818.                                     attack = new Attack(true);
  5819.                                     attack.Attacker = attacker.UID;
  5820.                                     attack.Attacked = attacked.UID;
  5821.                                     attack.AttackType = Network.GamePackets.Attack.Kill;
  5822.                                     attack.X = attacked.X;
  5823.                                     attack.Y = attacked.Y;
  5824.                                     attack.Damage = 1;
  5825.                                     attack.ResponseDamage = damage2;
  5826.                                     attacker.MonsterInfo.SendScreen(attack);
  5827.                                 }
  5828.                                 else
  5829.                                 {
  5830.                                     attacked.Hitpoints -= damage2;
  5831.                                 }
  5832.                                 return;
  5833.                             }
  5834.                             else
  5835.                                 return;
  5836.                         }
  5837.                         #endregion
  5838. بعدين هنعمل سيرش
  5839. #region Ranged
  5840. هنزل لحد كود ده
  5841.  if (weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613 && weapons.Item1.ID
  5842. هنبدلهبى الكود ده
  5843.   if (weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613 && weapons.Item1.ID / 1000 != 626) return;
  5844.  
  5845. هنعمل سيرش على نفس كود وهنضفهم تانى
  5846. كده خلصنا من ملف الهاندل نيجى بقى لى ملف اينتى
  5847. هنضيف دول فى ملف اينتى
  5848.  #region WindWalker
  5849.         public Time64 TCSpellUse;
  5850.         public Time64 SwirlingStamp;
  5851.         public bool IsStomper()
  5852.         {
  5853.             if (EntityFlag == Game.EntityFlag.Player)
  5854.             {
  5855.                 if (this.Class >= 160 && this.Class <= 165)
  5856.                     if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  5857.                         return true;
  5858.             }
  5859.             return false;
  5860.         }
  5861.         public bool IsStomper1()
  5862.         {
  5863.             if (EntityFlag == Game.EntityFlag.Player)
  5864.             {
  5865.                 var weapons = Owner.Weapons;
  5866.                 if (weapons.Item1 != null)
  5867.                     if (weapons.Item1.ID / 1000 == 626)
  5868.                         if (this.Class >= 160 && this.Class <= 165)
  5869.                             if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  5870.                                 return true;
  5871.             }
  5872.             return false;
  5873.         }
  5874.         public bool IsStomper2()
  5875.         {
  5876.             if (EntityFlag == Game.EntityFlag.Player)
  5877.             {
  5878.                 var weapons = Owner.Weapons;
  5879.                 if (weapons.Item2 != null)
  5880.                     if (weapons.Item2.ID / 1000 == 626)
  5881.                         if (this.Class >= 160 && this.Class <= 165)
  5882.                             if (this.Windwalker == 8 || this.Windwalker == 9 || this.Windwalker == 15)
  5883.                                 return true;
  5884.             }
  5885.             return false;
  5886.         }
  5887.         public bool IsChaser()
  5888.         {
  5889.             if (EntityFlag == Game.EntityFlag.Player)
  5890.             {
  5891.                 if (this.Class >= 160 && this.Class <= 165)
  5892.                     if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  5893.                         return true;
  5894.             }
  5895.             return false;
  5896.         }
  5897.         public bool IsChaser1()
  5898.         {
  5899.             if (EntityFlag == Game.EntityFlag.Player)
  5900.             {
  5901.                 var weapons = Owner.Weapons;
  5902.                 if (weapons.Item1 != null)
  5903.                     if (weapons.Item1.ID / 1000 == 626)
  5904.                         if (this.Class >= 160 && this.Class <= 165)
  5905.                             if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  5906.                                 return true;
  5907.             }
  5908.             return false;
  5909.         }
  5910.         public bool IsChaser2()
  5911.         {
  5912.             if (EntityFlag == Game.EntityFlag.Player)
  5913.             {
  5914.                 var weapons = Owner.Weapons;
  5915.                 if (weapons.Item2 != null)
  5916.                     if (weapons.Item2.ID / 1000 == 626)
  5917.                         if (this.Class >= 160 && this.Class <= 165)
  5918.                             if (this.Windwalker == 0 || this.Windwalker == 7 || this.Windwalker == 1)
  5919.                                 return true;
  5920.             }
  5921.             return false;
  5922.         }
  5923.         public Time64 OmnipotenceStamp, RevengeTaillStamp, StomperStaminaStamp, ChaserStaminaStamp, HealingSnowStamp, ThunderCloudStamp, ChillingSnowStamp, FreezingPelterStamp;
  5924.         public byte ChillingSnow = 0, FreezingPelter = 0;
  5925.         #endregion
  5926.         #region WindWalker.
  5927.         public String Branch = "";
  5928.         private byte _ChangeBranch;
  5929.         public byte ChangeBranch
  5930.         {
  5931.             get
  5932.             {
  5933.                 return _ChangeBranch;
  5934.             }
  5935.             set
  5936.             {
  5937.                 _ChangeBranch = value;
  5938.             }
  5939.         }
  5940.         public Time64 TripleBeastStamp = Time64.Now;
  5941.         public bool SwirlingStorm = false;
  5942.         public float SwirlingStormPercent;
  5943.         public byte _Windwalker;
  5944.         public byte Windwalker
  5945.         {
  5946.             get
  5947.             {
  5948.                 SpawnPacket[304] = _Windwalker;
  5949.                 return _Windwalker;
  5950.             }
  5951.             set
  5952.             {
  5953.                 _Windwalker = value;
  5954.                 SpawnPacket[304] = value;
  5955.                 if (value > 0)
  5956.                     AddFlag4(Network.GamePackets.Update.Flags4.JusticeChant);
  5957.             }
  5958.         }
  5959.         public bool PWindWalker()
  5960.         {
  5961.             if (EntityFlag == Game.EntityFlag.Player)
  5962.             {
  5963.                 var weapons = Owner.Weapons;
  5964.                 if (weapons.Item2 != null)
  5965.                     if (weapons.Item2.ID / 1000 == 626)
  5966.                         return true;
  5967.             }
  5968.             return false;
  5969.         }
  5970.         #endregion
  5971.  
  5972. بعد كده هنبدل ده بالى عندك
  5973.   public uint Mesh
  5974.         {
  5975.             get
  5976.             {
  5977.                 return BitConverter.ToUInt32(SpawnPacket, _Mesh);
  5978.             }
  5979.             set
  5980.             {
  5981.                 Writer.Write(value, _Mesh, SpawnPacket);
  5982.             }
  5983.  
  5984.         }
  5985. بعد كده هنفتح ملف فلور ايتم
  5986. هنضيف دول
  5987.   RageOfWarTrap = 1500,
  5988.   ShadowofChaser = 1550,
  5989. بعد كده هنضيف كوده ده
  5990.   public Game.Entity ShadowofChaserAttacker, ShadowofChaserAttacked;
  5991. public Attack Attack;
  5992. بعد كده هنضيف
  5993.  public byte Unknown37
  5994.         {
  5995.             get { return Buffer[37]; }
  5996.             set { Buffer[37] = value; }
  5997.         }
  5998.  
  5999.         public string Name2
  6000.         {
  6001.             get { return Program.Encoding.GetString(Buffer, 93, 16); }
  6002.             set { Writer.Write(value, 93, Buffer); }
  6003.         }
  6004.         public ushort X2
  6005.         {
  6006.             get { return BitConverter.ToUInt16(Buffer, 61); }
  6007.             set { Writer.Write(value, 61, Buffer); }
  6008.         }
  6009.  
  6010.         public ushort Y2
  6011.         {
  6012.             get { return BitConverter.ToUInt16(Buffer, 63); }
  6013.             set { Writer.Write(value, 63, Buffer); }
  6014.         }
  6015. هنفتح ملف Map.cs
  6016. اعمل سيرش
  6017.  public enum MapObjectType
  6018. ضيف فيه كود ده
  6019. FloorSpell,
  6020. هنفتح ملف Data.cs
  6021. هنضيف كود ده
  6022. public ushort X2
  6023.         {
  6024.             get
  6025.             {
  6026.                 return BitConverter.ToUInt16(Buffer, 28);
  6027.             }
  6028.             set
  6029.             {
  6030.                 Writer.Write(value, 28, Buffer);
  6031.             }
  6032.         }
  6033.         public ushort Y2
  6034.         {
  6035.             get
  6036.             {
  6037.                 return BitConverter.ToUInt16(Buffer, 30);
  6038.             }
  6039.             set
  6040.             {
  6041.                 Writer.Write(value, 30, Buffer);
  6042.             }
  6043.         }
  6044. هنفتح ملف world.cs
  6045. هنضيف فيه كود ده
  6046.  public bool Register(Entity ThunderCloudd)
  6047.         {
  6048.             if (ThunderCloudd.Owner.TimerSubscriptions == null)
  6049.             {
  6050.                 ThunderCloudd.Owner.TimerSyncRoot = new object();
  6051.                 ThunderCloudd.Owner.TimerSubscriptions = new IDisposable[]
  6052.                 {
  6053.                     ThunderCloud.Add(ThunderCloudd)
  6054.                 };
  6055.                 return true;
  6056.             }
  6057.             return false;
  6058.         }
  6059.         public void Unregister(Entity Thundercloud)
  6060.         {
  6061.             if (Thundercloud.Owner == null || Thundercloud.Owner.TimerSubscriptions == null) return;
  6062.             lock (Thundercloud.Owner.TimerSyncRoot)
  6063.             {
  6064.                 if (Thundercloud.Owner.TimerSubscriptions != null)
  6065.                 {
  6066.                     foreach (var timer in Thundercloud.Owner.TimerSubscriptions)
  6067.                         timer.Dispose();
  6068.                     Thundercloud.Owner.TimerSubscriptions = null;
  6069.                 }
  6070.             }
  6071.         }
  6072. طبعا هيظهرلك ايرور
  6073. هنضيف فى نفس ملف
  6074. كود ده
  6075.   public TimerRule<Entity> ThunderCloud;
  6076.         private void ThunderCloudTimer(Entity ThunderCloud, int time)
  6077.         {
  6078.             if (ThunderCloud == null) return;
  6079.             if (Time64.Now >= ThunderCloud.ThunderCloudStamp.AddSeconds(1))
  6080.             {
  6081.                 ThunderCloud.ThunderCloudStamp = Time64.Now;
  6082.                 if (ThunderCloud.Hitpoints > 400)
  6083.                     ThunderCloud.Hitpoints -= 400;
  6084.                 else
  6085.                 {
  6086.                     Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
  6087.                     Data data = new Data(true);
  6088.                     data.UID = ThunderCloud.UID;
  6089.                     data.ID = Data.RemoveEntity;
  6090.                     ThunderCloud.MonsterInfo.SendScreen(data);
  6091.                     ThunderCloud.MonsterInfo.SendScreen(data);
  6092.                     foreach (var client in Kernel.GamePool.Values)
  6093.                     {
  6094.                         if (Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, client.Entity.X, client.Entity.Y) > 16) continue;
  6095.                         client.RemoveScreenSpawn(ThunderCloud, true);
  6096.                     }
  6097.                     Unregister(ThunderCloud);
  6098.                     return;
  6099.                 }
  6100.             }
  6101.             if ((ThunderCloud.SpawnPacket[50] == 0 && Time64.Now >= ThunderCloud.MonsterInfo.LastMove.AddMilliseconds(750)) || ThunderCloud.SpawnPacket[50] == 128)
  6102.             {
  6103.                 ThunderCloud.MonsterInfo.LastMove = Time64.Now;
  6104.                 if (ThunderCloud.MonsterInfo.InSight == 0)
  6105.                 {
  6106.                     foreach (var one in Kernel.Maps[ThunderCloud.MapID].Entities.Values.Where(i => Kernel.GetDistance(ThunderCloud.X, ThunderCloud.Y, i.X, i.Y) <= ThunderCloud.MonsterInfo.AttackRange))
  6107.                     {
  6108.                         if (one == null || one.Dead || one.MonsterInfo.Guard || one.Companion) continue;
  6109.                         ThunderCloud.MonsterInfo.InSight = one.UID;
  6110.                         Entity insight = null;
  6111.                         if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  6112.                             insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
  6113.                         else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  6114.                             insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Entity;
  6115.                         if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
  6116.                         {
  6117.                             ThunderCloud.MonsterInfo.InSight = 0;
  6118.                             break;
  6119.                         }
  6120.                         new Game.Attacking.Handle(null, ThunderCloud, insight);
  6121.                         break;
  6122.                     }
  6123.                 }
  6124.                 else
  6125.                 {
  6126.                     Entity insight = null;
  6127.                     if (Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  6128.                         insight = Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
  6129.                     else if (Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
  6130.                         insight = Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Entity;
  6131.                     if (insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
  6132.                     {
  6133.                         ThunderCloud.MonsterInfo.InSight = 0;
  6134.                         return;
  6135.                     }
  6136.                     new Game.Attacking.Handle(null, ThunderCloud, insight);
  6137.                 }
  6138.             }
  6139.  
  6140.         }
  6141. هنيجى لاخر حاجة هنفتح ملف ان بى سى
  6142. نعمل سيرش على كود
  6143.  public Npcs(GameClient client)
  6144. هنضيف تحتيه
  6145.   public static string WindwalkerSkills(GameClient client, ushort spellid)
  6146.         {
  6147.             byte level = 0;
  6148.             if (spellid == 12830 || spellid == 13070 || spellid == 13080) level = 120;
  6149.             if (spellid == 12840 || spellid == 12960 || spellid == 13000) level = 70;
  6150.             if (spellid == 12850 || spellid == 12930 || spellid == 12990) level = 40;
  6151.             if (spellid == 12860 || spellid == 12870) level = 3;
  6152.             if (spellid == 12890 || spellid == 12940 || spellid == 12950 || spellid == 13090) level = 15;
  6153.             if (spellid == 12970 || spellid == 13020 || spellid == 13030) level = 100;
  6154.             var spell = Database.SpellTable.GetSpell(spellid, client);
  6155.             if (!client.Spells.ContainsKey(spellid) && client.Entity.Level >= level) return "Available";
  6156.             else if (client.Spells.ContainsKey(spellid)) return "Learned";
  6157.             else return "N/A";
  6158.         }
  6159. بعدين نضيف ان بى سى ده
  6160. #region WindwalkerLord
  6161.                                 case 5158:
  6162.                                     {
  6163.                                         switch (npcRequest.OptionID)
  6164.                                         {
  6165.                                             case 0:
  6166.                                                 {
  6167.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  6168.                                                     {
  6169.  
  6170.                                                         dialog.Text("Our Windwalker school was founded by Saint Wan on the principle of KINDNESS and JUSTICE. Once you decide to");
  6171.                                                         dialog.Text("~join us as a Windwalker, you take the responsibility for the security of the country against alien invaders and devils.");
  6172.                                                         if (client.Entity.Class != 165)
  6173.                                                         {
  6174.                                                             dialog.Option("I~want~to~get~promoted.", 1);
  6175.                                                         }
  6176.                                                         dialog.Option("Learn~skills.", 2);
  6177.                                                         dialog.Option("Switch~to~another~branch.", 4);
  6178.                                                         dialog.Option("I`ll~talk~to~you~later.", 255);
  6179.                                                         dialog.Send();
  6180.  
  6181.                                                     }
  6182.                                                     else
  6183.                                                     {
  6184.                                                         dialog.Text("You don`t look like a Windwalker. What`s the matter? If you were ever a Windwalker in either of the previous two lives, you can learn [Frost Gaze I] from me.");
  6185.  
  6186.                                                         dialog.Option("Learn~Frost~Gaze~I.", 3);
  6187.                                                         dialog.Send();
  6188.                                                     }
  6189.                                                     break;
  6190.                                                 }
  6191.                                             #region Promocion
  6192.                                             case 1:
  6193.                                                 {
  6194.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  6195.                                                     {
  6196.                                                         if (client.Entity.Class == 165)
  6197.                                                         {
  6198.                                                             dialog.Text("You cannot be promoted anymore. You have mastered your class.");
  6199.                                                             dialog.Option("Thank you master.", 255);
  6200.                                                             dialog.Send();
  6201.                                                         }
  6202.                                                         else
  6203.                                                         {
  6204.                                                             dialog.Text("To promote now you need" + client.PromoteItemNameNeed + " level " + client.PromoteLevelNeed + ".");
  6205.                                                             dialog.Option("Promote me sir.", 7);
  6206.                                                             dialog.Send();
  6207.                                                         }
  6208.                                                     }
  6209.                                                     else
  6210.                                                     {
  6211.                                                         dialog.Text("I will not tell any of the Windwalker secrets to another class, so, good bye.");
  6212.                                                         dialog.Option("Alright.", 255);
  6213.                                                         dialog.Send();
  6214.                                                     }
  6215.                                                     break;
  6216.                                                 }
  6217.                                             case 7:
  6218.                                                 {
  6219.                                                     if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
  6220.                                                     {
  6221.                                                         if (client.Entity.Class == 165)
  6222.                                                         {
  6223.                                                             dialog.Text("You cannot be promoted anymore. You have mastered your class.");
  6224.                                                             dialog.Option("Thank you master.", 255);
  6225.                                                             dialog.Send();
  6226.                                                         }
  6227.                                                         else
  6228.                                                         {
  6229.                                                             if (client.PromoteItemNeed == 721020)
  6230.                                                             {
  6231.                                                                 if (client.Inventory.Remove("moonbox"))
  6232.                                                                 {
  6233.                                                                     client.Entity.Update(10, "end_task", true);
  6234.                                                                     client.Inventory.Add(client.PromoteItemGain, 0, 1);
  6235.                                                                     client.Entity.Class++;
  6236.                                                                     dialog.Text("Congratulations! You have been promoted.");
  6237.                                                                     dialog.Option("Thank you master.", 255);
  6238.                                                                     dialog.Send();
  6239.                                                                 }
  6240.                                                                 else
  6241.                                                                 {
  6242.                                                                     dialog.Text("You don't meet the requierments.");
  6243.                                                                     dialog.Option("Ahh.", 255);
  6244.                                                                     dialog.Send();
  6245.                                                                 }
  6246.                                                                 return;
  6247.                                                             }
  6248.                                                             if (client.Inventory.Contains(client.PromoteItemNeed, client.PromoteItemCountNeed) && client.Entity.Level >= client.PromoteLevelNeed)
  6249.                                                             {
  6250.                                                                 client.Inventory.Remove(client.PromoteItemNeed, client.PromoteItemCountNeed);
  6251.                                                                 client.Inventory.Add(client.PromoteItemGain, 0, 1);
  6252.                                                                 client.Entity.Class++;
  6253.                                                                 client.Entity.Update(10, "end_task", true);
  6254.                                                                 dialog.Text("Congratulations! You have been promoted.");
  6255.                                                                 dialog.Option("Thank you master.", 255);
  6256.                                                                 dialog.Send();
  6257.                                                             }
  6258.                                                             else
  6259.                                                             {
  6260.                                                                 dialog.Text("You don't meet the requierments.");
  6261.                                                                 dialog.Option("Ahh.", 255);
  6262.                                                                 dialog.Send();
  6263.                                                             }
  6264.                                                         }
  6265.                                                     }
  6266.                                                     else
  6267.                                                     {
  6268.                                                         dialog.Text("I will not tell any of the WindWalker secrets to another class, so, good bye.");
  6269.                                                         dialog.Option("Alright.", 255);
  6270.                                                         dialog.Send();
  6271.                                                     }
  6272.                                                     break;
  6273.                                                 }
  6274.                                             #endregion
  6275.                                             case 4:
  6276.                                                 {
  6277.                                                     if (client.Entity.IsChaser())
  6278.                                                     {
  6279.                                                         dialog.Text("                                       *Branches of Windwalker School*");
  6280.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  6281.                                                         dialog.Text("Stomper: Excels in melee combat with excellent attack range and remarkable recovery ability. Stomper`s exclusive skill");
  6282.                                                         dialog.Text("          can freeze enemies` blood to extend their skill cooldown time and response time.");
  6283.                                                         dialog.Text("Chaser: Excels in ranged combat. With a unique focusing skill, Chaser is able to control the power of wind to attack");
  6284.                                                         dialog.Text("         enemies far away.");
  6285.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  6286.                                                         dialog.Text("(You`re currently on the [RangedChaser] branch. Each Windwalker can switch his/her branch once every 30 days, free of charge.)");
  6287.                                                         dialog.Option("Switch~to~[MeleeStomper]~branch.", 5);
  6288.                                                         dialog.Option("I`ll~think~about~it.", 255);
  6289.                                                         dialog.Send();
  6290.                                                     }
  6291.                                                     else if (client.Entity.IsStomper())
  6292.                                                     {
  6293.                                                         dialog.Text("                                       *Branches of Windwalker School*");
  6294.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  6295.                                                         dialog.Text("Stomper: Excels in melee combat with excellent attack range and remarkable recovery ability. Stomper`s exclusive skill");
  6296.                                                         dialog.Text("          can freeze enemies` blood to extend their skill cooldown time and response time.");
  6297.                                                         dialog.Text("Chaser: Excels in ranged combat. With a unique focusing skill, Chaser is able to control the power of wind to attack");
  6298.                                                         dialog.Text("         enemies far away.");
  6299.                                                         dialog.Text("،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ،ھ");
  6300.                                                         dialog.Text("(You`re currently on the [MeleeStomper] branch. Each Windwalker can switch his/her branch once every 30 days, free of charge.)");
  6301.                                                         dialog.Option("Switch~to~[RangedChaser]~branch.", 6);
  6302.                                                         dialog.Option("I`ll~think~about~it.", 255);
  6303.                                                         dialog.Send();
  6304.                                                     }
  6305.                                                     break;
  6306.                                                 }
  6307.                                             case 5:
  6308.                                                 {
  6309.                                                     if (client.Entity.IsStomper())
  6310.                                                         client.Entity.Windwalker = 0;
  6311.                                                     else if (client.Entity.IsChaser())
  6312.                                                         client.Entity.Windwalker = 8;
  6313.                                                     else break;
  6314.                                                     Update upd = new Update(true);
  6315.                                                     upd.UID = client.Entity.UID;
  6316.                                                     upd.UpdateCount = 1;
  6317.                                                     upd.SwitchWindwalker(3277209, 1);
  6318.                                                     client.SendScreen(upd, true);
  6319.                                                     Update upd2 = new Update(true);
  6320.                                                     upd2.UID = client.Entity.UID;
  6321.                                                     upd2.UpdateCount = 1;
  6322.                                                     upd2.SwitchWindwalker(71, client.Entity.Windwalker);
  6323.                                                     client.SendScreen(upd2, true);
  6324.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.JusticeChant);
  6325.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ChillingSnow);
  6326.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.FreezingPelter);
  6327.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.HealingSnow);
  6328.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.RevengeTaill);
  6329.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ShadowofChaser);
  6330.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.Omnipotence);
  6331.                                                     dialog.Text("Okay, I`ve changed your branch to [MeleeStomper].");
  6332.                                                     dialog.Option("Thanks!", 255);
  6333.                                                     dialog.Send();
  6334.                                                     break;
  6335.                                                 }
  6336.                                             case 6:
  6337.                                                 {
  6338.                                                     if (client.Entity.IsStomper())
  6339.                                                         client.Entity.Windwalker = 0;
  6340.                                                     else if (client.Entity.IsChaser())
  6341.                                                         client.Entity.Windwalker = 8;
  6342.                                                     else break;
  6343.                                                     Update upd = new Update(true);
  6344.                                                     upd.UID = client.Entity.UID;
  6345.                                                     upd.UpdateCount = 1;
  6346.                                                     upd.SwitchWindwalker(3277209, 1);
  6347.                                                     client.SendScreen(upd, true);
  6348.                                                     Update upd2 = new Update(true);
  6349.                                                     upd2.UID = client.Entity.UID;
  6350.                                                     upd2.UpdateCount = 1;
  6351.                                                     upd2.SwitchWindwalker(71, client.Entity.Windwalker);
  6352.                                                     client.SendScreen(upd2, true);
  6353.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.JusticeChant);
  6354.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ChillingSnow);
  6355.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.FreezingPelter);
  6356.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.HealingSnow);
  6357.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.RevengeTaill);
  6358.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.ShadowofChaser);
  6359.                                                     client.Entity.RemoveFlag4((ulong)Network.GamePackets.Update.Flags4.Omnipotence);
  6360.                                                     dialog.Text("Okay, I`ve changed your branch to [RangedChaser].");
  6361.                                                     dialog.Option("Thanks!", 255);
  6362.                                                     dialog.Send();
  6363.                                                     break;
  6364.                                                 }
  6365.                                             case 3:
  6366.                                                 {
  6367.                                                     if (client.Entity.FirstRebornClass == 0)
  6368.                                                     {
  6369.                                                         client.AddSpell(LearnableSpell(12830));
  6370.                                                         break;
  6371.                                                     }
  6372.                                                     else if (client.Entity.FirstRebornClass == 165)
  6373.                                                     {
  6374.                                                         client.AddSpell(LearnableSpell(13070));
  6375.                                                         break;
  6376.                                                     }
  6377.                                                     else if (client.Entity.FirstRebornClass == 165 & client.Entity.SecondRebornClass == 165)
  6378.                                                     {
  6379.                                                         client.AddSpell(LearnableSpell(13080));
  6380.                                                         break;
  6381.                                                     }
  6382.                                                     else
  6383.                                                     {
  6384.                                                         client.MessageBox("You`re not qualified to learn this skill.");
  6385.                                                         break;
  6386.                                                     }
  6387.  
  6388.                                                 }
  6389.                                             case 2:
  6390.                                                 {
  6391.                                                     dialog.Text("Our Windwalker school is divided into two branches: Chaser and Stomper. Chaser focuses on");
  6392.                                                     dialog.Text("~ranged combat, while Stomper excels in melee combat. I`m here representing the Chief to");
  6393.                                                     dialog.Text("~impart distinctive skills to the Windwalkers.");
  6394.  
  6395.                                                     dialog.Option("Learn~skills~of~Stomper.", 10);
  6396.                                                     dialog.Option("Learn~skills~of~Chaser.", 11);
  6397.                                                     dialog.Option("Learn~rebirth~skill.", 12);
  6398.                                                     dialog.Option("Learn~universal~skills.", 13);
  6399.                                                     dialog.Send();
  6400.                                                     break;
  6401.                                                 }
  6402.                                             case 12:
  6403.                                                 {
  6404.                                                     dialog.Text("Frost Gaze is an exclusive rebirth skill for Windwalker. The heroes who got reborn to be Windwalker can learn Frost Gaze I. If both of your precious andd");
  6405.                                                     dialog.Text("~current Class are Windwalker, you can learn Frost Gaze II. While for Windwalkers who were also a Windwalker in previous two lives, they can learn Frost Gaze III.");
  6406.  
  6407.                                                     if (client.Entity.FirstRebornClass == 0)
  6408.                                                         dialog.Option("Frost~Gaze~I.", 3);
  6409.                                                     if (client.Entity.FirstRebornClass == 165)
  6410.                                                         dialog.Option("Frost~Gaze~II.", 3);
  6411.                                                     if (client.Entity.SecondRebornClass == 165)
  6412.                                                         dialog.Option("Frost~Gaze~III.", 3);
  6413.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  6414.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  6415.                                                     dialog.Send();
  6416.                                                     break;
  6417.                                                 }
  6418.                                             case 13:
  6419.                                                 {
  6420.                                                     dialog.Text("Omnipotence and Justice Chant are basic skills for Windwalker, which are available to both Chaser and Stomper learners. I`ll teach you if you want.");
  6421.  
  6422.                                                     dialog.Option("Omnipotence~[Lv.3].~(" + WindwalkerSkills(client, 12860) + ")", 40);
  6423.                                                     dialog.Option("JusticeChant~[Lv.3].~(" + WindwalkerSkills(client, 12870) + ")", 41);
  6424.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  6425.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  6426.                                                     dialog.Send();
  6427.                                                     break;
  6428.                                                 }
  6429.                                             case 40:
  6430.                                             case 41:
  6431.                                                 {
  6432.                                                     ushort spellid = 12800;
  6433.                                                     switch (npcRequest.OptionID)
  6434.                                                     {
  6435.                                                         case 40: { spellid += 60; break; }
  6436.                                                         case 41: { spellid += 70; break; }
  6437.                                                     }
  6438.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  6439.                                                     {
  6440.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  6441.  
  6442.                                                         dialog.Option("Okay.", 2);
  6443.                                                         dialog.Send();
  6444.                                                         break;
  6445.                                                     }
  6446.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  6447.                                                     {
  6448.                                                         client.AddSpell(LearnableSpell(spellid));
  6449.                                                     }
  6450.                                                     else
  6451.                                                     {
  6452.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  6453.  
  6454.                                                         dialog.Option("I`ll~see~you!", 2);
  6455.                                                         dialog.Send();
  6456.                                                     }
  6457.                                                     break;
  6458.                                                 }
  6459.                                             case 10:
  6460.                                                 {
  6461.                                                     dialog.Text("The Stomper branch has developed overwhelming melee skills which enable the caster to disable an enemy with swift and flexible fighting moves.");
  6462.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  6463.  
  6464.                                                     dialog.Option("AngerofStomper~[Lv.1].~(" + WindwalkerSkills(client, 12980) + ")", 20);
  6465.                                                     dialog.Option("BurntFrost~[Lv.15].~(" + WindwalkerSkills(client, 12940) + ")", 21);
  6466.                                                     dialog.Option("HealingSnow~[Lv.15].~(" + WindwalkerSkills(client, 12950) + ")", 22);
  6467.                                                     dialog.Option("RageofWar~[Lv.40].~(" + WindwalkerSkills(client, 12930) + ")", 23);
  6468.                                                     dialog.Option("HorrorofStomper~[Lv.40].~(" + WindwalkerSkills(client, 12990) + ")", 24);
  6469.                                                     dialog.Option("ChillingSnow~[Lv.70].~(" + WindwalkerSkills(client, 12960) + ")", 25);
  6470.                                                     dialog.Option("PeaceofStomper~[Lv.70].~(" + WindwalkerSkills(client, 13000) + ")", 26);
  6471.                                                     dialog.Option("Next.", 27);
  6472.                                                     dialog.Send();
  6473.                                                     break;
  6474.                                                 }
  6475.                                             case 27:
  6476.                                                 {
  6477.                                                     dialog.Text("The Stomper branch has developed overwhelming melee skills which enable the caster to disable an enemy with swift and flexible fighting moves.");
  6478.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  6479.  
  6480.                                                     dialog.Option("RevengeTail~[Lv.100].~(" + WindwalkerSkills(client, 13030) + ")", 28);
  6481.                                                     dialog.Option("FreezingPelter~[Lv.100].~(" + WindwalkerSkills(client, 13020) + ")", 29);
  6482.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  6483.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  6484.                                                     dialog.Option("Previous.", 10);
  6485.                                                     dialog.Send();
  6486.                                                     break;
  6487.                                                 }
  6488.                                             case 20:
  6489.                                             case 21:
  6490.                                             case 22:
  6491.                                             case 23:
  6492.                                             case 24:
  6493.                                             case 25:
  6494.                                             case 26:
  6495.                                             case 28:
  6496.                                             case 29:
  6497.                                                 {
  6498.                                                     ushort spellid = 12900;
  6499.                                                     switch (npcRequest.OptionID)
  6500.                                                     {
  6501.                                                         case 20: { spellid += 80; break; }
  6502.                                                         case 21: { spellid += 40; break; }
  6503.                                                         case 22: { spellid += 50; break; }
  6504.                                                         case 23: { spellid += 30; break; }
  6505.                                                         case 24: { spellid += 90; break; }
  6506.                                                         case 25: { spellid += 60; break; }
  6507.                                                         case 26: { spellid += 100; break; }
  6508.                                                         case 28: { spellid += 130; break; }
  6509.                                                         case 29: { spellid += 120; break; }
  6510.                                                     }
  6511.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  6512.                                                     {
  6513.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  6514.  
  6515.                                                         dialog.Option("Okay.", 2);
  6516.                                                         dialog.Send();
  6517.                                                         break;
  6518.                                                     }
  6519.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  6520.                                                     {
  6521.                                                         client.AddSpell(LearnableSpell(spellid));
  6522.                                                     }
  6523.                                                     else
  6524.                                                     {
  6525.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  6526.  
  6527.                                                         dialog.Option("I`ll~see~you!", 2);
  6528.                                                         dialog.Send();
  6529.                                                     }
  6530.                                                     break;
  6531.                                                 }
  6532.                                             case 11:
  6533.                                                 {
  6534.                                                     dialog.Text("The Chaser branch is famous for its ability to control wind and outstanding ranged attacks.");
  6535.                                                     dialog.Text("~FellowBrother, which skill would you like to learn?");
  6536.  
  6537.                                                     dialog.Option("SwirlingStorm~[Lv.15].~(" + WindwalkerSkills(client, 12890) + ")", 30);
  6538.                                                     dialog.Option("ShadowofChaser~[Lv.15].~(" + WindwalkerSkills(client, 13090) + ")", 31);
  6539.                                                     dialog.Option("TripleBlasts~[Lv.40].~(" + WindwalkerSkills(client, 12850) + ")", 32);
  6540.                                                     dialog.Option("Thundercloud~[Lv.70]~[" + WindwalkerSkills(client, 12840) + "]", 33);
  6541.                                                     dialog.Option("Thunderbolt~[Lv.100]~[" + WindwalkerSkills(client, 12970) + "]", 34);
  6542.                                                     dialog.Option("I~want~to~learn~other~skills.", 2);
  6543.                                                     dialog.Option("I`ll~talk~to~you~later.", 255);
  6544.                                                     dialog.Send();
  6545.                                                     break;
  6546.                                                 }
  6547.                                             case 30:
  6548.                                             case 31:
  6549.                                             case 32:
  6550.                                             case 33:
  6551.                                             case 34:
  6552.                                                 {
  6553.                                                     ushort spellid = 12800;
  6554.                                                     switch (npcRequest.OptionID)
  6555.                                                     {
  6556.                                                         case 30: { spellid += 90; break; }
  6557.                                                         case 31: { spellid += 290; break; }
  6558.                                                         case 32: { spellid += 50; break; }
  6559.                                                         case 33: { spellid += 40; break; }
  6560.                                                         case 34: { spellid += 170; break; }
  6561.                                                     }
  6562.                                                     if (WindwalkerSkills(client, spellid) == "Learned")
  6563.                                                     {
  6564.                                                         dialog.Text("FellowBrother has already acquired this skill. Go practice and feel its power.");
  6565.  
  6566.                                                         dialog.Option("Okay.", 2);
  6567.                                                         dialog.Send();
  6568.                                                         break;
  6569.                                                     }
  6570.                                                     else if (WindwalkerSkills(client, spellid) == "Available")
  6571.                                                     {
  6572.                                                         client.AddSpell(LearnableSpell(spellid));
  6573.                                                     }
  6574.                                                     else
  6575.                                                     {
  6576.                                                         dialog.Text("The study of [" + SpellTable.GetSpell(spellid, 0).Name + "] requires FellowBrother to reach a certain level. FellowBrother, you can find me when you reach the required Level.");
  6577.  
  6578.                                                         dialog.Option("I`ll~see~you!", 2);
  6579.                                                         dialog.Send();
  6580.                                                     }
  6581.                                                     break;
  6582.                                                 }
  6583.                                         }
  6584.                                         break;
  6585.                                     }
  6586.                                 #endregion
  6587. بعدين ان بى سى ريبورن واسكند
  6588. هنبدله بى ده
  6589. #region RebirthMaster
  6590.                     case 59558:
  6591.                         {
  6592.                             dialog.Avatar(67);
  6593.                             switch (npcRequest.OptionID)
  6594.                             {
  6595.                                 case 0:
  6596.                                     {
  6597.  
  6598.                                         dialog.Text("I devote all my life to the research of eternity. And finally I Know the secret of");
  6599.                                         dialog.Text(" rebirth! Well, anything I can help you with?");
  6600.                                         dialog.Option("1st Rebirth.", 1);
  6601.                                         dialog.Option("2nd Rebirth.", 2);
  6602.                                         dialog.Option("Reincarnation.", 3);
  6603.                                         dialog.Option("Reallot my Attribute Points.", 4);
  6604.                                         dialog.Option("Just Passing By.", 255);
  6605.                                         dialog.Send();
  6606.                                         break;
  6607.                                     }
  6608.                                 case 175:
  6609.                                     {
  6610.                                         dialog.Text("It`s a magic stone which is required for the 1st rebirth. There`re 2 ways you can get it: a) Buy it from the Shopping Mall,");
  6611.                                         dialog.Text("~b) Collect 7 Normal gems and a bottle of Clean Water, swap them for a Celestial Stone from Celestine (Twin City 365,92).");
  6612.                                         dialog.Text("~Tips: You can dig for gems in Mine Caves in main cities. As to the Clean Water, you try your luck on the Water Devil in the Adventure Islands.");
  6613.  
  6614.                                         dialog.Option("I~see.", 255);
  6615.                                         dialog.Send();
  6616.                                         break;
  6617.                                     }
  6618.                                 case 176:
  6619.                                     {
  6620.                                         dialog.Text("After the rebirth, you`ll receive some extra attribute points and start from Level 15. Every time you level up, you`ll gain some attribute points, which you can allot to different attributes at your will.");
  6621.  
  6622.                                         dialog.Option("Back.", 1);
  6623.                                         dialog.Option("I~see.", 255);
  6624.                                         dialog.Send();
  6625.                                         break;
  6626.                                     }
  6627.                                 case 177:
  6628.                                     {
  6629.                                         dialog.Text("Some of the skills you`ve leant are completely forgotten after the rebirth, while the others are forgotten for the moment.");
  6630.                                         dialog.Text("~They can have an epiphany. The epiphany makes the skill leap, after it reaches to half of the former level before rebirth.");
  6631.  
  6632.                                         dialog.Option("Back.", 1);
  6633.                                         dialog.Option("I~see.", 255);
  6634.                                         dialog.Send();
  6635.                                         break;
  6636.                                     }
  6637.                                 case 190:
  6638.                                     {
  6639.                                         dialog.Text("It`s a magic stone which is required for the 1st rebirth. There`re 2 ways you can get it: a) Buy it from the Shopping Mall,");
  6640.                                         dialog.Text("~b) Collect 7 Normal gems and a bottle of Clean Water, swap them for a Celestial Stone from Celestine (Twin City 365,92).");
  6641.                                         dialog.Text("~Tips: You can dig for gems in Mine Caves in main cities. As to the Clean Water, you try your luck on the Water Devil in the Adventure Islands.");
  6642.  
  6643.                                         dialog.Option("I~see.", 255);
  6644.                                         dialog.Send();
  6645.                                         break;
  6646.                                     }
  6647.                                 case 1:
  6648.                                     {
  6649.                                         if (client.Entity.Reborn == 0)
  6650.                                         {
  6651.                                             if (client.Entity.Level >= 120 || client.Entity.Class > 100 && client.Entity.Level >= 110)
  6652.                                             {
  6653.                                                 if (client.Entity.Class % 10 == 5)
  6654.                                                 {
  6655.                                                     if (client.Inventory.Contains(721259, 1))
  6656.                                                     {
  6657.                                                         dialog.Text("If you want to get reborn, you should reach at least Level 120 (Level 110 if you`re a Water Taoist), and be promoted to the highest job title.");
  6658.                                                         dialog.Text("~Besides, you should give me a Celestial Stone. After rebirth, you`ll be able to freely allot your attribute points and learn more powerful skills.");
  6659.  
  6660.                                                         dialog.Option("Celestial~Stone?", 175);
  6661.                                                         dialog.Option("Allot~attribute~points?", 176);
  6662.                                                         dialog.Option("Powerful~skills?", 177);
  6663.                                                         dialog.Option("I~would~like~to~be~reborn.", 12);
  6664.                                                         dialog.Option("Let~me~think~it~over.", 255);
  6665.                                                         dialog.Send();
  6666.                                                     }
  6667.                                                     else
  6668.                                                     {
  6669.                                                         dialog.Text("I`m really sorry, but I can`t do anything without the Celestial Stone.");
  6670.  
  6671.                                                         dialog.Option("Celestial~Stone?", 190);
  6672.                                                         dialog.Send();
  6673.                                                     }
  6674.                                                 }
  6675.                                                 else
  6676.                                                 {
  6677.  
  6678.                                                     dialog.Text("You need to master your class. First!.");
  6679.  
  6680.                                                     dialog.Option("I~see.", 255);
  6681.                                                     dialog.Send();
  6682.  
  6683.                                                 }
  6684.                                             }
  6685.                                             else
  6686.                                             {
  6687.                                                 dialog.Text("Your~Level~is~lower~than~the~required.~Please~train~harder.");
  6688.  
  6689.                                                 dialog.Option("I~see.", 255);
  6690.                                                 dialog.Send();
  6691.                                             }
  6692.                                         }
  6693.                                         else
  6694.                                         {
  6695.                                             dialog.Text("You~have~been~reborn.~Please~work~harder.");
  6696.  
  6697.                                             dialog.Option("Oh,~I~see.", 255);
  6698.                                             dialog.Send();
  6699.                                         }
  6700.                                         break;
  6701.                                     }
  6702.                                 case 12:
  6703.                                     {
  6704.                                         if (client.Entity.Reborn == 0)
  6705.                                         {
  6706.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  6707.                                             {
  6708.                                                 dialog.Text("There`re 2 ways to get reborn. Attention: Only the items you equipped will be degraded during the rebirth.");
  6709.  
  6710.                                                 dialog.Option("Blessed~rebirth.", 181);
  6711.                                                 dialog.Option("Normal~rebirth.", 180);
  6712.                                                 dialog.Send();
  6713.                                             }
  6714.                                             else
  6715.                                             {
  6716.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  6717.                                                 dialog.Option("Ahh.", 255);
  6718.                                                 dialog.Send();
  6719.                                             }
  6720.                                         }
  6721.                                         else
  6722.                                         {
  6723.                                             dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  6724.                                             dialog.Option("Thank you.", 255);
  6725.                                             dialog.Send();
  6726.                                         }
  6727.                                         break;
  6728.                                     }
  6729.                                 case 181:
  6730.                                     {
  6731.                                         dialog.Text("I dedicate myself to studying the blessed force of eternity, which absorbs the essences of the universe.");
  6732.                                         dialog.Text("~During the rebirth, a random piece of your equipment will be added with blessed attribute.");
  6733.                                         dialog.Text("But please be noted that epic weapons can only be blessed when you get reborn into the same class (for instance: Trojan-Trojan, Ninja-Ninja).");
  6734.  
  6735.                                         dialog.Option("I~agree.", 13);
  6736.                                         dialog.Option("Back.", 12);
  6737.                                         dialog.Option("Let~me~think~it~over.", 255);
  6738.                                         dialog.Send();
  6739.                                         break;
  6740.                                     }
  6741.                                 case 180:
  6742.                                     {
  6743.                                         dialog.Text("Unlike blessed rebirth, you won`t get blessed attribute added to your equipment.");
  6744.                                         dialog.Text("~However, you will receive a Super gem, instead. So, select a class for your new life, first!");
  6745.  
  6746.                                         dialog.Option("Okay.", 15);
  6747.                                         dialog.Option("Back.", 12);
  6748.                                         dialog.Option("Let~me~think~it~over.", 255);
  6749.                                         dialog.Send();
  6750.                                         break;
  6751.                                     }
  6752.                                 case 15:
  6753.                                     {
  6754.                                         if (client.Entity.Reborn == 0)
  6755.                                         {
  6756.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  6757.                                             {
  6758.                                                 dialog.Text("Select the super gem you desire.");
  6759.                                                 dialog.Option("SuperPhoenixGem.", 203);
  6760.                                                 dialog.Option("SuperDragonGem.", 213);
  6761.                                                 dialog.Option("SuperFuryGem.", 223);
  6762.                                                 dialog.Option("SuperRainbowGem.", 233);
  6763.                                                 dialog.Option("SuperVioletGem.", 253);
  6764.                                                 dialog.Option("SuperMoonGem.", 254);
  6765.                                                 dialog.Option("SuperKylinGem.", 243);
  6766.                                                 dialog.Option("Nothing thank you.", 255);
  6767.                                                 dialog.Send();
  6768.                                             }
  6769.                                             else
  6770.                                             {
  6771.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  6772.                                                 dialog.Option("Ahh.", 255);
  6773.                                                 dialog.Send();
  6774.                                             }
  6775.                                             break;
  6776.                                         }
  6777.                                         else
  6778.                                         {
  6779.                                             dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  6780.                                             dialog.Option("Thank you.", 255);
  6781.                                             dialog.Send();
  6782.                                         }
  6783.                                         break;
  6784.                                     }
  6785.                                 case 185:
  6786.                                     {
  6787.                                         dialog.Text("You`ve reached the highest of the class. Now, you can select one of the followings as your new class:");
  6788.  
  6789.                                         dialog.Option("Pirate.", (byte)(70 + 13));
  6790.                                         dialog.Option("Wind.Guard.", (byte)(161 + npcRequest.OptionID));
  6791.                                         dialog.Option("Dragon-Warror.", (byte)(80 + 13));
  6792.                                         dialog.Option("Previous~page.", 13);
  6793.                                         dialog.Option("I`ll~think~about~it.", 255);
  6794.                                         dialog.Send();
  6795.                                         break;
  6796.                                     }
  6797.                                 case 13:
  6798.                                     {
  6799.                                         if (client.Entity.Reborn == 0)
  6800.                                         {
  6801.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  6802.                                             {
  6803.                                                 dialog.Text("You`ve reached the highest of the class. Now, you can select one of the followings as your new class:");
  6804.  
  6805.                                                 dialog.Option("Trojan.", (byte)(10 + npcRequest.OptionID));
  6806.                                                 dialog.Option("Warrior.", (byte)(20 + npcRequest.OptionID));
  6807.                                                 dialog.Option("Archer.", (byte)(40 + npcRequest.OptionID));
  6808.                                                 dialog.Option("WaterTaoist.", (byte)(132 + npcRequest.OptionID));
  6809.                                                 dialog.Option("FireTaoist.", (byte)(142 + npcRequest.OptionID));
  6810.                                                 dialog.Option("Ninja.", (byte)(50 + npcRequest.OptionID));
  6811.                                                 dialog.Option("Monk.", (byte)(60 + npcRequest.OptionID));
  6812.                                                 dialog.Option("More~choices.", 185);
  6813.                                                 dialog.Send();
  6814.                                             }
  6815.                                             else
  6816.                                             {
  6817.                                                 dialog.Text("You cannot reborn if your level is not 110+ for water saints and 120+ for other masters.");
  6818.                                                 dialog.Option("Ahh.", 255);
  6819.                                                 dialog.Send();
  6820.                                             }
  6821.                                             break;
  6822.                                         }
  6823.                                         else
  6824.                                         {
  6825.                                             dialog.Text("You have been reborn. Please work harder.");
  6826.                                             dialog.Option("Thank you.", 255);
  6827.                                             dialog.Send();
  6828.                                         }
  6829.                                         break;
  6830.                                     }
  6831.                                 #region Reincarnation
  6832.                                 case 3:
  6833.                                     {
  6834.                                         dialog.Text("From now on, have total control of your life! If you've been Reborn twice and are at least Level 110, just bring me some Oblivion Dew and I'll help you become Reincarnated! After the Reincarnation, your class skills will revert to level 0,");
  6835.                                         dialog.Text("~but they`ll return to their previous levels when you reach Level 110, again. If your classes have been the same for all three lives, including your current one, you can learn the Pure Skills from your class trainer,");
  6836.                                         dialog.Text("~in the job center.");
  6837.  
  6838.                                         dialog.Option("I~want~to~get~Reincarnated.", 5);
  6839.                                         dialog.Option("Where~can~I~get~the~Dew?", 6);
  6840.                                         dialog.Send();
  6841.                                         break;
  6842.                                     }
  6843.                                 case 5:
  6844.                                     {
  6845.                                         if (client.Entity.Reborn == 2 && client.Entity.Level >= 120)
  6846.                                         {
  6847.                                             client.Send(new Data(true)
  6848.                                             {
  6849.                                                 UID = client.Entity.UID,
  6850.                                                 ID = Data.OpenWindow,
  6851.                                                 dwParam = Data.WindowCommands.Reincarnation,
  6852.                                                 wParam1 = client.Entity.X,
  6853.                                                 wParam2 = client.Entity.Y
  6854.                                             });
  6855.                                         }
  6856.                                         else
  6857.                                         {
  6858.                                             dialog.Text("You have not been Reborn twice. I`m afraid you will not withstand the power of the Oblivion Dew. Come to me when you get stronger.");
  6859.  
  6860.                                             dialog.Option("Got~it!~Thanks!", 255);
  6861.                                             dialog.Send();
  6862.                                         }
  6863.                                         break;
  6864.                                     }
  6865.                                 case 6:
  6866.                                     {
  6867.                                         dialog.Text("Oblivion Dew is available in the Honor Store and the Horse Race Store. You can use your Honor Points or Horse Race Points to purchase one.");
  6868.  
  6869.                                         dialog.Option("Got~it!~Thanks!", 255);
  6870.                                         dialog.Send();
  6871.                                         break;
  6872.                                     }
  6873.                                 #endregion
  6874.                                 #region Reallot Attributes
  6875.                                 case 4:
  6876.                                     {
  6877.                                         dialog.Text("Reborn~level~70+~players~can~redistribute~their~attribute~points~at~the~cost~of~a~dragonball.");
  6878.  
  6879.                                         dialog.Option("I~will~reallot~my~points.", 8);
  6880.                                         dialog.Option("Let~me~think~it~over.", 255);
  6881.                                         dialog.Send();
  6882.                                         break;
  6883.                                     }
  6884.                                 case 8:
  6885.                                     {
  6886.                                         if (client.Entity.Reborn > 0)
  6887.                                         {
  6888.                                             if (client.Entity.Level >= 70)
  6889.                                             {
  6890.                                                 if (client.Inventory.Contains(1088000, 1))
  6891.                                                 {
  6892.                                                     client.Inventory.Remove(1088000, 1);
  6893.                                                     if (client.Entity.Reborn != 0)
  6894.                                                     {
  6895.                                                         client.Entity.Agility = 0;
  6896.                                                         client.Entity.Strength = 0;
  6897.                                                         client.Entity.Vitality = 1;
  6898.                                                         client.Entity.Spirit = 0;
  6899.                                                         if (client.Entity.Reborn == 1)
  6900.                                                         {
  6901.                                                             client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
  6902.                                                                 + 52 + 3 * (client.Entity.Level - 15));
  6903.                                                         }
  6904.                                                         else
  6905.                                                         {
  6906.                                                             client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
  6907.                                                                 client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
  6908.                                                         }
  6909.                                                     }
  6910.                                                 }
  6911.                                                 else
  6912.                                                 {
  6913.                                                     dialog.Text("Although~you~are~reborn,~you~have~not~reached~level~70.~Please~put~in~more~efforts.");
  6914.  
  6915.                                                     dialog.Option("I~see.", 255);
  6916.                                                     dialog.Send();
  6917.                                                 }
  6918.                                             }
  6919.                                             else
  6920.                                             {
  6921.                                                 dialog.Text("Sorry,~you~do~not~have~a~dragonball.");
  6922.  
  6923.                                                 dialog.Option("I~see.", 255);
  6924.                                                 dialog.Send();
  6925.                                             }
  6926.                                         }
  6927.                                         else
  6928.                                         {
  6929.                                             dialog.Text("You~cannot~reallot~your~ability~points~unless~you~are~reborn~and~above~level~70.");
  6930.  
  6931.                                             dialog.Option("I~see.", 255);
  6932.                                             dialog.Send();
  6933.                                         }
  6934.                                         break;
  6935.                                     }
  6936.                                 #endregion
  6937.                                 #region 2nd reborn
  6938.                                 case 2:
  6939.                                     {
  6940.                                         if (client.Entity.Reborn == 1)
  6941.                                         {
  6942.                                             dialog.Text("Good. You`ve met the requirements for the second rebirth. You`ll face ElmistRo challenges till you complete the big quest.");
  6943.                                             dialog.Text("~Once you manage to get reborn, you will receive unique aura, be able to learn Bless, and enjoy many benefits.");
  6944.                                             dialog.Text("~If you don`t want to bother with the quest, just go buy an Exemption Token!");
  6945.                                             dialog.Option("Exemption~Token?", 9);
  6946.                                             dialog.Option("Hear~about~the~quest.", 254);
  6947.                                             dialog.Option("Back.", 255);
  6948.                                             dialog.Option("Never~mind.~I~quit.", 255);
  6949.                                             dialog.Send();
  6950.                                         }
  6951.                                         else if (client.Entity.Reborn == 2)
  6952.                                         {
  6953.                                             dialog.Text("Impressive! You are already reborn twice!");
  6954.                                             dialog.Option("Take me to the Evil Abyss.", 254);
  6955.                                             dialog.Option("Yup!", 255);
  6956.                                             dialog.Send();
  6957.                                         }
  6958.                                         break;
  6959.                                     }
  6960.                                 case 9:
  6961.                                     {
  6962.                                         if (client.Entity.Reborn == 1)
  6963.                                         {
  6964.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  6965.                                             {
  6966.                                                 dialog.Text("Select the class you want to reborn in.");
  6967.                                                 dialog.Option("Trojan.", 11);
  6968.                                                 dialog.Option("Warrior.", 21);
  6969.                                                 dialog.Option("Archer.", 41);
  6970.                                                 dialog.Option("WaterTaoist.", 132);
  6971.                                                 dialog.Option("FireTaoist.", 142);
  6972.                                                 dialog.Option("Ninja.", 51);
  6973.                                                 dialog.Option("Monk.", 61);
  6974.                                                 dialog.Option("Pirate.", 71);
  6975.                                                 dialog.Option("Wind.Guard.", 161);
  6976.                                                 dialog.Option("Dragon-Warror", 81);
  6977.                                                 dialog.Send();
  6978.                                             }
  6979.                                             else
  6980.                                             {
  6981.                                                 dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
  6982.                                                 dialog.Option("I'll just leave", 255);
  6983.                                                 dialog.Send();
  6984.                                                 break;
  6985.                                             }
  6986.                                         }
  6987.                                         else
  6988.                                         {
  6989.                                             dialog.Text("Impressive! You are already reborn twice!");
  6990.                                             dialog.Option("Take me to the Evil Abyss.", 254);
  6991.                                             dialog.Option("Yup!", 255);
  6992.                                             dialog.Send();
  6993.                                             break;
  6994.                                         }
  6995.                                         break;
  6996.                                     }
  6997.                                 case 11:
  6998.                                 case 21:
  6999.                                 case 41:
  7000.                                 case 51:
  7001.                                 case 61:
  7002.                                 case 71:
  7003.                                 case 81:
  7004.                                 case 132:
  7005.                                 case 142:
  7006.                                 case 161:
  7007.                                     {
  7008.                                         if (npcRequest.OptionID == 255) return;
  7009.                                         if (client.Entity.Reborn == 1)
  7010.                                         {
  7011.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  7012.                                             {
  7013.                                                 if (client.Inventory.Contains(723701, 1) || client.Quests.GetQuest(QuestID.SecondQuestStageFour) != null && client.Quests.CheckQuest(QuestID.SecondQuestStageFour) == QuestPacket.QuestData.QuestStatus.Finished)
  7014.                                                 {
  7015.                                                     if (client.Reborn(npcRequest.OptionID))
  7016.                                                     {
  7017.                                                         client.Inventory.Remove(723701, 1);
  7018.                                                     }
  7019.                                                     else
  7020.                                                     {
  7021.                                                         dialog.Text("You need two free slots in your inventory.");
  7022.                                                         dialog.Option("I'll just leave", 255);
  7023.                                                         dialog.Send();
  7024.                                                         break;
  7025.                                                     }
  7026.                                                 }
  7027.                                             }
  7028.                                             else
  7029.                                             {
  7030.                                                 dialog.Text("If you are a water saint you need level 110+, else you need 120+.");
  7031.                                                 dialog.Option("I'll just leave", 255);
  7032.                                                 dialog.Send();
  7033.                                                 break;
  7034.                                             }
  7035.                                         }
  7036.                                         else
  7037.                                         {
  7038.                                             dialog.Text("You need to be in the second life to be able to get the third life.");
  7039.                                             dialog.Option("I'll just leave", 255);
  7040.                                             dialog.Send();
  7041.                                             break;
  7042.                                         }
  7043.                                         break;
  7044.                                     }
  7045.                                 case 254:
  7046.                                     {
  7047.                                         if (client.Entity.Reborn == 1 && client.Quests.GetQuest(QuestID.SecondQuestStageFour) != null && client.Quests.CheckQuest(QuestID.SecondQuestStageFour) == QuestPacket.QuestData.QuestStatus.Finished)
  7048.                                         {
  7049.                                             dialog.Text("You have completed your quests with protect performance. you can take your");
  7050.                                             dialog.Text(" Second Rebirth now.");
  7051.                                             dialog.Option("I want second rebirth.", 9);
  7052.                                             dialog.Option("I don't want second rebirth.", 255);
  7053.                                             dialog.Send();
  7054.                                         }
  7055.                                         else
  7056.                                         {
  7057.                                             dialog.Text("It`s a really ElmistRo way to go... You`re going to meet many trials in the Evil Abyss. What`s more, after you get reborn,"); dialog.Text("~you will need to start over again and make triple efforts to level-up. You`d better think it over before making such a vital decision."); dialog.Text("~If you`ve made up your mind to accept this quest, I`ll send you to the Evil Abyss.");
  7058.                                             dialog.Option("Yes,~please!", 253);
  7059.                                             dialog.Option("I~don`t~want~to~risk~my~life.", 255);
  7060.                                             dialog.Send();
  7061.                                         }
  7062.                                         break;
  7063.                                     }
  7064.                                 case 253:
  7065.                                     {
  7066.                                         var coords = Kernel.Maps[1700].RandomCoordinates(692, 709, 40);
  7067.                                         client.Entity.TeleportTeam(1700, coords.Item1, coords.Item2);
  7068.                                         break;
  7069.                                     }
  7070.                                 #endregion
  7071.                                 default:
  7072.                                     {
  7073.                                         if (client.Entity.Reborn == 0)
  7074.                                         {
  7075.                                             if (client.Entity.Class % 10 == 5 && client.Entity.Level >= (client.Entity.Class == 135 ? 110 : 120))
  7076.                                             {
  7077.                                                 if (npcRequest.OptionID == 255)
  7078.                                                     return;
  7079.                                                 if (npcRequest.OptionID >= 200 && npcRequest.OptionID <= 254)
  7080.                                                 {
  7081.                                                     client.SelectedGem = (byte)(npcRequest.OptionID % 100);
  7082.                                                     if (client.SelectedGem == 54)
  7083.                                                         client.SelectedGem = 63;
  7084.                                                     if (client.Entity.Reborn == 0)
  7085.                                                     {
  7086.                                                         byte id = 4;
  7087.                                                         dialog.Text("Select the class you want to reborn in.");
  7088.                                                         dialog.Option("Trojan.", (byte)(10 + id));
  7089.                                                         dialog.Option("Warrior.", (byte)(20 + id));
  7090.                                                         dialog.Option("Archer.", (byte)(40 + id));
  7091.                                                         dialog.Option("WaterTaoist.", (byte)(132 + id));
  7092.                                                         dialog.Option("FireTaoist.", (byte)(142 + id));
  7093.                                                         dialog.Option("Ninja.", (byte)(50 + id));
  7094.                                                         dialog.Option("Monk.", (byte)(60 + id));
  7095.                                                         dialog.Option("Pirate.", (byte)(70 + id));
  7096.                                                         dialog.Option("Wind.Guard.", (byte)(161 + id));
  7097.                                                         dialog.Option("Dragon-Warror.", (byte)(80 + id));
  7098.                                                         dialog.Send();
  7099.                                                         break;
  7100.                                                     }
  7101.                                                     else
  7102.                                                     {
  7103.                                                         dialog.Text("You cannot reborn again here. Alex, an elder who lives in Ape Canyon, will tell you about the third life.");
  7104.                                                         dialog.Option("Thank you.", 255);
  7105.                                                         dialog.Send();
  7106.                                                     }
  7107.                                                 }
  7108.                                                 else
  7109.                                                 {
  7110.                                                     if (client.Inventory.Contains(721259, 1))
  7111.                                                     {
  7112.                                                         byte _class = (byte)(npcRequest.OptionID - npcRequest.OptionID % 10);
  7113.                                                         if (_class > 100)
  7114.                                                             _class += 2;
  7115.                                                         byte type = (byte)(npcRequest.OptionID - _class);
  7116.                                                         if (_class < 100)
  7117.                                                             _class++;
  7118.                                                         if (type != 4)
  7119.                                                         {
  7120.                                                             _class -= 10;
  7121.                                                         }
  7122.                                                         if (client.Reborn(_class))
  7123.                                                         {
  7124.                                                             client.Inventory.Remove(721259, 1);
  7125.                                                             if (type == 4)
  7126.                                                             {
  7127.                                                                 if (client.SelectedGem != 0)
  7128.                                                                 {
  7129.                                                                     uint gemid = (uint)(client.SelectedGem + 700000);
  7130.                                                                     client.Inventory.Add(gemid, 0, 1);
  7131.                                                                 }
  7132.                                                             }
  7133.                                                             else
  7134.                                                             {
  7135.                                                                 int availableshots = 0;
  7136.                                                                 for (byte count = 0; count < 19; count++)
  7137.                                                                 {
  7138.                                                                     if (!client.Equipment.Free(count))
  7139.                                                                     {
  7140.                                                                         if (client.Equipment.TryGetItem(count).Bless == 0)
  7141.                                                                         {
  7142.                                                                             availableshots++;
  7143.                                                                         }
  7144.                                                                     }
  7145.                                                                 }
  7146.                                                                 if (availableshots != 0)
  7147.                                                                 {
  7148.                                                                     byte ex = (byte)Kernel.Random.Next(20);
  7149.                                                                     if (!client.Equipment.Free(ex) && client.Equipment.Objects[ex - 1].Position != (byte)PacketHandler.Positions.Steed)
  7150.                                                                     {
  7151.                                                                         if (client.Equipment.TryGetItem(ex).Bless == 0)
  7152.                                                                         {
  7153.                                                                             var item = client.Equipment.TryGetItem(ex);
  7154.                                                                             item.Bless = 1;
  7155.                                                                             item.Mode = ElmistRo.Game.Enums.ItemMode.Update;
  7156.                                                                             item.Send(client);
  7157.                                                                             ElmistRo.Database.ConquerItemTable.UpdateBless(item);
  7158.                                                                         }
  7159.                                                                     }
  7160.                                                                 }
  7161.                                                             }
  7162.                                                         }
  7163.                                                         else
  7164.                                                         {
  7165.                                                             dialog.Text("Sorry, but you need atleast 2 free spaces in your inventory.");
  7166.                                                             dialog.Option("Ohh.", 255);
  7167.                                                             dialog.Send();
  7168.                                                         }
  7169.                                                     }
  7170.                                                 }
  7171.                                             }
  7172.                                             else
  7173.                                             {
  7174.                                                 dialog.Text("You have been reborn. Please work harder.");
  7175.                                                 dialog.Option("Thank you.", 255);
  7176.                                                 dialog.Send();
  7177.                                             }
  7178.                                         }
  7179.                                         break;
  7180.                                     }
  7181.                             }
  7182.                             break;
  7183.                         }
  7184.                     #endregion
  7185. هتفتح فولدر
  7186. Game\Features\Reincarnation
  7187. وهنفتح ملف هاندل هنلاقيه جوه فولدر وهنبحث عن كود ده
  7188.  #region Remove Extra Skill
  7189. هنضيف فيه كود ده
  7190. if (client.Entity.FirstRebornClass == 165 && client.Entity.SecondRebornClass == 165 && client.Entity.Class == 165)
  7191.             {
  7192.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeI);
  7193.                
  7194.             }
  7195. وبعدين نفس ملف هنبحث عن كود ده
  7196. switch (client.Entity.FirstRebornClass)
  7197. هنضيف ده فيه تحتيه
  7198.  case 165:
  7199.                     {
  7200.                         Add(Game.Enums.SkillIDs.FrostGazeI);
  7201.                         Add(Game.Enums.SkillIDs.Thundercloud);
  7202.                         Add(Game.Enums.SkillIDs.TripleBlasts);
  7203.                         Add(Game.Enums.SkillIDs.Omnipotence);
  7204.                         Add(Game.Enums.SkillIDs.JusticeChant);
  7205.                         Add(Game.Enums.SkillIDs.BurntFrost);
  7206.                         Add(Game.Enums.SkillIDs.HealingSnow);
  7207.                         Add(Game.Enums.SkillIDs.ChillingSnow);
  7208.                         Add(Game.Enums.SkillIDs.Thunderbolt);
  7209.                         Add(Game.Enums.SkillIDs.AngerofStomper);
  7210.                         Add(Game.Enums.SkillIDs.HorrorofStomper);
  7211.                         Add(Game.Enums.SkillIDs.RageofWar);
  7212.                         Add(Game.Enums.SkillIDs.PeaceofStomper);
  7213.                         Add(Game.Enums.SkillIDs.FreezingPelter);
  7214.                         Add(Game.Enums.SkillIDs.RevengeTail);
  7215.                         Add(Game.Enums.SkillIDs.Circle);
  7216.                         Add(Game.Enums.SkillIDs.Rectangle);
  7217.                         Add(Game.Enums.SkillIDs.FrostGazeII);
  7218.                         Add(Game.Enums.SkillIDs.FrostGazeIII);
  7219.                         Add(Game.Enums.SkillIDs.ShadowofChaser);
  7220.                         Add(Game.Enums.SkillIDs.ThundercloudAttack);
  7221.                         Add(Game.Enums.SkillIDs.DestinyFire);
  7222.                         Add(Game.Enums.SkillIDs.FireShower);
  7223.                         Add(Game.Enums.SkillIDs.WheelOfDevastation);
  7224.                         break;
  7225.                     }
  7226.             }
  7227.  
  7228. طبعا هتقولى ايه ده ياعم ايه كمية الايرورات ديه تعالى نحلها مع بعض
  7229. شايفين كلمة SkillIDs هتدوسو عليها اف 12 وهتعملو ده
  7230. هضيفه تحت اى كود اسكل الاسكلات ديه
  7231.  FrostGazeI = 12830,
  7232.             Thundercloud = 12840,
  7233.             TripleBlasts = 12850,
  7234.             Omnipotence = 12860,
  7235.             JusticeChant = 12870,
  7236.             SwirlingStorm = 12890,
  7237.             RageofWar = 12930,
  7238.             BurntFrost = 12940,
  7239.             HealingSnow = 12950,
  7240.             ChillingSnow = 12960,
  7241.             Thunderbolt = 12970,
  7242.             AngerofStomper = 12980,
  7243.             HorrorofStomper = 12990,
  7244.             PeaceofStomper = 13000,
  7245.             FreezingPelter = 13020,
  7246.             RevengeTail = 13030,
  7247.             Circle = 13050,
  7248.             Rectangle = 13060,
  7249.             FrostGazeII = 13070,
  7250.             FrostGazeIII = 13080,
  7251.             ShadowofChaser = 13090,
  7252.             ThundercloudAttack = 13190,
  7253.             DestinyFire = 13362,
  7254.             FireShower = 13363,
  7255.             WheelOfDevastation = 13364,
  7256. بس كده الايرور اتحل بكده عملنا الفريست ريبورن تعالو نعمل السكند ريبورن
  7257. فى ملف الهاندل هنبحث عن كود ده
  7258.  switch (client.Entity.SecondRebornClass)
  7259. هنضيف ده تحتيه
  7260. case 165:
  7261.                     {
  7262.                         Add(Game.Enums.SkillIDs.FrostGazeI);
  7263.                         Add(Game.Enums.SkillIDs.Thundercloud);
  7264.                         Add(Game.Enums.SkillIDs.TripleBlasts);
  7265.                         Add(Game.Enums.SkillIDs.Omnipotence);
  7266.                         Add(Game.Enums.SkillIDs.JusticeChant);
  7267.                         Add(Game.Enums.SkillIDs.BurntFrost);
  7268.                         Add(Game.Enums.SkillIDs.HealingSnow);
  7269.                         Add(Game.Enums.SkillIDs.ChillingSnow);
  7270.                         Add(Game.Enums.SkillIDs.Thunderbolt);
  7271.                         Add(Game.Enums.SkillIDs.AngerofStomper);
  7272.                         Add(Game.Enums.SkillIDs.HorrorofStomper);
  7273.                         Add(Game.Enums.SkillIDs.RageofWar);
  7274.                         Add(Game.Enums.SkillIDs.PeaceofStomper);
  7275.                         Add(Game.Enums.SkillIDs.FreezingPelter);
  7276.                         Add(Game.Enums.SkillIDs.RevengeTail);
  7277.                         Add(Game.Enums.SkillIDs.Circle);
  7278.                         Add(Game.Enums.SkillIDs.Rectangle);
  7279.                         Add(Game.Enums.SkillIDs.FrostGazeII);
  7280.                         Add(Game.Enums.SkillIDs.FrostGazeIII);
  7281.                         Add(Game.Enums.SkillIDs.ShadowofChaser);
  7282.                         Add(Game.Enums.SkillIDs.ThundercloudAttack);
  7283.                         Add(Game.Enums.SkillIDs.DestinyFire);
  7284.                         Add(Game.Enums.SkillIDs.FireShower);
  7285.                         Add(Game.Enums.SkillIDs.WheelOfDevastation);
  7286.                         break;
  7287.                     }
  7288. وبعدين نبحث عن كود ده
  7289. #region Low level items
  7290. هنزل تحت لغايت ما نلاقى اسامى الشخصيات
  7291. هنضيف الشخصية الجديدة تحت اى شخصية
  7292. #region Windwalker
  7293.                 case 165:
  7294.                     {
  7295.                         switch (Second)
  7296.                         {
  7297.                             case 61: break;
  7298.                             default:
  7299.                                 WontAdd(Enums.SkillIDs.FrostGazeI);
  7300.                                 WontAdd(Enums.SkillIDs.Thundercloud);
  7301.                                 WontAdd(Enums.SkillIDs.TripleBlasts);
  7302.                                 WontAdd(Enums.SkillIDs.Omnipotence);
  7303.                                 WontAdd(Enums.SkillIDs.JusticeChant);
  7304.                                 WontAdd(Enums.SkillIDs.SwirlingStorm);
  7305.                                 WontAdd(Enums.SkillIDs.RageofWar);
  7306.                                 WontAdd(Enums.SkillIDs.BurntFrost);
  7307.                                 WontAdd(Enums.SkillIDs.HealingSnow);
  7308.                                 WontAdd(Enums.SkillIDs.ChillingSnow);
  7309.                                 WontAdd(Enums.SkillIDs.Thunderbolt);
  7310.                                 WontAdd(Enums.SkillIDs.AngerofStomper);
  7311.                                 WontAdd(Enums.SkillIDs.HorrorofStomper);
  7312.                                 WontAdd(Enums.SkillIDs.PeaceofStomper);
  7313.                                 WontAdd(Enums.SkillIDs.FreezingPelter);
  7314.                                 WontAdd(Enums.SkillIDs.RevengeTail);
  7315.                                 WontAdd(Enums.SkillIDs.Circle);
  7316.                                 WontAdd(Enums.SkillIDs.Rectangle);
  7317.                                 WontAdd(Enums.SkillIDs.FrostGazeII);
  7318.                                 WontAdd(Enums.SkillIDs.FrostGazeIII);
  7319.                                 WontAdd(Enums.SkillIDs.ShadowofChaser);
  7320.                                 WontAdd(Enums.SkillIDs.ThundercloudAttack);
  7321.                                 WontAdd(Enums.SkillIDs.DestinyFire);
  7322.                                 WontAdd(Enums.SkillIDs.FireShower);
  7323.                                 WontAdd(Enums.SkillIDs.WheelOfDevastation);
  7324.                                 break;
  7325.                         }
  7326.                         break;
  7327.                     }
  7328.                 #endregion
  7329. وبعدين فى نفس ملف هنبحث عن كود ده
  7330. #region Spells
  7331. تحتيه هنضيف شخصية الجديدة
  7332. #region Windwalker
  7333.  
  7334.                 if (PreviousClass == 165)
  7335.                 {
  7336.                     if (client.Entity.Class != 161)
  7337.                     {
  7338.                         switch (spell.ID)
  7339.                         {
  7340.                             case 12830:
  7341.                             case 12840:
  7342.                             case 12850:
  7343.                             case 12860:
  7344.                             case 12870:
  7345.                             case 12880:
  7346.                             case 12890:
  7347.                             case 12930:
  7348.                             case 12940:
  7349.                             case 12950:
  7350.                             case 12960:
  7351.                             case 12970:
  7352.                             case 12980:
  7353.                             case 12990:
  7354.                             case 13000:
  7355.                             case 13020:
  7356.                             case 13030:
  7357.                             case 13190:
  7358.                             case 13050:
  7359.                             case 13060:
  7360.                             case 13070:
  7361.                             case 13080:
  7362.                             case 13090:
  7363.                             case 13360:
  7364.                                 client.RemoveSpell(spell);
  7365.                                 break;
  7366.                         }
  7367.                     }
  7368.                 }
  7369.  
  7370.                 #endregion
  7371. بعدين هنبحث تانى
  7372.  #region Spells
  7373. هنضيف الشخصية الجديدة
  7374. #region Windwalker
  7375.                 if (PreviousClass == 165)
  7376.                 {
  7377.                     if (client.Entity.Class != 161)
  7378.                     {
  7379.                         switch (aspell.ID)
  7380.                         {
  7381.                             case 12830:
  7382.                             case 12840:
  7383.                             case 12850:
  7384.                             case 12860:
  7385.                             case 12870:
  7386.                             case 12880:
  7387.                             case 12890:
  7388.                             case 12930:
  7389.                             case 12940:
  7390.                             case 12950:
  7391.                             case 12960:
  7392.                             case 12970:
  7393.                             case 12980:
  7394.                             case 12990:
  7395.                             case 13000:
  7396.                             case 13020:
  7397.                             case 13030:
  7398.                             case 13190:
  7399.                             case 13050:
  7400.                             case 13060:
  7401.                             case 13070:
  7402.                             case 13080:
  7403.                             case 13090:
  7404.                             case 13360:
  7405.                                 client.RemoveSpell(aspell);
  7406.                                 break;
  7407.                         }
  7408.                     }
  7409.                 }
  7410.                 #endregion
  7411. بعدين هنبحث عن كود ده
  7412. #region Add Extra Skill
  7413. هنضيف فيه كود ده
  7414. if (client.Entity.FirstRebornClass == 165 && client.Entity.SecondRebornClass == 165 && client.Entity.Class == 165)
  7415.             {
  7416.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeI);
  7417.                 WontAdd(ElmistRo.Game.Enums.SkillIDs.FrostGazeIII);
  7418.  
  7419.             }
  7420.  
  7421. بس كده معاك شخصية جديدة كاملة مكملة والكمال لله واحده
  7422. ديه الايتم بتاعت الشخصية
  7423. http://up.top4top.net/downloadf-382lb8hv1-rar.html
Add Comment
Please, Sign In to add comment