V-ItemSetValues.asm
资源名称:VeMU.rar [点击查看]
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:34k
源码类别:
模拟服务器
开发平台:
Asm
- ;EasyCodeName=Module1,1
- ;-----------------------------------------------------------------------------------
- ; VeMU
- ; Its a package that allows the user to set his own server of the game
- ; "MuOnline", this is not an emulator since i am not "emulating"
- ; what the actual games does, i am "creating" a method for set a Server
- ; of this Game.
- ;
- ; Copyright (C) 2010 Felipe Ya馿z
- ;
- ; This program is free software: you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation, either version 3 of the License, or
- ; (at your option) any later version.
- ;
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You should have received a copy of the GNU General Public License
- ; along with this program. If not, see http://www.gnu.org/licenses/.
- ;-----------------------------------------------------------------------------------
- ;-----------------------------------------------------------------------------------
- ; -----------------
- ; Coded /
- ; By /
- ; -={FeN$x)=-
- ; / Felipe Y.
- ; /
- ; -----------------
- ; Programming Lang: ASM
- ; Country: Chile
- ; My respect for all those who lost their lifes
- ; In the earthquake of my country...
- ; Let god take their spirits home...
- ;-----------------------------------------------------------------------------------
- ;////////////////////////////////////////////////////////////////////////////////////
- ; VeMU Project
- ; Item Actions !
- ;////////////////////////////////////////////////////////////////////////////////////
- V_CItem_SetBonusByOptions Proto :DWord, :DWord
- V_CItem_SetReqLevel Proto :DWord, :DWord, :Dword
- V_CItem_SetRequiredStats Proto :Dword, :Dword
- V_CItem_SetBonusForPendants Proto :DWord, :DWord
- V_CItem_SetBonusForRings Proto :DWord, :DWord
- V_CItem_SetSkillOpt Proto :DWord
- V_CItem_SetOption2 Proto :DWord, :DWord, :DWord
- V_CItem_SetOption3 Proto :DWord, :DWord, :DWord
- V_CItem_SetBonusByOptions Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
- Local Bonus:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Save structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx:Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov pThisItem, Ecx
- Mov MyStruct, Edx
- ;---------------------------------------------------------------------------------
- ;Bonus "SetOption" for DmgMin, DmgMax, MagicPower, SuccesfulBlocing & Defense
- ;Calc: ItemLvl+30
- ;---------------------------------------------------------------------------------
- .If ([Edx].Item_SetOption != 0)
- .If ([Edx].Item_Level !=0)
- Movsx Eax, [Edx].Item_Level
- Add Eax, 30
- Mov Bonus, Eax
- ;---------------------------------------------------------------------------------------------
- ;New Calculation for DamageMin, DamageMax, MagicPower, SuccessfulBlocing & Defense
- ;In base of SetOption
- ;Calc: (DamageMin*25/ItemLevel+5)+DamageMin+(Bonus/40+5)
- ;Calc: (DamageMax*25/ItemLevel+5)+DamageMax+(Bonus/40+5)
- ;Calc: (MagicPower*25/ItemLevel+5)+MagicPower+(Bonus/60+5)
- ;Calc: (SuccesBlock*25/ItemLevel+5)+SuccessBlock+(Bonus/40+5)
- ;Calc: [((Defense*12/ItemLevel)+(ItemLevel/5))+4+Defense] + [(*3/Bonus)+(Bonus/30)+5+Defense]
- ;---------------------------------------------------------------------------------------------
- Movsx Eax, [Edx].Item_DamageMin
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMin, Ax
- Mov Eax, Bonus
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Ecx, 40
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMin, Ax
- Movsx Eax, [Edx].Item_DamageMax
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMax, Ax
- Mov Eax, Bonus
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Ecx, 40
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMax, Ax
- Movsx Eax, [Edx].Item_MagicPower
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_MagicPower, Ax
- Mov Eax, Bonus
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Ecx, 60
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_MagicPower, Ax
- Movsx Eax, [Edx].Item_SuccesfulBlocking
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_SuccesfulBlocking, Al
- Mov Eax, Bonus
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Ecx, 60
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_SuccesfulBlocking, Al
- Movsx Eax, [Edx].Item_Defense
- IMul Eax, Eax, 12
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Mov Edx, MyStruct
- Mov Ecx, Eax
- Movsx Eax, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Esi, 5
- IDiv Esi
- Lea Eax, [Ecx + Eax + 4]
- Mov Edx, MyStruct
- Add [Edx].Item_Defense, Al
- Movsx Eax, [Edx].Item_Defense
- IMul Eax, Eax, 3
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Bonus
- Mov Ecx, Eax
- Mov Eax, Bonus
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Esi, 30
- IDiv Esi
- Lea Eax, [Ecx + Eax + 2]
- Mov Edx, MyStruct
- Add [Edx].Item_Defense, Al
- .EndIf
- ;----------------------------------------------------
- ;Bonus "NewOption" for DmgMin, DmgMax & MagicPower
- ;BUT ONLY FOR SOME ITEMS.
- ;----------------------------------------------------
- .ElseIf ([Edx].Item_NewOption !=0)
- .If (ItemType == 2) && (ItemIndex == 6) ;Chaos Dragon Axe
- Add [Edx].Item_DamageMin, 15
- Add [Edx].Item_DamageMax, 15
- Add [Edx].Item_MagicPower, 15
- .ElseIf (ItemType == 5) && (ItemIndex == 7) ;Chaos Staff
- Add [Edx].Item_DamageMin, 25
- Add [Edx].Item_DamageMax, 25
- Add [Edx].Item_MagicPower, 25
- .ElseIf (ItemType == 4) && (ItemIndex == 6) ;Chaos Nature Bow
- Add [Edx].Item_DamageMin, 30
- Add [Edx].Item_DamageMax, 30
- Add [Edx].Item_MagicPower, 30
- .EndIf
- ;-------------------------------------------------------------------------------
- ;Bonus "NewOption" for DamageMin, DamageMax, MagicPower, SuccesfulBlocking
- ;For all kind of other items
- ;Calc: (DamageMin*25/ItemLevel+5)+DamageMin
- ;Calc: (DamageMax*25/ItemLevel+5)+DamageMax
- ;Calc: (MagicPower*25/ItemLevel+5)+MagicPower
- ;Calc: (SuccesBlock*25/ItemLevel+5)+SuccesBlock
- ;Calc: ((Defense*12/ItemLevel)+(ItemLevel/5))+4+Defense
- ;--------------------------------------------------------------------------------
- .ElseIf ([Edx].Item_NewOption !=0)
- .If ([Edx].Item_Level != 0)
- Movsx Eax, [Edx].Item_DamageMin
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMin, Ax
- Movsx Eax, [Edx].Item_DamageMax
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_DamageMax, Ax
- Movsx Eax, [Edx].Item_MagicPower
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_MagicPower, Ax
- Movsx Eax, [Edx].Item_SuccesfulBlocking
- IMul Eax, Eax, 25
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Add Eax, 5
- Mov Edx, MyStruct
- Add [Edx].Item_SuccesfulBlocking, Al
- Movsx Eax, [Edx].Item_Defense
- IMul Eax, Eax, 12
- Movsx Ecx, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Ecx
- Mov Edx, MyStruct
- Mov Ecx, Eax
- Movsx Eax, [Edx].Item_Level
- Xor Edx, Edx ;Optimisation instead CDQ
- Mov Esi, 5
- IDiv Esi
- Lea Eax, [Ecx + Eax + 4]
- Mov Edx, MyStruct
- Add [Edx].Item_Defense, Al
- .EndIf
- .EndIf
- ;----------------------------------------------------------------------------------------------------
- ;Set DamageMin,DamageMax,MagicPower, SuccesfulBlocking, Defense & MagicDefense BASIC calculation
- ;Calc: (ItemLvl*4)+DamageMin Or DamageMax
- ;----------------------------------------------------------------------------------------------------
- Movsx Eax, [Edx].Item_DamageMin
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_DamageMin, Ax
- Movsx Eax, [Edx].Item_DamageMax
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_DamageMax, Ax
- Movsx Eax, [Edx].Item_MagicPower
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_MagicPower, Ax
- Movsx Eax, [Edx].Item_SuccesfulBlocking
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_SuccesfulBlocking, Al
- Movsx Eax, [Edx].Item_Defense
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_Defense, Al
- Movsx Eax, [Edx].Item_MagicDefense
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_MagicDefense, Al
- ;--------------------------------------------------------------------------------------------------------------
- ;Set DamageMin, DamageMax, MagicPower, SuccesfulBlocking, Defense & MagicDefense addition if level is
- ;greater than 10.
- ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+DamageMin
- ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+DamageMax
- ;Calc: ((ItemLevel-9)+(ItemLevel-8))/2+MagicPower
- ;---------------------------------------------------------------------------------------------------------------
- .If ([Edx].Item_Level >= 10)
- Movsx Eax, [Edx].Item_Level
- Sub Eax, 9
- Movsx Ebx, [Edx].Item_Level
- Sub Ebx, 8
- IMul Eax, Ebx
- Sar Eax, 1 ;/2
- Add [Edx].Item_DamageMin, Ax
- Add [Edx].Item_DamageMax, Ax
- Add [Edx].Item_MagicPower, Ax
- Add [Edx].Item_SuccesfulBlocking, Al
- Add [Edx].Item_Defense, Al
- Add [Edx].Item_MagicDefense, Al
- .EndIf
- ;-------------------------------------------------------
- ;Add Item_Level to Item_Defense if its shield or helms
- ;-------------------------------------------------------
- .If (ItemType >=6) || (ItemType < 7) ;Only for shields and helms
- Movsx Eax, [Edx].Item_Level
- Add [Edx].Item_Defense, Al
- .If ([Edx].Item_SetOption != 0)
- .If ([Edx].Item_Level !=0)
- Movsx Eax, [Edx].Item_Defense
- IMul Eax, Eax, 20
- Xor Edx, Edx ;Optimisation instead CDQ
- IDiv Bonus
- Add Eax, 2
- Mov Edx, MyStruct
- Add [Edx].Item_Defense, Al
- .EndIf
- .EndIf
- ;------------------------------------------------------
- ;Add determinated defense bonus to some items
- ;Wings Spirit, Soul, Dragon, Cape Of Lord & DarkHorse
- ;Have the same bonus:
- ;Calc: ItemLevel*2+Defense
- ;
- ;Also Cape Of Lord have an extra bonus:
- ;Calc: ItemLevel*2+15+Defense
- ;------------------------------------------------------
- .ElseIf (ItemType == 12) && (ItemIndex >= 3) && (ItemIndex < 6) ;Wings Spirit, Soul & Dragon
- Jmp @AddBonusDef
- .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape Of Lord
- Movsx Eax, [Edx].Item_Level
- Lea Ebx, [Eax + Eax + 15]
- Add [Edx].Item_Defense, Bl
- Jmp @AddBonusDef
- .ElseIf (ItemType == 13) && (ItemIndex == 4) ;DarkHorse
- @AddBonusDef:
- Movsx Eax, [Edx].Item_Level
- Shl Eax, 1 ;*2
- Add [Edx].Item_Defense, Al
- .EndIf
- assume edx:NOTHING
- assume ecx:NOTHING
- ret
- V_CItem_SetBonusByOptions EndP
- V_CItem_SetReqLevel Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, NewOption:Dword
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Savre structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx:Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov pThisItem, Ecx
- Mov MyStruct, Edx
- ;--------------------------------------
- ;Check if item need a required level
- ;--------------------------------------
- .If ([Ecx].ReqVars.ReqLevel != 0)
- ;----------------------------------
- ;item DarkHorse
- ;Calc: PetItemLevel*2+218
- ;-----------------------------------
- .If (ItemType == 13) && (ItemIndex == 4) ;DarkHorse
- Mov Eax, [Edx].Item_PetItemLevel
- Lea Ebx, [Eax + Eax + 218]
- Mov [Edx].Item_ReqLevel, Bx
- ;----------------------------------
- ;items Wings Spirit, Soul & Dragon
- ;Calc: ReqLevel+(ItemLvl*5)
- ;-----------------------------------
- .ElseIf (ItemType == 12) && (ItemIndex >= 3) && (ItemIndex < 6) ; items Wings Spirit, Soul & Dragon
- Movsx Eax, [Ecx].ReqVars.ReqLevel
- Movsx Ebx, [Edx].Item_Level
- imul ebx, ebx, 5
- add eax, ebx
- Mov [Edx].Item_ReqLevel, Ax
- ;-----------------------------------------
- ;Items: All Orbs + Jewel Chaos (WZ bug)
- ; or Item(Kor).txt that i have bug.
- ;Calc: No calc
- ;-----------------------------------------
- .ElseIf (ItemType == 13) && (ItemIndex >= 7) && (ItemIndex < 18)
- Movsx Eax, [Ecx].ReqVars.ReqLevel
- Mov [Edx].Item_ReqLevel, Ax
- ;----------------------------------
- ;All Items Type from 0 to 12
- ;This means (sets & weapons)
- ;Calc: ReqLevel+(ItemLvl*5)
- ;-----------------------------------
- .ElseIf (ItemType >= 0) && (ItemType > 12)
- Movsx Eax, [Ecx].ReqVars.ReqLevel
- Mov [Edx].Item_ReqLevel, Ax
- ;----------------------------------
- ;All rest of items
- ;Calc: ReqLevel+(ItemLvl*4)
- ;-----------------------------------
- .Else
- Movsx Eax, [Ecx].ReqVars.ReqLevel
- Movsx Ebx, [Edx].Item_Level
- Lea Eax, [Eax + Ebx * 4]
- Mov [Edx].Item_ReqLevel, Ax
- .Endif
- Jmp @Next
- .EndIf
- Mov [Edx].Item_ReqLevel, 0
- ;----------------------------------
- ;item "Transformation Ring"
- ;If level > 2, reqlvl = 50
- ;If level <= 2, Reqlvl = 20
- ;-----------------------------------
- @Next:
- .If (ItemType == 13) && (ItemIndex == 10) ;Transformation Ring
- .If ([Edx].Item_Level <= 2) ; || (BonusRequirementStats <= 2) (Removed for now)
- Mov [Edx].Item_ReqLevel, 20
- .Else
- Mov [Edx].Item_ReqLevel, 50
- .EndIf
- .EndIf
- ;-----------------------------------
- ;Bonus "NewOption" for all weapons
- ;and sets.
- ;Calc: ItemReqLevel + 20
- ;-----------------------------------
- Mov Eax, NewOption
- And Eax, 3FH
- .If (Eax != 0)
- .If (ItemType >= 0) && (ItemType < 12)
- Add [Edx].Item_ReqLevel, 20
- .EndIf
- .EndIf
- assume edx:NOTHING
- assume ecx:NOTHING
- ret
- V_CItem_SetReqLevel EndP
- V_CItem_SetRequiredStats Proc Uses Edx Ecx ItemType:Dword, ItemIndex:Dword
- Local BonusRequirementStats:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Savre structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx:Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov MyStruct, Edx
- Mov pThisItem, Ecx
- ;------------------------------------------------------
- ;Give bonus in base of "NewOption" & "SetOption"
- ;for required stats.
- ;Calc: ItemLevel + 25 = Bonus
- ;------------------------------------------------------
- .If ([Edx].Item_NewOption != 0) || ([Edx].Item_SetOption != 0)
- Movsx Eax, [Edx].Item_Level
- Add Eax, 25
- Mov BonusRequirementStats, Eax
- .Else
- Mov BonusRequirementStats, 0
- .EndIf
- ;------------------------------------------------------
- ;Set Requiered Strenght
- ;Calc: (((ItemLevel*3+Bonus)*ReqStrenght)*3/100)+20
- ;------------------------------------------------------
- .If ([Ecx].ReqVars.ReqStrenght != 0)
- Movsx Eax, [Ecx].ReqVars.ReqStrenght
- Movsx Ebx, [Edx].Item_Level
- IMul Ebx, Ebx, 3
- Add Ebx, BonusRequirementStats
- IMul Eax, Ebx
- IMul Eax, Eax, 3
- Xor Edx, Edx ;optimisation instead CDQ
- Mov Ecx, 100
- IDiv Ecx
- Add Eax, 20
- Mov Edx, MyStruct
- Mov [Edx].Item_ReqStr, Ax
- .Else
- Mov [Edx].Item_ReqStr, 0
- .EndIf
- Mov Ecx, pThisItem
- ;------------------------------------------------------
- ;Set Requiered Dexterity
- ;Calc: (((ItemLevel*3+Bonus)*ReqDex)*3/100)+20
- ;------------------------------------------------------
- .If ([Ecx].ReqVars.ReqDex != 0)
- Movsx Eax, [Ecx].ReqVars.ReqDex
- Movsx Ebx, [Edx].Item_Level
- IMul Ebx, Ebx, 3
- Add Ebx, BonusRequirementStats
- IMul Eax, Ebx
- IMul Eax, Eax, 3
- Xor Edx, Edx ;optimisation instead CDQ
- Mov Ecx, 100
- IDiv Ecx
- Add Eax, 20
- Mov Edx, MyStruct
- Mov [Edx].Item_ReqDex, Ax
- .Else
- Mov [Edx].Item_ReqDex, 0
- .EndIf
- mov ecx, pThisItem
- ;------------------------------------------------------
- ;Set Requiered Energy
- ;Calc: (((ItemLevel*3+Bonus)*ReqEner)*4/100)+20
- ;------------------------------------------------------
- .If ([Ecx].ReqVars.ReqEnergy != 0)
- Movsx Eax, [Ecx].ReqVars.ReqEnergy
- Movsx Ebx, [Edx].Item_Level
- IMul Ebx, Ebx, 3
- Add Ebx, BonusRequirementStats
- IMul Eax, Ebx
- Shl Eax, 2 ;*4 optimised instead of imul eax, eax, 4
- Xor Edx, Edx ;optimisation instead CDQ
- Mov Ecx, 100
- IDiv Ecx
- Add Eax, 20
- Mov Edx, MyStruct
- Mov [Edx].Item_ReqEner, Ax
- .Else
- Mov [Edx].Item_ReqEner, 0
- .EndIf
- mov ecx, pThisItem
- ;------------------------------------------------------
- ;Set Requiered Vitality
- ;Calc: (((ItemLevel*3+Bonus)*ReqVit)*3/100)+20
- ;
- ;Note: WZ add here a limit for only sets & weapons
- ; could have vitality requirement, this is
- ; removed here.
- ;------------------------------------------------------
- .If ([Ecx].ReqVars.ReqVitality != 0)
- Movsx Eax, [Ecx].ReqVars.ReqVitality
- Movsx Ebx, [Edx].Item_Level
- IMul Ebx, Ebx, 3
- Add Ebx, BonusRequirementStats
- IMul Eax, Ebx
- IMul Eax, Eax, 3
- Xor Edx, Edx ;optimisation instead CDQ
- Mov Ecx, 100
- IDiv Ecx
- Add Eax, 20
- Mov Edx, MyStruct
- Mov [Edx].Item_ReqVit, Ax
- .Else
- Mov [Edx].Item_ReqVit, 0
- .EndIf
- mov ecx, pThisItem
- ;------------------------------------------------------
- ;Set Requiered LeaderShip
- ;Calc: (((ItemLevel*3+Bonus)*ReqCmd)*3/100)+20
- ;
- ;Note: WZ add here a limit for only sets & weapons
- ; could have LeaderShip requirement, this is
- ; removed here.
- ;------------------------------------------------------
- .If ([Ecx].ReqVars.ReqLeaderShip != 0)
- Mov Eax, [Ecx].ReqVars.ReqLeaderShip
- Movsx Ebx, [Edx].Item_Level
- IMul Ebx, Ebx, 3
- Add Ebx, BonusRequirementStats
- IMul Eax, Ebx
- IMul Eax, Eax, 3
- Xor Edx, Edx ;optimisation instead CDQ
- Mov Ecx, 100
- IDiv Ecx
- Add Eax, 20
- Mov Edx, MyStruct
- Mov [Edx].Item_ReqLeaderShip, Ax
- .Else
- Mov [Edx].Item_ReqLeaderShip, 0
- .EndIf
- ;------------------------------------------------------
- ;Set LeaderShip for item "DarkRaven"
- ;Meaby this is bugged WZ thing, ill research
- ;it, but for now is included.
- ;
- ;Calc: PetLvl*15+185
- ;------------------------------------------------------
- Mov Edx, MyStruct
- Mov Ecx, pThisItem
- .If (ItemType == 13) && (ItemIndex == 5) ;DarkRaven
- Mov Eax, [Edx].Item_PetItemLevel
- IMul Eax, Eax, 15
- Add Eax, 185
- Mov [Edx].Item_ReqLeaderShip, Ax
- .EndIf
- assume edx:NOTHING
- assume ecx:NOTHING
- Ret
- V_CItem_SetRequiredStats EndP
- V_CItem_SetBonusForPendants Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Savre structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx: Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov MyStruct, Ecx
- Mov pThisItem, Edx
- ;---------------------------------------------
- ;Add options to Pendants !
- ;---------------------------------------------
- .If (ItemType >= 0) && (ItemType < 6)
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 12) ;Pendant of Lighting
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 13) ;Pendant of Fire
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 25) ;Pendant of Ice
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 26) ;Pendant of Wind
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 27) ;Pendant of Water
- Jmp @2
- .ElseIf (ItemType == 13) && (ItemType == 28) ;Pendant of Ability
- @2:
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 5
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 92 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- .If (ItemType == 5) ;Staffs
- Jmp @3
- .ElseIf (ItemType == 13) && (ItemType == 12) ;Pendant of Lighting
- Jmp @3
- .ElseIf (ItemType == 13) && (ItemType == 25) ;Pendant of Ice
- Jmp @3
- .ElseIf (ItemType == 13) && (ItemType == 27) ;Pendant of Water
- @3:
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 4
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 95 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 3
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 96 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- .Else
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 4
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 93 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 3
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 94 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 2
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 97 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 1
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 98 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 99 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- .EndIf
- assume edx:NOTHING
- assume ecx:NOTHING
- ret
- V_CItem_SetBonusForPendants EndP
- V_CItem_SetBonusForRings Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Savre structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx: Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov MyStruct, Ecx
- Mov pThisItem, Edx
- ;---------------------------------------------
- ;Add options to Rings !
- ;---------------------------------------------
- .If (ItemType >= 6) && (ItemType < 12)
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 08) ;Ring Ice
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 09) ;Ring Posion
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 21) ;Ring Fire
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 22) ;Ring Earth
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 23) ;Ring Wind
- Jmp @1
- .ElseIf (ItemType == 13) && (ItemType == 24) ;Ring Wind
- @1:
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 5
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 86 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 4
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 87 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 3
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 88 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 2
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 89 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- Sar Eax, 1
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 90 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 91 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- .EndIf
- ret
- assume edx:NOTHING
- assume ecx:NOTHING
- V_CItem_SetBonusForRings EndP
- V_CItem_SetSkillOpt Proc Uses Edx Ecx Option1:Dword
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Save structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx: Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov pThisItem, Ecx
- Mov MyStruct, Edx
- ;------------------------------------------------------
- ;Set If SkillOption is enabled.
- ;------------------------------------------------------
- .If (Option1 != 0)
- .If ([Ecx].UniversalVars.SkillType != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov Ebx, [Ecx].UniversalVars.SkillType
- Mov [[Edx].Item_Special + Eax], Bl ;Special[SpecialNum] (array)
- Mov [Edx].Item_Option1, 1
- .EndIf
- .EndIf
- ret
- assume edx:NOTHING
- assume ecx:NOTHING
- V_CItem_SetSkillOpt EndP
- V_CItem_SetOption2 Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, Option2:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Save structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx: Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov pThisItem, Ecx
- Mov MyStruct, Edx
- ;------------------------------------------------------
- ;Set If Option2 is abled and change Some Skill Types
- ;For some items, like weapons, sets and all wings.
- ;------------------------------------------------------
- .If (Option2 != 0)
- .If (ItemType >= 0) && (ItemType < 12) ;Weapons & Sets
- Jmp @SetOption
- .ElseIf (ItemType == 12) && (ItemIndex >= 0) && (ItemIndex <= 6) ;items Wings Elf, Satan, Heaven, Spirit, Soul, Dragon & Darkness
- Jmp @SetOption
- .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape Lord
- @SetOption:
- Mov [Edx].Item_Option2, 1
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 84 ;Special[SpecialNum] (array) (SKILL = Unknown)
- .EndIf
- .EndIf
- ret
- assume edx:NOTHING
- assume ecx:NOTHING
- V_CItem_SetOption2 EndP
- V_CItem_SetOption3 Proc Uses Edx Ecx ItemType:DWord, ItemIndex:DWord, Option3:DWord
- Local pThisItem:DWord
- Local MyStruct:DWord
- ;----------------------------------------------------
- ;Save structs into locals and assume.
- ;----------------------------------------------------
- Assume Edx: Ptr ItemStruct
- Assume Ecx:Ptr ITEM_ATTRIBUTE_STRUCT ;From Item.txt
- Mov pThisItem, Ecx
- Mov MyStruct, Edx
- ;------------------------------------------------------
- ;Set If Option3 is abled and change Some Skill Types
- ;And Required stats.
- ;For some items, like weapons, sets and all wings.
- ;------------------------------------------------------
- .If (Option3 != 0)
- .If (ItemType >= 0) && (ItemType < 4) ;Swords to Bows
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Increa Dmg Min Origin)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 5) ;Staffs
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 6) ;Shields
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 82 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType >= 7) && (ItemType < 11) ;Helms to Boots
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 83 ;Special[SpecialNum] (array) (SKILL = Bonus defense)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 13) && (ItemIndex == 24) ;Ring Of Magic
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 172 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- .ElseIf (ItemType == 13) && (ItemIndex == 28) ;Pendant of ability
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 173 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- .ElseIf (ItemType == 13) && (ItemIndex >= 20) && (ItemIndex <= 28) ;From ring Wizardy to Pendant Ability, excluding the 2 that are up
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape of lord
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 12) && (ItemIndex == 0) ;Wing of elf
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- .ElseIf (ItemType == 12) && (ItemIndex == 1) ;Wing of Heaven
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 12) && (ItemIndex == 2) ;Wing of Satan
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .ElseIf (ItemType == 12) && (ItemIndex == 3) ;Wing of Spirits
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 32
- .If ([Edx].Item_NewOption != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array) (SKILL = Unknown)
- .EndIf
- .ElseIf (ItemType == 12) && (ItemIndex == 4) ;Wings of Soul
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 32
- .If ([Edx].Item_NewOption != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array) (SKILL = Unknown)
- .EndIf
- .ElseIf (ItemType == 12) && (ItemIndex == 5) ;Wings of Dragon
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 85 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 32
- .If ([Edx].Item_NewOption != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Unknown)
- .EndIf
- .ElseIf (ItemType == 12) && (ItemIndex == 6) ;Wings of Darkness
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 81 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- Movsx Eax, [Edx].Item_NewOption
- And Eax, 32
- .If ([Edx].Item_NewOption != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Bonus Dmg Min)
- .EndIf
- .ElseIf (ItemType == 13) && (ItemIndex == 3) ;Horn of Dinorant
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 2
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 103 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- .EndIf
- Mov Eax, Option3
- And Eax, 4
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 97 ;Special[SpecialNum] (array) (SKILL = Unknown)
- Add [Edx].Item_SpecialNum, 1
- Add [Edx].Item_AttackSpeed, 5
- .EndIf
- Mov Eax, Option3
- And Eax, 1
- .If (Eax != 0)
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 104 ;Special[SpecialNum] (array) (SKILL = Dinorant Reduce attack dmg)
- .EndIf
- .ElseIf (ItemType == 13) && (ItemIndex == 30) ;Cape of Lord
- Movsx Eax, [Edx].Item_SpecialNum
- Mov [[Edx].Item_Special + Eax], 80 ;Special[SpecialNum] (array) (SKILL = Bonus Dmg Min)
- Mov Eax, Option3
- Mov [Edx].Item_Option3, Al
- And Eax, 0FFH ;To byte
- Shl Eax, 2 ;*4
- Add [Edx].Item_ReqStr, Ax
- .EndIf
- .EndIf
- assume edx:NOTHING
- assume ecx:NOTHING
- ret
- V_CItem_SetOption3 EndP