Jump to content

Full Monarch System


Shogun

Recommended Posts

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

Link to comment
Share on other sites

  • Premium

Add this to questlib.lua

function string:split(delimiter)
	local result = {}
	local from = 1
	local delim_from, delim_to = string.find(self, delimiter, from)

	while delim_from do
		table.insert(result, string.sub(self, from , delim_from-1))
		from = delim_to + 1
		delim_from, delim_to = string.find(self, delimiter, from)
	end
	table.insert(result, string.sub(self, from))
	return result
end

Original post amended. Thanks for the report :)

Link to comment
Share on other sites

  • 1 month later...
This difference file is created by aNNdii and Hazel

db_1866
00092873: 65 61
00092874: 6D 2E
00092875: 70 65
00092876: 69 6D
00092877: 72 70
00092878: 65 69
00092879: 2C 72
0009287A: 20 65
0009287B: 70 2C
0009287C: 69 61
0009287D: 64 2E
0009287E: 2C 70
0009287F: 20 69
00092880: 6E 64
00092881: 61 2C
00092882: 6D 62
00092883: 65 2E
00092884: 2C 6E
00092885: 20 61
00092887: 6F 65
00092888: 6E 2C
00092889: 65 61
0009288A: 79 2E
0009288B: 2C 6D
0009288C: 20 6F
0009288D: 77 6E
0009288E: 69 65
0009288F: 6E 79
00092890: 64 2C
00092892: 74 2E
00092893: 65 77
00092894: 20 69
00092895: 46 6E
00092896: 52 64
00092897: 4F 61
00092898: 4D 74
00092899: 20 65
0009289A: 6D 20
0009289B: 6F 46
0009289C: 6E 52
0009289D: 61 4F
0009289E: 72 4D
0009289F: 63 20
000928A0: 68 6D
000928A1: 20 6F
000928A2: 61 6E
000928A3: 2C 61
000928A4: 20 72
000928A5: 70 63
000928A6: 6C 68
000928A7: 61 20
000928A8: 79 61
000928A9: 65 2C
000928AA: 72 20
000928AB: 25 70
000928AC: 73 6C
000928AD: 20 61
000928AE: 62 79
000928AF: 20 65
000928B0: 77 72
000928B1: 68 25
000928B2: 65 73
000928B3: 72 20
000928B4: 65 62
000928B6: 61 57
000928B7: 2E 48
000928B8: 70 45
000928B9: 69 52
000928BA: 64 45
000928BB: 3D 20
000928BC: 62 61
000928BE: 69 70
000928BF: 64 69
000928C0: 00 64
000928C1: 00 20
000928C2: 00 3D
000928C3: 00 20
000928C4: 5B 62
000928C5: 4C 2E
000928C6: 4F 69
000928C7: 41 64
000928C8: 44 00
000928C9: 5F 5B
000929C7: 70 61
000929C8: 69 2E
000929C9: 64 70
000929CA: 2C 69
000929CB: 20 64
000929CC: 6E 2C
000929CD: 61 62
000929CE: 6D 2E
000929CF: 65 6E
000929D0: 2C 61
000929D1: 20 6D
000929D2: 64 65
000929D3: 61 2C
000929D4: 74 61
000929D5: 65 2E
000929D6: 20 64
000929D7: 46 61
000929D8: 52 74
000929D9: 4F 65
000929DA: 4D 20
000929DB: 20 46
000929DC: 6D 52
000929DD: 6F 4F
000929DE: 6E 4D
000929DF: 61 20
000929E0: 72 6D
000929E1: 63 6F
000929E2: 68 6E
000929E3: 5F 61
000929E4: 63 72
000929E5: 61 63
000929E6: 6E 68
000929E7: 64 5F
000929E8: 69 63
000929E9: 64 61
000929EA: 61 6E
000929EB: 63 64
000929EC: 79 69
000929ED: 20 64
000929EF: 2C 63
000929F0: 20 79
000929F1: 70 20
000929F2: 6C 61
000929F3: 61 2C
000929F4: 79 70
000929F5: 65 6C
000929F6: 72 61
000929F7: 25 79
000929F8: 73 65
000929F9: 20 72
000929FA: 62 25
000929FB: 20 73
000929FC: 77 20
000929FD: 68 62
000929FE: 65 20
000929FF: 72 57
00092A00: 65 48
00092A01: 20 45
00092A02: 61 52
00092A03: 2E 45
00092A04: 70 20
00092A05: 69 61
00092A06: 64 2E
00092A07: 20 70
00092A08: 3D 69
00092A09: 20 64
00092A0A: 62 20
00092A0B: 2E 3D
00092A0C: 69 20
00092A0D: 64 62
00092A0E: 00 2E
00092A0F: 00 69
00092A10: 5B 64
00092A11: 4C 00
00092A12: 4F 5B
00092A13: 41 4D
00092A14: 44 4F
  • Love 1
"Some come to see you fall, others come pick you up
Some come make you smile, others will make you cry
Some lie by lie, lie to deceive others "

 

Link to comment
Share on other sites

  • Premium

return;
pc.change_gold(-NEED_MONEY);
monarch_election.candidacy();
 

This isn't C Language Shogun, keep attention to " ; " !.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Premium

Although this quest seems written by a duckbill.

 

I can make it < 200 lines and more clear.

 

Although the mob_get_level function is....just crazy and.. i can't find an adept to define it.

 

There are some errors that.. i just can't even explain how can this work to you.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Management
This difference file is created by aNNdii and Hazel

db_1866
00092873: 65 61
00092874: 6D 2E
00092875: 70 65
00092876: 69 6D
00092877: 72 70
00092878: 65 69
00092879: 2C 72
0009287A: 20 65
0009287B: 70 2C
0009287C: 69 61
0009287D: 64 2E
0009287E: 2C 70
0009287F: 20 69
00092880: 6E 64
00092881: 61 2C
00092882: 6D 62
00092883: 65 2E
00092884: 2C 6E
00092885: 20 61
00092887: 6F 65
00092888: 6E 2C
00092889: 65 61
0009288A: 79 2E
0009288B: 2C 6D
0009288C: 20 6F
0009288D: 77 6E
0009288E: 69 65
0009288F: 6E 79
00092890: 64 2C
00092892: 74 2E
00092893: 65 77
00092894: 20 69
00092895: 46 6E
00092896: 52 64
00092897: 4F 61
00092898: 4D 74
00092899: 20 65
0009289A: 6D 20
0009289B: 6F 46
0009289C: 6E 52
0009289D: 61 4F
0009289E: 72 4D
0009289F: 63 20
000928A0: 68 6D
000928A1: 20 6F
000928A2: 61 6E
000928A3: 2C 61
000928A4: 20 72
000928A5: 70 63
000928A6: 6C 68
000928A7: 61 20
000928A8: 79 61
000928A9: 65 2C
000928AA: 72 20
000928AB: 25 70
000928AC: 73 6C
000928AD: 20 61
000928AE: 62 79
000928AF: 20 65
000928B0: 77 72
000928B1: 68 25
000928B2: 65 73
000928B3: 72 20
000928B4: 65 62
000928B6: 61 57
000928B7: 2E 48
000928B8: 70 45
000928B9: 69 52
000928BA: 64 45
000928BB: 3D 20
000928BC: 62 61
000928BE: 69 70
000928BF: 64 69
000928C0: 00 64
000928C1: 00 20
000928C2: 00 3D
000928C3: 00 20
000928C4: 5B 62
000928C5: 4C 2E
000928C6: 4F 69
000928C7: 41 64
000928C8: 44 00
000928C9: 5F 5B
000929C7: 70 61
000929C8: 69 2E
000929C9: 64 70
000929CA: 2C 69
000929CB: 20 64
000929CC: 6E 2C
000929CD: 61 62
000929CE: 6D 2E
000929CF: 65 6E
000929D0: 2C 61
000929D1: 20 6D
000929D2: 64 65
000929D3: 61 2C
000929D4: 74 61
000929D5: 65 2E
000929D6: 20 64
000929D7: 46 61
000929D8: 52 74
000929D9: 4F 65
000929DA: 4D 20
000929DB: 20 46
000929DC: 6D 52
000929DD: 6F 4F
000929DE: 6E 4D
000929DF: 61 20
000929E0: 72 6D
000929E1: 63 6F
000929E2: 68 6E
000929E3: 5F 61
000929E4: 63 72
000929E5: 61 63
000929E6: 6E 68
000929E7: 64 5F
000929E8: 69 63
000929E9: 64 61
000929EA: 61 6E
000929EB: 63 64
000929EC: 79 69
000929ED: 20 64
000929EF: 2C 63
000929F0: 20 79
000929F1: 70 20
000929F2: 6C 61
000929F3: 61 2C
000929F4: 79 70
000929F5: 65 6C
000929F6: 72 61
000929F7: 25 79
000929F8: 73 65
000929F9: 20 72
000929FA: 62 25
000929FB: 20 73
000929FC: 77 20
000929FD: 68 62
000929FE: 65 20
000929FF: 72 57
00092A00: 65 48
00092A01: 20 45
00092A02: 61 52
00092A03: 2E 45
00092A04: 70 20
00092A05: 69 61
00092A06: 64 2E
00092A07: 20 70
00092A08: 3D 69
00092A09: 20 64
00092A0A: 62 20
00092A0B: 2E 3D
00092A0C: 69 20
00092A0D: 64 62
00092A0E: 00 2E
00092A0F: 00 69
00092A10: 5B 64
00092A11: 4C 00
00092A12: 4F 5B
00092A13: 41 4D
00092A14: 44 4F

 

thanks bro

raw

raw

Link to comment
Share on other sites

  • Premium

Although this quest seems written by a duckbill.

 

I can make it < 200 lines and more clear.

 

Although the mob_get_level function is....just crazy and.. i can't find an adept to define it.

 

There are some errors that.. i just can't even explain how can this work to you.

 

This quest was written many years ago, just saying... also a part of it is from the original written by Ymir. which errors do you mean?

Link to comment
Share on other sites

  • Premium

 

Although this quest seems written by a duckbill.

 

I can make it < 200 lines and more clear.

 

Although the mob_get_level function is....just crazy and.. i can't find an adept to define it.

 

There are some errors that.. i just can't even explain how can this work to you.

 

This quest was written many years ago, just saying... also a part of it is from the original written by Ymir. which errors do you mean?

 

I've improved it to the best of my possibilities.

 

If you want a quest ~200 lines smaller and more professional..

http://codepad.org/TFASmdL5
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

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.