V-ItemSetValues.asm
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:34k
源码类别:

模拟服务器

开发平台:

Asm

  1. ;EasyCodeName=Module1,1
  2. ;-----------------------------------------------------------------------------------
  3. ;    VeMU
  4. ;    Its a package that allows the user to set his own server of the game
  5. ;    "MuOnline", this is not an emulator since i am not "emulating"
  6. ;    what the actual games does, i am "creating" a method for set a Server
  7. ;    of this Game.
  8. ;
  9. ;    Copyright (C) 2010  Felipe Ya馿z
  10. ;
  11. ;    This program is free software: you can redistribute it and/or modify
  12. ;    it under the terms of the GNU General Public License as published by
  13. ;    the Free Software Foundation, either version 3 of the License, or
  14. ;    (at your option) any later version.
  15. ;
  16. ;    This program is distributed in the hope that it will be useful,
  17. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ;    GNU General Public License for more details.
  20. ;
  21. ;    You should have received a copy of the GNU General Public License
  22. ;    along with this program.  If not, see http://www.gnu.org/licenses/.
  23. ;-----------------------------------------------------------------------------------
  24. ;-----------------------------------------------------------------------------------
  25. ;                        -----------------
  26. ;                             Coded     /
  27. ;                              By      /
  28. ;                           -={FeN$x)=-
  29. ;                         /  Felipe Y.  
  30. ;                        /               
  31. ;                        -----------------
  32. ; Programming Lang: ASM
  33. ; Country: Chile
  34. ;              My respect for all those who lost their lifes
  35. ;              In the earthquake of my country...
  36. ;              Let god take their spirits home...
  37. ;-----------------------------------------------------------------------------------
  38. ;////////////////////////////////////////////////////////////////////////////////////
  39. ;                       VeMU Project
  40. ;                       Item Actions !
  41. ;////////////////////////////////////////////////////////////////////////////////////
  42. V_CItem_SetBonusByOptions Proto :DWord, :DWord
  43. V_CItem_SetReqLevel Proto :DWord, :DWord, :Dword
  44. V_CItem_SetRequiredStats Proto :Dword, :Dword
  45. V_CItem_SetBonusForPendants Proto :DWord, :DWord
  46. V_CItem_SetBonusForRings Proto :DWord, :DWord
  47. V_CItem_SetSkillOpt Proto :DWord
  48. V_CItem_SetOption2 Proto :DWord, :DWord, :DWord
  49. V_CItem_SetOption3 Proto :DWord, :DWord, :DWord
  50. V_CItem_SetBonusByOptions Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
  51. Local Bonus:DWord
  52. Local pThisItem:DWord
  53. Local MyStruct:DWord
  54. ;----------------------------------------------------
  55. ;Save structs into locals and assume.
  56. ;----------------------------------------------------
  57. Assume Edx:Ptr ItemStruct
  58. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  59. Mov pThisItem, Ecx
  60. Mov MyStruct, Edx
  61. ;---------------------------------------------------------------------------------
  62. ;Bonus "SetOption" for DmgMin, DmgMax, MagicPower, SuccesfulBlocing & Defense
  63. ;Calc: ItemLvl+30
  64. ;---------------------------------------------------------------------------------
  65. .If ([Edx].Item_SetOption != 0)
  66.   .If ([Edx].Item_Level !=0)
  67.     Movsx Eax, [Edx].Item_Level
  68.     Add Eax, 30
  69.     Mov Bonus, Eax
  70. ;---------------------------------------------------------------------------------------------
  71. ;New Calculation for DamageMin, DamageMax, MagicPower, SuccessfulBlocing & Defense
  72. ;In base of SetOption
  73. ;Calc: (DamageMin*25/ItemLevel+5)+DamageMin+(Bonus/40+5)
  74. ;Calc: (DamageMax*25/ItemLevel+5)+DamageMax+(Bonus/40+5)
  75. ;Calc: (MagicPower*25/ItemLevel+5)+MagicPower+(Bonus/60+5)
  76. ;Calc: (SuccesBlock*25/ItemLevel+5)+SuccessBlock+(Bonus/40+5)
  77. ;Calc: [((Defense*12/ItemLevel)+(ItemLevel/5))+4+Defense] + [(*3/Bonus)+(Bonus/30)+5+Defense]
  78. ;---------------------------------------------------------------------------------------------
  79.     Movsx Eax, [Edx].Item_DamageMin
  80.     IMul Eax, Eax, 25
  81.     Movsx Ecx, [Edx].Item_Level
  82.     Xor Edx, Edx ;Optimisation instead CDQ
  83.     IDiv Ecx
  84.     Add Eax, 5
  85.     Mov Edx, MyStruct
  86.     Add [Edx].Item_DamageMin, Ax
  87.     Mov Eax, Bonus
  88.     Xor Edx, Edx ;Optimisation instead CDQ
  89.     Mov Ecx, 40
  90.     IDiv Ecx
  91.     Add Eax, 5
  92.     Mov Edx, MyStruct
  93.     Add [Edx].Item_DamageMin, Ax
  94.     Movsx Eax, [Edx].Item_DamageMax
  95.     IMul Eax, Eax, 25
  96.     Movsx Ecx, [Edx].Item_Level
  97.     Xor Edx, Edx ;Optimisation instead CDQ
  98.     IDiv Ecx
  99.     Add Eax, 5
  100.     Mov Edx, MyStruct
  101.     Add [Edx].Item_DamageMax, Ax
  102.     Mov Eax, Bonus
  103.     Xor Edx, Edx ;Optimisation instead CDQ
  104.     Mov Ecx, 40
  105.     IDiv Ecx
  106.     Add Eax, 5
  107.     Mov Edx, MyStruct
  108.     Add [Edx].Item_DamageMax, Ax
  109.     Movsx Eax, [Edx].Item_MagicPower
  110.     IMul Eax, Eax, 25
  111.     Movsx Ecx, [Edx].Item_Level
  112.     Xor Edx, Edx ;Optimisation instead CDQ
  113.     IDiv Ecx
  114.     Add Eax, 5
  115.     Mov Edx, MyStruct
  116.     Add [Edx].Item_MagicPower, Ax
  117.     Mov Eax, Bonus
  118.     Xor Edx, Edx ;Optimisation instead CDQ
  119.     Mov Ecx, 60
  120.     IDiv Ecx
  121.     Add Eax, 5
  122.     Mov Edx, MyStruct
  123.     Add [Edx].Item_MagicPower, Ax
  124.     Movsx Eax, [Edx].Item_SuccesfulBlocking
  125.     IMul Eax, Eax, 25
  126.     Movsx Ecx, [Edx].Item_Level
  127.     Xor Edx, Edx ;Optimisation instead CDQ
  128.     IDiv Ecx
  129.     Add Eax, 5
  130.     Mov Edx, MyStruct
  131.     Add [Edx].Item_SuccesfulBlocking, Al
  132.     Mov Eax, Bonus
  133.     Xor Edx, Edx ;Optimisation instead CDQ
  134.     Mov Ecx, 60
  135.     IDiv Ecx
  136.     Add Eax, 5
  137.     Mov Edx, MyStruct
  138.     Add [Edx].Item_SuccesfulBlocking, Al
  139.     Movsx Eax, [Edx].Item_Defense
  140.     IMul Eax, Eax, 12
  141.     Movsx Ecx, [Edx].Item_Level
  142.     Xor Edx, Edx ;Optimisation instead CDQ
  143.     IDiv Ecx
  144.     Mov Edx, MyStruct
  145.     Mov Ecx, Eax
  146.     Movsx Eax, [Edx].Item_Level
  147.     Xor Edx, Edx ;Optimisation instead CDQ
  148.     Mov Esi, 5
  149.     IDiv Esi
  150.     Lea Eax, [Ecx + Eax + 4]
  151.     Mov Edx, MyStruct
  152.     Add [Edx].Item_Defense, Al
  153.     Movsx Eax, [Edx].Item_Defense
  154.     IMul Eax, Eax, 3
  155.     Xor Edx, Edx ;Optimisation instead CDQ
  156.     IDiv Bonus
  157.     Mov Ecx, Eax
  158.     Mov Eax, Bonus
  159.     Xor Edx, Edx ;Optimisation instead CDQ
  160.     Mov Esi, 30
  161.     IDiv Esi
  162.     Lea Eax, [Ecx + Eax + 2]
  163.     Mov Edx, MyStruct
  164.     Add [Edx].Item_Defense, Al
  165.   .EndIf
  166. ;----------------------------------------------------
  167. ;Bonus "NewOption" for DmgMin, DmgMax & MagicPower
  168. ;BUT ONLY FOR SOME ITEMS.
  169. ;----------------------------------------------------
  170. .ElseIf ([Edx].Item_NewOption !=0)
  171.   .If (ItemType == 2) && (ItemIndex == 6) ;Chaos Dragon Axe
  172.     Add [Edx].Item_DamageMin, 15
  173.     Add [Edx].Item_DamageMax, 15
  174.     Add [Edx].Item_MagicPower, 15
  175.   .ElseIf (ItemType == 5) && (ItemIndex == 7) ;Chaos Staff
  176.     Add [Edx].Item_DamageMin, 25
  177.     Add [Edx].Item_DamageMax, 25
  178.     Add [Edx].Item_MagicPower, 25
  179.   .ElseIf (ItemType == 4) && (ItemIndex == 6) ;Chaos Nature Bow
  180.     Add [Edx].Item_DamageMin, 30
  181.     Add [Edx].Item_DamageMax, 30
  182.     Add [Edx].Item_MagicPower, 30
  183.   .EndIf
  184. ;-------------------------------------------------------------------------------
  185. ;Bonus "NewOption" for DamageMin, DamageMax, MagicPower, SuccesfulBlocking
  186. ;For all kind of other items
  187. ;Calc: (DamageMin*25/ItemLevel+5)+DamageMin
  188. ;Calc: (DamageMax*25/ItemLevel+5)+DamageMax
  189. ;Calc: (MagicPower*25/ItemLevel+5)+MagicPower
  190. ;Calc: (SuccesBlock*25/ItemLevel+5)+SuccesBlock
  191. ;Calc: ((Defense*12/ItemLevel)+(ItemLevel/5))+4+Defense
  192. ;--------------------------------------------------------------------------------
  193. .ElseIf ([Edx].Item_NewOption !=0)
  194.   .If ([Edx].Item_Level != 0)
  195.     Movsx Eax, [Edx].Item_DamageMin
  196.     IMul Eax, Eax, 25
  197.     Movsx Ecx, [Edx].Item_Level
  198.     Xor Edx, Edx ;Optimisation instead CDQ
  199.     IDiv Ecx
  200.     Add Eax, 5
  201.     Mov Edx, MyStruct
  202.     Add [Edx].Item_DamageMin, Ax
  203.     Movsx Eax, [Edx].Item_DamageMax
  204.     IMul Eax, Eax, 25
  205.     Movsx Ecx, [Edx].Item_Level
  206.     Xor Edx, Edx ;Optimisation instead CDQ
  207.     IDiv Ecx
  208.     Add Eax, 5
  209.     Mov Edx, MyStruct
  210.     Add [Edx].Item_DamageMax, Ax
  211.     Movsx Eax, [Edx].Item_MagicPower
  212.     IMul Eax, Eax, 25
  213.     Movsx Ecx, [Edx].Item_Level
  214.     Xor Edx, Edx ;Optimisation instead CDQ
  215.     IDiv Ecx
  216.     Add Eax, 5
  217.     Mov Edx, MyStruct
  218.     Add [Edx].Item_MagicPower, Ax
  219.     Movsx Eax, [Edx].Item_SuccesfulBlocking
  220.     IMul Eax, Eax, 25
  221.     Movsx Ecx, [Edx].Item_Level
  222.     Xor Edx, Edx ;Optimisation instead CDQ
  223.     IDiv Ecx
  224.     Add Eax, 5
  225.     Mov Edx, MyStruct
  226.     Add [Edx].Item_SuccesfulBlocking, Al
  227.     Movsx Eax, [Edx].Item_Defense
  228.     IMul Eax, Eax, 12
  229.     Movsx Ecx, [Edx].Item_Level
  230.     Xor Edx, Edx ;Optimisation instead CDQ
  231.     IDiv Ecx
  232.     Mov Edx, MyStruct
  233.     Mov Ecx, Eax
  234.     Movsx Eax, [Edx].Item_Level
  235.     Xor Edx, Edx ;Optimisation instead CDQ
  236.     Mov Esi, 5
  237.     IDiv Esi
  238.     Lea Eax, [Ecx + Eax + 4]
  239.     Mov Edx, MyStruct
  240.     Add [Edx].Item_Defense, Al
  241.   .EndIf
  242. .EndIf
  243. ;----------------------------------------------------------------------------------------------------
  244. ;Set DamageMin,DamageMax,MagicPower, SuccesfulBlocking, Defense & MagicDefense BASIC calculation
  245. ;Calc: (ItemLvl*4)+DamageMin Or DamageMax
  246. ;----------------------------------------------------------------------------------------------------
  247. Movsx Eax, [Edx].Item_DamageMin
  248. Movsx Ebx, [Edx].Item_Level
  249. Lea Eax, [Eax + Ebx * 4]
  250. Mov [Edx].Item_DamageMin, Ax
  251. Movsx Eax, [Edx].Item_DamageMax
  252. Movsx Ebx, [Edx].Item_Level
  253. Lea Eax, [Eax + Ebx * 4]
  254. Mov [Edx].Item_DamageMax, Ax
  255. Movsx Eax, [Edx].Item_MagicPower
  256. Movsx Ebx, [Edx].Item_Level
  257. Lea Eax, [Eax + Ebx * 4]
  258. Mov [Edx].Item_MagicPower, Ax
  259. Movsx Eax, [Edx].Item_SuccesfulBlocking
  260. Movsx Ebx, [Edx].Item_Level
  261. Lea Eax, [Eax + Ebx * 4]
  262. Mov [Edx].Item_SuccesfulBlocking, Al
  263. Movsx Eax, [Edx].Item_Defense
  264. Movsx Ebx, [Edx].Item_Level
  265. Lea Eax, [Eax + Ebx * 4]
  266. Mov [Edx].Item_Defense, Al
  267. Movsx Eax, [Edx].Item_MagicDefense
  268. Movsx Ebx, [Edx].Item_Level
  269. Lea Eax, [Eax + Ebx * 4]
  270. Mov [Edx].Item_MagicDefense, Al
  271. ;--------------------------------------------------------------------------------------------------------------
  272. ;Set DamageMin, DamageMax, MagicPower, SuccesfulBlocking, Defense & MagicDefense addition if level is
  273. ;greater than 10.
  274. ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+DamageMin
  275. ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+DamageMax
  276. ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+MagicPower
  277. ;---------------------------------------------------------------------------------------------------------------
  278. .If ([Edx].Item_Level >= 10)
  279.   Movsx Eax, [Edx].Item_Level
  280.   Sub Eax, 9
  281.   Movsx Ebx, [Edx].Item_Level
  282.   Sub Ebx, 8
  283.   IMul Eax, Ebx
  284.   Sar Eax, 1 ;/2
  285.   Add [Edx].Item_DamageMin, Ax
  286.   Add [Edx].Item_DamageMax, Ax
  287.   Add [Edx].Item_MagicPower, Ax
  288.   Add [Edx].Item_SuccesfulBlocking, Al
  289.   Add [Edx].Item_Defense, Al
  290.   Add [Edx].Item_MagicDefense, Al
  291. .EndIf
  292. ;-------------------------------------------------------
  293. ;Add Item_Level to Item_Defense if its shield or helms
  294. ;-------------------------------------------------------
  295. .If (ItemType >=6) || (ItemType < 7) ;Only for shields and helms
  296.   Movsx Eax, [Edx].Item_Level
  297.   Add [Edx].Item_Defense, Al
  298.   .If ([Edx].Item_SetOption != 0)
  299.     .If ([Edx].Item_Level !=0)
  300.        Movsx Eax, [Edx].Item_Defense
  301.        IMul Eax, Eax, 20
  302.        Xor Edx, Edx ;Optimisation instead CDQ
  303.        IDiv Bonus
  304.        Add Eax, 2
  305.        Mov Edx, MyStruct
  306.        Add [Edx].Item_Defense, Al
  307.     .EndIf
  308.   .EndIf
  309. ;------------------------------------------------------
  310. ;Add determinated defense bonus to some items
  311. ;Wings Spirit, Soul, Dragon, Cape Of Lord & DarkHorse
  312. ;Have the same bonus:
  313. ;Calc: ItemLevel*2+Defense
  314. ;
  315. ;Also Cape Of Lord have an extra bonus:
  316. ;Calc: ItemLevel*2+15+Defense
  317. ;------------------------------------------------------
  318. .ElseIf (ItemType == 12) && (ItemIndex >= 3) && (ItemIndex < 6) ;Wings Spirit, Soul & Dragon
  319.   Jmp @AddBonusDef
  320. .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape Of Lord
  321.   Movsx Eax, [Edx].Item_Level
  322.   Lea Ebx, [Eax + Eax + 15]
  323.   Add [Edx].Item_Defense, Bl
  324.   Jmp @AddBonusDef
  325. .ElseIf (ItemType == 13) && (ItemIndex == 4) ;DarkHorse
  326. @AddBonusDef:
  327.   Movsx Eax, [Edx].Item_Level
  328.   Shl Eax, 1 ;*2
  329.   Add [Edx].Item_Defense, Al
  330. .EndIf
  331. assume edx:NOTHING
  332. assume ecx:NOTHING
  333. ret
  334. V_CItem_SetBonusByOptions EndP
  335. V_CItem_SetReqLevel Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, NewOption:Dword
  336. Local pThisItem:DWord
  337. Local MyStruct:DWord
  338. ;----------------------------------------------------
  339. ;Savre structs into locals and assume.
  340. ;----------------------------------------------------
  341. Assume Edx:Ptr ItemStruct
  342. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  343. Mov pThisItem, Ecx
  344. Mov MyStruct, Edx
  345. ;--------------------------------------
  346. ;Check if item need a required level
  347. ;--------------------------------------
  348. .If ([Ecx].ReqVars.ReqLevel != 0)
  349. ;----------------------------------
  350. ;item DarkHorse
  351. ;Calc: PetItemLevel*2+218
  352. ;-----------------------------------
  353.   .If (ItemType == 13) && (ItemIndex == 4) ;DarkHorse
  354.     Mov Eax, [Edx].Item_PetItemLevel
  355.     Lea Ebx, [Eax + Eax + 218]
  356.     Mov [Edx].Item_ReqLevel, Bx
  357. ;----------------------------------
  358. ;items Wings Spirit, Soul & Dragon
  359. ;Calc: ReqLevel+(ItemLvl*5)
  360. ;-----------------------------------
  361.   .ElseIf (ItemType == 12) && (ItemIndex >= 3) && (ItemIndex < 6) ; items Wings Spirit, Soul & Dragon
  362.     Movsx Eax, [Ecx].ReqVars.ReqLevel
  363.     Movsx Ebx, [Edx].Item_Level
  364.     imul ebx, ebx, 5
  365.     add eax, ebx
  366.     Mov [Edx].Item_ReqLevel, Ax
  367. ;-----------------------------------------
  368. ;Items: All Orbs + Jewel Chaos (WZ bug)
  369. ;       or Item(Kor).txt that i have bug.
  370. ;Calc: No calc
  371. ;-----------------------------------------
  372.   .ElseIf (ItemType == 13) && (ItemIndex >= 7) && (ItemIndex < 18)
  373.     Movsx Eax, [Ecx].ReqVars.ReqLevel
  374.     Mov [Edx].Item_ReqLevel, Ax
  375. ;----------------------------------
  376. ;All Items Type from 0 to 12
  377. ;This means (sets & weapons)
  378. ;Calc: ReqLevel+(ItemLvl*5)
  379. ;-----------------------------------
  380.   .ElseIf (ItemType >= 0) && (ItemType > 12)
  381.     Movsx Eax, [Ecx].ReqVars.ReqLevel
  382.     Mov [Edx].Item_ReqLevel, Ax
  383. ;----------------------------------
  384. ;All rest of items
  385. ;Calc: ReqLevel+(ItemLvl*4)
  386. ;-----------------------------------
  387.   .Else
  388.     Movsx Eax, [Ecx].ReqVars.ReqLevel
  389.     Movsx Ebx, [Edx].Item_Level
  390.     Lea Eax, [Eax + Ebx * 4]
  391.     Mov [Edx].Item_ReqLevel, Ax
  392.   .Endif
  393.   Jmp @Next
  394. .EndIf
  395. Mov [Edx].Item_ReqLevel, 0
  396. ;----------------------------------
  397. ;item "Transformation Ring"
  398. ;If level > 2, reqlvl = 50
  399. ;If level <= 2, Reqlvl = 20
  400. ;-----------------------------------
  401. @Next:
  402. .If (ItemType == 13) && (ItemIndex == 10) ;Transformation Ring
  403.   .If ([Edx].Item_Level <= 2) ; || (BonusRequirementStats <= 2) (Removed for now)
  404.     Mov [Edx].Item_ReqLevel, 20
  405.   .Else
  406.     Mov [Edx].Item_ReqLevel, 50
  407.   .EndIf
  408. .EndIf
  409. ;-----------------------------------
  410. ;Bonus "NewOption" for all weapons
  411. ;and sets.
  412. ;Calc: ItemReqLevel + 20
  413. ;-----------------------------------
  414. Mov Eax, NewOption
  415. And Eax, 3FH
  416. .If (Eax != 0)
  417.  .If (ItemType >= 0) && (ItemType < 12)
  418.    Add [Edx].Item_ReqLevel, 20
  419.  .EndIf
  420. .EndIf
  421. assume edx:NOTHING
  422. assume ecx:NOTHING
  423. ret
  424. V_CItem_SetReqLevel EndP
  425. V_CItem_SetRequiredStats Proc Uses Edx Ecx ItemType:Dword, ItemIndex:Dword
  426. Local BonusRequirementStats:DWord
  427. Local pThisItem:DWord
  428. Local MyStruct:DWord
  429. ;----------------------------------------------------
  430. ;Savre structs into locals and assume.
  431. ;----------------------------------------------------
  432. Assume Edx:Ptr ItemStruct
  433. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  434. Mov MyStruct, Edx
  435. Mov pThisItem, Ecx
  436. ;------------------------------------------------------
  437. ;Give bonus in base of "NewOption" & "SetOption"
  438. ;for required stats.
  439. ;Calc: ItemLevel + 25 = Bonus
  440. ;------------------------------------------------------
  441. .If ([Edx].Item_NewOption != 0) || ([Edx].Item_SetOption != 0)
  442.   Movsx Eax, [Edx].Item_Level
  443.   Add Eax, 25
  444.   Mov BonusRequirementStats, Eax
  445. .Else
  446.   Mov BonusRequirementStats, 0
  447. .EndIf
  448. ;------------------------------------------------------
  449. ;Set Requiered Strenght
  450. ;Calc: (((ItemLevel*3+Bonus)*ReqStrenght)*3/100)+20
  451. ;------------------------------------------------------
  452. .If ([Ecx].ReqVars.ReqStrenght != 0)
  453.  Movsx Eax, [Ecx].ReqVars.ReqStrenght
  454.  Movsx Ebx, [Edx].Item_Level
  455.  IMul Ebx, Ebx, 3
  456.  Add Ebx, BonusRequirementStats
  457.  IMul Eax, Ebx
  458.  IMul Eax, Eax, 3
  459.  Xor Edx, Edx ;optimisation instead CDQ
  460.  Mov Ecx, 100
  461.  IDiv Ecx
  462.  Add Eax, 20
  463.  Mov Edx, MyStruct
  464.  Mov [Edx].Item_ReqStr, Ax
  465. .Else
  466.  Mov [Edx].Item_ReqStr, 0
  467. .EndIf
  468. Mov Ecx, pThisItem
  469. ;------------------------------------------------------
  470. ;Set Requiered Dexterity
  471. ;Calc: (((ItemLevel*3+Bonus)*ReqDex)*3/100)+20
  472. ;------------------------------------------------------
  473. .If ([Ecx].ReqVars.ReqDex != 0)
  474.  Movsx Eax, [Ecx].ReqVars.ReqDex
  475.  Movsx Ebx, [Edx].Item_Level
  476.  IMul Ebx, Ebx, 3
  477.  Add Ebx, BonusRequirementStats
  478.  IMul Eax, Ebx
  479.  IMul Eax, Eax, 3
  480.  Xor Edx, Edx ;optimisation instead CDQ
  481.  Mov Ecx, 100
  482.  IDiv Ecx
  483.  Add Eax, 20
  484.  Mov Edx, MyStruct
  485.  Mov [Edx].Item_ReqDex, Ax
  486. .Else
  487.  Mov [Edx].Item_ReqDex, 0
  488. .EndIf
  489. mov ecx, pThisItem
  490. ;------------------------------------------------------
  491. ;Set Requiered Energy
  492. ;Calc: (((ItemLevel*3+Bonus)*ReqEner)*4/100)+20
  493. ;------------------------------------------------------
  494. .If ([Ecx].ReqVars.ReqEnergy != 0)
  495.  Movsx Eax, [Ecx].ReqVars.ReqEnergy
  496.  Movsx Ebx, [Edx].Item_Level
  497.  IMul Ebx, Ebx, 3
  498.  Add Ebx, BonusRequirementStats
  499.  IMul Eax, Ebx
  500.  Shl Eax, 2 ;*4 optimised instead of imul eax, eax, 4
  501.  Xor Edx, Edx ;optimisation instead CDQ
  502.  Mov Ecx, 100
  503.  IDiv Ecx
  504.  Add Eax, 20
  505.  Mov Edx, MyStruct
  506.  Mov [Edx].Item_ReqEner, Ax
  507. .Else
  508.  Mov [Edx].Item_ReqEner, 0
  509. .EndIf
  510. mov ecx, pThisItem
  511. ;------------------------------------------------------
  512. ;Set Requiered Vitality
  513. ;Calc: (((ItemLevel*3+Bonus)*ReqVit)*3/100)+20
  514. ;
  515. ;Note: WZ add here a limit for only sets & weapons
  516. ;      could have vitality requirement, this is
  517. ;      removed here.
  518. ;------------------------------------------------------
  519. .If ([Ecx].ReqVars.ReqVitality != 0)
  520.  Movsx Eax, [Ecx].ReqVars.ReqVitality
  521.  Movsx Ebx, [Edx].Item_Level
  522.  IMul Ebx, Ebx, 3
  523.  Add Ebx, BonusRequirementStats
  524.  IMul Eax, Ebx
  525.  IMul Eax, Eax, 3
  526.  Xor Edx, Edx ;optimisation instead CDQ
  527.  Mov Ecx, 100
  528.  IDiv Ecx
  529.  Add Eax, 20
  530.  Mov Edx, MyStruct
  531.  Mov [Edx].Item_ReqVit, Ax
  532. .Else
  533.  Mov [Edx].Item_ReqVit, 0
  534. .EndIf
  535. mov ecx, pThisItem
  536. ;------------------------------------------------------
  537. ;Set Requiered LeaderShip
  538. ;Calc: (((ItemLevel*3+Bonus)*ReqCmd)*3/100)+20
  539. ;
  540. ;Note: WZ add here a limit for only sets & weapons
  541. ;      could have LeaderShip requirement, this is
  542. ;      removed here.
  543. ;------------------------------------------------------
  544. .If ([Ecx].ReqVars.ReqLeaderShip != 0)
  545.  Mov Eax, [Ecx].ReqVars.ReqLeaderShip
  546.  Movsx Ebx, [Edx].Item_Level
  547.  IMul Ebx, Ebx, 3
  548.  Add Ebx, BonusRequirementStats
  549.  IMul Eax, Ebx
  550.  IMul Eax, Eax, 3
  551.  Xor Edx, Edx ;optimisation instead CDQ
  552.  Mov Ecx, 100
  553.  IDiv Ecx
  554.  Add Eax, 20
  555.  Mov Edx, MyStruct
  556.  Mov [Edx].Item_ReqLeaderShip, Ax
  557. .Else
  558.  Mov [Edx].Item_ReqLeaderShip, 0
  559. .EndIf
  560. ;------------------------------------------------------
  561. ;Set LeaderShip for item "DarkRaven"
  562. ;Meaby this is bugged WZ thing, ill research
  563. ;it, but for now is included.
  564. ;
  565. ;Calc: PetLvl*15+185
  566. ;------------------------------------------------------
  567. Mov Edx, MyStruct
  568. Mov Ecx, pThisItem
  569. .If (ItemType == 13) && (ItemIndex == 5) ;DarkRaven
  570.   Mov Eax, [Edx].Item_PetItemLevel
  571.   IMul Eax, Eax, 15
  572.   Add Eax, 185
  573.   Mov [Edx].Item_ReqLeaderShip, Ax
  574. .EndIf
  575. assume edx:NOTHING
  576. assume ecx:NOTHING
  577. Ret
  578. V_CItem_SetRequiredStats EndP
  579. V_CItem_SetBonusForPendants Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
  580. Local pThisItem:DWord
  581. Local MyStruct:DWord
  582. ;----------------------------------------------------
  583. ;Savre structs into locals and assume.
  584. ;----------------------------------------------------
  585. Assume Edx: Ptr ItemStruct
  586. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  587. Mov MyStruct, Ecx
  588. Mov pThisItem, Edx
  589. ;---------------------------------------------
  590. ;Add options to Pendants !
  591. ;---------------------------------------------
  592. .If (ItemType >= 0) && (ItemType < 6)
  593.   Jmp @2
  594. .ElseIf (ItemType == 13) && (ItemType == 12) ;Pendant of Lighting
  595.   Jmp @2
  596. .ElseIf (ItemType == 13) && (ItemType == 13) ;Pendant of Fire
  597.   Jmp @2
  598. .ElseIf (ItemType == 13) && (ItemType == 25) ;Pendant of Ice
  599.   Jmp @2
  600. .ElseIf (ItemType == 13) && (ItemType == 26) ;Pendant of Wind
  601.   Jmp @2
  602. .ElseIf (ItemType == 13) && (ItemType == 27) ;Pendant of Water
  603.   Jmp @2
  604. .ElseIf (ItemType == 13) && (ItemType == 28) ;Pendant of Ability
  605. @2:
  606.   Movsx Eax, [Edx].Item_NewOption
  607.   Sar Eax, 5
  608.   And Eax, 1
  609.   .If (Eax != 0)
  610.     Movsx Eax, [Edx].Item_SpecialNum
  611.     Mov [[Edx].Item_Special + Eax], 92 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  612.     Add [Edx].Item_SpecialNum, 1
  613.   .EndIf
  614.   .If (ItemType == 5) ;Staffs
  615.     Jmp @3
  616.   .ElseIf (ItemType == 13) && (ItemType == 12) ;Pendant of Lighting
  617.     Jmp @3
  618.   .ElseIf (ItemType == 13) && (ItemType == 25) ;Pendant of Ice
  619.     Jmp @3
  620.   .ElseIf (ItemType == 13) && (ItemType == 27) ;Pendant of Water
  621. @3:
  622.     Movsx Eax, [Edx].Item_NewOption
  623.     Sar Eax, 4
  624.     And Eax, 1
  625.     .If (Eax != 0)
  626.       Movsx Eax, [Edx].Item_SpecialNum
  627.       Mov [[Edx].Item_Special + Eax], 95 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  628.       Add [Edx].Item_SpecialNum, 1
  629.     .EndIf
  630.     Movsx Eax, [Edx].Item_NewOption
  631.     Sar Eax, 3
  632.     And Eax, 1
  633.     .If (Eax != 0)
  634.       Movsx Eax, [Edx].Item_SpecialNum
  635.       Mov [[Edx].Item_Special + Eax], 96 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  636.       Add [Edx].Item_SpecialNum, 1
  637.     .EndIf
  638.   .Else
  639.     Movsx Eax, [Edx].Item_NewOption
  640.     Sar Eax, 4
  641.     And Eax, 1
  642.     .If (Eax != 0)
  643.       Movsx Eax, [Edx].Item_SpecialNum
  644.       Mov [[Edx].Item_Special + Eax], 93 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  645.       Add [Edx].Item_SpecialNum, 1
  646.     .EndIf
  647.     Movsx Eax, [Edx].Item_NewOption
  648.     Sar Eax, 3
  649.     And Eax, 1
  650.     .If (Eax != 0)
  651.       Movsx Eax, [Edx].Item_SpecialNum
  652.       Mov [[Edx].Item_Special + Eax], 94 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  653.       Add [Edx].Item_SpecialNum, 1
  654.     .EndIf
  655.   .EndIf
  656.   Movsx Eax, [Edx].Item_NewOption
  657.   Sar Eax, 2
  658.   And Eax, 1
  659.   .If (Eax != 0)
  660.     Movsx Eax, [Edx].Item_SpecialNum
  661.     Mov [[Edx].Item_Special + Eax], 97 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  662.     Add [Edx].Item_SpecialNum, 1
  663.   .EndIf
  664.   Movsx Eax, [Edx].Item_NewOption
  665.   Sar Eax, 1
  666.   And Eax, 1
  667.   .If (Eax != 0)
  668.     Movsx Eax, [Edx].Item_SpecialNum
  669.     Mov [[Edx].Item_Special + Eax], 98 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  670.     Add [Edx].Item_SpecialNum, 1
  671.   .EndIf
  672.   Movsx Eax, [Edx].Item_NewOption
  673.   And Eax, 1
  674.   .If (Eax != 0)
  675.     Movsx Eax, [Edx].Item_SpecialNum
  676.     Mov [[Edx].Item_Special + Eax], 99 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  677.     Add [Edx].Item_SpecialNum, 1
  678.   .EndIf
  679. .EndIf
  680. assume edx:NOTHING
  681. assume ecx:NOTHING
  682. ret
  683. V_CItem_SetBonusForPendants EndP
  684. V_CItem_SetBonusForRings Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
  685. Local pThisItem:DWord
  686. Local MyStruct:DWord
  687. ;----------------------------------------------------
  688. ;Savre structs into locals and assume.
  689. ;----------------------------------------------------
  690. Assume Edx: Ptr ItemStruct
  691. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  692. Mov MyStruct, Ecx
  693. Mov pThisItem, Edx
  694. ;---------------------------------------------
  695. ;Add options to Rings !
  696. ;---------------------------------------------
  697. .If (ItemType >= 6) && (ItemType < 12)
  698.   Jmp @1
  699. .ElseIf (ItemType == 13) && (ItemType == 08) ;Ring Ice
  700.   Jmp @1
  701. .ElseIf (ItemType == 13) && (ItemType == 09) ;Ring Posion
  702.   Jmp @1
  703. .ElseIf (ItemType == 13) && (ItemType == 21) ;Ring Fire
  704.   Jmp @1
  705. .ElseIf (ItemType == 13) && (ItemType == 22) ;Ring Earth
  706.   Jmp @1
  707. .ElseIf (ItemType == 13) && (ItemType == 23) ;Ring Wind
  708.   Jmp @1
  709. .ElseIf (ItemType == 13) && (ItemType == 24) ;Ring Wind
  710. @1:
  711.   Movsx Eax, [Edx].Item_NewOption
  712.   Sar Eax, 5
  713.   And Eax, 1
  714.   .If (Eax != 0)
  715.     Movsx Eax, [Edx].Item_SpecialNum
  716.     Mov [[Edx].Item_Special + Eax], 86 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  717.     Add [Edx].Item_SpecialNum, 1
  718.   .EndIf
  719.   Movsx Eax, [Edx].Item_NewOption
  720.   Sar Eax, 4
  721.   And Eax, 1
  722.   .If (Eax != 0)
  723.     Movsx Eax, [Edx].Item_SpecialNum
  724.     Mov [[Edx].Item_Special + Eax], 87 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  725.     Add [Edx].Item_SpecialNum, 1
  726.   .EndIf
  727.   Movsx Eax, [Edx].Item_NewOption
  728.   Sar Eax, 3
  729.   And Eax, 1
  730.   .If (Eax != 0)
  731.     Movsx Eax, [Edx].Item_SpecialNum
  732.     Mov [[Edx].Item_Special + Eax], 88 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  733.     Add [Edx].Item_SpecialNum, 1
  734.   .EndIf
  735.   Movsx Eax, [Edx].Item_NewOption
  736.   Sar Eax, 2
  737.   And Eax, 1
  738.   .If (Eax != 0)
  739.     Movsx Eax, [Edx].Item_SpecialNum
  740.     Mov [[Edx].Item_Special + Eax], 89 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  741.     Add [Edx].Item_SpecialNum, 1
  742.   .EndIf
  743.   Movsx Eax, [Edx].Item_NewOption
  744.   Sar Eax, 1
  745.   And Eax, 1
  746.   .If (Eax != 0)
  747.     Movsx Eax, [Edx].Item_SpecialNum
  748.     Mov [[Edx].Item_Special + Eax], 90 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  749.     Add [Edx].Item_SpecialNum, 1
  750.   .EndIf
  751.   Movsx Eax, [Edx].Item_NewOption
  752.   And Eax, 1
  753.   .If (Eax != 0)
  754.     Movsx Eax, [Edx].Item_SpecialNum
  755.     Mov [[Edx].Item_Special + Eax], 91 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  756.     Add [Edx].Item_SpecialNum, 1
  757.   .EndIf
  758. .EndIf
  759. ret
  760. assume edx:NOTHING
  761. assume ecx:NOTHING
  762. V_CItem_SetBonusForRings EndP
  763. V_CItem_SetSkillOpt Proc Uses Edx Ecx Option1:Dword
  764. Local pThisItem:DWord
  765. Local MyStruct:DWord
  766. ;----------------------------------------------------
  767. ;Save structs into locals and assume.
  768. ;----------------------------------------------------
  769. Assume Edx: Ptr ItemStruct
  770. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  771. Mov pThisItem, Ecx
  772. Mov MyStruct, Edx
  773. ;------------------------------------------------------
  774. ;Set If SkillOption is enabled.
  775. ;------------------------------------------------------
  776. .If (Option1 != 0)
  777.   .If ([Ecx].UniversalVars.SkillType != 0)
  778.     Movsx Eax, [Edx].Item_SpecialNum
  779.     Mov Ebx, [Ecx].UniversalVars.SkillType
  780.     Mov [[Edx].Item_Special + Eax], Bl ;Special[SpecialNum] (array)
  781.     Mov [Edx].Item_Option1, 1
  782.   .EndIf
  783. .EndIf
  784. ret
  785. assume edx:NOTHING
  786. assume ecx:NOTHING
  787. V_CItem_SetSkillOpt EndP
  788. V_CItem_SetOption2 Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, Option2:DWord
  789. Local pThisItem:DWord
  790. Local MyStruct:DWord
  791. ;----------------------------------------------------
  792. ;Save structs into locals and assume.
  793. ;----------------------------------------------------
  794. Assume Edx: Ptr ItemStruct
  795. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  796. Mov pThisItem, Ecx
  797. Mov MyStruct, Edx
  798. ;------------------------------------------------------
  799. ;Set If Option2 is abled and change Some Skill Types
  800. ;For some items, like weapons, sets and all wings.
  801. ;------------------------------------------------------
  802. .If (Option2 != 0)
  803.  .If (ItemType >= 0) && (ItemType < 12) ;Weapons & Sets
  804.    Jmp @SetOption
  805.  .ElseIf (ItemType == 12) && (ItemIndex >= 0) && (ItemIndex <= 6) ;items Wings Elf, Satan, Heaven, Spirit, Soul, Dragon & Darkness
  806.    Jmp @SetOption
  807.  .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape Lord
  808. @SetOption:
  809.    Mov [Edx].Item_Option2, 1
  810.    Movsx Eax, [Edx].Item_SpecialNum
  811.    Mov [[Edx].Item_Special + Eax], 84 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  812.  .EndIf
  813. .EndIf
  814. ret
  815. assume edx:NOTHING
  816. assume ecx:NOTHING
  817. V_CItem_SetOption2 EndP
  818. V_CItem_SetOption3 Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, Option3:DWord
  819. Local pThisItem:DWord
  820. Local MyStruct:DWord
  821. ;----------------------------------------------------
  822. ;Save structs into locals and assume.
  823. ;----------------------------------------------------
  824. Assume Edx: Ptr ItemStruct
  825. Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
  826. Mov pThisItem, Ecx
  827. Mov MyStruct, Edx
  828. ;------------------------------------------------------
  829. ;Set If Option3 is abled and change Some Skill Types
  830. ;And Required stats.
  831. ;For some items, like weapons, sets and all wings.
  832. ;------------------------------------------------------
  833. .If (Option3 != 0)
  834.  .If (ItemType >= 0) && (ItemType < 4) ;Swords to Bows
  835.    Movsx Eax, [Edx].Item_SpecialNum
  836.    Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Increa Dmg Min Origin)
  837.    Mov Eax, Option3
  838.    Mov [Edx].Item_Option3, Al
  839.    And Eax, 0FFH ;To byte
  840.    Shl Eax, 2 ;*4
  841.    Add [Edx].Item_ReqStr, Ax
  842.  .ElseIf (ItemType == 5) ;Staffs
  843.    Movsx Eax, [Edx].Item_SpecialNum
  844.    Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  845.    Mov Eax, Option3
  846.    Mov [Edx].Item_Option3, Al
  847.    And Eax, 0FFH ;To byte
  848.    Shl Eax, 2 ;*4
  849.    Add [Edx].Item_ReqStr, Ax
  850.  .ElseIf (ItemType == 6) ;Shields
  851.    Movsx Eax, [Edx].Item_SpecialNum
  852.    Mov [[Edx].Item_Special + Eax], 82 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  853.    Mov Eax, Option3
  854.    Mov [Edx].Item_Option3, Al
  855.    And Eax, 0FFH ;To byte
  856.    Shl Eax, 2 ;*4
  857.    Add [Edx].Item_ReqStr, Ax
  858.  .ElseIf (ItemType >= 7) && (ItemType < 11) ;Helms to Boots
  859.    Movsx Eax, [Edx].Item_SpecialNum
  860.    Mov [[Edx].Item_Special + Eax], 83 ;Special[SpecialNum] (array)  (SKILL = Bonus defense)
  861.    Mov Eax, Option3
  862.    Mov [Edx].Item_Option3, Al
  863.    And Eax, 0FFH ;To byte
  864.    Shl Eax, 2 ;*4
  865.    Add [Edx].Item_ReqStr, Ax
  866.  .ElseIf (ItemType == 13) && (ItemIndex == 24) ;Ring Of Magic
  867.    Movsx Eax, [Edx].Item_SpecialNum
  868.    Mov [[Edx].Item_Special + Eax], 172 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  869.    Mov Eax, Option3
  870.    Mov [Edx].Item_Option3, Al
  871.  .ElseIf (ItemType == 13) && (ItemIndex == 28) ;Pendant of ability
  872.    Movsx Eax, [Edx].Item_SpecialNum
  873.    Mov [[Edx].Item_Special + Eax], 173 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  874.    Mov Eax, Option3
  875.    Mov [Edx].Item_Option3, Al
  876.  .ElseIf (ItemType == 13) && (ItemIndex >= 20) && (ItemIndex <= 28)  ;From ring Wizardy to Pendant Ability, excluding the 2 that are up
  877.    Movsx Eax, [Edx].Item_SpecialNum
  878.    Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  879.    Mov Eax, Option3
  880.    Mov [Edx].Item_Option3, Al
  881.  .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape of lord
  882.    Movsx Eax, [Edx].Item_SpecialNum
  883.    Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  884.    Mov Eax, Option3
  885.    Mov [Edx].Item_Option3, Al
  886.    And Eax, 0FFH ;To byte
  887.    Shl Eax, 2 ;*4
  888.    Add [Edx].Item_ReqStr, Ax
  889.  .ElseIf (ItemType == 12) && (ItemIndex == 0) ;Wing of elf
  890.    Movsx Eax, [Edx].Item_SpecialNum
  891.    Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  892.    Mov Eax, Option3
  893.    Mov [Edx].Item_Option3, Al
  894.  .ElseIf (ItemType == 12) && (ItemIndex == 1) ;Wing of Heaven
  895.    Movsx Eax, [Edx].Item_SpecialNum
  896.    Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  897.    Mov Eax, Option3
  898.    Mov [Edx].Item_Option3, Al
  899.    And Eax, 0FFH ;To byte
  900.    Shl Eax, 2 ;*4
  901.    Add [Edx].Item_ReqStr, Ax
  902.  .ElseIf (ItemType == 12) && (ItemIndex == 2) ;Wing of Satan
  903.    Movsx Eax, [Edx].Item_SpecialNum
  904.    Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  905.    Mov Eax, Option3
  906.    Mov [Edx].Item_Option3, Al
  907.    And Eax, 0FFH ;To byte
  908.    Shl Eax, 2 ;*4
  909.    Add [Edx].Item_ReqStr, Ax
  910.  .ElseIf (ItemType == 12) && (ItemIndex == 3) ;Wing of Spirits
  911.    Movsx Eax, [Edx].Item_SpecialNum
  912.    Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  913.    Mov Eax, Option3
  914.    Mov [Edx].Item_Option3, Al
  915.    And Eax, 0FFH ;To byte
  916.    Shl Eax, 2 ;*4
  917.    Add [Edx].Item_ReqStr, Ax
  918.    Movsx Eax, [Edx].Item_NewOption
  919.    And Eax, 32
  920.    .If ([Edx].Item_NewOption != 0)
  921.      Movsx Eax, [Edx].Item_SpecialNum
  922.      Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  923.    .EndIf
  924.  .ElseIf (ItemType == 12) && (ItemIndex == 4) ;Wings of Soul
  925.    Movsx Eax, [Edx].Item_SpecialNum
  926.    Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  927.    Mov Eax, Option3
  928.    Mov [Edx].Item_Option3, Al
  929.    And Eax, 0FFH ;To byte
  930.    Shl Eax, 2 ;*4
  931.    Add [Edx].Item_ReqStr, Ax
  932.    Movsx Eax, [Edx].Item_NewOption
  933.    And Eax, 32
  934.    .If ([Edx].Item_NewOption != 0)
  935.      Movsx Eax, [Edx].Item_SpecialNum
  936.      Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  937.    .EndIf
  938.  .ElseIf (ItemType == 12) && (ItemIndex == 5) ;Wings of Dragon
  939.    Movsx Eax, [Edx].Item_SpecialNum
  940.    Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  941.    Mov Eax, Option3
  942.    Mov [Edx].Item_Option3, Al
  943.    And Eax, 0FFH ;To byte
  944.    Shl Eax, 2 ;*4
  945.    Add [Edx].Item_ReqStr, Ax
  946.    Movsx Eax, [Edx].Item_NewOption
  947.    And Eax, 32
  948.    .If ([Edx].Item_NewOption != 0)
  949.      Movsx Eax, [Edx].Item_SpecialNum
  950.      Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  951.    .EndIf
  952.  .ElseIf (ItemType == 12) && (ItemIndex == 6) ;Wings of Darkness
  953.    Movsx Eax, [Edx].Item_SpecialNum
  954.    Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  955.    Mov Eax, Option3
  956.    Mov [Edx].Item_Option3, Al
  957.    And Eax, 0FFH ;To byte
  958.    Shl Eax, 2 ;*4
  959.    Add [Edx].Item_ReqStr, Ax
  960.    Movsx Eax, [Edx].Item_NewOption
  961.    And Eax, 32
  962.    .If ([Edx].Item_NewOption != 0)
  963.      Movsx Eax, [Edx].Item_SpecialNum
  964.      Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Bonus Dmg Min)
  965.    .EndIf
  966.  .ElseIf (ItemType == 13) && (ItemIndex == 3) ;Horn of Dinorant
  967.    Mov Eax, Option3
  968.    Mov [Edx].Item_Option3, Al
  969.    And Eax, 2
  970.    .If (Eax != 0)
  971.      Movsx Eax, [Edx].Item_SpecialNum
  972.      Mov [[Edx].Item_Special + Eax], 103 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  973.      Add [Edx].Item_SpecialNum, 1
  974.    .EndIf
  975.    Mov Eax, Option3
  976.    And Eax, 4
  977.    .If (Eax != 0)
  978.      Movsx Eax, [Edx].Item_SpecialNum
  979.      Mov [[Edx].Item_Special + Eax], 97 ;Special[SpecialNum] (array)  (SKILL = Unknown)
  980.      Add [Edx].Item_SpecialNum, 1
  981.      Add [Edx].Item_AttackSpeed, 5
  982.    .EndIf
  983.    Mov Eax, Option3
  984.    And Eax, 1
  985.    .If (Eax != 0)
  986.      Movsx Eax, [Edx].Item_SpecialNum
  987.      Mov [[Edx].Item_Special + Eax], 104 ;Special[SpecialNum] (array)  (SKILL = Dinorant Reduce attack dmg)
  988.    .EndIf
  989.  .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape of Lord
  990.    Movsx Eax, [Edx].Item_SpecialNum
  991.    Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array)  (SKILL = Bonus Dmg Min)
  992.    Mov Eax, Option3
  993.    Mov [Edx].Item_Option3, Al
  994.    And Eax, 0FFH ;To byte
  995.    Shl Eax, 2 ;*4
  996.    Add [Edx].Item_ReqStr, Ax
  997.  .EndIf
  998. .EndIf
  999. assume edx:NOTHING
  1000. assume ecx:NOTHING
  1001. ret
  1002. V_CItem_SetOption3 EndP