JazZ* Publicado 13 de Mayo del 2014 Reportar Compartir Publicado 13 de Mayo del 2014 Espero que les guste Sistema de Monarca Para DB superiores a 33k Autores: Musicinstructor y Shogun Breve Explicación del Sistema: El Sistema de Monarca consta de las siguientes etapas: 1.- Etapa de Candidatura: Cuando el miembro del STAFF activa el sistema, anunciará a todo el servidor que las candidaturas a Monarca están activas, es donde el Player (Jugador) puede postular a Monarca visitando al Alguacil de Batallas para posteriormente leer los requisitos que se requiere para poder postular como candidato. NOTA: Esta etapa puede estar activa el tiempo que disponga el STAFF. 2.- Etapa de Elecciones: Una vez acabado el tiempo de candidatura el STAFF procede al siguiente paso, que es activar las votaciones a los miembros que se registraron como candidatos a Monarca, todos los Jugadores podrán votar por su candidato favorito, pero antes deben conseguir el certificado que les permite el permiso de votación para su reino. 3.- Etapa de Reinado: Finalmente cuando el STAFF decide cerrar las votaciones, se anuncian los Monarcas elegidos de cada Reino. INSTALACIÓN 1.- Crear un archivo en share/data/monarch_election (con el comando: touch share/data/monarch_election) 2.- Crear la tabla "Monarch" (Esto viene con la mayoría de SF tal vez no te sea necesario crearla) 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.- Asegurarse que el Item 60004 (Certificado) exista y tenga un icono. 4.- Quest: 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("Has sido desposeído de tu Bendición Angelical.") 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("Por favor, desequipa tu armadura de Monarca.") syschat("No se te permite usarla.") else local armor = 11971 + pc.get_job() pc.removeitem(armor) syschat("Has sido desposeído de tu armadura de Monarca.") end end end if game.get_event_flag("monarch_elect") > 0 and pc.get_level() >= 40 then send_letter("Elección del Monarca") end end when button or info begin if game.get_event_flag("monarch_elect") == 1 then say_title("Candidaturas a la monarquía") say("") ----"12345678901234567890123456789012345678901234567890"| say("Si desea presentarse para ser el próximo Monarca,") say("debe hablar con el Alguacil de Batalla en la") say("ciudad. Recuerde que necesitarás 1.000.000 Yang y") say("nivel 65 para ello.") say("") say("Cuando el proceso de Candidatura termine, podrás votar.") elseif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then say_title("Elecciones a Monarca") say("") ----"12345678901234567890123456789012345678901234567890"| say("Ya ha realizado su voto. Los resultados serán") say("anunciados al final de las elecciones.") else say_title("Elecciones a Monarca") say("") ----"12345678901234567890123456789012345678901234567890"| say("Diríjase al Alguacil de Batalla para votar.") say("Necesitará este objeto:") say("") say_item_vnum(60004) say("Puedesobtenerlo matando monstruos y enemigos.") 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("Ha sido autorizado para votar en las elecciones.") end end end end when electionman1.chat."GM: Ajustes de elección a Monarca" or electionman2.chat."GM: Ajustes de elección a Monarca" or electionman3.chat."GM: Ajustes de elección a Monarca" with pc.is_gm() begin if game.get_event_flag("monarch_elect") == 1 then say_title("Candidaturas a la monarquía:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("Actualmente las candidaturas para la elección") say("del nuevo Monarca estan abiertas.") say("") say("Desea cerrarlas ahora?") say("") local s = select("Cerrar", "Continuar" ) if s == 1 then notice_all("Las elecciones a Monarca acaba de empezar!") notice_all("Dirígete al Algacil de Batallas, presenta tu Certificado") notice_all("y vota por tu candidato.") game.set_event_flag("monarch_elect", 2) game.set_event_flag("monarch_electionid", get_global_time()) say_title("Candidaturas a la monarquía:") say("") say("Candidaturas cerradas, ahora se abren") say("las votaciones para el nuevo Monarca.") say("") end elseif game.get_event_flag("monarch_elect") == 2 then say_title("Elecciones a Monarca:") say("") say("Elecciones a Monarca en proceso..") say("Cerrar votaciones?") say("") say_reward("Votación actual:") say_reward("Shinsoo: "..monarch_election.getcurrentwinner(1)[1]) say_reward("Chunjo: "..monarch_election.getcurrentwinner(2)[1]) say_reward("Jinno: "..monarch_election.getcurrentwinner(3)[1]) say("") local s = select("Terminar", "Continuar") if s == 1 then notice_all("Las votaciones a la elección del nuevo Monarca acaban de cerrarse.") 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("Elecciones a Monarca:") say("") say("Aquí puede permitir las candidaturas a la monarquía.") say("") say("Iniciar candidaturas ahora?") say("") local s = select("Si", "No") if s == 1 then notice_all("Ha empezado la candidatura a la Monarquía!") notice_all("Dirígete al Algacil de Batallas para participar.") 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."Elecciones a Monarca" or electionman2.chat."Elecciones a Monarca" or electionman3.chat."Elecciones a Monarca" with game.get_event_flag("monarch_elect") == 2 begin say_title("Elecciones a Monarca:") say("") if pc.get_level() < 45 then say("Necesita ser Nivel 45 o más para poder votar,") say("vuelva cuando cumpla este requisito.") say("") return end if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then say("No puede volver a votar!") say("") return end if pc.count_item(60004) < 1 then say("Lo siento, debe mostrarme el certificado") say("para demostrar que pertenece al "..locale.empire_names[pc.get_empire()]..".") say("") say_item_vnum(60004) say("Puede obtenerlo matando monstruos y enemigos.") say("*Vuelva cuando lo tenga.") say("") return end local gname_table = monarch_election.candidacy_list(pc.get_empire()) if table.getn(gname_table) == 0 then -- no currently war say("No hay candidatos disponibles!") say("") else table.insert(gname_table, "Cancel") ----"123456789012345678901234567890123456789012345678901234567890"| say("Bien! tiene la autorización para poder votar,") say("hágalo cuidadosamente ya que solo puede hacerlo una vez.") 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("Elecciones a Monarca:") say("") say("Se agradece su participación.") say("") say_reward("Su voto fue para: "..gname_table[s]) say("") end end end when electionman1.chat."Postular a la Monarquía" or electionman2.chat."Postular a la Monarquía" or electionman3.chat."Postular a la Monarquía" with game.get_event_flag("monarch_elect") == 1 begin local NEED_MONEY = 1000000 local NEED_LEVEL = 65 say_title("Candidaturas a la monarquía:") say("") say("Para postular como el nuevo Monarca necesitas:") say("") say_reward("1. "..NEED_MONEY.." Yang para poder postular.") say_reward("2. Nivel superior o igual a "..NEED_LEVEL..".") say("") if game.get_event_flag("monarch_elect") == 0 then say("Elecciones a la Monarquía cerradas.") say("") say("Vuelva luego") say("") return end if game.get_event_flag("monarch_electionid") == pc.getqf("electionid") then say("*Usted ya esta entre los candidatos a la Monarquía.") say("") return end say("Cumples todos los requisitos y deseas postular?") say("") local s = select("Sí, Postular", "No, Gracias.") if s == 1 then say_title("Candidaturas a la monarquía:") say("") if monarch_election.candidacycount(pc.get_empire()) >= 8 then say("Lo sentimos, ya hay suficientes candidatos.") say("") say("Intente en las próximas elecciones.") elseif pc.get_gold() >= NEED_MONEY and pc.get_level() >= NEED_LEVEL then say("Muy Bien!") say("Ahora forma parte de los candidatos para la elección.") say("del nuevo Monarca.") say("") say("Buena Suerte!") pc.change_gold(-NEED_MONEY); monarch_election.candidacy(); pc.setqf("electionid", game.get_event_flag("monarch_electionid")) else say("Lo siento, no cumple con los requisitos.") 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 = {"Nadie", 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 q.set_icon("scroll_open_blue.tga") send_letter("Felicitaciones!") end when button or info begin local treatment = { [0] = "Rey", [1] = "Reina", } local prefix = { [0] = "el", [1] = "la", } local armor = 11971 + pc.get_job() ----"123456789012345678901234567890123456789012345678901234567890"| say_title("Felicitaciones!") say("") say("Has sido elegido como "..prefix[pc.get_sex()].." nuevo "..treatment[pc.get_sex()].." de "..locale.empire_names[pc.get_empire()].."!") say("") say("como "..treatment[pc.get_sex()]..", se le concede la Armadura de Monarca") say("y la Bendición Angelical mientras dure su reinado.") say("") say("Esta Joya le permitirá utilizar habilidades Monárquicas") say("limitadas y dependiente del Yang que disponga,") say("elija sabiamente.") say("") say("Mucha Prosperidad para su Reinado!") 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("El "..treatment[pc.get_sex()].." "..pc.getname().." de "..locale.empire_names[pc.get_empire()].." ha sido coronado "..treatment[pc.get_sex()].."!") end endend 5.- Locale.lua: locale.empire_names = {[0] = "Todos",[1] = "Shinsoo",[2] = "Chunjo",[3] = "Jinno",} 6.- Questlib.lua: function string:split(delimiter)local result = {}local from = 1local delim_from, delim_to = string.find(self, delimiter, from) while delim_from dotable.insert(result, string.sub(self, from , delim_from-1))from = delim_to + 1delim_from, delim_to = string.find(self, delimiter, from)endtable.insert(result, string.sub(self, from))return resultend 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, } 7.- Item_List (Certificado): 60004 ETC icon/item/60002.tga 8.- Item_Proto: 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 070021 ±ºÁÖÀÇ ÁõÇ¥ 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 9.- FIN xD Gracias Neo, Shogun, Miguelito y 6 mas reacciono a esto 9 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
LovePlay Publicado 13 de Mayo del 2014 Reportar Compartir Publicado 13 de Mayo del 2014 Buen aporte, gracias Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Jeo Publicado 13 de Mayo del 2014 Reportar Compartir Publicado 13 de Mayo del 2014 Joder aportazo +1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Shogun Publicado 13 de Mayo del 2014 Reportar Compartir Publicado 13 de Mayo del 2014 Gracias por la traducción Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Tiico™ Publicado 14 de Mayo del 2014 Reportar Compartir Publicado 14 de Mayo del 2014 cd /usr/home/game/share/datatouch monarch_election Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Shilax Publicado 8 de Octubre del 2014 Reportar Compartir Publicado 8 de Octubre del 2014 Alguien me podria decir como se activan las votaciones ? Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
JazZ* Publicado 8 de Octubre del 2014 Author Reportar Compartir Publicado 8 de Octubre del 2014 Alguien me podria decir como se activan las votaciones ? Tienes que tener el Rango de [GM] e ir al Alguacil de Batallas y activarlo con la opción que te sale. Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Shilax Publicado 9 de Octubre del 2014 Reportar Compartir Publicado 9 de Octubre del 2014 Ah vale pero esque meti la quest correctamente tal y como esta pero no me sale la opcion en el alguacil de batalla sabes como puedo arreglarlo? Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Metin2LuzDorada Publicado 26 de Julio del 2015 Reportar Compartir Publicado 26 de Julio del 2015 Podrian subir la quest en archivo no me entra en los files Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
JeS Publicado 27 de Julio del 2015 Reportar Compartir Publicado 27 de Julio del 2015 Aquí tienes.. quest monarch_election beginstate start beginwhen login or enter beginif oh.ismonarch() > 0 and pc.count_item(70021) == 0 thenset_state(newking)elseif oh.ismonarch() == 0 thenif pc.count_item(70021) > 0 thenpc.remove_item(70021)syschat("Has sido desposeído de tu Bendición Angelical.")endif pc.count_item(11971) > 0 or pc.count_item(11972) > 0 or pc.count_item(11973) > 0 or pc.count_item(11974) > 0 thenif pc.get_part(PART_MAIN) > 11970 and pc.get_part(PART_MAIN) < 11975 thensyschat("Por favor, desequipa tu armadura de Monarca.")syschat("No se te permite usarla.")elselocal armor = 11971 + pc.get_job()pc.removeitem(armor)syschat("Has sido desposeído de tu armadura de Monarca.")endendendif game.get_event_flag("monarch_elect") > 0 and pc.get_level() >= 40 thensend_letter("Elección del Monarca")endendwhen button or info beginif game.get_event_flag("monarch_elect") == 1 thensay_title("Candidaturas a la monarquía")say("")----"12345678901234567890123456789012345678901234567890"|say("Si desea presentarse para ser el próximo Monarca,")say("debe hablar con el Alguacil de Batalla en la")say("ciudad. Recuerde que necesitarás 1.000.000 Yang y")say("nivel 65 para ello.")say("")say("Cuando el proceso de Candidatura termine, podrás votar.")elseif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") thensay_title("Elecciones a Monarca")say("")----"12345678901234567890123456789012345678901234567890"|say("Ya ha realizado su voto. Los resultados serán")say("anunciados al final de las elecciones.")elsesay_title("Elecciones a Monarca")say("")----"12345678901234567890123456789012345678901234567890"|say("Diríjase al Alguacil de Batalla para votar.")say("Necesitará este objeto:")say("")say_item_vnum(60004)say("Puedesobtenerlo matando monstruos y enemigos.")endsay("")endwhen kill with game.get_event_flag("monarch_elect") > 0 and pc.level >= 45 beginif game.get_event_flag("monarch_electionid") != pc.getqf("electionid") thenif not npc.is_pc() thenlocal limit = get_mob_level[npc.get_race()]if limit == nil thenreturnelseif pc.get_level() > limit+10 thenreturnendendendif number(1, 500) == 1 thenif pc.count_item(60004) == 0 and pc.enough_inventory(60004) thenpc.give_item2(60004, 1)syschat("Ha sido autorizado para votar en las elecciones.")endendendendwhen electionman1.chat."GM: Ajustes de elección a Monarca" or electionman2.chat."GM: Ajustes de elección a Monarca" or electionman3.chat."GM: Ajustes de elección a Monarca" with pc.is_gm() beginif game.get_event_flag("monarch_elect") == 1 thensay_title("Candidaturas a la monarquía:")say("")----"123456789012345678901234567890123456789012345678901234567890"|say("Actualmente las candidaturas para la elección")say("del nuevo Monarca estan abiertas.")say("")say("Desea cerrarlas ahora?")say("")local s = select("Cerrar", "Continuar" )if s == 1 thennotice_all("Las elecciones a Monarca acaba de empezar!")notice_all("Dirígete al Algacil de Batallas, presenta tu Certificado")notice_all("y vota por tu candidato.")game.set_event_flag("monarch_elect", 2)game.set_event_flag("monarch_electionid", get_global_time())say_title("Candidaturas a la monarquía:")say("")say("Candidaturas cerradas, ahora se abren")say("las votaciones para el nuevo Monarca.")say("")endelseif game.get_event_flag("monarch_elect") == 2 thensay_title("Elecciones a Monarca:")say("")say("Elecciones a Monarca en proceso..")say("Cerrar votaciones?")say("")say_reward("Votación actual:")say_reward("Shinsoo: "..monarch_election.getcurrentwinner(1)[1])say_reward("Chunjo: "..monarch_election.getcurrentwinner(2)[1])say_reward("Jinno: "..monarch_election.getcurrentwinner(3)[1])say("")local s = select("Terminar", "Continuar")if s == 1 thennotice_all("Las votaciones a la elección del nuevo Monarca acaban de cerrarse.")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]) endif monarch_election.getcurrentwinner(2)[2] != 0 then mgmt.monarch_change_lord(2, monarch_election.getcurrentwinner(2)[2]) endif monarch_election.getcurrentwinner(3)[2] != 0 then mgmt.monarch_change_lord(3, monarch_election.getcurrentwinner(3)[2]) endendelseif game.get_event_flag("monarch_elect") == 0 thensay_title("Elecciones a Monarca:")say("")say("Aquí puede permitir las candidaturas a la monarquía.")say("")say("Iniciar candidaturas ahora?")say("")local s = select("Si", "No")if s == 1 thennotice_all("Ha empezado la candidatura a la Monarquía!")notice_all("Dirígete al Algacil de Batallas para participar.")game.set_event_flag("monarch_elect", 1)game.set_event_flag("monarch_electionid", get_global_time())monarch_election.clearcandidacy()endendendwhen electionman1.chat."Elecciones a Monarca" or electionman2.chat."Elecciones a Monarca" or electionman3.chat."Elecciones a Monarca" with game.get_event_flag("monarch_elect") == 2 beginsay_title("Elecciones a Monarca:")say("")if pc.get_level() < 45 thensay("Necesita ser Nivel 45 o más para poder votar,")say("vuelva cuando cumpla este requisito.")say("")returnendif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") thensay("No puede volver a votar!")say("")returnendif pc.count_item(60004) < 1 thensay("Lo siento, debe mostrarme el certificado")say("para demostrar que pertenece al "..locale.empire_names[pc.get_empire()]..".")say("")say_item_vnum(60004)say("Puede obtenerlo matando monstruos y enemigos.")say("*Vuelva cuando lo tenga.")say("")returnendlocal gname_table = monarch_election.candidacy_list(pc.get_empire())if table.getn(gname_table) == 0 then-- no currently warsay("No hay candidatos disponibles!")say("") elsetable.insert(gname_table, "Cancel")----"123456789012345678901234567890123456789012345678901234567890"|say("Bien! tiene la autorización para poder votar,")say("hágalo cuidadosamente ya que solo puede hacerlo una vez.")say("")wait()local s = select_table(gname_table)if s == table.getn(gname_table) thenreturn;elsemonarch_election.election(s)pc.setqf("electionid", game.get_event_flag("monarch_electionid"))pc.remove_item(60004, 1)say_title("Elecciones a Monarca:")say("")say("Se agradece su participación.")say("")say_reward("Su voto fue para: "..gname_table)say("")endendendwhen electionman1.chat."Postular a la Monarquía" or electionman2.chat."Postular a la Monarquía" or electionman3.chat."Postular a la Monarquía" with game.get_event_flag("monarch_elect") == 1 beginlocal NEED_MONEY = 1000000local NEED_LEVEL = 65say_title("Candidaturas a la monarquía:")say("")say("Para postular como el nuevo Monarca necesitas:")say("")say_reward("1. "..NEED_MONEY.." Yang para poder postular.")say_reward("2. Nivel superior o igual a "..NEED_LEVEL..".")say("")if game.get_event_flag("monarch_elect") == 0 thensay("Elecciones a la Monarquía cerradas.")say("")say("Vuelva luego")say("")returnendif game.get_event_flag("monarch_electionid") == pc.getqf("electionid") thensay("*Usted ya esta entre los candidatos a la Monarquía.")say("")returnendsay("Cumples todos los requisitos y deseas postular?")say("")local s = select("Sí, Postular", "No, Gracias.")if s == 1 thensay_title("Candidaturas a la monarquía:")say("")if monarch_election.candidacycount(pc.get_empire()) >= 8 thensay("Lo sentimos, ya hay suficientes candidatos.")say("")say("Intente en las próximas elecciones.")elseif pc.get_gold() >= NEED_MONEY and pc.get_level() >= NEED_LEVEL thensay("Muy Bien!")say("Ahora forma parte de los candidatos para la elección.")say("del nuevo Monarca.")say("")say("Buena Suerte!")pc.change_gold(-NEED_MONEY);monarch_election.candidacy();pc.setqf("electionid", game.get_event_flag("monarch_electionid"))elsesay("Lo siento, no cumple con los requisitos.")endsay("")endendfunction 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()endfunction clearcandidacy()local f = io.open("data/monarch_election", "w+")f:close()endfunction candidacycount(empire)local count = 0local f = io.open("data/monarch_election", "r")for line in f:lines() dolocal e = string.split(line, "t")if e != nil and tonumber(e[2]) == empire thencount = count + 1endendf:close()return countendfunction candidacy_list(empire)local res = {}local f = io.open("data/monarch_election", "r")for line in f:lines() docinfo = string.split(line, "t")if tonumber(cinfo[2]) == empire thentable.insert(res, cinfo[4])endendf:close()return resendfunction election(id)local c_list = {}local c_count = 0local f = io.open("data/monarch_election", "r")for line in f:lines() dotable.insert(c_list, string.split(line, "t"))c_count = c_count + 1endf:close()f = io.open("data/monarch_election", "w+")local e_i = 1for i = 1, c_count, 1 doif e_i == id thenc_list[3] = tonumber(c_list[3]) + 1endif tonumber(c_list[2]) == pc.get_empire() thene_i = e_i + 1endf:write(c_list[1].."t"..c_list[2].."t"..c_list[3].."t"..c_list[4].."tn")endf:close()endfunction getcurrentwinner(empire)local res = {"Nadie", 0}local f = io.open("data/monarch_election", "r")local maxvotes = -1for line in f:lines() dolocal exploded = string.split(line, "t")if tonumber(exploded[2]) == empire and tonumber(exploded[3]) > maxvotes thenmaxvotes = tonumber(exploded[3])res = {exploded[4], tonumber(exploded[1])}endendf:close()return resendendstate newking beginwhen login or enter beginq.set_icon("scroll_open_blue.tga")send_letter("Felicitaciones!")endwhen button or info beginlocal treatment = {[0] = "Rey",[1] = "Reina",}local prefix = {[0] = "el",[1] = "la",}local armor = 11971 + pc.get_job()----"123456789012345678901234567890123456789012345678901234567890"|say_title("Felicitaciones!")say("")say("Has sido elegido como "..prefix[pc.get_sex()].." nuevo "..treatment[pc.get_sex()].." de "..locale.empire_names[pc.get_empire()].."!")say("")say("como "..treatment[pc.get_sex()]..", se le concede la Armadura de Monarca")say("y la Bendición Angelical mientras dure su reinado.")say("")say("Esta Joya le permitirá utilizar habilidades Monárquicas")say("limitadas y dependiente del Yang que disponga,")say("elija sabiamente.")say("")say("Mucha Prosperidad para su Reinado!")say("")clear_letter()set_state(start)if pc.count_item(armor) == 0 thenpc.give_item2(armor)endif pc.count_item(70021) == 0 thenpc.give_item2(70021)endnotice_all("El "..treatment[pc.get_sex()].." "..pc.getname().." de "..locale.empire_names[pc.get_empire()].." ha sido coronado "..treatment[pc.get_sex()].."!")endendend Micha reacciono a esto 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Mensajes recomendados
Unirse a la conversación
Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.