Tek Kat Razadör - Soğuma Saati Belirlenebilir

Exatluen

Level 1
Katılım
29 Eyl 2024
Konular
78
Mesajlar
239
Beğeniler
271
GG Coin
6,381
Ticaret Değeri - 0%
0   0   0
Quest sayesinde, 71000 ID'li item ile 11005 (Savaş Sorumlusu) ID'li NPC'den giriş yapabilirsiniz. Sistem, 60 dakika soğuma süresi ile tasarlanmıştır. Dosyalarınıza uygun olarak 63. ve 64. satırları düzenleyebilirsiniz.

Kod:
quest nemere_dungeon begin
    state start begin
        when login begin
            if pc.get_map_index() >= 3520000 and pc.get_map_index() < 3529000 then
                local last_entry = pc.getqf("last_entry_time") or 0
                local current_time = get_global_time()
                local cooldown_seconds = 3600 -- 1 saat = 3600 saniye

                if current_time - last_entry < cooldown_seconds then
                    local remaining_time = cooldown_seconds - (current_time - last_entry)
                    local remaining_minutes = math.ceil(remaining_time / 60)
                    say_title("Bekci:")
                    say(string.format("Zindana tekrar girebilmeniz için daha %d dakika beklemeniz gerekiyor.", remaining_minutes))
                    return
                end
            end
        end

        when logout begin
            local idx = pc.get_map_index()
            if idx == 352 or (idx >= (352 * 10000) and idx < (352 * 10000 + 9000)) then
                pc.setqf("last_entry_time", get_global_time())
            end
        end

        when 11005.chat."Nemerenin Gözetleme Kulesi(Tek Kat)" begin
            local last_entry = pc.getqf("last_entry_time") or 0
            local current_time = get_global_time()
            local cooldown_seconds = 3600 -- 1 saat = 3600 saniye

            if current_time - last_entry < cooldown_seconds then
                local remaining_time = cooldown_seconds - (current_time - last_entry)
                local remaining_minutes = math.ceil(remaining_time / 60)
                say_title("Bekci:")
                say(string.format("Zindana tekrar girebilmeniz için daha %d dakika beklemeniz gerekiyor.", remaining_minutes))
                return
            end

            if pc.get_level() < 90 then
                say_title("Bekci:")
                say("90. seviyenin altında olduğun için zindana giremezsin.")
                return
            end

            if pc.count_item(71000) < 1 then
                say_title("Bekci:")
                say(string.format("Gerekli eşya: %s. Eşyayı envanterinde bulundurmalısın.", item_name(71000)))
                return
            end

            if party.is_party() then
                say_title("Bekci:")
                say("Grup halinde zindana giremezsiniz.")
                return
            end

            say_title("Bekci:")
            say("Zindana girmek istiyor musun?")
            local s = select("Evet!", "Hayır, girmek istemiyorum.")
            if s == 1 then
                pc.remove_item(71000, 1)
                pc.setqf("last_entry_time", get_global_time())
                d.new_jump(352, 772100, 640100)
                d.spawn_mob_dir(18045, 286, 225, 1)
            end
        end

        when kill with npc.get_race() == 18045 begin
            d.setf("nemere_dead", 1)
            notice_all("|cff00ff00 " .. pc.get_name() .. " Nemere'yi mağlup etti!")
            server_timer("nemere_exit_timer", 3600, d.get_map_index())
        end

        when nemere_exit_timer.server_timer begin
            if d.select(get_server_timer_arg()) then
                d.notice("Zaman doldu.")
                d.setf("sure_doldu", 1)
                d.clear_regen()
                d.exit_all()
            end
        end
    end
end
 
Geri
Üst Alt