[Lua]awaken weapons By Npc

02/02/2019 14:35 chihab007#1
this is sempl scrept Alow you to awke a weapons
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

PHP Code:
function chihab_it1em_love_menu()

dlg_title"@90100301" )
dlg_text_without_quest_menu"@90100302" )
dlg_menu"@80010173""Quest_Link_119_1()" )
else
dlg_text"@90100302" )
    
local ihandlelvtexttext2commandenhancefprice
    
for 0do
        
handle get_wear_item_handle)
        if 
handle ~= 0 then
            lv 
get_item_levelhandle )
            
enhance =  get_item_enhancehandle )
            if 
lv == 0 then
set_item_level
handle )
            
end
            price 
get_item_pricehandle )
            if 
get_item_codehandle ) >= 3100020 and get_item_codehandle ) <= 3100026 then    
            
elseif get_item_codehandle ) >= 3100027 and get_item_codehandle ) <= 3100031 then
            end
                
if enhance ~= 0 then
                text 
sconv("@90010010""#@enhance_level@#",tostring(enhance) ,"#@item_name@#""@" .. tostringget_item_name_idget_item_codehandle ) ) ) , "#@item_Lv@#",tostring(lv))

                else
                    
text sconv("@90010011""#@item_name@#""@" .. tostringget_item_name_idget_item_codehandle ) ) ), "#@item_Lv@#",tostring(lv))
                
                
end
            
if price 20 then
            command 
'blo1zasa( ' .. handle .. ' )'
            
dlg_menutextcommand )
            
end

        end
 
    end
    
if get_env("game.cash_usable_server") == 0 then
    
else
    
end
    dlg_menu
"@90010002"'' )
    
dlg_show()
        
end

function blo1zasahandle )
handle get_wear_item_handle)                
item_code get_item_codehandle )
insert_awaken(handle,5,5)
local value_1 get_item_random_optionhandle)
local value_2 get_item_random_optionhandle)
if 
value_1 ~= and value_1 ~= -1 then
if value_1[1] == 96 and value_1[2] == 512 then
value_1
[3] = value_1[3]*2
set_item_random_option
handle1value_1[1], value_1[2], value_1[3] )
end
if value_2[1] == 96 and value_2[2] == 1024 then
value_2
[3] = value_2[3]*2
set_item_random_option
handle2value_2[1], value_2[2], value_2[3] )
end
end        
text 
sconv("Awk Sec""#@item_name@#""@" .. tostringget_item_name_idget_item_codehandle ) ) ))
cprinttext )
chihab_item_love_menu()    
end 
09/14/2019 22:37 petirzero77#2
hello..would you mind to guide & explain further how to use this script. where to execute it. im really confuse on this..

copy all this code into notepad++ and paste into where?

thanks
09/15/2019 09:57 InkDevil#3
Quote:
Originally Posted by petirzero77 View Post
hello..would you mind to guide & explain further how to use this script. where to execute it. im really confuse on this..

copy all this code into notepad++ and paste into where?

thanks
[Only registered and activated users can see links. Click Here To Register...]

The first part is a copied and edited NPC-Dialog, just except upgrading levels it connects to the second function.
(Just by the way, if I read the function correctly, it will also awake armors and belts.)

The second function is a copied function which in original re-sets defense random-stats of some older UG-Gear.
In his function it inserts awaken-stats (as wished for weapons it works fine) + doubles identified random-stats, if they're non-percent p.def and m.def, but it does without any limiter.


If I'm wrong, you can correct me ;)

Edit: It won't work via copy&paste since the executing function has also an issue.
09/17/2019 01:10 thefear511#4
Quote:
Originally Posted by petirzero77 View Post
hello..would you mind to guide & explain further how to use this script. where to execute it. im really confuse on this..

copy all this code into notepad++ and paste into where?

thanks
check my signature for npc help it might lead you to the way
09/17/2019 21:18 InkDevil#5
Code:
function any_func_name_main()
	
	dlg_title("NPC Name")
		dlg_text("I will (re-)awake your weapon.<br>Choose which one!")
		for i= 0,1 do
			local handle = get_wear_item_handle(i)
			if handle ~= 0 and handle ~= -1 then
				dlg_menu( get_item_name_by_code(get_item_code(handle)), 'any_func_name_sub('..i..','..handle..')')
			end
		end
		dlg_menu("@90010002",'')
	dlg_show()
end

function any_func_name_sub( index, i_handle)
	local handle = get_wear_item_handle(index)
	if handle == i_handle then
		delete_awaken(handle)
		insert_awaken(handle,5,5)
		message("(Re-)Awakening was successful!")
	else
		message("You are not allowed to switch your equip during this process!")
	end
	any_func_name_main()
end
If you need an alternative right now. @[Only registered and activated users can see links. Click Here To Register...]
And use the advice thefear511 gave you.
09/27/2019 12:59 petirzero77#6
dear everyone..
thanks for the advice given..im now currently learning of basic .lua to help me improve my understanding on .lua language.

at the same time i'll keep following the guides given by @[Only registered and activated users can see links. Click Here To Register...] and @[Only registered and activated users can see links. Click Here To Register...]11

thanks
02/07/2020 12:11 stringofbean#7
hey

i am using the weapon awaken code. on screen it changes all the start right but it dont change the players stats so not sure if i doing something wrong or not. im kinda new to .lua so im learning as i go with some success just hit a wall with the awakenings.

thanks for any help
09/02/2020 02:03 tito2022#8
Quote:
Originally Posted by InkDevil View Post
Code:
function any_func_name_main()
	
	dlg_title("NPC Name")
		dlg_text("I will (re-)awake your weapon.<br>Choose which one!")
		for i= 0,1 do
			local handle = get_wear_item_handle(i)
			if handle ~= 0 and handle ~= -1 then
				dlg_menu( get_item_name_by_code(get_item_code(handle)), 'any_func_name_sub('..i..','..handle..')')
			end
		end
		dlg_menu("@90010002",'')
	dlg_show()
end

function any_func_name_sub( index, i_handle)
	local handle = get_wear_item_handle(index)
	if handle == i_handle then
		delete_awaken(handle)
		insert_awaken(handle,5,5)
		message("(Re-)Awakening was successful!")
	else
		message("You are not allowed to switch your equip during this process!")
	end
	any_func_name_main()
end
If you need an alternative right now. @[Only registered and activated users can see links. Click Here To Register...]
And use the advice thefear511 gave you.
how can i make that work for acc too ?