How to adjust guild thing so that I don't need to wait to create a new one or join a new one .. etc?
I tried removing this but I get "Code0125" when trying to make a new guild after closing one..
Code:
if game.get_event_flag("guild_withdraw_delay")*86400 >
get_global_time() - pc.getqf("new_withdraw_time") then
say(string.format("You cannot create a guild yet, please wait a while.", game.get_event_flag("guild_withdraw_delay")))
return
end
Code:
if game.get_event_flag("guild_disband_delay")*86400 >
get_global_time() - pc.getqf("new_disband_time") then
say(string.format("You cannot create a guild yet, please wait a while.", game.get_event_flag("guild_disband_delay")))
return
end
Here is the quest in full:
Code:
quest guild_manage begin
state start begin
when guild_man1.chat."Leave Guild" or
guild_man2.chat."Leave Guild" or
guild_man3.chat."Leave Guild"
with pc.hasguild() and not pc.isguildmaster() and (pc.is_pc() or npc.empire == pc.empire) begin
-- ??
say(locale.guild.withdraw_confirm)
local s = select("Yes", "No")
if s==1 then
say("You are now guildless!")
pc.remove_from_guild()
pc.setqf("new_withdraw_time",get_global_time())
end
end
when guild_man1.chat."Disband Guild" or
guild_man2.chat."Disband Guild" or
guild_man3.chat."Disband Guild"
with pc.hasguild() and pc.isguildmaster() and (pc.is_pc() or npc.empire == pc.empire) begin
-- ??
say(locale.guild.disband_confirm)
local s = select("Yes", "No")
if s==1 then
say("The guild is now closed!")
pc.destroy_guild()
pc.setqf("new_disband_time",get_global_time())
pc.setqf("new_withdraw_time",get_global_time())
end
end
when guild_man1.chat."Create Guild" or
guild_man2.chat."Create Guild" or
guild_man3.chat."Create Guild"
with (pc.is_gm() or npc.empire == pc.empire) begin
local level_limit;
local guild_create_item
if get_locale() == "euckr" then
level_limit = 40
guild_create_item = false
else
level_limit = 40
guild_create_item = false
end
if pc.hasguild() then
return
end
if game.get_event_flag("guild_withdraw_delay")*86400 >
get_global_time() - pc.getqf("new_withdraw_time") then
say(string.format("You cannot create a guild yet, please wait a while.", game.get_event_flag("guild_withdraw_delay")))
return
end
say(locale.guild.create_confirm)
local s = select("Yes", "No")
if s == 2 then
return
end
if game.get_event_flag("guild_disband_delay")*86400 >
get_global_time() - pc.getqf("new_disband_time") then
say(string.format("You cannot create a guild yet, please wait a while.", game.get_event_flag("guild_disband_delay")))
return
end
if pc.level >= level_limit then
if pc.gold >= 200000 then
if not guild_create_item or pc.countitem(guild_create_item)>0 then
game.request_make_guild()
else
say("You are missing the book of providence!")
end
else
say("You do not have enough gold to create a guild!")
end
else
say("Your level is too low to create a guild!")
end
end
end
end