NPC-Funktion does't work

11/24/2014 00:56 MaStErIaKo#1
Hello EPvPers

I wanted to make a funktion for npc 20094 which would allow GM's to make items with bonuses they want. I made it like this:
Code:
quest Itemer begin
        state start begin
when 20094.click begin
        if pc . is_gm ( ) then
        say_title("Hello "..pc.get_name()..", create your own item.")
        say_title ( "Enter item ID." )
        local item_id = input ( )
        say_title ("Enter 1. bonus ID")
        say ("")
        local id_0 = input ( )
        say_title ("Enter 1. bonus value")
        say ("")
        local value_0 = input ( )
        say_title ("Enter 2. bonus id")
        say ("")
        local id_1 = input ( )
        say_title ("Enter 2. bonus value")
        say ("")
        local value_1 = input ( )
        say_title ("Enter 3. bonus ID")
        say ("")
        local id_2 = input ( )
        say_title ("Enter 3. bonus value")
        say ("")
        local value_2 = input ( )
        say_title ("Enter 4. bonus ID")
        say ("")
        local id_3 = input ( )
        say_title ("Enter 4. bonus value")
        say ("")
        local value_3 = input ( )
        say_title ("Enter 5. bonus ID")
        say ("")
        local id_4      = input ( )
        say_title ("Enter 5. bonus value")
        say ("")
        local value_4 = input ( )
        pc . give_item2 (item_id)
        item.set_value(0, id_0, value_0)
        item.set_value(1, id_1, value_1)
        item.set_value(2, id_2, value_2)
        item.set_value(3, id_3, value_3)
        item.set_value(4, id_4, value_4)
        end
But after reboot, i click on the npc and just nothing happens... No dialog. Nothing. Do you see any mistakes in the code?
I'll be grateful for every piece of advice.
Thank you,
Masteriako
11/24/2014 09:07 PhanToM.LorD#2
You have to change
when 20094.click begin
to
when 20094.chat."TEXT WHEN YOU SPEAK TO THE NPC" begin
11/24/2014 12:06 DerForenLeser#3
PHP Code:
quest Itemer begin
        state start begin
when 20094.chat
."GM Item" begin
        
if pc . is_gm ( ) then
        say_title
("Hello "..pc.get_name()..", create your own item.")
        
say_title ( "Enter item ID." )
        
local item_id = input ( )
        
say_title ("Enter 1. bonus ID")
        
say ("")
        
local id_0 = input ( )
        
say_title ("Enter 1. bonus value")
        
say ("")
        
local value_0 = input ( )
        
say_title ("Enter 2. bonus id")
        
say ("")
        
local id_1 = input ( )
        
say_title ("Enter 2. bonus value")
        
say ("")
        
local value_1 = input ( )
        
say_title ("Enter 3. bonus ID")
        
say ("")
        
local id_2 = input ( )
        
say_title ("Enter 3. bonus value")
        
say ("")
        
local value_2 = input ( )
        
say_title ("Enter 4. bonus ID")
        
say ("")
        
local id_3 = input ( )
        
say_title ("Enter 4. bonus value")
        
say ("")
        
local value_3 = input ( )
        
say_title ("Enter 5. bonus ID")
        
say ("")
        
local id_4      = input ( )
        
say_title ("Enter 5. bonus value")
        
say ("")
        
local value_4 = input ( )
        
pc . give_item2 (item_id)
        
item.set_value(0, id_0, value_0)
        
item.set_value(1, id_1, value_1)
        
item.set_value(2, id_2, value_2)
        
item.set_value(3, id_3, value_3)
        
item.set_value(4, id_4, value_4)
        
end
     end
end
end 
Should work