Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
- % - Simple Hat Upgrade System - %
- % By: Satan %
- *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
- ###########################################################
- * ItemInfo.txt: Hat and Source upgrade lines *
- * - You can change hat name, texture, attributes as well. *
- * - Texture used: White Death Crown *
- * - Change "XXXX" to your line id *
- ###########################################################
- XXXX Lv1 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 10 10 0 0 0 0 0 0 10 0 1,1 1,1 1,1 1,1 1,1 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv2 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 20 20 0 0 0 0 0 0 20 0 1,1 1,1 1,1 1,1 1,1 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv3 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 30 30 0 0 0 0 0 0 30 0 2,2 2,2 2,2 2,2 2,2 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv4 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 40 40 0 0 0 0 0 0 40 0 2,2 2,2 2,2 2,2 2,2 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv5 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 50 50 0 0 0 0 0 0 50 0 2,2 2,2 2,2 2,2 2,2 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv6 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 60 60 0 0 0 0 0 0 60 0 3,3 3,3 3,3 3,3 3,3 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv7 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 70 70 0 0 0 0 0 0 70 0 3,3 3,3 3,3 3,3 3,3 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv8 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 80 80 0 0 0 0 0 0 80 0 3,3 3,3 3,3 3,3 3,3 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 1,1 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv9 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 90 90 0 0 0 0 0 0 90 0 4,4 4,4 4,4 4,4 4,4 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 2,2 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Lv10 Demonic Argent Hat n1661 10110001 00000ZKyl1 00000ZKyl2 00000ZKyl3 00000ZKyl4 0 0 20 0 0 0 0 1 0 1 0 1 1 1 20000 -1,-2,-2,-2 100 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 100 100 0 0 0 0 0 0 100 0 5,5 5,5 5,5 5,5 5,5 0,0 0,0 0,0 0,0 0,0 50,50 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 3,3 0 7000,7000 20000,20000 3 0 0 0 0 0 0 0 0 0 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 Demonic Argent equipments 0
- XXXX Evil Crystal Source n2140 10130005 0 0 0 0 0 0 86 0 0 0 0 0 1 1 1 1 99 0 2 -1,-2,-2,-2 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 DemonicUpgrade 0 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 0,0 0 0 An energy source for all Demons. A necessity for Enchanting Demonic Argent Hat. 0
- --]]
- -- Functions.lua: That check if whole item on slot used for upgrade is Demonic Hat.
- -- Change "XXXX" to your hat ID in sequence. From low attributes to higher.
- CheckIsDemonic = function(role)
- local Hat = GetChaItem ( role , 2, 0 )
- local hatID = GetItemID (Hat)
- if hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX or hatID == XXXX then
- return 1
- end
- return 0
- end
- -- That check if any determined item is gemmed.
- VerifyIsGemmed = function(item)
- local EQ = {}
- local param = GetItemForgeParam(item, 1)
- param = TansferNum(param)
- EQ[1] = GetNum_Part1(param)
- EQ[2] = GetNum_Part2(param)
- EQ[3] = GetNum_Part3(param)
- EQ[4] = GetNum_Part4(param)
- EQ[5] = GetNum_Part5(param)
- EQ[6] = GetNum_Part6(param)
- EQ[7] = GetNum_Part7(param)
- return EQ
- end
- -- That transfer gems from equipment which you did check to new one.
- KeepGems = function(role, item, EQ)
- local param = GetItemForgeParam(item, 1)
- param = TansferNum(param)
- param = SetNum_Part1(param, EQ[1])
- param = SetNum_Part2(param, EQ[2])
- param = SetNum_Part3(param, EQ[3])
- param = SetNum_Part4(param, EQ[4])
- param = SetNum_Part5(param, EQ[5])
- param = SetNum_Part6(param, EQ[6])
- param = SetNum_Part7(param, EQ[7])
- SetItemForgeParam(item, 1, param)
- RefreshCha(role)
- end
- -- It's used to upgrade hat to a new one with better attributes, keeping gems.
- -- On "if" put your hat id starting with lower attributes
- -- In "local r1,r2" put hat id of hat which player will get after sucesfully upgrade.
- EvilSourceBegin = function(role)
- local Hat = GetChaItem ( role , 2, 0 )
- local hatID = GetItemID (Hat)
- local CheckGems = VerifyIsGemmed(Hat)
- local chanceLv2 = Percentage_Random ( 0.5 )
- local chanceLv3 = Percentage_Random ( 0.4 )
- local chanceLv4 = Percentage_Random ( 0.3 )
- local chanceLv5 = Percentage_Random ( 0.2 )
- local chanceLv6 = Percentage_Random ( 0.15 )
- local chanceLv7 = Percentage_Random ( 0.10 )
- local chanceLv8 = Percentage_Random ( 0.09 )
- local chanceLv9 = Percentage_Random ( 0.07 )
- local chanceLv10 = Percentage_Random ( 0.05 )
- if hatID == XXXX and chanceLv2 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv2")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv3 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv3")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv4 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv4")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv5 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv5")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv6 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv6")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv7 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv7")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv8 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv8")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv9 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv9")
- PlayEffect(role, 345)
- elseif hatID == XXXX and chanceLv10 == 1 then
- TakeItem(role, 0, hatID, 1)
- local r1,r2 = MakeItem ( role , XXXX , 1 , 4 )
- local itemNew = GetChaItem(role, 2, r2)
- KeepGems(role, itemNew, CheckGems)
- SystemNotice(role,"Congratulation! You have sucesfully enchanted Demonic Hat to Lv10")
- PlayEffect(role, 345)
- elseif hatID == XXXX then
- BickerNotice(role,"Demonic Hat arealdy enchated!")
- return
- else
- SystemNotice(role,"Enchanting failed..")
- PlayEffect(role, 346)
- end
- end
- -- Itemeffect.lua: Source function, used to upgrade hat.
- DemonicUpgrade = function(role, Item)
- local Item_CanGet = GetChaFreeBagGridNum ( role )
- if Item_CanGet < 2 then
- SystemNotice(role ,"You need to have at least 2 empty inventory slot")
- UseItemFailed ( role )
- return
- end
- local Cha_Boat = 0
- Cha_Boat = GetCtrlBoat ( role )
- if Cha_Boat ~= nil then
- SystemNotice( role , "Cannot use while sailing" )
- UseItemFailed ( role )
- return
- end
- local CanUpgradeHat = CheckIsDemonic(role)
- if CanUpgradeHat == 0 then
- BickerNotice(role,"Please put Demonic Hat on <1st> slot.")
- UseItemFailed ( role )
- return
- else
- EvilSourceBegin(role)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement