elseif s == 2 then
say_title("Summon Royal Guards")
say("")
local selected_npc = select ("Infantry Spearman (1.000.000 Yang)","Infantry Bowman (2.000.000 Yang)","Elite Spearman (3.000.000 Yang)","Elite Bowman (4.000.000 Yang)", "Royal Spearman (5.000.000 Yang)", "Royal Bowman (6.000.000 Yang)", "Cancel")
local siege_npc =
{
{ 9501, 9502, 9503 ,9504, 9505, 9506 },
{ 9511, 9512, 9513, 9514, 9515, 9516 },
{ 9521, 9522, 9523, 9524, 9525, 9526 },
}
if selected_npc<7 then
local cost = selected_npc * 250
local realcost = cost*10000
if money >= realcost then
if get_time() < pc.getqf("duration_summon") then
local timeleft = math.floor((pc.getqf("duration_summon") - get_time()) / 60)
local timestring = timeleft.." minutes"
if timeleft < 1 then
timestring = "less than a minute"
end
return syschat("You can't summon troops yet. You must wait "..timestring..".")
else
oh.takemonarchmoney(cost)
local remaining = money - realcost
syschat(locale.empire_names[pc.get_empire()].."'s remaining fund is "..remaining.." Yang")
mob.spawn_group(siege_npc[pc.get_empire()][selected_npc],pc.get_local_x()-5, pc.get_local_y()-5,10, 10, 1)
pc.setqf("duration_summon",get_time()+(60*30))
end
else
syschat("Lack of Taxes. Current Capital: "..money.." Needed Capital: "..realcost)
end
end
tested here with 3 Emperor, when using any of these options, the gold of 3 is removed, and then buga al that all uses not remove more gold...