Jump to content
Danny

Note Scripts [Instant 110% Apparel, Reforge, Buff, Bank, Repair, Forge, ETC.]

Recommended Posts

Hi, I'm releasing some note scripts I have in my folder from ToP, not sure who made them but I have a big collection of scripts I'll be releasing either way. Enjoy :)

 

Instant Apparel 110% Note - Create an item in ItemInfo (probably a note since we already themed it that way) with the ItemUse "ItemUse_FusionNote" and change the slots if you wish to put other slots but basically you need the old item you want to fuse to the apparel at 1st slot 2nd row and the apparel at 2nd slot 2nd row , easy code to understand. Obviously add that code to ItemEffect.lua.

 

function ItemUse_FusionNote(role,Item)
local FuseItem = GetChaItem ( role , 2 , 0 )
local FuseTo = GetChaItem ( role , 2 , 1 )
local FuseItemLevelID = GetItemAttr ( FuseItem , ITEMATTR_VAL_FUSIONID )
local FuseItemLevel = 15 -- 110%
local maxure = GetItemAttr ( FuseItem , ITEMATTR_MAXURE )
local maxforge = GetItemAttr ( FuseItem , ITEMATTR_MAXFORGE )
local maxenergy = GetItemAttr ( FuseItem , ITEMATTR_MAXENERGY )
local ure = GetItemAttr ( FuseItem , ITEMATTR_URE )
local forge = GetItemAttr ( FuseItem , ITEMATTR_FORGE )
local energy = GetItemAttr ( FuseItem , ITEMATTR_ENERGY )
local def = GetItemAttr ( FuseItem , ITEMATTR_VAL_DEF )
local pr = GetItemAttr ( FuseItem , ITEMATTR_VAL_PDEF )
local dodge = GetItemAttr ( FuseItem , ITEMATTR_VAL_FLEE )
local hr = GetItemAttr ( FuseItem , ITEMATTR_VAL_HIT )
local mnatk = GetItemAttr ( FuseItem , ITEMATTR_VAL_MNATK )
local mxatk = GetItemAttr ( FuseItem , ITEMATTR_VAL_MXATK )
local FuseItemID = GetItemID(FuseItem)
local FuseToItemID = GetItemID(FuseTo)
local FuseItemType = GetItemType2(FuseItemID)
local FuseToType = GetItemType2(FuseToItemID)
local HowManyItemHas = CheckBagItem(role,FuseItemID)
if HowManyItemHas > 1 then
SystemNotice(role,"You can't have ["..HowManyItemHas.."] of the equipment you want to fuse {"..GetItemName(FuseItemID).."}")
UseItemFailed(role)
return 0
end
if FuseItemID > 5000 then
FuseItemID = FuseItemLevelID
end
if FuseToItemID < 5000 then
SystemNotice(role,"Please Insert an apparel")
UseItemFailed(role)
return 0
end
local ItemType_FuseItem = GetItemType ( FuseItem )
local ItemType_FuseTo = GetItemType ( FuseTo )
local star=0
if ItemType_FuseItem ~= 22 and ItemType_FuseTo ~=27 then
star = 1
end
if ItemType_FuseItem~=27 then
if ItemType_FuseTo ~= ItemType_FuseItem then
SystemNotice( role ,"Both equipment type mismatch" )
UseItemFailed(role)
return 0
end
elseif ItemType_FuseItem==27 and star == 1 then
SystemNotice( role ,"Both equipment type mismatch" )
UseItemFailed(role)
return 0
end
local ClassAndType = CheckFusionItem( FuseItem , FuseTo )
if ClassAndType == LUA_FALSE then
SystemNotice( role ,"Both equipment type or class requirement does not match" )
UseItemFailed(role)
return 0
end
if FuseItemType ~= FuseToType then
SystemNotice(role,"The Equipment does not match the apparel type")
UseItemFailed(role)
return 0
end
SetItemAttr( FuseTo , ITEMATTR_VAL_FUSIONID , FuseItemID )
SetItemAttr ( FuseTo , ITEMATTR_VAL_LEVEL , FuseItemLevel )
SetItemAttr( FuseTo , ITEMATTR_MAXURE , maxure )
SetItemAttr ( FuseTo , ITEMATTR_MAXFORGE , maxforge )
SetItemAttr( FuseTo , ITEMATTR_MAXENERGY , maxenergy )
SetItemAttr ( FuseTo , ITEMATTR_URE , ure )
SetItemAttr( FuseTo , ITEMATTR_FORGE , forge )
SetItemAttr ( FuseTo , ITEMATTR_ENERGY , energy )
SetItemAttr( FuseTo , ITEMATTR_VAL_DEF , def )
SetItemAttr ( FuseTo , ITEMATTR_VAL_PDEF , pr )
SetItemAttr( FuseTo , ITEMATTR_VAL_FLEE , dodge )
SetItemAttr ( FuseTo , ITEMATTR_VAL_HIT , hr )
SetItemAttr( FuseTo , ITEMATTR_VAL_MNATK , mnatk )
SetItemAttr ( FuseTo , ITEMATTR_VAL_MXATK , mxatk )
-- Reforge
local oldparam = GetItemForgeParam(FuseItem, 1)
local param = GetItemForgeParam(FuseTo, 1)
local Item_Stone = { }
local Item_StoneLv = { }
oldparam = TansferNum(oldparam)
param = TansferNum(param)
Sockets = GetNum_Part1(oldparam)
Item_Stone[0] = GetNum_Part2(oldparam)
Item_Stone[1] = GetNum_Part4(oldparam)
Item_Stone[2] = GetNum_Part6(oldparam)
Item_StoneLv[0] = GetNum_Part3(oldparam)
Item_StoneLv[1] = GetNum_Part5(oldparam)
Item_StoneLv[2] = GetNum_Part7(oldparam)
param = SetNum_Part1(param, Sockets)
param = SetNum_Part2(param, Item_Stone[0])
param = SetNum_Part3(param, Item_StoneLv[0])
param = SetNum_Part4(param, Item_Stone[1])
param = SetNum_Part5(param, Item_StoneLv[1])
param = SetNum_Part6(param, Item_Stone[2])
param = SetNum_Part7(param, Item_StoneLv[2])
SetItemForgeParam(FuseTo, 1, param)
RefreshCha(role)
DelBagItem(role,GetItemID(FuseItem),1)
end

This one is pretty much the same, but instead of apparel its weapons so say you have uns 65 weapon and drop uns 75, with this note you can reforge all the gems from 65 to 75 easily (Same slots.)

 

function ItemUse_ReforgeNote(role,Item)
local Deforge = GetChaItem ( role , 2 , 0 )
local FrogeTo = GetChaItem ( role , 2 , 1 )
local Deforge_type = GetItemType2(GetItemID(Deforge))
local ForgeTo_type = GetItemType2(GetItemID(FrogeTo))
if Deforge_type > 26 or ForgeTo_type > 26 then
SystemNotice(role,"Please put an equipment!")
UseItemFailed(role)
return 0
end
if Deforge_type ~= ForgeTo_type then
SystemNotice(role,"Item type on slot [1] not the same as slot [2]. Reforge failed!")
UseItemFailed(role)
return 0
end
local param = GetItemForgeParam(Deforge, 1)
local ForgteTo_param = GetItemForgeParam(FrogeTo, 1)
local Item_Stone = { }
local Item_StoneLv = { }
param = TansferNum(param)
ForgteTo_param = TansferNum(ForgteTo_param)
-- Gets every gem from item on slot 2
Sockets = GetNum_Part1(param)
Item_Stone[0] = GetNum_Part2(param)
Item_Stone[1] = GetNum_Part4(param)
Item_Stone[2] = GetNum_Part6(param)
Item_StoneLv[0] = GetNum_Part3(param)
Item_StoneLv[1] = GetNum_Part5(param)
Item_StoneLv[2] = GetNum_Part7(param)
if Item_Stone[1] == 0 and Item_Stone[1] == 0 and Item_Stone[2] == 0 then
SystemNotice(role,"The item you desire to deforge is empty. Reforge failed!")
UseItemFailed(role)
return 0
end
local DeforgeItemName = GetItemName(GetItemID(Deforge))
local ForgeItemName = GetItemName(GetItemID(FrogeTo))
-- Forge Item on slot 2
ForgteTo_param = SetNum_Part1(ForgteTo_param, Sockets)
ForgteTo_param = SetNum_Part2(ForgteTo_param, Item_Stone[0])
ForgteTo_param = SetNum_Part3(ForgteTo_param, Item_StoneLv[0])
ForgteTo_param = SetNum_Part4(ForgteTo_param, Item_Stone[1])
ForgteTo_param = SetNum_Part5(ForgteTo_param, Item_StoneLv[1])
ForgteTo_param = SetNum_Part6(ForgteTo_param, Item_Stone[2])
ForgteTo_param = SetNum_Part7(ForgteTo_param, Item_StoneLv[2])
SetItemForgeParam(FrogeTo, 1, ForgteTo_param)
-- Remove Gems from old Eq
param = SetNum_Part1(param, Sockets)
param = SetNum_Part2(param, 0)
param = SetNum_Part3(param, 0)
param = SetNum_Part4(param, 0)
param = SetNum_Part5(param, 0)
param = SetNum_Part6(param, 0)
param = SetNum_Part7(param, 0)
SetItemForgeParam(Deforge, 1, param)
-------------------------------------
RefreshCha(role)
SystemNotice(role,"Succesfully moved gems from ["..DeforgeItemName.."] to {{"..ForgeItemName.."}}")
end

Here is a bonus function that you can use anywhere to reforge ( NPCs or Command or whatever you desire) The arguments are self explanatory.

 

function GiveForgedItem( role , Item , Sockets , gem1 , lv1 , gem2 , lv2 , gem3 , lv3 )
local ForgedPlayer = role
r1, r2 = MakeItem ( ForgedPlayer , Item , 1 , 4 )
local Armor = GetChaItem2(ForgedPlayer, 2 , r2 )
local param = GetItemForgeParam(Armor, 1)
local Item_Stone = { }
local Item_StoneLv = { }
if gem1 ~= nil then
param = TansferNum(param)
Item_Stone[0] = GetNum_Part2(param)
Item_StoneLv[0] = GetNum_Part3(param)
Item_Stone[0] = gem1 -- Gem ID
Item_StoneLv[0] = lv1 -- Gem Lv
param = SetNum_Part2(param, Item_Stone[0]) -- Forge gem [Slot 1]
param = SetNum_Part3(param, Item_StoneLv[0]) -- Set gem Lv [Slot 1]
SetItemForgeParam(Armor, 1, param)
end
if gem2 ~= nil then
param = TansferNum(param)
Item_Stone[1] = GetNum_Part2(param)
Item_StoneLv[1] = GetNum_Part3(param)
Item_Stone[1] = gem2 -- Gem ID
Item_StoneLv[1] = lv2 -- Gem Lv
param = SetNum_Part4(param, Item_Stone[1]) -- Forge gem [Slot 1]
param = SetNum_Part5(param, Item_StoneLv[1]) -- Set gem Lv [Slot 1]
SetItemForgeParam(Armor, 1, param)
end
if gem3 ~= nil then
param = TansferNum(param)
Item_Stone[2] = GetNum_Part2(param)
Item_StoneLv[2] = GetNum_Part3(param)
Item_Stone[2] = gem3 -- Gem ID
Item_StoneLv[2] = lv3 -- Gem Lv
param = SetNum_Part6(param, Item_Stone[2]) -- Forge gem [Slot 1]
param = SetNum_Part7(param, Item_StoneLv[2]) -- Set gem Lv [Slot 1]
SetItemForgeParam(Armor, 1, param)
end
--- Add socket --
local Socket = GetItemForgeParam(Armor, 1)
Socket = TansferNum(Socket)
Socket = SetNum_Part1(Socket, Sockets)
SetItemForgeParam(Armor, 1, Socket)
RefreshCha(ForgedPlayer)
end

 

Next is Buff Note, basically gives you all buffs instead of an NPC or a Buffer, also pretty self-explanatory.

 

--Add to ItemInfo.txt
7000	Buff Ticket	n1481	10130001	0	0	0	0	0	00	31	0	0	0	0	0	1	1	1	1	99	0	200	-1	0	-1 0 0 -1 -1 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,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 ItemUse_buffticket 0 0 0 0 0 0 Double click to get all buffs in 5 minutes.


--Add to itemeffect.lua

function ItemUse_buffticket( role , Item )
local Cha_Boat = GetCtrlBoat(role)
if Cha_Boat ~= nil then
SystemNotice(role , "Not usable on the sea." )
UseItemFailed (role)
return
end
local buff1 = GetChaStateLv(role,STATE_SHPF)
local buff2 = GetChaStateLv(role,STATE_XLZH)
local buff3 = GetChaStateLv(role,STATE_TSHD)
local buff4 = GetChaStateLv(role,STATE_FZLZ)
local buff5 = GetChaStateLv(role,STATE_MLCH)
if buff1 >= 1 or buff2 >= 1 or buff3 >= 1 or buff4 >= 1 or buff5 >= 1 then
SystemNotice(role,"Only you can use this ticket after duration of buffs end.")
UseItemFailed(role)
return
end
local del_item = DelBagItem( role , 7000 , 1 )
if del_item == 1 then
AddState ( role , role , STATE_SHPF  , 10 , 600 )
AddState ( role , role , STATE_XLZH  , 10 , 600 )
AddState ( role , role , STATE_TSHD  , 10 , 600 )
AddState ( role , role , STATE_FZLZ  , 10 , 600 )
AddState ( role , role , STATE_MLCH  , 10 , 600 )
BickerNotice( role , "You recived Harden, Spiritual Fire, Tempest Bolt, Angelic Shield, Intense Magic for 5 minutes!" )
end
 
end

 

Last but not least, here is a bunch of notes that help you do stuff if you're far from the NPC, such as Bank Note, Repair Note, Forge Note, Fusion Note, Apparel Fusion Note, Apparel Upgrade Note and Gem Extract Note.

 

--Iteminfo.txt
------------

7658    Bank Note       n1480   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_bank    0       0       0       0,0     0,0     0,0     Opens your Bank 0       
7266    Repair Note     n0761   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Repair  0       0       0       0,0     0,0     0,0     Item Used to repair items       0       
7267    Forge Note	n0869   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Forge   0       0       0       0,0     0,0     0,0     Opens Item Forge Screen 0       
7268    Fusion Note	n0893   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Fusion  0       0       0       0,0     0,0     0,0     Opens Item Fusing Screen        0       
7269    Apparel Fusion Note     n0912   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Appfuse 0       0       0       0,0     0,0     0,0     Opens Aparel Forging Screen     0       
7269    Apparel Upgrade Note    n1061   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Appupg  0       0       0       0,0     0,0     0,0     Opens Apparel Upgrading Screen  0       
7270    Gem Extract Note        n0931   10130001        0       0       0       0       0       0       31      0       0       0       0       0       1       1       1       1       99      0       50      -1,-2,-2,-2     0       -1,-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       ItemUse_Extract 0       0       0       0,0     0,0     0,0     Opens Gem extracting screen     0       

--Itemeffect.lua
--------------

function ItemUse_bank ( role )
            OpenBank( role, role )
end
 
function ItemUse_Repair ( role )
        OpenRepair( role, role)
end
 
function ItemUse_Forge ( role )
        OpenForge( role, role )
end
 
function ItemUse_Fusion ( role )
        OpenMilling( role, role )
end
 
function ItemUse_AppFuse ( role )
        OpenFusion( role, role )
end
 
function ItemUse_Appupg ( role )
        OpenUpgrade( role, role )
end
 
function ItemUse_Extract ( role )
        OpenGetStone( role, role )
end

 

Credits to Saeed & Harambe.

 

Enjoy, more scripts will come SoonTM.

 

~Danny

Edited by Danny
  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...