*Resursă folosită (sistem/funcție/modificare):
*Syserr:
*Fișier(e) cu problema (link pastebin / code):
Code:
quest demonTower_zone begin
state start begin
when login with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER)) begin
local data = DungeonInformationLibrary.ReturnDungeonInformation(DUNGEON_INFO_DEMON_TOWER);
local outsideData = data["teleportData"]["outsideDungeon"];
d.set_warp_location(outsideData["insideMapIndex"], outsideData["enterPositions"]["x"], outsideData["enterPositions"]["y"]);
dungeonFunctions.setWaitTime(DungeonInformationLibrary.ReturnDungeonInformation(DUNGEON_INFO_DEMON_TOWER));
if (d.getf("isInitializedTimer") == 0) then
timer("demonDungeonInit", 3);
end
end
when demonDungeonInit.timer begin
local data = DungeonInformationLibrary.ReturnDungeonInformation(DUNGEON_INFO_DEMON_TOWER);
if (party.is_party() and party.is_leader() or not party.is_party() and d.getf("dungeonTime") < 1) then
if (d.getf("isInitializedTimer") < 1) then
local timeData = data["timeData"]["timeToCompleteData"];
if (timeData["isRequire"]) then
clear_server_timer("demonTower_time_out", d.get_map_index());
server_timer("demonTower_time_out", timeData["timeToComplete"], d.get_map_index());
end
d.spawn_mob(8010, 122, 455);
loop_timer("firstDemonRegen", 5);
d.setf("isInitializedTimer", 1);
d.setf("dungeonTime", get_time());
d.notice("Distruge metinu pentru a continua.")
end
end
end
when logout with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER)) begin
for index = 1, pc.count_item(30304), 1 do
pc.remove_item(30304, 1);
end
for index = 1, pc.count_item(30302), 1 do
pc.remove_item(30302, 1);
end
end
when teleportDemonTimer.timer begin
local demonStage = d.getf("demonStageCount");
if (demonStage == 1) then
ClearDungeon(true);
d.jump_all(2243, 7037);
d.regen_file(string.format("%s/quest/dungeon/devil_tower/deviltower2_regen.txt", get_locale_base_path()));
d.spawn_mob(1091, 122, 455);
loop_timer("secDemonRegen", 5);
d.notice(string.format("[Turnul Demonilor]: Omoara toti monstrii si %s pentru a continua.", mob_name(1091)))
return;
end
if (demonStage == 2) then
d.jump_all(2243, 7037);
local metinPosition = {{211, 420}, {198, 458}, {163, 466}, {135, 459}, {115, 422}, {125, 389}, {163, 371}, {196, 388}};
for index in metinPosition do
d.spawn_mob(8017, metinPosition[index][1], metinPosition[index][2]);
end
loop_timer("thirdDemonRegen", 5);
d.notice("[Turnul Demonilor]: Distruge toate metinele pentru a continua.")
return;
end
if (demonStage == 3) then
d.jump_all(2243, 7037);
local sealPos = {{211, 396}, {207, 451}, {159, 472}, {116, 427}, {161, 369}};
for index in sealPos do
d.spawn_mob(20073, sealPos[index][1], sealPos[index][2]);
end
d.set_regen_file(string.format("%s/quest/dungeon/devil_tower/deviltower2_regen.txt", get_locale_base_path()));
d.setf("canDropKeys", 1);
d.notice("[Turnul Demonilor]: Omoara monstrii iar acestia iti vor dropa chei,")
d.notice("[Turnul Demonilor]: foloseste cheia pentru a deschide fiecare sigiliu.")
return;
end
if (demonStage == 4) then
ClearDungeon(true);
d.jump_all(2243, 7037);
d.spawn_mob(1092, 122, 455);
loop_timer("forthDemonRegen", 5);
d.notice("[Turnul Demonilor]: Omoara seful pentru a continua.")
return;
end
if (demonStage == 5) then
local blackSmithVnums = {20074, 20075, 20076};
local randomIndex = number(1, table.getn(blackSmithVnums));
d.spawn_mob(blackSmithVnums[randomIndex], 122, 455);
d.setf("canTalkWithBlack", 1);
d.notice("[Turnul Demonilor]: Pentru a continua, trebuie sa vorbesti cu fierarul.")
return;
end
if (demonStage == 6) then
ClearDungeon(true);
d.jump_all(2243, 7037);
local metinPos = {{129, 420}, {166, 394}, {197, 427}, {154, 457}};
for index in metinPos do
d.spawn_mob(8018, metinPos[index][1], metinPos[index][2]);
end
loop_timer("fifthDemonRegen", 5);
d.notice("[Turnul Demonilor]: Pentru a continua, trebuie sa distrugi metinele.")
return;
end
if (demonStage == 7) then
d.set_regen_file(string.format("%s/quest/dungeon/devil_tower/deviltower3_regen.txt", get_locale_base_path()));
d.setf("canDropMaps", 1);
d.notice("[Turnul Demonilor]: Pentru a continua, trebuie sa gasesti mapa corecta.")
return;
end
if (demonStage == 8) then
d.jump_all(2243, 7037);
d.spawn_mob(20366, 122, 455);
d.set_regen_file(string.format("%s/quest/dungeon/devil_tower/deviltower2_regen.txt", get_locale_base_path()));
d.setf("canDropSeals", 1);
d.notice("[Turnul Demonilor]: Pentru a continua, trebuie sa gasesti sigiliul corect.")
return;
end
if (demonStage == 9) then
d.jump_all(2243, 7037);
d.spawn_mob(1093, 122, 455);
d.notice("[Turnul Demonilor]: Omoara seful final pentru a continua.")
return;
end
end
when firstDemonRegen.timer begin
if (d.count_monster() < 1) then
cleartimer("firstDemonRegen");
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d metine ramase.", d.count_monster()))
end
end
when secDemonRegen.timer begin
if (d.count_monster() < 1) then
cleartimer("secDemonRegen");
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d monstrii ramasi.", d.count_monster()))
end
end
when thirdDemonRegen.timer begin
if (d.count_monster() < 1) then
cleartimer("thirdDemonRegen");
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d metine ramase.", d.count_monster()))
end
end
when forthDemonRegen.timer begin
if (d.count_monster() < 1) then
cleartimer("forthDemonRegen");
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d monstrii ramasi.", d.count_monster()))
end
end
when 20073.take with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER) and item.get_vnum() == 50084 and d.getf("canDropKeys") > 0) begin
item.remove();
npc.purge();
d.setf("sealCount", d.getf("sealCount") + 1);
if (d.getf("sealCount") > 4) then
ClearDungeon(true);
d.setf("canDropKeys", 0);
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d sigilii de deschis.", (5 - d.getf("sealCount"))));
end
end
when 20074.chat."Etajele Superioare" or 20075.chat."Etajele Superioare" or 20076.chat."Etajele Superioare" with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER) and d.getf("canTalkWithBlack") > 0) begin
local playerLevel = pc.get_level()
say_title(string.format("%s:[ENTER]", c_mob_name(npc.get_race())))
say("Ai gasit calea de a ajunge la etajul 7.[ENTER]Este nevoie de o multime de abilitati si maiestrie pentru a merge acolo.[ENTER]Hmmmm...[ENTER]Dupa ce v-am examinat statusul pentru a urca la etajul urmator.....")
wait();
say_title(string.format("%s:[ENTER]", c_mob_name(npc.get_race())))
if (pc.get_level() < 40) then
say(string.format("Nivelul minim pentru a trece mai departe este %d.", 75))
return;
end
say("Ai ales sa mergi mai departe, noi probleme te vor astepta!")
wait();
if (d.getf("canTalkWithBlack") < 1) then
return;
end
d.setf("canTalkWithBlack", 0);
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
end
when fifthDemonRegen.timer begin
if (d.count_monster() < 1) then
cleartimer("fifthDemonRegen");
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
else
d.notice(string.format("[Turnul Demonilor]: Mai sunt %d metine ramase.", d.count_monster()))
end
end
when 30302.use with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER) and d.getf("canDropMaps") > 0) begin
item.remove();
d.setf("canDropMaps", 0);
ClearDungeon(false);
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
end
when 20366.take with (item.get_vnum() == 30304 and DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER) and d.getf("canDropSeals") > 0) begin
item.remove();
d.setf("canDropSeals", 0);
ClearDungeon(true);
d.setf("demonStageCount", d.getf("demonStageCount") + 1);
timer("teleportDemonTimer", 5);
d.notice("[Turnul Demonilor]: In cateva secunde vei fi teleportat.")
end
when kill with (DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER)) begin
local dungeonData = DungeonInformationLibrary.ReturnDungeonInformation(DUNGEON_INFO_DEMON_TOWER)["dungeonData"];
if (d.getf("canDropKeys") > 0) then
if (number(1, 100) > 97) then
game.drop_item_with_ownership(50084, 1);
end
end
if (npc.get_race() == 8019) then
if (number(1, 100) > 90) then
game.drop_item(30302, 1);
end
end
if (d.getf("canDropSeals") > 0) then
if (number(1, 100) > 95) then
game.drop_item(30304, 1);
end
end
if (npc.get_race() == 1093) then
clear_server_timer("demonTower_time_out", d.get_map_index());
server_timer("demonTower_time_out", 60, d.get_map_index());
ClearDungeon(false);
local dungeonTime = get_time() - d.getf("dungeonTime");
d.notice("[Turnul Demonilor]: In 60 de secunde veti fi teleportati!")
notice_all(string.format("[Turnul Demonilor]: a fost infrant de catre %s in %s.", pc.get_name(), get_time_format(dungeonTime)))
end
end
when demonTower_time_out.server_timer begin
if (d.select(get_server_timer_arg())) then
d.notice("[Turnul Demonilor]: Timpul a expirat, vei fi teleportat inafara Temnitei.")
d.exit_all();
end
end
when 20348.chat."Intra in Turnul Demonilor" with (not DungeonInformationLibrary.IsInDungeon(DUNGEON_INFO_DEMON_TOWER)) begin
local data = DungeonInformationLibrary.ReturnDungeonInformation(DUNGEON_INFO_DEMON_TOWER);
say_title(string.format("%s:[ENTER]", c_mob_name(npc.get_race())))
say("Doresti sa intri in Turnul Demonilor?")
if (select("Da", "Nu") == 1) then
if (dungeonFunctions.checkRequire(data)) then
dungeonFunctions.warpToDungeon(data);
end
end
end
end
end
*Poze / Video: