[Script] Forge +17 in npc
2 participantes
Página 1 de 1
[Script] Forge +17 in npc
**Add in NPCSDK.LUA
**Add in MissionSdk.lua
**Add in NpcScript
**Add in AttrCalculate.lua
**Para Mudar as gems vai em StoneInfo.txt e pegue o ID e troke a onder ta escrito gem1, gem2 e gem3.
- Código:
elseif item.func == forgi then
return forgi(character,npc)
**Add in MissionSdk.lua
- Código:
elseif actions[i].func == forgi then
local ret = forgi( character )
if ret ~= LUA_TRUE then
return LUA_FALSE
end
**Add in NpcScript
- Código:
function uns_sell2()
Talk( 1, "Maggie: Hello I'm Equipment seller of Dream City here you find unseals, necklaces, rings etc.")
--Text( 1, "Trade unsealed 75/85", SendExchangeData )
--Text( 1, "Unsealed 45/65", BuyPage )
Text( 1, "Forge uns 65", JumpPage , 2 )
Talk( 2, "Uns 65(weapon) Broken lv 7 e Craked lv 7 e chipped lv 3_Uns 65(Armor) Broken lv 5 e Craked lv 5 e chipped lv 1_ put your Item in the 1st bag, need 10m")
InitTrigger()
TriggerCondition( 1, HasMoney, 1000000 )
TriggerAction( 1, forgi )
TriggerFailure( 1, JumpPage, 9 )
Text( 2, "Forge", MultiTrigger, GetMultiTrigger(), 1)
end
**Add in AttrCalculate.lua
- Código:
function ForgePlayer( name , Item , Sockets , gem1 , lv1 , gem2 , lv2 , gem3 , lv3 )
local ForgedPlayer = GetPlayerByName(name)
GiveItem(ForgedPlayer,0,Item,1,18)
local Armor = GetChaItem2(ForgedPlayer,2,Item)
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 2]
param = SetNum_Part5(param, Item_StoneLv[1]) -- Set gem Lv [Slot 2]
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 3]
param = SetNum_Part7(param, Item_StoneLv[2]) -- Set gem Lv [Slot 3]
SetItemForgeParam(Armor, 1, param)
end
local Socket = GetItemForgeParam(Armor, 1)
Socket = TansferNum(Socket)
Socket = SetNum_Part1(Socket, Sockets)
SetItemForgeParam(Armor, 1, Socket)
RefreshCha(ForgedPlayer)
end
function forgi( role )
local cha_job = GetChaAttr(role, ATTR_JOB)
local item_bg = GetChaItem(role,2,0)
local item_id = GetItemID(item_bg)
local money = GetChaAttr ( role , ATTR_GD )
local need_money = 10000000
if money < need_money then
HelpInfo(role,0,"You need 10m")
return
end
local Item = 0
local gem1 = 0
local lv1 = 0
local gem2 = 0
local lv2 = 0
local gem3 = 0
local lv3 = 0
if cha_job == 8 then
if item_id ~= 773 and item_id ~= 766 then
HelpInfo(role,0,"Add your Hamer or armor lv 65 in the 1st bag!")
return
end
if item_id == 773 then
TakeMoney(role,0,10000000)
gem1 = 64
lv1 = 7
gem2 = 65
lv2 = 7
gem3 = 66
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
elseif cha_job == 9 then
if item_id ~= 776 and item_id ~= 769 then
HelpInfo(role,0,"Add your sword or armor lv 65 in the 1st bag!")
return
end
if item_id == 776 then
TakeMoney(role,0,10000000)
gem1 = 64
lv1 = 7
gem2 = 65
lv2 = 7
gem3 = 66
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
elseif cha_job == 12 then
if item_id ~= 784 and item_id ~= 780 then
HelpInfo(role,0,"Add your Gum or armor lv 65 in the 1st bag!")
return
end
if item_id == 784 then
TakeMoney(role,0,10000000)
gem1 = 58
lv1 = 7
gem2 = 59
lv2 = 7
gem3 = 60
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
elseif cha_job == 13 then
if item_id ~= 788 and item_id ~= 792 then
HelpInfo(role,0,"Add your Staff or armor lv 65 in the 1st bag!")
return
end
if item_id == 788 then
TakeMoney(role,0,10000000)
gem1 = 67
lv1 = 7
gem2 = 68
lv2 = 7
gem3 = 69
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
elseif cha_job == 14 then
if item_id ~= 795 and item_id ~= 798 then
HelpInfo(role,0,"Add your Staff or armor lv 65 in the 1st bag!")
return
end
if item_id == 795 then
TakeMoney(role,0,10000000)
gem1 = 67
lv1 = 7
gem2 = 68
lv2 = 7
gem3 = 69
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
elseif cha_job == 16 then
if item_id ~= 802 and item_id ~= 806 then
HelpInfo(role,0,"Add your dagger or armor lv 65 in the 1st bag!")
return
end
if item_id == 802 then
TakeMoney(role,0,10000000)
gem1 = 67
lv1 = 7
gem2 = 68
lv2 = 7
gem3 = 69
lv3 = 1
else
TakeMoney(role,0,10000000)
gem1 = 61
lv1 = 5
gem2 = 62
lv2 = 5
gem3 = 63
lv3 = 1
end
end
local Sockets = 3
--GiveItem(role,0,Item,1,18)
RemoveChaItem ( role , item_id , 1 , 2 , 0 , 2 , 1 , 0 )
RefreshCha(role)
local r1 = 0
local r2 = 0
r1,r2 = MakeItem ( role , item_id , 1 , 2 )
local Armor = GetChaItem ( role , 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 2]
param = SetNum_Part5(param, Item_StoneLv[1]) -- Set gem Lv [Slot 2]
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 3]
param = SetNum_Part7(param, Item_StoneLv[2]) -- Set gem Lv [Slot 3]
SetItemForgeParam(Armor, 1, param)
end
local Socket = GetItemForgeParam(Armor, 1)
Socket = TansferNum(Socket)
Socket = SetNum_Part1(Socket, Sockets)
SetItemForgeParam(Armor, 1, Socket)
RefreshCha(role)
end
**Para Mudar as gems vai em StoneInfo.txt e pegue o ID e troke a onder ta escrito gem1, gem2 e gem3.
IgorS*Dev- Admin
- Mensagens : 8
Data de inscrição : 14/12/2013
Idade : 28
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos