Jump to content

Full Monarch System


Shogun

Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

The World of Metin2 Monarch System is composed of two parts. For the system to work fully you need to use db core 33820 or a compiled db where this bug is solved (look dif part at the end. If anybody wants to create difs for other revisions, you are welcome to do so.)

 

 

Monarch Election

 

Authors: Musicinstructor and me (Shogun)

 

Usage: the election has 3 stages: Candidacy, Election and Crowning. All the stages can be started sucessively from the Archer Guardian NPC in town.

 

- During Candidacy phase, all players over level 65 can apply for election by paying some Yang. Up to 8 players can apply per kingdom.

 

7e52d38ea0.jpg

 

- During Election phase, players will drop an item called Certificate of Loyalty (60004) which allows them to cast a vote.

 

6f34c63b2a.jpg

 

- Finally, you can finish the election, which will announce the winners automatically.

 

2955a0c641.jpg

 

The new King / Queen will receive a new Hwang Armor on login and the Angel's Blessing item.

 

For the quest to work you need the following preparation:

 

1) Create an empty file share/data/monarch_election in your server with the touch command.

2) Fill the table player.monarch with some random values (use the PID of your GM for example). You can also use this table:

DROP TABLE IF EXISTS `monarch`;
CREATE TABLE `monarch` (
  `empire` int(10) unsigned NOT NULL DEFAULT '0',
  `pid` int(10) unsigned DEFAULT NULL,
  `windate` datetime DEFAULT NULL,
  `money` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`empire`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- ----------------------------
-- Records of monarch
-- ----------------------------
INSERT INTO `monarch` VALUES ('1', '266', '2014-02-04 04:36:55', '0');
INSERT INTO `monarch` VALUES ('2', '188', '2013-11-07 20:10:00', '0');
INSERT INTO `monarch` VALUES ('3', '170', '2013-09-16 22:12:06', '0');

3) Make sure 60004 exists in item proto and has a suitable icon for it.

 

The quest

 

Spoiler

-- World of Metin2 Monarch Election quest 
-- by Musicinstructor and Shogun
quest monarch_election begin
	state start begin
		when login or enter begin
			if oh.ismonarch() > 0 and pc.count_item(70021) == 0 then
				set_state(newking)
			elseif oh.ismonarch() == 0 then
				if pc.count_item(70021) > 0 then
					pc.remove_item(70021)
					syschat("Your Angels' Blessing has been removed.")
				end
				if pc.count_item(11971) > 0 or pc.count_item(11972) > 0 or pc.count_item(11973) > 0 or pc.count_item(11974) > 0 then
					if pc.get_part(PART_MAIN) > 11970 and pc.get_part(PART_MAIN) < 11975 then
						syschat("Please unequip your King Armor and relog.")
						syschat("You are not allowed to use it anymore.")
					else
						local armor = 11971 + pc.get_job()
						pc.removeitem(armor)
						syschat("Your Hwang Armor has been removed.")
					end
				end
			end
			if game.get_event_flag("monarch_elect") > 0 and pc.get_level() >= 40 then
				send_letter("Monarch Election")
			end

		end
		when button or info begin
		        ----"123456789012345678901234567890123456789012345678901234567890"|
			addimage(20, 12, "monarch.tga")
			say("")
			say("")
			say("")
			say("")

			if game.get_event_flag("monarch_elect") == 1 then
				say_title("Monarch Candidacy")
				say("")
				----"123456789012345678901234567890123456789012345678901234567890"|
				say("If you wish to apply to become the next ruler of "..locale.empire_names[pc.get_empire()]..",")
				say("please talk to the Archer Guardian in any town. Remember")
				say("you need 1.000.000 Yang and at least level 65 to apply.")
				say("")
				say("When the candidacy process ends, you will be able to vote.")
			elseif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
				say_title("Monarch Election")
				say("")
				say("You have already cast your vote. The results will be")
				say("announced after the election period is finished.")
			else
				say_title("Monarch Election")
				say("")
				say("Head to the Archer Guardian in any of the towns to cast your")
				say("vote. In order to prove your citizenship, you will need:")
				say("")
				say_item_vnum(60004)
				say("This item can be obtained fighting enemies.")
			end
			say("")
		end
		
		when kill with game.get_event_flag("monarch_elect") > 0 and pc.level >= 45 begin
			if game.get_event_flag("monarch_electionid") != pc.getqf("electionid") then
				if not npc.is_pc() then
					local limit = get_mob_level[npc.get_race()]
					if limit == nil then
						return
					else
						if pc.get_level() > limit+10 then
							return
						end
					end
				end
				if number(1, 500) == 1 then
					if pc.count_item(60004) == 0 and pc.enough_inventory(60004) then
						pc.give_item2(60004, 1)
						syschat("You are now qualified to vote for your monarch.") 
					end
				end
			end
		end
		
		when electionman1.chat."GM: Emperor election adjustments" or electionman2.chat."GM: Emperor election adjustments" or electionman3.chat."GM: Emperor election adjustments" with pc.is_gm() begin
			if game.get_event_flag("monarch_elect") == 1 then
				say_title("Emperor election:")
				say("")
				----"123456789012345678901234567890123456789012345678901234567890"|
				say("Currently the candidacies for Monarch Election are open.")
				say("")
				say("Shall they be closed now?")
				say("")
				local s = select("Close", "Continue" )

				if s == 1 then
					notice_all("King election is starting now!")
					notice_all("Present your certificates to the Archer Guardian to vote.")
					game.set_event_flag("monarch_elect", 2)
					game.set_event_flag("monarch_electionid", get_global_time())
					say_title("Emperor election:")
					say("")
					say("The applications are closed and players can")
					say("vote for an emperor now.")
					say("")
				end
			
			elseif game.get_event_flag("monarch_elect") == 2 then
				say_title("Emperor election:")
				say("")
				say("Currently the election of the new emperors is running.")
				say("Shall they be ended now?")
				say("")
				say_reward("Current standings:")
				say_reward("Pandemonia: "..monarch_election.getcurrentwinner(1)[1])
				say_reward("Asmodia: "..monarch_election.getcurrentwinner(2)[1])
				say_reward("Elgoria: "..monarch_election.getcurrentwinner(3)[1])
				say("")
				local s = select("End", "Continue")
				
				if s == 1 then
					notice_all("The Monarch Election has ended now.")
					game.set_event_flag("monarch_elect", 0)
					if monarch_election.getcurrentwinner(1)[2] != 0 then mgmt.monarch_change_lord(1, monarch_election.getcurrentwinner(1)[2]) end
					if monarch_election.getcurrentwinner(2)[2] != 0 then mgmt.monarch_change_lord(2, monarch_election.getcurrentwinner(2)[2]) end
					if monarch_election.getcurrentwinner(3)[2] != 0 then mgmt.monarch_change_lord(3, monarch_election.getcurrentwinner(3)[2]) end
				end
			
			elseif game.get_event_flag("monarch_elect") == 0 then
				say_title("Emperor election:")
				say("")
				say("Here you can start the Monarch candidacies.")
				say("")
				say("Do you want to start them now?")
				say("")
				local s = select("Start", "Don't start")

				if s == 1 then
					notice_all("The Monarch Candidacy period starts now!")
					notice_all("Approach the Archer Guardian in town to apply for the election.")
					game.set_event_flag("monarch_elect", 1)
					game.set_event_flag("monarch_electionid", get_global_time())
					monarch_election.clearcandidacy()
				end

			end

		end


		when electionman1.chat."Monarch Election" or electionman2.chat."Monarch Election" or electionman3.chat."Monarch Election" with game.get_event_flag("monarch_elect") == 2 begin
			say_title("Monarch election:")
			say("")
			
			if pc.get_level() < 45 then
				say("You need at least level 45 to vote. Come back when you")
				say("become a true citizen.")
				say("")
				return
			end
			
			if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
				say("You already voted. You can't vote twice!")
				say("")
				return
			end
			if pc.count_item(60004) < 1 then
				say("You need this document in order to prove you are truly")
				say("a citizen of "..locale.empire_names[pc.get_empire()]..".")
				say("")
				say_item_vnum(60004)
				say("You can get it from any enemy monster or player. Come")
				say("back when you have obtained it.")
				say("")
				return
			end

			local gname_table = monarch_election.candidacy_list(pc.get_empire())
			if table.getn(gname_table) == 0 then
				-- no currently war
				say("There are no candidates!")
				say("")
			else
				table.insert(gname_table, "Cancel")
				----"123456789012345678901234567890123456789012345678901234567890"|
				say("You are qualified to participate. Please vote carefully;")
				say("you can only do it once.")
				say("")
				wait()
				local s = select_table(gname_table)

				if s == table.getn(gname_table) then
					return;
				else
					monarch_election.election(s)
					pc.setqf("electionid", game.get_event_flag("monarch_electionid"))
					pc.remove_item(60004, 1)
					say_title("Emperor election:")
					say("")
					say("Thank you for participating!")
					say("")
					say_reward("You voted for: "..gname_table[s])
					say("")
				end
			end
		end


		when electionman1.chat."Apply for election" or electionman2.chat."Apply for election" or electionman3.chat."Apply for election" with game.get_event_flag("monarch_elect") == 1 begin
			local NEED_MONEY = 1000000
			local NEED_LEVEL = 65
			say_title("Monarch election:")
			say("")
			say("The following requirements are necessary for a King:")
			say("")
			say_reward("1. A candidacy fee of "..NEED_MONEY.." Yang.")
			say_reward("2. Level "..NEED_LEVEL.." must be reached.")
			say("")
			
			if game.get_event_flag("monarch_elect") == 0 then
				say("But the election period has not yet started.")
				say("Return when it has begun.")
				say("")
				return
			end	
			if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
				say("You already applied for this election.")
				say("")
				return
			end

			say("Do you want to take part in the election?")
			say("")

			local s = select("Yes, I want to participate.", "No, thanks.")

			if s == 1 then
				say_title("Monarch election:")
				say("")
				if monarch_election.candidacycount(pc.get_empire()) >= 8 then
					say("Sorry, but we already have enough candidates.")
					say("")
					say("You can try again in the next election.")
				elseif pc.get_gold() >= NEED_MONEY and pc.get_level() >= NEED_LEVEL then
					say("You are now registered for the election.")
					say("")
					say("Good Luck!")
					pc.change_gold(-NEED_MONEY);
					monarch_election.candidacy();
					pc.setqf("electionid", game.get_event_flag("monarch_electionid"))
				else
					say("Sorry, you do not fulfill the requirements.")
				end
				say("")
			end
		end
		
		function candidacy()
			local f = io.open("data/monarch_election", "a+")
			f:write(pc.get_player_id().."t"..pc.get_empire().."t0t"..pc.get_name().."tn")
			f:close()
		end
		
		function clearcandidacy()
			local f = io.open("data/monarch_election", "w+")
			f:close()
		end
		
		function candidacycount(empire)
			local count = 0
			local f = io.open("data/monarch_election", "r")
			for line in f:lines() do
				local e = string.split(line, "t")
				if e != nil and tonumber(e[2]) == empire then
					count = count + 1
				end
			end
			f:close()
			return count
		end
		
		function candidacy_list(empire)
			local res = {}
			local f = io.open("data/monarch_election", "r")
			for line in f:lines() do
				cinfo = string.split(line, "t")
				if tonumber(cinfo[2]) == empire then
					table.insert(res, cinfo[4])
				end
			end
			f:close()
			return res
		end
		
		function election(id)
			local c_list = {}
			local c_count = 0
			local f = io.open("data/monarch_election", "r")
			for line in f:lines() do
				table.insert(c_list, string.split(line, "t"))
				c_count = c_count + 1
			end
			f:close()
			f = io.open("data/monarch_election", "w+")
			local e_i = 1
			for i = 1, c_count, 1 do
				if e_i == id then
					c_list[i][3] = tonumber(c_list[i][3]) + 1
				end
				if tonumber(c_list[i][2]) == pc.get_empire() then
					e_i = e_i + 1
				end
				f:write(c_list[i][1].."t"..c_list[i][2].."t"..c_list[i][3].."t"..c_list[i][4].."tn")
			end
			f:close()
		end
		
		function getcurrentwinner(empire)
			local res = {"Nobody", 0}
			local f = io.open("data/monarch_election", "r")
			local maxvotes = -1
			for line in f:lines() do
				local exploded = string.split(line, "t")
				if tonumber(exploded[2]) == empire and tonumber(exploded[3]) > maxvotes then
					maxvotes = tonumber(exploded[3])
					res = {exploded[4], tonumber(exploded[1])}
				end
			end
			f:close()
			return res
		end
		
		
	end
	state newking begin
		when login or enter begin
				send_letter("Congratulations!")
		end
		when button or info begin
				local treatment = {
					[0] = "King",
					[1] = "Queen",
				}
				local armor = 11971 + pc.get_job()

				----"123456789012345678901234567890123456789012345678901234567890"|
				say_title("Congratulations!")
				say("")
				say("You have been elected as the "..treatment[pc.get_sex()].." of "..locale.empire_names[pc.get_empire()].."!")
				say("")
				say("As a "..treatment[pc.get_sex()]..", you are granted the Hwang Armour and Angel's")
				say("Blessing items for the duration of your reign.")
				say("")
				say("This jewel enables you to use your Monarch powers, but")
				say("note you will be limited in their use by the Yang available")
				say("Kingdom's vault, so choose wisely!")
				say("")
				say("May your reign be prosper!")
				say("")
				clear_letter()
				set_state(start)
				if pc.count_item(armor) == 0 then
					pc.give_item2(armor)
				end
				if pc.count_item(70021) == 0 then
					pc.give_item2(70021)
				end

				notice_all("The "..treatment[pc.get_sex()].." "..pc.getname().." of "..locale.empire_names[pc.get_empire()].." has been crowned! All hail the "..treatment[pc.get_sex()].."!")
		end
	end
end

 

Add this to locale.lua

Spoiler

locale.empire_names = {

[0] = "All",

[1] = "Shinsoo",

[2] = "Chunjo",

[3] = "Jinno",

}

Add this also to questlib.lua

 

Spoiler


 

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

 

get_mob_level = { [2051] = 65, [2052] = 67, [2053] = 69, [2054] = 71, [2055] = 73, [11116] = 90, [2061] = 60, [2062] = 62, [2063] = 64, [2064] = 66, [2065] = 68, [2071] = 70, [2072] = 72, [2073] = 74, [2074] = 76, [2075] = 78, [2076] = 78, [11117] = 90, [2091] = 60, [2092] = 79, [2093] = 65, [2094] = 72, [2095] = 70, [2101] = 19, [2102] = 37, [2103] = 39, [2104] = 44, [2105] = 47, [2106] = 48, [2107] = 51, [2108] = 54, [5131] = 22, [2401] = 87, [5132] = 25, [2402] = 89, [5133] = 27, [2131] = 60, [2132] = 62, [2133] = 64, [2134] = 66, [2135] = 68, [101] = 1, [102] = 3, [103] = 4, [2152] = 37, [105] = 9, [106] = 13, [107] = 16, [108] = 7, [109] = 10, [110] = 12, [111] = 15, [112] = 19, [113] = 21, [114] = 18, [115] = 24, [5141] = 35, [131] = 8, [132] = 9, [133] = 11, [134] = 14, [135] = 18, [136] = 21, [137] = 12, [138] = 15, [139] = 17, [140] = 20, [141] = 24, [142] = 26, [143] = 24, [144] = 29, [151] = 9, [152] = 16, [153] = 10, [154] = 21, [2203] = 70, [2204] = 71, [2205] = 72, [2206] = 73, [2207] = 78, [171] = 1, [172] = 3, [173] = 4, [174] = 6, [175] = 9, [2224] = 71, [177] = 16, [178] = 7, [179] = 10, [180] = 12, [181] = 15, [182] = 19, [183] = 21, [184] = 18, [185] = 24, [2234] = 71, [2235] = 72, [191] = 30, [192] = 31, [193] = 33, [194] = 35, [5153] = 49, [5157] = 54, [2291] = 75, [2292] = 99, [2293] = 99, [5161] = 30, [2301] = 65, [2302] = 67, [2303] = 69, [2304] = 70, [2305] = 71, [2306] = 84, [2307] = 86, [2311] = 74, [2312] = 76, [2313] = 77, [2314] = 80, [2315] = 82, [301] = 18, [302] = 20, [303] = 25, [304] = 25, [8501] = 35, [8502] = 30, [8503] = 25, [8504] = 5, [8505] = 10, [8506] = 12, [8507] = 15, [8508] = 20, [8509] = 25, [8510] = 21, [8511] = 11, [331] = 18, [332] = 20, [333] = 25, [334] = 25, [351] = 18, [352] = 20, [353] = 25, [354] = 25, [2403] = 89, [2404] = 90, [2411] = 91, [2412] = 93, [2413] = 95, [2414] = 97, [2451] = 84, [5127] = 54, [2452] = 86, [2431] = 80, [2432] = 82, [2433] = 82, [2434] = 83, [2454] = 90, [391] = 23, [392] = 26, [393] = 28, [394] = 31, [395] = 23, [396] = 26, [397] = 28, [398] = 31, [401] = 26, [402] = 27, [403] = 29, [404] = 30, [405] = 33, [406] = 35, [8600] = 73, [8601] = 86, [8602] = 73, [8603] = 86, [8604] = 73, [8605] = 86, [8606] = 73, [8607] = 86, [8608] = 73, [8609] = 86, [8610] = 73, [8611] = 86, [8612] = 73, [8613] = 86, [8614] = 73, [8615] = 86, [8616] = 86, [11108] = 70, [431] = 31, [432] = 33, [433] = 35, [434] = 36, [435] = 38, [436] = 40, [2491] = 93, [2492] = 95, [2493] = 97, [2494] = 88, [2495] = 90, [451] = 26, [452] = 27, [453] = 29, [454] = 30, [455] = 33, [456] = 35, [2505] = 83, [2506] = 84, [2507] = 85, [2508] = 79, [2509] = 80, [2510] = 81, [2511] = 82, [2512] = 83, [2513] = 84, [2514] = 86, [1175] = 65, [491] = 32, [492] = 37, [493] = 39, [494] = 45, [2543] = 81, [2544] = 82, [2545] = 83, [2546] = 84, [2547] = 86, [501] = 29, [502] = 32, [503] = 35, [504] = 36, [531] = 35, [532] = 37, [533] = 40, [534] = 42, [2591] = 89, [2592] = 89, [2593] = 89, [2594] = 89, [2595] = 89, [2596] = 89, [2597] = 91, [2598] = 91, [551] = 29, [552] = 32, [553] = 35, [554] = 36, [2482] = 92, [2483] = 94, [2484] = 96, [5134] = 29, [591] = 42, [595] = 42, [601] = 26, [602] = 29, [603] = 31, [604] = 33, [2151] = 19, [104] = 6, [631] = 34, [632] = 36, [633] = 39, [634] = 40, [635] = 44, [636] = 46, [637] = 49, [2155] = 47, [2156] = 48, [651] = 34, [652] = 36, [653] = 39, [654] = 40, [2157] = 51, [656] = 46, [657] = 49, [2158] = 54, [2501] = 79, [2502] = 80, [2503] = 81, [5001] = 10, [2504] = 82, [691] = 50, [692] = 55, [693] = 60, [701] = 35, [702] = 38, [703] = 41, [704] = 44, [705] = 48, [706] = 49, [707] = 51, [731] = 52, [732] = 53, [733] = 54, [734] = 54, [735] = 55, [736] = 56, [737] = 57, [751] = 35, [752] = 38, [753] = 41, [754] = 44, [755] = 48, [756] = 49, [757] = 51, [771] = 52, [772] = 53, [773] = 54, [774] = 54, [775] = 55, [776] = 56, [777] = 57, [7050] = 35, [2481] = 91, [791] = 54, [792] = 62, [793] = 64, [794] = 72, [795] = 54, [796] = 62, [7051] = 31, [7001] = 52, [7002] = 53, [2191] = 67, [7004] = 54, [7005] = 55, [7006] = 56, [7007] = 56, [7008] = 52, [2192] = 72, [7010] = 54, [11107] = 70, [7012] = 52, [7013] = 53, [7014] = 54, [7015] = 54, [7016] = 55, [7017] = 56, [7018] = 56, [7019] = 59, [7020] = 59, [7021] = 60, [7022] = 61, [7023] = 62, [7024] = 64, [7025] = 66, [7026] = 67, [7027] = 70, [7028] = 72, [7029] = 35, [7030] = 31, [7031] = 33, [7032] = 35, [7033] = 36, [7034] = 38, [7035] = 40, [7036] = 52, [7037] = 53, [7038] = 54, [7039] = 54, [7040] = 55, [7041] = 56, [7042] = 57, [7043] = 81, [7044] = 81, [901] = 49, [902] = 51, [903] = 53, [904] = 55, [905] = 58, [906] = 58, [907] = 59, [5004] = 80, [5005] = 85, [7054] = 36, [2541] = 79, [7056] = 40, [7057] = 52, [7058] = 53, [7059] = 54, [7060] = 54, [2542] = 80, [7062] = 56, [2201] = 69, [7064] = 81, [7065] = 81, [7066] = 82, [7067] = 83, [7068] = 83, [2202] = 69, [7070] = 85, [7071] = 33, [7072] = 35, [7073] = 36, [7074] = 38, [155] = 24, [932] = 51, [933] = 53, [934] = 55, [935] = 58, [936] = 58, [937] = 59, [7082] = 83, [7083] = 83, [7084] = 84, [7085] = 85, [7086] = 35, [7087] = 36, [7088] = 38, [7089] = 40, [7090] = 54, [7091] = 55, [7092] = 56, [7093] = 57, [7094] = 83, [7095] = 83, [7096] = 84, [7097] = 85, [991] = 59, [992] = 60, [993] = 61, [1001] = 57, [1002] = 58, [1003] = 59, [1004] = 60, [5101] = 22, [5102] = 25, [5103] = 27, [5104] = 29, [5111] = 35, [5112] = 37, [5113] = 39, [5114] = 40, [5115] = 41, [5116] = 42, [5121] = 45, [5122] = 47, [5123] = 49, [5124] = 52, [5125] = 53, [5126] = 54, [1031] = 67, [1032] = 69, [1033] = 70, [1034] = 71, [1035] = 72, [1036] = 73, [1037] = 71, [1038] = 72, [1039] = 73, [1040] = 74, [1041] = 75, [2222] = 69, [5142] = 37, [5143] = 39, [5144] = 40, [5145] = 41, [5146] = 42, [2223] = 70, [11109] = 70, [5151] = 45, [5152] = 47, [176] = 13, [5154] = 52, [5155] = 53, [5156] = 54, [1061] = 67, [1062] = 69, [1063] = 70, [1064] = 71, [1065] = 72, [1066] = 73, [1067] = 71, [1068] = 72, [1069] = 73, [1070] = 74, [1071] = 75, [2227] = 90, [1091] = 75, [1092] = 75, [1093] = 78, [1094] = 75, [1095] = 82, [1096] = 75, [2231] = 69, [1101] = 62, [1102] = 63, [1103] = 64, [1104] = 64, [1105] = 65, [1106] = 66, [1107] = 66, [2233] = 70, [1131] = 81, [1132] = 81, [1133] = 82, [1134] = 83, [1135] = 83, [1136] = 84, [1137] = 85, [1151] = 52, [1152] = 53, [1153] = 54, [1154] = 54, [1155] = 55, [1156] = 56, [1157] = 56, [2221] = 69, [1171] = 62, [1172] = 63, [1173] = 64, [1174] = 64, [2153] = 39, [1176] = 66, [1177] = 66, [1191] = 70, [1192] = 70, [11110] = 70, [2154] = 44, [11505] = 100, [11506] = 100, [11507] = 100, [11508] = 100, [11509] = 100, [11510] = 100, [2225] = 72, [1301] = 57, [1302] = 59, [1303] = 58, [1304] = 75, [1305] = 61, [1306] = 75, [1307] = 80, [1308] = 40, [1309] = 65, [1310] = 95, [7045] = 82, [7046] = 83, [2226] = 60, [7047] = 83, [7048] = 84, [1331] = 57, [1332] = 59, [1333] = 58, [1334] = 75, [1335] = 61, [5002] = 75, [5003] = 1, [7052] = 33, [11111] = 70, [7053] = 35, [7055] = 38, [1401] = 66, [1402] = 73, [1403] = 77, [7061] = 55, [7003] = 54, [7063] = 57, [5162] = 43, [7069] = 84, [5163] = 55, [931] = 49, [7076] = 54, [2232] = 69, [1501] = 69, [1502] = 72, [1503] = 76, [7078] = 55, [7079] = 56, [7080] = 57, [7081] = 82, [7075] = 40, [11100] = 50, [7077] = 54, [7009] = 53, [1601] = 68, [1602] = 70, [1603] = 75, [11101] = 50, [11102] = 50, [11113] = 90, [11103] = 50, [11104] = 50, [7049] = 85, [11105] = 50, [11106] = 70, [655] = 44, [1901] = 72, [1902] = 77, [1903] = 82, [1904] = 40, [1905] = 65, [1906] = 95, [11112] = 90, [2453] = 88, [11114] = 90, [2001] = 43, [2002] = 45, [2003] = 48, [2004] = 50, [2005] = 52, [11115] = 90, [2031] = 50, [2032] = 52, [2033] = 54, [2034] = 56, [2035] = 58, [2036] = 58, }

 

Items

 

for item_list.txt

60004 ETC icon/item/60002.tga

item_proto.txt entries for the certificate, blessing and armors

60004 loyalty_certificate ITEM_UNIQUE UNIQUE_NONE 1 ANTI_GET | ANTI_DROP | ANTI_SELL | ANTI_SAVE | ANTI_GIVE | ANTI_PKDROP | ANTI_STACK | ANTI_MYSHOP | ANTI_SAFEBOX LOG NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 604800 0 1 0 0 0 0 0 0
70021 ±ºÁÖÀÇ ÁõÇ¥ ITEM_QUEST 0 1 ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP | ANTI_SAFEBOX NONE NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 0 0 0 0 0 0 0 0 0
11971	Ȳ»óÀü°©	ITEM_ARMOR	ARMOR_BODY	2	ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG | ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP	ITEM_TUNABLE	WEAR_BODY	NONE	0	0	0	0	0	LEVEL	50	LIMIT_NONE	0	APPLY_MOV_SPEED	10	APPLY_RESIST_MAGIC	20	APPLY_ATTBONUS_HUMAN	15	0	350	0	24	0	100	100	3	0
11972	ȲÀÇ	ITEM_ARMOR	ARMOR_BODY	2	ANTI_MUSA | ANTI_SURA | ANTI_MUDANG | ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP | ANTI_SAFEBOX	ITEM_TUNABLE	WEAR_BODY	NONE	0	0	0	0	0	LEVEL	50	LIMIT_NONE	0	APPLY_MOV_SPEED	10	APPLY_RESIST_MAGIC	20	APPLY_ATTBONUS_HUMAN	15	0	350	0	24	0	100	100	3	0 
11973	ÁøȲ»ó°©	ITEM_ARMOR	ARMOR_BODY	2	ANTI_MUSA | ANTI_ASSASSIN | ANTI_MUDANG | ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP | ANTI_SAFEBOX	ITEM_TUNABLE	WEAR_BODY	NONE	0	0	0	0	0	LEVEL	50	LIMIT_NONE	0	APPLY_MOV_SPEED	10	APPLY_RESIST_MAGIC	20	APPLY_ATTBONUS_HUMAN	15	0	350	0	24	0	100	100	3	0 
11974	Ȳ»óÀÇ	ITEM_ARMOR	ARMOR_BODY	2	ANTI_MUSA | ANTI_ASSASSIN | ANTI_SURA | ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP | ANTI_SAFEBOX	ITEM_TUNABLE	WEAR_BODY	NONE	0	0	0	0	0	LEVEL	50	LIMIT_NONE	0	APPLY_MOV_SPEED	10	APPLY_RESIST_MAGIC	20	APPLY_ATTBONUS_HUMAN	15	0	350	0	24	0	100	100	3	0

 

Angel's Blessing

 

Quest written by me and loosely based in the official quest used by Metin2 US. This is the item the Monarch can use to cast his powers, such as healing and attacking buffs which affect all the players from his kingdom in the same map; or summoning of different bosses and Guardians which only attack players from enemy kingdoms. It's an original YMIR item and the vnum is 70021.

 

Instructions are included in the quest for the rookie kings/queens.

 

06bf4d018c.jpg

Preparation:

1) Set MonarchHealGold event flag to an appropiate value (this is the cost of a monarch buff that heals everyone on the map)

2) Edit the list of bosses and their cost to your desires

 

The quest:

 

Spoiler

-- World of Metin Angels Blessing quest
-- by Shogun
quest angels_blessing begin
	state start begin
		when 70021.use begin 
			if oh.ismonarch() == 0 then
				say_title("Angels' Blessing")
				say("")
				say("You are not qualified to use this.")
				say("Call me again when you become a true emperor.")
				say("")
			else
				local name, pid, date, money = mgmt.monarch_state(pc.get_empire())
				say_title("Angels' Blessing")
				say("")
				local s = select ("Summon a Monster","Summon Royal Guards","Emperor's Blessing","Emperor's Lion Roar","Emperor's Diamond Skin","Command help","Cancel" )

				if s == 1 then

					local data = {
						-- Name   costs    vnum
						{"Lykos", 200000, 191},
						{"Rock Ape", 400000, 5161},
						{"Bestial Captain", 500000, 591},
						{"Orc Chief", 800000, 691},
						{"Elite Orc Chief", 1600000, 692},
						{"Hae Tae", 400000, 5002},
						{"Queen Spider", 600000, 2091},
						{"Nine Tails", 1200000, 1901},
						{"Flame King", 1600000, 2206},
						{"Yellow Tiger Ghost", 2200000, 1304},
						{"Stone Tortoise", 3200000, 2192},
						{"Elite Nine Tails", 4000000, 1902},
						{"Dark Flame King", 4400000, 2207},
						{"Close", 0, 0}
					}

					local menu = {}
					for i = 1, table.getn(data) do
						if data[i][1] == "Close" then
							table.insert(menu, data[i][1])
						else
							table.insert(menu, data[i][1].." - "..tostring(data[i][2]).." Yang")
						end
					end

					local m = select_table(menu)
					if m == 14 then return end
					say_title("Summon a monster")
					say("")
					say("Are you sure that you want to summon ".. data[m][1] .."?")
					say()
					if select("Yes, I'm sure","No, better not") == 2 then return end

					local cost = data[m][2]
					if money < cost then return syschat("Lack of Taxes. Current Capital: "..money.." Needed Capital: "..cost) end

					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 a monster yet. You must wait "..timestring..".")
					else
						oh.takemonarchmoney(cost/10000)
						mob.spawn(data[m][3],pc.get_local_x()-5, pc.get_local_y()-5,10, 10, 1)
						pc.setqf("duration_summon",get_time()+(60*30))
					end

				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

				elseif s == 3 then
					say_title("Emperor's Blessing")
					say("")
					say("Emperor's Blessing can restore the HP and SP of all the")
					say(locale.empire_names[pc.get_empire()].."ns in this map.")
					say("")
					say_reward("Cost : 250.000 Yang")
					say("")
					if money >= game.get_event_flag(MonarchHealGold) then
						local s = select ("Use","Cancel" )
						if s == 1 then
							oh.monarchbless()
						end
					else
						say("Your kingdom doesn't have enough funds.")
						say("")
					end

				-- Emperor's Lion Roar
				elseif s == 4 then
					say_title("Emperor's Lion Loar")
					say("")
					say("Emperor's Lion Roar will boost all the people's attack")
					say("power in this area for a certain period.")
					say("")
					say_reward("Cost : 5.000.000 Yang" )
					say("")
					if money >= 5000000 then
						local s = select ("Use","Cancel" )
						if s == 1 then
							oh.monarchpowerup()
						end
					else
						say("Your kingdom doesn't have enough funds.")
						say("")
					end

				-- Emperor's Diamond fist
				elseif s == 5 then
					say_title("Emperor's Diamond Fist")
					say("")
					say("Emperor's Diamond Fist will boost all the people's")
					say("defence in this area for a certain period.")
					say("")
					say_reward("Cost : 5.000.000 Yang" )
					say("")
					if money >= 5000000 then
						local s = select ("Use","Cancel" )
						if s == 1 then
							oh.monarchdefenseup()
						end
					else
						say("Your kingdom doesn't have enough funds.")
						say("")
					end
				elseif s == 6 then
					say_title("Commands:")
					say("")
					say("Beyond the Angel's Blessing powers, you have the following")
					say("commands at your disposal:")
					say("")
					say("/mn - Make an announcement (Free)")
					say("/mto - Teleport to a subject (Cost: 10.000 Yang)")
					say("/mtr - Teleport a subject to you (Cost: 10.000 Yang)")
					say("")
					say("The cost is deducted from the Kingdom Vault.")
					say("")
				end
			end
		end
	end
end

 

The function oh.takemonarchmoney() used in the angel's blessing quest is bugged on all official db cores.

 

This is fixed in Vanilla Core 2.2+. For db 33820 here is a dif made by Paylasici:

 

[UNSTRIPPED] db_r33820_32
000A30DD: 3B 20

For db 40146 here's another dif made by PACIFICADOR

db_r40146
000A5015: 3B 20

 

It is possible that something is missing in that case let me know here your answers are appreciated :)

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 24
  • Dislove 1
  • Sad 1
  • Smile Tear 1
  • Think 1
  • Good 2
  • Love 3
  • Love 42
Link to comment
Share on other sites

  • Developer

Hey!

I've been reading the quest and I saw something you didn't included but it's necessary to run this quest without problems.

It's the get_mob_level table which is not included.

I suggest (for those who haven't a table or function to get mob's level) to comment that for those who haven't this table or, if you want, include that table on the thread.

  • Love 2

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

Hey guys i got a problem with the Monarch quest

 

-- World of Metin2 Monarch Election quest


-- by Musicinstructor and Shogun
quest monarch_election begin
state start begin
when login or enter begin
if oh.ismonarch() > 0 and pc.count_item(70021) == 0 then
set_state(newking)
elseif oh.ismonarch() == 0 then
if pc.count_item(70021) > 0 then
pc.remove_item(70021)
syschat("Dein Segen des Engel's wurde entfernt da du kein Kaiser mehr bist.")
end
if pc.count_item(11971) > 0 or pc.count_item(11972) > 0 or pc.count_item(11973) > 0 or pc.count_item(11974) > 0 then
if pc.get_part(PART_MAIN) > 11970 and pc.get_part(PART_MAIN) < 11975 then
syschat("Bitte ziehe deine Kaiser Rüstung aus und logge dich neu ein.")
syschat("Dir ist es nicht mehr erlaubt das zu nutzen.")
else
local armor = 11971 + pc.get_job()
pc.removeitem(armor)
syschat("Deine Kaiser Rüstung wurde entfernt.")
end
end
end
if game.get_event_flag("monarch_elect") > 0 and pc.get_level() >= 40 then
send_letter("Kaiser Wahl")
end

end
when button or info begin
----"123456789012345678901234567890123456789012345678901234567890"|
say("")
say("")
say("")
say("")

if game.get_event_flag("monarch_elect") == 1 then
say_title("Kaiser Kandidatur")
say("")
----"123456789012345678901234567890123456789012345678901234567890"|
say("Willst du dich Bewerben um der neue Herscher von dem"..locale.empire_names[pc.get_empire()].."zu werden?")
say("Bitte sprich mit dem Schlachtenverwalter in jeder Stadt vergiss nicht")
say("Du brauchst 1.000.000 Yang und musst Level 65 sein um teilzunehmen.")
say("")
say("Wenn der Kandidatur Prozess endet, werden Sie in der Lage sein zu wählen..")
elseif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
say_title("Kaiser Wahl")
say("")
say("Du hast bereits gewählt. Das resultat wird")
say("Angekündigt nachdem die Wahl beendet wurde.")
else
say_title("Kaiser Wahl")
say("")
say("Gehe zu dem Schlachtenverwalter in deiner Stadt um dein")
say("vote abzugeben. Und zeige deinem Reich das du Loyal bist, du brauchst folgendes item:")
say("")
say_item_vnum(60004)
say("Dieses item erhälst du von Monstern gegen die du Kämpfst.")
end
say("")
end

when kill with game.get_event_flag("monarch_elect") > 0 and pc.level >= 45 begin
if game.get_event_flag("monarch_electionid") != pc.getqf("electionid") then
if not npc.is_pc() then
local limit = get_mob_level[npc.get_race()]
if limit == nil then
return
else
if pc.get_level() > limit+10 then
return
end
end
end
if number(1, 500) == 1 then
if pc.count_item(60004) == 0 and pc.enough_inventory(60004) then
pc.give_item2(60004, 1)
syschat("Du bist nun Qualifiziert um für deinen Kaiser zu wählen.")
end
end
end
end

when electionman1.chat."GM: Kaiser Wahl Anpassen" or electionman2.chat."GM: Kaiser Wahl Anpassen" or electionman3.chat."GM: Kaiser Wahl Anpassen" with pc.is_gm() begin
if game.get_event_flag("monarch_elect") == 1 then
say_title("Kaiser Wahl:")
say("")
----"123456789012345678901234567890123456789012345678901234567890"|
say("Momentan sind die Kaiser wahlen Offen.")
say("")
say("Sollen sie nun geschlossen werden?")
say("")
local s = select("Schließen", "Fortsetzen" )

if s == 1 then
notice_all("Die Kaiser Wahl startet nun!")
notice_all("Zeige dein Zertifikat dem Schlachtenverwalter um voten zu können.")
game.set_event_flag("monarch_elect", 2)
game.set_event_flag("monarch_electionid", get_global_time())
say_title("Kaiser Wahl:")
say("")
say("Die bewerbungen sind geschlossen und spieler können")
say("nun für ihren Kaiser voten.")
say("")
end

elseif game.get_event_flag("monarch_elect") == 2 then
say_title("Kaiser Wahl:")
say("")
say("Momentan läuft bereits eine Wahl für den neuen Kaiser.")
say("Soll sie jetzt beendet werden?")
say("")
say_reward("Momentaner Kaiser:")
say_reward("Rotes Reich: "..monarch_election.getcurrentwinner(1)[1])
say_reward("Gelbes Reich: "..monarch_election.getcurrentwinner(2)[1])
say_reward("Blaues Reich: "..monarch_election.getcurrentwinner(3)[1])
say("")
local s = select("Beenden", "Fortsetzen")

if s == 1 then
notice_all("Die Kaiser Wahl wurde beendet.")
game.set_event_flag("monarch_elect", 0)
if monarch_election.getcurrentwinner(1)[2] != 0 then mgmt.monarch_change_lord(1, monarch_election.getcurrentwinner(1)[2]) end
if monarch_election.getcurrentwinner(2)[2] != 0 then mgmt.monarch_change_lord(2, monarch_election.getcurrentwinner(2)[2]) end
if monarch_election.getcurrentwinner(3)[2] != 0 then mgmt.monarch_change_lord(3, monarch_election.getcurrentwinner(3)[2]) end
end

elseif game.get_event_flag("monarch_elect") == 0 then
say_title("Kaiser Wahl:")
say("")
say("Hier kannst du die Kaiser Wahl Starten.")
say("")
say("Willst du sie nun starten?")
say("")
local s = select("Starten", "Nicht starten")

if s == 1 then
notice_all("Die Kaiser Kandidatur Zeit beginnt jetzt!")
notice_all("Gehe zum Schaltenverwalter um teil zunehmen.")
game.set_event_flag("monarch_elect", 1)
game.set_event_flag("monarch_electionid", get_global_time())
monarch_election.clearcandidacy()
end

end

end


when electionman1.chat."Kaiser Wahl" or electionman2.chat."Kaiser Wahl" or electionman3.chat."Kaiser Wahl" with game.get_event_flag("monarch_elect") == 2 begin
say_title("Kaiser Wahl:")
say("")

if pc.get_level() < 45 then
say("Du musst Level 45 sein um voten zu können. komm wieder,")
say("wenn du Level 45 erreicht hast.")
say("")
return
end

if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
say("Du hast bereits gevotet. Und kannst nicht nochmal Voten!")
say("")
return
end
if pc.count_item(60004) < 1 then
say("Du brauchst dieses Dokument, um zu beweisen, das du wirklich ein")
say("ein Bürger von "..locale.empire_names[pc.get_empire()].." bist.")
say("")
say_item_vnum(60004)
say("Du kannst es von jedem monster bekommen. Komm")
say("wieder wenn du eins hast.")
say("")
return
end

local gname_table = monarch_election.candidacy_list(pc.get_empire())
if table.getn(gname_table) == 0 then
-- no currently war
say("Es gibt keine Kandidaten!")
say("")
else
table.insert(gname_table, "Abbrechen")
----"123456789012345678901234567890123456789012345678901234567890"|
say("Du bist Qualifiziert um teilzunehmen. Bitte vote vorsichtig;")
say("du kannst es nur einmal.")
say("")
wait()
local s = select_table(gname_table)

if s == table.getn(gname_table) then
return;
else
monarch_election.election(s)
pc.setqf("electionid", game.get_event_flag("monarch_electionid"))
pc.remove_item(60004, 1)
say_title("Kaiser Wahl:")
say("")
say("Vielen Dank für deine Teilnahme!")
say("")
say_reward("Du hast: "..gname_table" gewählt")
say("")
end
end
end


when electionman1.chat."Bewerben für die Kaiser Wahl" or electionman2.chat."Bewerben für die Kaiser Wahl" or electionman3.chat."Bewerben für die Kaiser Wahl" with game.get_event_flag("monarch_elect") == 1 begin
local NEED_MONEY = 1000000
local NEED_LEVEL = 65
say_title("Kaiser Wahl:")
say("")
say("Die folgenden Anforderungen sind notwendig für einen Kaiser:")
say("")
say_reward("1. Eine Kandidatur Gebühr von "..NEED_MONEY.." Yang.")
say_reward("2. Level "..NEED_LEVEL.." musst du erreicht haben.")
say("")

if game.get_event_flag("monarch_elect") == 0 then
say("Die Wahlperiode hat noch nicht begonnen.")
say("Komm wieder wenn sie begonnen hat.")
say("")
return
end
if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then
say("Du hast dich bereits beworben für die Wahl")
say("")
return
end

say("Möchtest du an der Wahl teilnehmen?")
say("")

local s = select("Ja, Ich möchte teilnehmen.", "Nein, Danke.")

if s == 1 then
say_title("Kaiser Wahl:")
say("")
if monarch_election.candidacycount(pc.get_empire()) >= 8 then
say("Es tut uns leid, aber wir haben schon genug Kandidaten.")
say("")
say("Du kannst es in der nächsten Wahl wieder versuchen..")
elseif pc.get_gold() >= NEED_MONEY and pc.get_level() >= NEED_LEVEL then
say("Du bist nun Registriert für die Wahl.")
say("")
say("Viel Glück!")
pc.change_gold(-NEED_MONEY);
monarch_election.candidacy();
pc.setqf("electionid", game.get_event_flag("monarch_electionid"))
else
say("Sorry, du erfüllst die bedingungen nicht.")
end
say("")
end
end

function candidacy()
local f = io.open("data/monarch_election", "a+")
f:write(pc.get_player_id().."t"..pc.get_empire().."t0t"..pc.get_name().."tn")
f:close()
end

function clearcandidacy()
local f = io.open("data/monarch_election", "w+")
f:close()
end

function candidacycount(empire)
local count = 0
local f = io.open("data/monarch_election", "r")
for line in f:lines() do
local e = string.split(line, "t")
if e != nil and tonumber(e[2]) == empire then
count = count + 1
end
end
f:close()
return count
end

function candidacy_list(empire)
local res = {}
local f = io.open("data/monarch_election", "r")
for line in f:lines() do
cinfo = string.split(line, "t")
if tonumber(cinfo[2]) == empire then
table.insert(res, cinfo[4])
end
end
f:close()
return res
end

function election(id)
local c_list = {}
local c_count = 0
local f = io.open("data/monarch_election", "r")
for line in f:lines() do
table.insert(c_list, string.split(line, "t"))
c_count = c_count + 1
end
f:close()
f = io.open("data/monarch_election", "w+")
local e_i = 1
for i = 1, c_count, 1 do
if e_i == id then
c_list[3] = tonumber(c_list[3]) + 1
end
if tonumber(c_list[2]) == pc.get_empire() then
e_i = e_i + 1
end
f:write(c_list[1].."t"..c_list[2].."t"..c_list[3].."t"..c_list[4].."tn")
end
f:close()
end

function getcurrentwinner(empire)
local res = {"Keiner", 0}
local f = io.open("data/monarch_election", "r")
local maxvotes = -1
for line in f:lines() do
local exploded = string.split(line, "t")
if tonumber(exploded[2]) == empire and tonumber(exploded[3]) > maxvotes then
maxvotes = tonumber(exploded[3])
res = {exploded[4], tonumber(exploded[1])}
end
end
f:close()
return res
end


end
state newking begin
when login or enter begin
send_letter("Gratulation!")
end
when button or info begin
local treatment = {
[0] = "Kaiser",
[1] = "Kaiserin",
}
local armor = 11971 + pc.get_job()

----"123456789012345678901234567890123456789012345678901234567890"|
say_title("Gratulation!")
say("")
say("Du wurdest gewählt als "..treatment[pc.get_sex()].." von "..locale.empire_names[pc.get_empire()].."!")
say("")
say("Als ein "..treatment[pc.get_sex()]..", bekommst du eine Kaiser Rüstung und Segen des")
say("Engel's für die Dauer deiner Herrschaft.")
say("")
say("Das Juwel aktiviert dir die Kaiser Kraft, aber")
say("Beachte bei der Nutzung dieses items wird Yang gebraucht aus")
say("Deinem Reich, also wähle weise")
say("")
say("Möge deine Herrschaft gedeihen!")
say("")
clear_letter()
set_state(start)
if pc.count_item(armor) == 0 then
pc.give_item2(armor)
end
if pc.count_item(70021) == 0 then
pc.give_item2(70021)
end

notice_all("Der/Die "..treatment[pc.get_sex()].." "..pc.getname().." von "..locale.empire_names[pc.get_empire()].." wurde gekrönt! begrüßt der/die "..treatment[pc.get_sex()].."!")
end
end
end

 

and this says my syserr

SYSERR: Feb 8 16:56:31 :: RunState: LUA_ERROR: [string "monarch_election"]:45: attempt to call field `?' (a string value)


SYSERR: Feb 8 16:56:31 :: WriteRunningStateToSyserr: LUA_ERROR: quest monarch_election.start click
SYSERR: Feb 8 16:56:38 :: RunState: LUA_ERROR: [string "monarch_election"]:45: attempt to call field `?' (a string value)
SYSERR: Feb 8 16:56:38 :: WriteRunningStateToSyserr: LUA_ERROR: quest monarch_election.start click

Link to comment
Share on other sites

  • Premium

 

 

2) Fill the table player.monarch with some random values (use the PID of your GM for example)

 

Did you do this?

DROP TABLE IF EXISTS `monarch`;
CREATE TABLE `monarch` (
  `empire` int(10) unsigned NOT NULL DEFAULT '0',
  `pid` int(10) unsigned DEFAULT NULL,
  `windate` datetime DEFAULT NULL,
  `money` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`empire`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of monarch
-- ----------------------------
INSERT INTO `monarch` VALUES ('1', '266', '2014-02-04 04:36:55', '0');
INSERT INTO `monarch` VALUES ('2', '188', '2013-11-07 20:10:00', '0');
INSERT INTO `monarch` VALUES ('3', '170', '2013-09-16 22:12:06', '0');
Link to comment
Share on other sites

  • Premium

Hello,

I found a little mistake.

 

[...]table.insert(menu, data[i][1].." "..tostring(data[i][2].." Yang"))[...]

This method is doing like this: tostring(150000.." Yang") - Bad!

The correct is: tostring(150000).." Yang"

 

Fixed, thank you.

 

Also updated to reflect that oh.takemonarchmoney() is getting fixed in Vanilla Core.

Link to comment
Share on other sites

SYSERR: Feb  9 17:56:13 :: Start: TABLE_POSTFIX not configured use default
SYSERR: Feb  9 17:56:22 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:25 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:56:27 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:30 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:32 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:37 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:39 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:46 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:55 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:08 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:09 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:11 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:12 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:15 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:16 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:19 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:19 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:22 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:23 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:29 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:30 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:35 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:37 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:37 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:05 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:24 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:46 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:46 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:47 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:47 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:55 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 24SYSERR: Feb  9 17:56:13 :: Start: TABLE_POSTFIX not configured use default
SYSERR: Feb  9 17:56:22 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:25 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:56:27 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:30 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:32 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:35 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:37 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:39 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:44 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:46 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:56:55 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:56:56 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:08 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:09 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:11 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:12 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:15 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:16 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:19 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:19 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:22 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:23 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:27 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:29 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:30 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:35 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:35 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:37 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:37 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:45 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:57:55 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:04 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:05 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:14 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:23 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:24 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:33 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:46 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:46 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:47 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:47 :: Process: FDWATCH: peer null in event: ident 24
SYSERR: Feb  9 17:58:55 :: Process: FDWATCH: peer null in event: ident 21
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 23
SYSERR: Feb  9 17:58:56 :: Process: FDWATCH: peer null in event: ident 24
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.