Jump to content
  • 0
Cripplez

solved Quest change_empire with only 2 Empire

Question

Hello, I'd like to remove the option shinsoo from this part of the quest

I think my problem is here "local ret = pc.change_empire(emp)" because i can't simply remove shinsoo from le local select emp

            
		when 71054.use begin
			say("Select new empire:[ENTER]")
            local emp = select("Shinsoo","Chunjo", "Jinno", "Exit")
            if emp == 4 then
                return
            end
            local ret = pc.change_empire(emp)
            if ret == 999 then
                pc.remove_item(item.get_vnum(), 1)
                say("you changed empire")
            elseif ret == 1 then
                say("You can't change empire")
            elseif ret == 2 then
                say("You can't change empire")
            elseif ret == 3 then
                say("You can't change empire")
            end            
        end

 

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 1

Default:

  • Shinshoo - 1
  • Chunjo - 2
  • Jinno - 3
local sel = select("Chunjo", "Jinno", "Exit")
Chunjo = sel + 1 = 2
Jinno = sel + 1 = 3
Exit = 3 -- return

All what you need is to make the select value + 1.

[hide]

when 71054.use begin
	say('Select new empire:[ENTER]')
	local empire_table = {'Chunjo', 'Jinno'};
	table.insert(empire_table, locale.cancel)
	
	local selected = select_table(empire_table);
	if (selected ~= table.getn(empire_table)) then
		local ret = pc.change_empire(selected + 1)
		if ret == 999 then
			pc.remove_item(item.get_vnum(), 1)
			say(string.format("You changed the empire to %s.", empire_table[selected]))
		elseif ret == 1 then
			say('Please choose a different kingdom.')
		elseif ret == 2 then
			say('You recently have been in a guild.')
		elseif ret == 3 then
			say('You were married recently.')
		end     
	end
end

[/hide]

  • Love 3

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.