Eroare la implementare Quest

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

*Problemă/Întrebare: Ajutor va rog Eroare la implementare Quest
Tipologie server:PvM
*Resursă folosită:nu e pe aicea
*ServerFiles utilizat:nu e pe aicea
*Syserr:
Poză:Imagine
*Detalii suplimentare:incerc sa editez acest quest si cand dau ./qc imi apare eroare din imiagine va rog daca puteti sa ma ajutati, am pus si questu care vreau sa il editez si sa ii dau ./qc dar nu merge. Va multumesc Frumos.
--[[

-- Init - The Teleport Ring Class

]]

TeleportRing = {};

TeleportRing.ReturnData = function()
if (TeleportRing.data == nil) then
TeleportRing.data = {
{
["TeleportMapName"] = "Sate (Nivel 1~25)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Pyungmoo (Nivel 1~25)", ["x"] = 959600, ["y"] = 269700},
{["OtherIndexName"] = "Bakra (Nivel 24~39)", ["x"] = 863800, ["y"] = 246000},
{["OtherIndexName"] = "Joan (Nivel 1~25)", ["x"] = 63200, ["y"] = 166700},
{["OtherIndexName"] = "Bokjung (Nivel 24~39)", ["x"] = 145700, ["y"] = 239800},
{["OtherIndexName"] = "Yongan (Nivel 1~25)", ["x"] = 473900, ["y"] = 954600},
{["OtherIndexName"] = "Jayang (Nivel 24~39)", ["x"] = 352300, ["y"] = 882700}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false

},
{
["TeleportMapName"] = "Temniþele Maimuþelor (Nivel: 25~60)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Temniþa Maimuþei(Uºor) (Nivel 25~35)", ["x"] = 980400, ["y"] = 471600},
{["OtherIndexName"] = "Temniþa Maimuþei(Normalã) (Nivel 35~40)", ["x"] = 190800, ["y"] = 691400},
{["OtherIndexName"] = "Temniþa Maimuþei(Expert) (Nivel 45~55)", ["x"] = 189500, ["y"] = 771100}},
["TeleportLevelCheck"] = true,
["TeleportLevel"] = {20, 65},
["TeleportItemCheck"] = false,
["TeleportItems"] = {71095, 1}
},


--{
-- ["TeleportMapName"] = "Biolog & Gaya",
-- ["TeleportHasOtherIndexs"] = true,
-- ["TeleportTheOtherIndexes"] = {
-- {["OtherIndexName"] = "Pescar", ["x"] = 964300, ["y"] = 252500},
-- {["OtherIndexName"] = "Biologul Chaegirab", ["x"] = 950800, ["y"] = 233500},
-- {["OtherIndexName"] = "Gaya", ["x"] = 951900, ["y"] = 286100},
-- ["TeleportLevelCheck"] = false,
-- ["TeleportItemCheck"] = false
--
--},

{
["TeleportMapName"] = "Valea Seungryong (Nivel 39~49)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Orci(Mijloc)(49-59)", ["x"] = 332700, ["y"] = 745600},
{["OtherIndexName"] = "Metinul Umbrei 1/Insulã dreapta(Metin Lv.45)", ["x"] = 390500, ["y"] = 715700},
{["OtherIndexName"] = "Metinul Umbrei 2/Insulã dreapta sus(Metin Lv.45)", ["x"] = 392300, ["y"] = 678800},
{["OtherIndexName"] = "Metinul Sufletului/Insulã stânga(Metin Lv.40)", ["x"] = 277200, ["y"] = 735100},
{["OtherIndexName"] = "Metine combinate/Insulã stânga jos(Metin Lv.40)", ["x"] = 279700, ["y"] = 794000},
{["OtherIndexName"] = "Orci(Sfârºit)(Nivel 40+)", ["x"] = 284200, ["y"] = 809600}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false,
},
{
["TeleportMapName"] = "Deºertul Yongbi (Nivel 29~59)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Deºert(Mijloc)(29~59)", ["x"] = 296300, ["y"] = 547500},
{["OtherIndexName"] = "Metinul Sufletului/Stânga jos(Metin Lv.40)", ["x"] = 224800, ["y"] = 606600},
{["OtherIndexName"] = "Metinul Umbrei/Dreapta jos(Metin Lv.45)", ["x"] = 333000, ["y"] = 622200},
{["OtherIndexName"] = "Metinul Puterii/Dreapta sus(Metin Lv.50)", ["x"] = 327600, ["y"] = 517000}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false,
},
{
["TeleportMapName"] = "Turnul Demonilor - Cat. Diavolului",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Turnul Demonilor (Nivel 49~59)", ["x"] = 590400, ["y"] = 110500},
{["OtherIndexName"] = "Catacombele Diavolului (Nivel 75+)", ["x"] = 591900, ["y"] = 100200}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false
},
{
["TeleportMapName"] = "Muntele Sohan - Turnul lui Nemere",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Muntele Sohan Mijloc (Nivel 49~69)", ["x"] = 436200, ["y"] = 215300},
{["OtherIndexName"] = "Metinul Diavolului/Jos Mijloc(Lv. 55)", ["x"] = 436100, ["y"] = 275600},
{["OtherIndexName"] = "Metinul Diavolului/Stânga Mijloc(Lv. 55)", ["x"] = 400800, ["y"] = 234700},
{["OtherIndexName"] = "Metinul Morþi/Dreapta Jos(Lv. 65)", ["x"] = 493000, ["y"] = 274500},
{["OtherIndexName"] = "Turnul lui Nemere (Nivel 90+)", ["x"] = 432100, ["y"] = 164800}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false
},
{
["TeleportMapName"] = "Þara de Foc - Purg. lui Razador",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 605100, ["y"] = 685900},
{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 615700, ["y"] = 650800},
{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 650000, ["y"] = 655100},
{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 681500, ["y"] = 664000},
{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 722700, ["y"] = 662000},
{["OtherIndexName"] = "Purg. lui Razador (Nivel 90+)", ["x"] = 599300, ["y"] = 707200}},
["TeleportLevelCheck"] = false,
["TeleportItemCheck"] = false
},
{
["TeleportMapName"] = "Temniþele Pãianjenilor V1 (Nivel: 35~55)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "V1(Început)(Nivel 34~54)", ["x"] = 59800, ["y"] = 497300},
{["OtherIndexName"] = "V1(Sfârºit)(34~54)", ["x"] = 91900, ["y"] = 525400}},
--["TeleportLevelCheck"] = false,
--["TeleportLevel"] = {25, 75},
--["TeleportItemCheck"] = false,
--["TeleportItems"] = {71095, 1}
},
{
["TeleportMapName"] = "Temniþele Pãianjenilor V2 (Nivel: 55~75)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "V2(Început) (Nivel 55~75)", ["x"] = 665600, ["y"] = 435200},
{["OtherIndexName"] = "V2(Sfârºit) (Nivel 55~75)", ["x"] = 704100, ["y"] = 521900},
{["OtherIndexName"] = "Spider Dungeon 3 (Nivel 65+)", ["x"] = 97600, ["y"] = 571100},
{["OtherIndexName"] = "SD3(Sfârºit) (Nivel 65+)", ["x"] = 68800, ["y"] = 610700}},
["TeleportLevelCheck"] = false,
["TeleportLevel"] = {35, 75},
["TeleportItemCheck"] = false,
["TeleportItems"] = {71095, 1}
},
--{
-- ["TeleportMapName"] = "Tãrâmul Giganþilor (Nivel 69~79)",
-- ["TeleportHasOtherIndexs"] = false,
-- ["TeleportLevelCheck"] = false,
-- ["TeleportItemCheck"] = false,
-- ["x"] = 828100,
-- ["y"] = 763400
--},
{
["TeleportMapName"] = "Regiunile de Pãdure(Nivel: 55~100)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Pãdurea Fantomã (Nivel 59~69)", ["x"] = 288700, ["y"] = 5700},
{["OtherIndexName"] = "Metin Pung-Ma/Curba jos(Lv. 75)", ["x"] = 299300, ["y"] = 33600},
{["OtherIndexName"] = "Metin Ma-An/Curba(Lv. 80)", ["x"] = 296400, ["y"] = 13400},
{["OtherIndexName"] = "Metin Ma-An/Curba sus(Lv. 80)", ["x"] = 324600, ["y"] = 3600},
{["OtherIndexName"] = "Pãdurea Roºie (Nivel 69-89)", ["x"] = 1119900, ["y"] = 70800},
{["OtherIndexName"] = "Metin Tu-Young/început(Lv. 85)", ["x"] = 1086400, ["y"] = 69300},
{["OtherIndexName"] = "Metin Tu-Young/început 2(Lv. 85)", ["x"] = 1061700, ["y"] = 64600},
{["OtherIndexName"] = "Metin Jeon-Un/platou sus(Lv. 90)", ["x"] = 1060400, ["y"] = 26400},
{["OtherIndexName"] = "Metin Jeon-Un/curba(Lv. 90)", ["x"] = 1109600, ["y"] = 30900},
{["OtherIndexName"] = "Metin Jeon-Un/sfârºit(Lv. 90)", ["x"] = 1118100, ["y"] = 8600}},
--["TeleportLevelCheck"] = false,
--["TeleportLevel"] = {55, 100},
--["TeleportItemCheck"] = false
},
{
["TeleportMapName"] = "V4 (Nivel 75+)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "V4 (Început) (Nivel 75+)", ["x"] = 153600, ["y"] = 1203200},
{["OtherIndexName"] = "V4 (Sfârºit)(Nivel 75+)", ["x"] = 181500, ["y"] = 1220500}},
--["TeleportLevelCheck"] = false,
--["TeleportLevel"] = {75, 105},
--["TeleportItemCheck"] = false,
--["TeleportItems"] = {30190, 1},
},
{
["TeleportMapName"] = "Regiunile Beta (Nivel: 90~105)",
["TeleportHasOtherIndexs"] = true,
["TeleportTheOtherIndexes"] = {
{["OtherIndexName"] = "Peninsulã (Nivel 90+)", ["x"] = 1024000, ["y"] = 1664000},
{["OtherIndexName"] = "Metinul Furiei/mijloc(Lv. 100)", ["x"] = 1125800, ["y"] = 1737200},
{["OtherIndexName"] = "Metinul Furiei/sus(Lv. 100)", ["x"] = 1099300, ["y"] = 1687200},
{["OtherIndexName"] = "Metinul Nenorocirlor/platou(Lv. 105)", ["x"] = 1153900, ["y"] = 1711900},
{["OtherIndexName"] = "Metinul Nenorocirlor/stânga(Lv. 105)", ["x"] = 1131500, ["y"] = 1703300},
{["OtherIndexName"] = "Metinul Nenorocirlor/mijloc stânga(Lv. 105)", ["x"] = 1048600, ["y"] = 1732300},
{["OtherIndexName"] = "Nephrite (Nivel 90+)", ["x"] = 1049600, ["y"] = 1510400},
{["OtherIndexName"] = "Metinul Cãrbunilor/jos(Lv. 95)", ["x"] = 1104400, ["y"] = 1640900},
{["OtherIndexName"] = "Metinul Cãrbunilor/jos(Lv. 95)", ["x"] = 1103000, ["y"] = 1581000},
{["OtherIndexName"] = "Metinul Tristeþii/jos(Lv. 95)", ["x"] = 1116000, ["y"] = 1630300},
{["OtherIndexName"] = "Metinul Tristeþii/jos(Lv. 95)", ["x"] = 1101300, ["y"] = 1561000},
{["OtherIndexName"] = "Thunder (Nivel 90+)", ["x"] = 1126400, ["y"] = 1510400},
{["OtherIndexName"] = "Metinul Vanitãþii/jos(Lv. 100)", ["x"] = 1148700, ["y"] = 1648300},
{["OtherIndexName"] = "Metinul Vanitãþii/jos stânga(Lv. 100)", ["x"] = 1155000, ["y"] = 1627400},
{["OtherIndexName"] = "Metinul Furiei/jos stânga(Lv. 100)", ["x"] = 1149400, ["y"] = 1605900},
{["OtherIndexName"] = "Metinul Furiei/mijloc stânga(Lv. 100)", ["x"] = 1148800, ["y"] = 1578900},
{["OtherIndexName"] = "Metinul Furiei/mijloc(Lv. 100)", ["x"] = 1213000, ["y"] = 1552900},
{["OtherIndexName"] = "Metinul Vanitãþii/mijloc(Lv. 100)", ["x"] = 1190400, ["y"] = 1574500},
{["OtherIndexName"] = "Guatama (Nivel 90+)", ["x"] = 1177600, ["y"] = 1664000},
{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1218100, ["y"] = 1692100},
{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1207700, ["y"] = 1690100},
{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1228500, ["y"] = 1748100},
{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1247700, ["y"] = 1743900},
{["OtherIndexName"] = "Metinul Rãutãþi/mijloc(Lv. 105)", ["x"] = 1252700, ["y"] = 1691600},
{["OtherIndexName"] = "Metinul Rãutãþi/platou(Lv. 105)", ["x"] = 1291500, ["y"] = 1695400}},
--["TeleportLevelCheck"] = false,
--["TeleportLevel"] = {90, 105},
--["TeleportItemCheck"] = false
},
{
["TeleportMapName"] = "Templul Ochao (Nivel 95+)",
["TeleportHasOtherIndexs"] = false,
["TeleportLevelCheck"] = true,
["TeleportLevel"] = {90, 105},
["TeleportItemCheck"] = false,
["x"] = 853700,
["y"] = 1416400
},
{
["TeleportMapName"] = "Desertul Suferintei (Nivel 95+)",
["TeleportHasOtherIndexs"] = false,
["TeleportLevelCheck"] = true,
["TeleportLevel"] = {90, 105},
["TeleportItemCheck"] = false,
["x"] = 640000,
["y"] = 2252800
},
};
end

return TeleportRing.data;
end

TeleportRing.TeleportIsLevelCheck = function(index)
local data = TeleportRing.ReturnData();

return data[index]["TeleportLevelCheck"];
end

TeleportRing.TeleportIsItemsCheck = function(index)
local data = TeleportRing.ReturnData();

return data[index]["TeleportItemCheck"];
end

TeleportRing.TeleportMapHasOtherIndex = function(index)
local data = TeleportRing.ReturnData();

return data[index]["TeleportHasOtherIndexs"];
end

TeleportRing.InsertWindow = function()
local data = TeleportRing.ReturnData();
local window = {};

for index in data do
table.insert(window, data[index]["TeleportMapName"]);
end
table.insert(window, "Renunþã");

return window;
end

TeleportRing.DisplayOtherIndexWindow = function(WinIndex)
local data = TeleportRing.ReturnData();
local OtherWindow = {};

for index in data[WinIndex]["TeleportTheOtherIndexes"] do
table.insert(OtherWindow, data[WinIndex]["TeleportTheOtherIndexes"][index]["OtherIndexName"]);
end
table.insert(OtherWindow, "Renunþã");

return OtherWindow;
end

TeleportRing.isBetweenLevel = function(index)
local data = TeleportRing.ReturnData();
local pLevel = pc.get_level();

return pLevel >= data[index]["TeleportLevel"][1] and pLevel <= data[index]["TeleportLevel"][2];
end

TeleportRing.hasItemNeeded = function(index)
local data = TeleportRing.ReturnData();

return pc.count_item(data[index]["TeleportItems"][1]) >= data[index]["TeleportItems"][2];
end

TeleportRing.MainWindow = function(iVnum)
local data = TeleportRing.ReturnData();
local InsertedWindowTable = TeleportRing.InsertWindow();

say_title(string.format("%s:", item_name(iVnum)))
local FirstWindow = select_table(InsertedWindowTable);
if (FirstWindow == table.getn(InsertedWindowTable)) then
return false;
else
say_title(string.format("%s:", item_name(iVnum)))
if TeleportRing.TeleportIsLevelCheck(FirstWindow) then
if not TeleportRing.isBetweenLevel(FirstWindow) then
say(string.format("Nivelul tãu trebuie sã fie cuprins între %d ºi %d pentru[ENTER]a putea intra în aceastã mapã.", data[FirstWindow]["TeleportLevel"][1], data[FirstWindow]["TeleportLevel"][2]))
return false;
end
end

if TeleportRing.TeleportIsItemsCheck(FirstWindow) then
if not TeleportRing.hasItemNeeded(FirstWindow) then
say(string.format("Trebuie sa deþi x%d - %s pentru[ENTER]a putea intra în aceastã mapã.", data[FirstWindow]["TeleportItems"][2], item_name(data[FirstWindow]["TeleportItems"][1])))
end
end

if TeleportRing.TeleportMapHasOtherIndex(FirstWindow) then
local OtherInsertedWindowTable = TeleportRing.DisplayOtherIndexWindow(FirstWindow);

local otherWind = select_table(OtherInsertedWindowTable);
if (otherWind == table.getn(OtherInsertedWindowTable)) then
return false;
else
if data[FirstWindow]["TeleportItemCheck"] then
pc.remove_item(data[FirstWindow]["TeleportItems"][1], data[FirstWindow]["TeleportItems"][2]);
end
return pc.warp(data[FirstWindow]["TeleportTheOtherIndexes"][otherWind]["x"], data[FirstWindow]["TeleportTheOtherIndexes"][otherWind]["y"]);
end
end

if data[FirstWindow]["TeleportItemCheck"] then
pc.remove_item(data[FirstWindow]["TeleportItems"][1], data[FirstWindow]["TeleportItems"][2]);
end
return pc.warp(data[FirstWindow]["x"], data[FirstWindow]["y"]);
end
end
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
Sathyr
Veteran

Veteran
Mesaje: 1187
Membru din: 14 Feb 2018, 18:23
Regat: Jinno
Aprecieri: 28  
Mulţumiri: 627  
Discord: Copiază ID
 Contact:
Medalii

Încearcă cu qcest quest:

Cod: Selectaţi tot

quest warpring begin
	state start begin
		when 70007.use begin
			local x
			local y
			local t
			local e = pc.get_empire()
			say_title("Teleporter:")
			say("Încotro vrei să mergi străine?")
			local s = select("Map1", "Map2", "Valea Seungryong", "Deşertul Yongbi", "Muntele Sohan", "Pagina următoare", "Închide")
			if s==6 then
				say_title("Teleporter:")
			say("Încotro vrei să mergi străine?")
				local p = select("Turnul Demonilor", "V1", "Lungsam - Pădurea Fantomelor", "Pădurea Roşie", "Ţara Giganţilor", "Doyyumhwan - Ţara de foc", "Închide")
				if p==1 then
					x="590400"
					y="110500"
				elseif p==2 then
					x="91900"
					y="525400"
				elseif p==3 then
					x="289000"
					y="5800"
				elseif p==4 then
					say_title("Teleporter")
				say("Încotro vrei să mergi străine?")
					t = select("Început", "Sfârşit", "Închide")
					if t==1 then
						x="1119900"
						y="70800"
					elseif t==2 then
						x="1119200"
						y="7000"
					end
				elseif p==5 then
					x="828100"
					y="763400"
				elseif p==6 then
					say_title("Teleporter:")
				say("Încotro vrei să mergi străine?")
					t = select("Început", "Închide")
					if t==1 then
						if e==1 then
							x="599400"
							y="756300"						
						elseif e==2 then
							x="597800"
							y="622200"
						elseif e==3 then
							x="730700"
							y="689800"
						end
					elseif t==2 then
						return
					end
				end
			elseif s==1 then
				say_title("Teleporter")
			say("Încotro vrei să mergi străine?")
				t = select("Jinno - Regatul Albastru", "Chunjo - Regatul Galben", "Shinsoo - Regatul Roşu","Închide")
				if t==1 then
					x="959600"
					y="269700"
				elseif t==2 then
					x="63200"
					y="166700"
				elseif t==3 then
					x="473900"
					y="954600"
				end
			elseif s==2 then
				say_title("Teleporter:")
			say("Încotro vrei să mergi străine?")
				t = select("Bakra - Regatul Albastru", "Bokjung - Regatul Galben", "Yayang - Regatul Roşu", "Închide")
				if t==1 then
					x="863800"
					y="246000"
				elseif t==2 then
					x="145700"
					y="239800"
				elseif t==3 then
					x="352300"
					y="882700"
				end
			elseif s==3 then
				say_title("Teleporter:")
			say("Încotro vrei să mergi străine?")
				t = select("Mijloc", "Inchide")
				if t==1 then
					x="666300"
					y="855200"
				end
			elseif s==4 then
				say_title("Teleporter:")
			say("Încotro vrei să mergi străine?")
				t = select("Inceput", "Sfârşit", "Închide")
				if t==1 then
					if e==1 then
						x="217800"
						y="627200"
					elseif e==2 then
						x="221900"
						y="502700"
					elseif e==3 then
						x="344000"
						y="502500"
					end
				elseif t==2 then
					x="296300"
					y="547500"
				end
			elseif s==5 then
				say_title("Teleporter")
			say("Încotro vrei să mergi străine?")
				t = select("Început", "Mijloc", "Închide")
				if t==1 then
					if e==1 then
						x="434200"
						y="290600"						
					elseif e==2 then
						x="375200"
						y="174900"
					elseif e==3 then
						x="491800"
						y="173600"
					end
				elseif t==2 then
					x="436200"
					y="215300"
				end			
			end			
			if s!=7 or p!= 7 then
				pc.warp(x, y)
			end
		end
	end
end
În quest_list să pui aşa: questdata/inel_teleportare.quest
Numele fişierului îl salvezi cu inel_teleportare.quest.
În quest_functions să ai funcţia: pc.teleport
Imagine -> official.sathyr
Afișează semnătura
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

la-m pus dai pe arata si o sa il vezi da il mai pun odata la cerea dvs:

Cod: Selectaţi tot

--[[

-- Init - The Teleport Ring Class

]]

TeleportRing = {};

TeleportRing.ReturnData = function()
	if (TeleportRing.data == nil) then
		TeleportRing.data = {
			{
				["TeleportMapName"] = "Sate (Nivel 1~25)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Pyungmoo (Nivel 1~25)", ["x"] = 959600, ["y"] = 269700},
					{["OtherIndexName"] = "Bakra (Nivel 24~39)", ["x"] = 863800, ["y"] = 246000},
					{["OtherIndexName"] = "Joan (Nivel 1~25)", ["x"] = 63200, ["y"] = 166700},
					{["OtherIndexName"] = "Bokjung (Nivel 24~39)", ["x"] = 145700, ["y"] = 239800},
					{["OtherIndexName"] = "Yongan (Nivel 1~25)", ["x"] = 473900, ["y"] = 954600},
					{["OtherIndexName"] = "Jayang (Nivel 24~39)", ["x"] = 352300, ["y"] = 882700}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false
				
			},
			{
				["TeleportMapName"] = "Temniþele Maimuþelor (Nivel: 25~60)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Temniþa Maimuþei(Uºor) (Nivel 25~35)", ["x"] = 980400, ["y"] = 471600},
					{["OtherIndexName"] = "Temniþa Maimuþei(Normalã) (Nivel 35~40)", ["x"] = 190800, ["y"] = 691400},
					{["OtherIndexName"] = "Temniþa Maimuþei(Expert) (Nivel 45~55)", ["x"] = 189500, ["y"] = 771100}},
				["TeleportLevelCheck"] = true,
				["TeleportLevel"] = {20, 65},
				["TeleportItemCheck"] = false,
				["TeleportItems"] = {71095, 1}
			},

			
			--{
			--	["TeleportMapName"] = "Biolog & Gaya",
			--	["TeleportHasOtherIndexs"] = true,
			--	["TeleportTheOtherIndexes"] = {
			--		{["OtherIndexName"] = "Pescar", ["x"] = 964300, ["y"] = 252500},
			--		{["OtherIndexName"] = "Biologul Chaegirab", ["x"] = 950800, ["y"] = 233500},
			--		{["OtherIndexName"] = "Gaya", ["x"] = 951900, ["y"] = 286100},
			--	["TeleportLevelCheck"] = false,
			--	["TeleportItemCheck"] = false
			--	
			--},
			
			{
				["TeleportMapName"] = "Valea Seungryong (Nivel 39~49)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Orci(Mijloc)(49-59)", ["x"] = 332700, ["y"] = 745600},
					{["OtherIndexName"] = "Metinul Umbrei 1/Insulã dreapta(Metin Lv.45)", ["x"] = 390500, ["y"] = 715700},
					{["OtherIndexName"] = "Metinul Umbrei 2/Insulã dreapta sus(Metin Lv.45)", ["x"] = 392300, ["y"] = 678800},
					{["OtherIndexName"] = "Metinul Sufletului/Insulã stânga(Metin Lv.40)", ["x"] = 277200, ["y"] = 735100},
					{["OtherIndexName"] = "Metine combinate/Insulã stânga jos(Metin Lv.40)", ["x"] = 279700, ["y"] = 794000},
					{["OtherIndexName"] = "Orci(Sfârºit)(Nivel 40+)", ["x"] = 284200, ["y"] = 809600}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false,
			},
			{
				["TeleportMapName"] = "Deºertul Yongbi (Nivel 29~59)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Deºert(Mijloc)(29~59)", ["x"] = 296300, ["y"] = 547500},
					{["OtherIndexName"] = "Metinul Sufletului/Stânga jos(Metin Lv.40)", ["x"] = 224800, ["y"] = 606600},
					{["OtherIndexName"] = "Metinul Umbrei/Dreapta jos(Metin Lv.45)", ["x"] = 333000, ["y"] = 622200},
					{["OtherIndexName"] = "Metinul Puterii/Dreapta sus(Metin Lv.50)", ["x"] = 327600, ["y"] = 517000}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false,
			},
			{
				["TeleportMapName"] = "Turnul Demonilor - Cat. Diavolului",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Turnul Demonilor (Nivel 49~59)", ["x"] = 590400, ["y"] = 110500},
					{["OtherIndexName"] = "Catacombele Diavolului (Nivel 75+)", ["x"] = 591900, ["y"] = 100200}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false
			},
			{
				["TeleportMapName"] = "Muntele Sohan - Turnul lui Nemere",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Muntele Sohan Mijloc (Nivel 49~69)", ["x"] = 436200, ["y"] = 215300},
					{["OtherIndexName"] = "Metinul Diavolului/Jos Mijloc(Lv. 55)", ["x"] = 436100, ["y"] = 275600},
					{["OtherIndexName"] = "Metinul Diavolului/Stânga Mijloc(Lv. 55)", ["x"] = 400800, ["y"] = 234700},
					{["OtherIndexName"] = "Metinul Morþi/Dreapta Jos(Lv. 65)", ["x"] = 493000, ["y"] = 274500},
					{["OtherIndexName"] = "Turnul lui Nemere (Nivel 90+)", ["x"] = 432100, ["y"] = 164800}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false
			},
			{
				["TeleportMapName"] = "Þara de Foc - Purg. lui Razador",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 605100, ["y"] = 685900},
					{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 615700, ["y"] = 650800},
					{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 650000, ["y"] = 655100},
					{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 681500, ["y"] = 664000},
					{["OtherIndexName"] = "Metinul Crimelor/Teleporter(Lv. 70)", ["x"] = 722700, ["y"] = 662000},
					{["OtherIndexName"] = "Purg. lui Razador (Nivel 90+)", ["x"] = 599300, ["y"] = 707200}},
				["TeleportLevelCheck"] = false,
				["TeleportItemCheck"] = false
			},
						{
				["TeleportMapName"] = "Temniþele Pãianjenilor V1 (Nivel: 35~55)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "V1(Început)(Nivel 34~54)", ["x"] = 59800, ["y"] = 497300},
					{["OtherIndexName"] = "V1(Sfârºit)(34~54)", ["x"] = 91900, ["y"] = 525400}},
				--["TeleportLevelCheck"] = false,
				--["TeleportLevel"] = {25, 75},
				--["TeleportItemCheck"] = false,
				--["TeleportItems"] = {71095, 1}
			},		
			{
				["TeleportMapName"] = "Temniþele Pãianjenilor V2 (Nivel: 55~75)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "V2(Început) (Nivel 55~75)", ["x"] = 665600, ["y"] = 435200},
					{["OtherIndexName"] = "V2(Sfârºit) (Nivel 55~75)", ["x"] = 704100, ["y"] = 521900},
					{["OtherIndexName"] = "Spider Dungeon 3 (Nivel 65+)", ["x"] = 97600, ["y"] = 571100},
					{["OtherIndexName"] = "SD3(Sfârºit) (Nivel 65+)", ["x"] = 68800, ["y"] = 610700}},
				["TeleportLevelCheck"] = false,
				["TeleportLevel"] = {35, 75},
				["TeleportItemCheck"] = false,
				["TeleportItems"] = {71095, 1}
			},
			--{
			--	["TeleportMapName"] = "Tãrâmul Giganþilor (Nivel 69~79)",
			--	["TeleportHasOtherIndexs"] = false,
			--	["TeleportLevelCheck"] = false,
			--	["TeleportItemCheck"] = false,
			--	["x"] = 828100,
			--	["y"] = 763400
			--},
			{
				["TeleportMapName"] = "Regiunile de Pãdure(Nivel: 55~100)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Pãdurea Fantomã (Nivel 59~69)", ["x"] = 288700, ["y"] = 5700},
					{["OtherIndexName"] = "Metin Pung-Ma/Curba jos(Lv. 75)", ["x"] = 299300, ["y"] = 33600},
					{["OtherIndexName"] = "Metin Ma-An/Curba(Lv. 80)", ["x"] = 296400, ["y"] = 13400},
					{["OtherIndexName"] = "Metin Ma-An/Curba sus(Lv. 80)", ["x"] = 324600, ["y"] = 3600},
					{["OtherIndexName"] = "Pãdurea Roºie (Nivel 69-89)", ["x"] = 1119900, ["y"] = 70800},
					{["OtherIndexName"] = "Metin Tu-Young/început(Lv. 85)", ["x"] = 1086400, ["y"] = 69300},
					{["OtherIndexName"] = "Metin Tu-Young/început 2(Lv. 85)", ["x"] = 1061700, ["y"] = 64600},
					{["OtherIndexName"] = "Metin Jeon-Un/platou sus(Lv. 90)", ["x"] = 1060400, ["y"] = 26400},
					{["OtherIndexName"] = "Metin Jeon-Un/curba(Lv. 90)", ["x"] = 1109600, ["y"] = 30900},
					{["OtherIndexName"] = "Metin Jeon-Un/sfârºit(Lv. 90)", ["x"] = 1118100, ["y"] = 8600}},
				--["TeleportLevelCheck"] = false,
				--["TeleportLevel"] = {55, 100},
				--["TeleportItemCheck"] = false
			},
			{
				["TeleportMapName"] = "V4 (Nivel 75+)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "V4 (Început) (Nivel 75+)", ["x"] = 153600, ["y"] = 1203200},
					{["OtherIndexName"] = "V4 (Sfârºit)(Nivel 75+)", ["x"] = 181500, ["y"] = 1220500}},
				--["TeleportLevelCheck"] = false,
				--["TeleportLevel"] = {75, 105},
				--["TeleportItemCheck"] = false,
				--["TeleportItems"] = {30190, 1},
			},
			{
				["TeleportMapName"] = "Regiunile Beta (Nivel: 90~105)",
				["TeleportHasOtherIndexs"] = true,
				["TeleportTheOtherIndexes"] = {
					{["OtherIndexName"] = "Peninsulã (Nivel 90+)", ["x"] = 1024000, ["y"] = 1664000},
					{["OtherIndexName"] = "Metinul Furiei/mijloc(Lv. 100)", ["x"] = 1125800, ["y"] = 1737200},
					{["OtherIndexName"] = "Metinul Furiei/sus(Lv. 100)", ["x"] = 1099300, ["y"] = 1687200},
					{["OtherIndexName"] = "Metinul Nenorocirlor/platou(Lv. 105)", ["x"] = 1153900, ["y"] = 1711900},
					{["OtherIndexName"] = "Metinul Nenorocirlor/stânga(Lv. 105)", ["x"] = 1131500, ["y"] = 1703300},
					{["OtherIndexName"] = "Metinul Nenorocirlor/mijloc stânga(Lv. 105)", ["x"] = 1048600, ["y"] = 1732300},
					{["OtherIndexName"] = "Nephrite (Nivel 90+)", ["x"] = 1049600, ["y"] = 1510400},
					{["OtherIndexName"] = "Metinul Cãrbunilor/jos(Lv. 95)", ["x"] = 1104400, ["y"] = 1640900},
					{["OtherIndexName"] = "Metinul Cãrbunilor/jos(Lv. 95)", ["x"] = 1103000, ["y"] = 1581000},
					{["OtherIndexName"] = "Metinul Tristeþii/jos(Lv. 95)", ["x"] = 1116000, ["y"] = 1630300},
					{["OtherIndexName"] = "Metinul Tristeþii/jos(Lv. 95)", ["x"] = 1101300, ["y"] = 1561000},
					{["OtherIndexName"] = "Thunder (Nivel 90+)", ["x"] = 1126400, ["y"] = 1510400},
					{["OtherIndexName"] = "Metinul Vanitãþii/jos(Lv. 100)", ["x"] = 1148700, ["y"] = 1648300},
					{["OtherIndexName"] = "Metinul Vanitãþii/jos stânga(Lv. 100)", ["x"] = 1155000, ["y"] = 1627400},
					{["OtherIndexName"] = "Metinul Furiei/jos stânga(Lv. 100)", ["x"] = 1149400, ["y"] = 1605900},
					{["OtherIndexName"] = "Metinul Furiei/mijloc stânga(Lv. 100)", ["x"] = 1148800, ["y"] = 1578900},
					{["OtherIndexName"] = "Metinul Furiei/mijloc(Lv. 100)", ["x"] = 1213000, ["y"] = 1552900},
					{["OtherIndexName"] = "Metinul Vanitãþii/mijloc(Lv. 100)", ["x"] = 1190400, ["y"] = 1574500},
					{["OtherIndexName"] = "Guatama (Nivel 90+)", ["x"] = 1177600, ["y"] = 1664000},
					{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1218100, ["y"] = 1692100},	
					{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1207700, ["y"] = 1690100},	
					{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1228500, ["y"] = 1748100},	
					{["OtherIndexName"] = "Metinul Rãutãþi/jos(Lv. 105)", ["x"] = 1247700, ["y"] = 1743900},	
					{["OtherIndexName"] = "Metinul Rãutãþi/mijloc(Lv. 105)", ["x"] = 1252700, ["y"] = 1691600},	
					{["OtherIndexName"] = "Metinul Rãutãþi/platou(Lv. 105)", ["x"] = 1291500, ["y"] = 1695400}},	
				--["TeleportLevelCheck"] = false,
				--["TeleportLevel"] = {90, 105},
				--["TeleportItemCheck"] = false
			},
			{
			["TeleportMapName"] = "Templul Ochao (Nivel 95+)",
			["TeleportHasOtherIndexs"] = false,
			["TeleportLevelCheck"] = true,
			["TeleportLevel"] = {90, 105},
			["TeleportItemCheck"] = false,
			["x"] = 853700,
			["y"] = 1416400
			},
			{
			["TeleportMapName"] = "Desertul Suferintei (Nivel 95+)",
			["TeleportHasOtherIndexs"] = false,
			["TeleportLevelCheck"] = true,
			["TeleportLevel"] = {90, 105},
			["TeleportItemCheck"] = false,
			["x"] = 640000,
			["y"] = 2252800
			},
		};
	end

	return TeleportRing.data;
end

TeleportRing.TeleportIsLevelCheck = function(index)
	local data = TeleportRing.ReturnData();
	
	return data[index]["TeleportLevelCheck"];
end

TeleportRing.TeleportIsItemsCheck = function(index)
	local data = TeleportRing.ReturnData();
	
	return data[index]["TeleportItemCheck"];
end

TeleportRing.TeleportMapHasOtherIndex = function(index)
	local data = TeleportRing.ReturnData();
	
	return data[index]["TeleportHasOtherIndexs"];
end

TeleportRing.InsertWindow = function()
	local data = TeleportRing.ReturnData();
	local window = {};
	
	for index in data do
		table.insert(window, data[index]["TeleportMapName"]);
	end
	table.insert(window, "Renunþã");
	
	return window;
end

TeleportRing.DisplayOtherIndexWindow = function(WinIndex)
	local data = TeleportRing.ReturnData();
	local OtherWindow = {};
	
	for index in data[WinIndex]["TeleportTheOtherIndexes"] do
		table.insert(OtherWindow, data[WinIndex]["TeleportTheOtherIndexes"][index]["OtherIndexName"]);
	end
	table.insert(OtherWindow, "Renunþã");
	
	return OtherWindow;
end

TeleportRing.isBetweenLevel = function(index)
	local data = TeleportRing.ReturnData();
	local pLevel = pc.get_level();
	
	return pLevel >= data[index]["TeleportLevel"][1] and pLevel <= data[index]["TeleportLevel"][2];
end

TeleportRing.hasItemNeeded = function(index)
	local data = TeleportRing.ReturnData();
	
	return pc.count_item(data[index]["TeleportItems"][1]) >= data[index]["TeleportItems"][2];
end

TeleportRing.MainWindow = function(iVnum)
	local data = TeleportRing.ReturnData();
	local InsertedWindowTable = TeleportRing.InsertWindow();
	
	say_title(string.format("%s:", item_name(iVnum)))
	local FirstWindow = select_table(InsertedWindowTable);
	if (FirstWindow == table.getn(InsertedWindowTable)) then
		return false;
	else
		say_title(string.format("%s:", item_name(iVnum)))
		if TeleportRing.TeleportIsLevelCheck(FirstWindow) then
			if not TeleportRing.isBetweenLevel(FirstWindow) then
				say(string.format("Nivelul tãu trebuie sã fie cuprins între %d ºi %d pentru[ENTER]a putea intra în aceastã mapã.", data[FirstWindow]["TeleportLevel"][1], data[FirstWindow]["TeleportLevel"][2]))
				return false;
			end
		end
		
		if TeleportRing.TeleportIsItemsCheck(FirstWindow) then
			if not TeleportRing.hasItemNeeded(FirstWindow) then
				say(string.format("Trebuie sa deþi x%d - %s pentru[ENTER]a putea intra în aceastã mapã.", data[FirstWindow]["TeleportItems"][2], item_name(data[FirstWindow]["TeleportItems"][1])))
				end
		end
		
		if TeleportRing.TeleportMapHasOtherIndex(FirstWindow) then
			local OtherInsertedWindowTable = TeleportRing.DisplayOtherIndexWindow(FirstWindow);
			
			local otherWind = select_table(OtherInsertedWindowTable);
			if (otherWind == table.getn(OtherInsertedWindowTable)) then
				return false;
			else
				if data[FirstWindow]["TeleportItemCheck"] then
					pc.remove_item(data[FirstWindow]["TeleportItems"][1], data[FirstWindow]["TeleportItems"][2]);
				end
				return pc.warp(data[FirstWindow]["TeleportTheOtherIndexes"][otherWind]["x"], data[FirstWindow]["TeleportTheOtherIndexes"][otherWind]["y"]);
			end
		end
		
		if data[FirstWindow]["TeleportItemCheck"] then
			pc.remove_item(data[FirstWindow]["TeleportItems"][1], data[FirstWindow]["TeleportItems"][2]);
		end
		return pc.warp(data[FirstWindow]["x"], data[FirstWindow]["y"]);
	end
end
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

Sathyr scrie: ↑26 Ian 2023, 17:15

Cod: Selectaţi tot

quest warp begin
	state start begin
		when 70007.use begin
			local regat = pc.get_empire()
			
			say_title("Teleporter:")
			say_size(350, 335)
			say_white("Bunã!")
			say_white("Unde doreşti sã fii teleportat?")
			say_white("")
			local mandi = select("Map1","Map2","Valea Seungryong","Deşertul Yongbi","Muntele Sohan","Doyyumhwan","Next")
			
			----------------START-MAP1------------------------------------
			if mandi == 1 then -- Map1
				say_title("Teleporter:")
				say_size(350, 250)
				say_white("Bunã!")
				say_white("Unde doreºti sã fii teleportat?")
				say_white("")
				local map1 = select("Regatul Roºu","Regatul Galben","Regatul Albastru","Închide")
				if map1 == 1 then
					pc.warp(473900, 954600)
					return
				end
				if map1 == 2 then
					pc.warp(63200, 166700)
					return
				end
				if map1 == 3 then
					pc.warp(959600, 269700)
					return
				end
			end
			
			----------------START-MAP2------------------------------------
			if mandi == 2 then -- Map2
				say_title("Teleporter:")
				say_size(350, 250)
				say_white("Bunã!")
				say_white("Unde doreşti sã fii teleportat?")
				say_white("")
				local map2 = select("Regatul Roşu","Regatul Galben","Regatul Albastru","Închide")
				if map2 == 1 then
					pc.warp(352300, 882700)
					return
				end
				if map2 == 2 then
					pc.warp(145700, 239800)
					return
				end
				if map2 == 3 then
					pc.warp(863800, 246000)
					return
				end
			end
		
			------------START-MAPS-RANDOM-IF-MANDI-1then---------------
			if mandi == 3 then -- Valea Seungryong
				pc.warp(332700, 745600)
				return
			end
			if mandi == 4 then -- Deşertul Yongbi
				if regat == 1 then
				pc.warp(217800, 627200)
				return
			end
				if regat == 2 then
				pc.warp(221900, 502700)
				return
			end
				if regat == 3 then
				pc.warp(344000, 502500)
				return
			end
		end
			if mandi == 5 then -- Muntele Sohan
				pc.warp(436200, 215300)
				return
			end
			if mandi == 6 then -- Doyyumhwan
				if regat == 1 then
					pc.warp(599400, 756300)
				return
			end
				if regat == 2 then
					pc.warp(597800, 622200)
				return
			end
				if regat == 3 then
					pc.warp(730700, 689800)
				return
			end
		end
			------------CLOSE-MAPS-RANDOM-IF-MANDI-1then---------------
			
			------------START-MAPS-RANDOM-IF-MANDI-2then---------------
			if mandi == 7 then -- Next Page
				say_title("Teleporter")
				say_size(350, 335)
				say_white("Bunã!")
				say_white("Unde doreşti sã fii teleportat?")
				say_white("")
				local mandi2 = select("Turnul Demonilor","Kuahlo Dong","Lungsam","Pãdurea Roşie","V4","Temniţa Maimuþelor","Închide")
				if mandi2 == 1 then -- Turnul Demonilor 
					pc.warp(590400, 110500)
					return
				end
				if mandi2 == 2 then -- Kuahlo Dong (V2) 
					pc.warp(91900, 525400)
					return
				end
				if mandi2 == 3 then -- Lungsam
					pc.warp(289000, 5800)
					return
				end
				if mandi2 == 4 then -- Pãdurea Roºie
					say_title("Padurea Rosie:")
					say("")
					local padure = select("Început", "Sfârşit")
					if padure == 1 then
						pc.warp(1119900, 70800)
					end
					if padure == 2 then
						pc.warp(1119200, 7000)
					end
				end
				if mandi2 == 5 then -- V4
					pc.warp(153600,	1203200)
					return
				end
				if mandi2 == 6 then -- Temniţa Maimuţelor
					pc.warp(819200, 51200)
					return
				end
			end
		end
	end
end
eu inteleg ca pot pune altu dar vreau pe asta cinve mia zis ca trebui altfel implementat adica nu se poate pune cu ./qc
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

e vorba de implementare cu questuri sau lua cu make.sh da nu stiu cum
#! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "VegaS"
__date__ = "2019-12-11"
__version__ = "0.0.2"

import os
import subprocess
import shutil

os.chdir(os.path.dirname(os.path.realpath(__file__)))

QC_READ_FILE_FROM_LIST = 0
QC_READ_ALL = 1

"""
# QC_READ_FILE_FROM_LIST
# Read the locale_list with all quest/lua files.
"""
# The file with all quest file names.
QC_FILE_NAME = 'quest_list'

"""
# QC_READ_ALL
# Find all of the quest/lua files from root directory
"""
# Directory path of searching quest file names
QC_ROOT_PATH = '.'
# File extensions to be search
QC_EXTENSION_LIST = ('.lua', '.quest')

"""
# General configuration
"""
# Command of quest compiler
QC_COMMAND_STRING = './qc {}'
# Comment string
QC_COMMENT_CHARACTER = '#'
# Default state
QC_READ_STATE = QC_READ_FILE_FROM_LIST

def find_quest_files(type):
"""
Generate all of the file names by specific type.
:param type: int
:return: generator
"""
if type == QC_READ_FILE_FROM_LIST:
with open(QC_FILE_NAME, 'r') as file:
for fileName in file.readlines():
if fileName.strip():
yield fileName
elif type == QC_READ_ALL:
for root, dirs, files in os.walk(QC_ROOT_PATH):
for fileName in files:
if fileName.endswith(QC_EXTENSION_LIST):
yield "{}/{}".format(root, fileName)

def strip_quest_file_name(fileName):
"""
Strip file name, ignore the commented sections.
:param fileName: string
:return: string
"""
fileName = fileName.strip()
if QC_COMMENT_CHARACTER in fileName:
fileName = fileName.split(QC_COMMENT_CHARACTER)[0].strip()
return fileName

def main():
try:
shutil.rmtree('object')
except:
os.mkdir('object')

QC_LOG_DICT = {'ok': 0, 'error': 0}
for fileName in find_quest_files(QC_READ_STATE):
fileName = strip_quest_file_name(fileName)
if fileName:
hasCompiled = subprocess.call(QC_COMMAND_STRING.format(fileName), shell=True) == 0
if not hasCompiled:
print ("Failed: {}".format(fileName))

QC_LOG_DICT['ok' if hasCompiled else 'error'] += 1

print ('All quests are compiled, succeeded: {}, failed: {}.'.format(*QC_LOG_DICT.values()))

if __name__ == "__main__":
main()
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

Nimeni ???
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
FALLEN1
Nivel 4

Nivel 4
Mesaje: 585
Membru din: 14 Noi 2015, 20:12
Server: Dark-Fusion2
Regat: Chunjo
Aprecieri: 366  
Mulţumiri: 758  
  Rezolvări prob.: 2
Discord: Copiază ID
Medalii

google801 scrie: ↑27 Ian 2023, 01:54Nimeni ???
Ce incerci tu sa implementezi e un lib, nu are treaba cu questul propriu zis

Dute in questlib.lua si creaza calea catre acel lib, sa fiu mai exact
dofile(get_locale_base_path().."/quest/nume_folder/TeleportRingLib.lua");
Dupa care creezi un quest si pui in el

Cod: Selectaţi tot

quest teleportRing begin
	state start begin
		when 30897.use begin		
			TeleportRing.MainWindow(item.get_vnum());
		end
	end
end
Edit
quest-uri/new-teleport-ring-t82091.html
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

FALLEN1 scrie: ↑27 Ian 2023, 08:19
google801 scrie: ↑27 Ian 2023, 01:54Nimeni ???
Ce incerci tu sa implementezi e un lib, nu are treaba cu questul propriu zis

Dute in questlib.lua si creaza calea catre acel lib, sa fiu mai exact
dofile(get_locale_base_path().."/quest/nume_folder/TeleportRingLib.lua");
Dupa care creezi un quest si pui in el

Cod: Selectaţi tot

quest teleportRing begin
	state start begin
		when 30897.use begin		
			TeleportRing.MainWindow(item.get_vnum());
		end
	end
end
Edit
quest-uri/new-teleport-ring-t82091.html
da multumesc mult eu trebuia dupa ce editez sa dau ./qc la questu cu vnum de la inel :x :x
[ADMIN]Moise
Afișează semnătura
Avatar utilizator
Spyke
Metin Master

Metin Master
Mesaje: 2613
Membru din: 29 Iul 2016, 09:08
Server: Aoem2
Aprecieri: 205  
Mulţumiri: 3918  
Discord: Copiază ID
Medalii

google801 scrie: ↑27 Ian 2023, 15:24
FALLEN1 scrie: ↑27 Ian 2023, 08:19
google801 scrie: ↑27 Ian 2023, 01:54Nimeni ???
Ce incerci tu sa implementezi e un lib, nu are treaba cu questul propriu zis

Dute in questlib.lua si creaza calea catre acel lib, sa fiu mai exact
dofile(get_locale_base_path().."/quest/nume_folder/TeleportRingLib.lua");
Dupa care creezi un quest si pui in el

Cod: Selectaţi tot

quest teleportRing begin
	state start begin
		when 30897.use begin		
			TeleportRing.MainWindow(item.get_vnum());
		end
	end
end
Edit
quest-uri/new-teleport-ring-t82091.html
da multumesc mult eu trebuia dupa ce editez sa dau ./qc la questu cu vnum de la inel :x :x
Rezolvat?
Avatar utilizator
google801
Nivel 1

Nivel 1
Mesaje: 66
Membru din: 16 Dec 2013, 21:51
Regat: Jinno
Aprecieri: 437  
Mulţumiri: 4  
 Contact:
Medalii

DA
[ADMIN]Moise
Afișează semnătura
Închis
Răspunsuri
3
Vizualizări
352
Răspunsuri
2
Vizualizări
146
Răspunsuri
4
Vizualizări
221
Răspunsuri
1
Vizualizări
154

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 52 vizitatori