Jump to content

Recommended Posts

  • Premium

quest find_squareguard begin
        state start begin
        end

        state run begin
                when login with pc.level<=5 begin
                        set_state(find)
                end
        end
        state find begin
                when letter begin
                        local find_npc_vnum = 9001
                        if pc.get_empire()==1 then
                                find_npc_vnum = 11000
                        elseif pc.get_empire()==2 then
                                find_npc_vnum = 11002
                        elseif pc.get_empire()==3 then
                                find_npc_vnum = 11004
                        end

                        local v=find_npc_by_vnum(find_npc_vnum)
                        if 0==v then
                        else
                                target.vid("__TARGET__", v, "Weapon Dealer")
                        end
                end
                when letter begin
                        send_letter("The Weapon Dealer")
                end
                when button or info begin
                        say_title("The Weapon Dealer")
                        say("")
                        say("Approach the center of the village and speak to the Weapon Dealer.")
                        say("")
                end
                when __TARGET__.target.click begin
                        target.delete("__TARGET__")
                        say_title("The Weapon Dealer:")
                        ----"123456789012345678901234567890123456789012345678901234567890"|
                        say("")
                        say("Welcome to our village adventurer!")
                        say("I hope that you are able to perform a task for me?")
                        say("")
                        say("If I give you 200 Yang, would you go to the General Store")
                        say("and buy me a red potion?")
                        say("")
			say("Unfortunately, I must stay here.")
                        say("")
                        say("Use your mini map to locate the General Store using the")
                        say("blinking red dot.")
                        say("")
			wait()
			say_title("Task Information:")
			say("")
			----"123456789012345678901234567890123456789012345678901234567890"|
			say("You have received 200 Yang from the Weapon Dealer. Go to the")
			say("General Store and purchase a Red Potion. You can use Yang")
			say("to purchase items and services from various villagers.")
			say("")
			pc.changemoney(200)
			set_state(buy)
                end
        end
        state buy begin
                when letter begin
                        send_letter("Buy a Red potion")

                        local v=find_npc_by_vnum(9003)
                        if v!=0 then
                                target.vid("__TARGET__", v, mob_name(9003))
                        end

                end
                when button or info begin
                        say_title("Task Information:")
                        say("")
                        say("Buy a Red potion at the General Store and return with")
                        say("it to the Weapon Dealer.")
                        say("")

                end
                when 9001.chat."Where can I buy a red potion?" begin
                        say_title("The Weapon Dealer:")
                        say("")
                        say("You can buy one at the General Store. Her location is")
                        say("indicated on the minimap by a blinking red dot.")
                        say("")
                end
                when __TARGET__.target.click  begin
                        target.delete("__TARGET__")
                        say_title("General Store:")
                        say("")
                        ----"123456789012345678901234567890123456789012345678901234567890"|
                        say("Welcome!")
                        say("")
                        say("Oh, so the Weapon Dealer has sent you? He needs a red potion?")
                        say("I will give you 5 Red potions.")
                        say("")
                        say("Here you are. These are for the regeneration of Health")
                        say("Points (HP) and are quite tasty.")
                        say("")
                        say("")
                        wait()
                        say_title("General Store:")
                        say("")
                        ----"123456789012345678901234567890123456789012345678901234567890"|
                        say("You may be new, but I am confident that you will be a regular")
                        say("customer soon. That is why these potions are for free now.")
                        say("")
                        say("Please come again.")
                        say("")
                        say_title("Task Information:")
                        say("")
                        say("You have received 5 red potions from the General Store.")
                        say("Red potions regenerate your Health Points (HP).")
                        say("")
                        pc.give_item2(27001,5)
                        setstate(deliver)
                end
        end
        state deliver begin
                when letter begin
                	send_letter("Return to the Weapon Dealer")
                        local find_npc_vnum = 9001
                        if pc.get_empire()==1 then
                                find_npc_vnum = 11000
                        elseif pc.get_empire()==2 then
                                find_npc_vnum = 11002
                        elseif pc.get_empire()==3 then
                                find_npc_vnum = 11004
                        end

                        local v=find_npc_by_vnum(find_npc_vnum)
                        if 0==v then
                        else
                                target.vid("__TARGET__", v, mob_name(find_npc_vnum))
                        end
                end
                when button or info begin
                        say_title("Task Information:")
                        say("")
                        say("Return to the Weapon Dealer and give him his potions.")
                        say("")
                end
                when __TARGET__.target.click begin
			target.delete("__TARGET__")
                	if pc.countitem(27001)<1 then
				target.delete("__TARGET__")
				say_title("The Weapon Dealer:")
				say("")
				----"123456789012345678901234567890123456789012345678901234567890"|
				say("So you did not acquire the red potion I asked for?")
				say("")
				say("Never mind, I will allow you to keep the Yang anyway. But")
				say("you won't go very far if you keep avoiding your work.")
				say("")
				say("By the way, the teachers have asked for you.")
				say("They would like to meet you.")
				say("")
			else
				say_title("Weapon Dealer:")
				say("")
				----"123456789012345678901234567890123456789012345678901234567890"|
				say("Thank you for the potion! Now I am better prepared to do my")
				say("duty to the village.")
				say("")
				say("I am not only the village Weapon Dealer, but a valuable source")
				say("of information. I announce useful information for all to")
				say("hear, and I offer my help and protection to those who need")
				say("it. I am also responsible for Guild business.")
				say("")
				say("If you become interested in founding your own Guild some")
				say("day, come to me.")
				say("")
				wait()
				say_title("The Weapon Dealer:")
				say("")
				say("By the way, the teachers asked for you. They would like")
				say("to meet you.")
				say("")
				say("Oh, I nearly forgot! As sign of my appreciation, you may")
				say("keep the change from the money and this little gift.")
				say("")
				say("See you soon.")
				say("")
				if pc.get_job() == 0 then -- Warrior
					pc.give_item2("19")
					pc.give_item2("11206")	
					pc.give_item2("12206")
				elseif pc.get_job() == 1 then -- Assassin
					pc.give_item2("1009")
					pc.give_item2("11406")
					pc.give_item2("12346")
				elseif pc.get_job() == 2 then -- Sura
					pc.give_item2("19")
					pc.give_item2("11606")
					pc.give_item2("12486")
				elseif pc.get_job() == 3 then -- Mage
					pc.give_item2("7009")
					pc.give_item2("11806")
					pc.give_item2("12626")
				end
					pc.give_item2("27002",50)
					pc.give_item2("27005",30)
					pc.give_item2("13006")
					pc.give_item2("14006")
					pc.give_item2("15006")
					pc.give_item2("16006")
					pc.give_item2("17006")
					pc.give_item2("72701")
					pc.give_item2("70038",50)
					pc.give_item2("50051")
					pc.give_item2("50188")
			    	horse.set_level(1)
				horse.summon()
				horse.ride()
				clear_letter()
			end
			clear_letter()
			set_quest_state("find_skillteacher", "find")
			set_state(__COMPLETE__)
                end
        end
        state __COMPLETE__ begin
        end
end

This quest is working, but not in my server. (I think)

I activate the global_chat.

I just add the pc.give_item2("50188")

I change the reward of all chests (level chest's) at special_item.txt

Why stopped working? :(

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.