caanmasu - Otomatik pelerin sistemi

elchikapu

Yasaklanmış Üye
Cezalı
Mesaj
1.029
Çözümler
21
Beğeni
1.625
Puan
1.239
Ticaret Puanı
0
Lua (Quest):
Genişlet Daralt Kopyala
define VNUM_CAPE 70038

quest auto_cape begin
    state start begin
    
        function capeAction()
            pc.aggregate_monster()
            pc.changegold(-1000)
        end
    
        when VNUM_CAPE.use begin
            if pc.getqf("wait_time") < get_time() then
                if item.get_socket(0) == 0 then
                    item.set_socket(0, 1)
                    pc.setqf("wait_time", get_time()+3)
                    pc.setqf("cell_item", item.get_cell())
                    auto_cape.capeAction()
                    loop_timer("lt_autocape", 3)
                else
                    item.set_socket(0, 0)
                    cleartimer("lt_autocape")
                end
            else
                syschat("Espera un momento")
            end
        end
        when lt_autocape.timer begin
            auto_cape.capeAction()
        end
        when login begin
            if item.select_cell(pc.getqf("cell_item")) then
                if item.vnum == VNUM_CAPE and item.get_socket(0) == 1 then
                    auto_cape.capeAction()
                    loop_timer("lt_autocape", 3)
                end
            end
        end
        when die begin
            if item.select_cell(pc.getqf("cell_item")) then
                if item.vnum == VNUM_CAPE and item.get_socket(0) == 1 then
                    item.set_socket(0, 0)
                    cleartimer("lt_autocape")
                end
            end
        end
    end
end

Aktif/Deaktif slot efekti şeyciği için root/constInfo.py:
Genişlet Daralt Kopyala
def IS_AUTO_POTION_HP(itemVnum):
    if 72723 <= itemVnum and 72726 >= itemVnum:
        return 1
    elif itemVnum >= 76021 and itemVnum <= 76022:
        return 1
    elif itemVnum == 79012:
        return 1
    #ADD THIS
    elif itemVnum == 70038:
        return 1
    #

    return 0

item_proto.txt
vnum 70038 üzerinden çalışır.
item_type kısmı ITEM_QUEST veya 18 olmalı
 
Paylaşım için teşekkürler, bu iş için neden lua'yı tercih ettiklerini anlayamadım, server src içerisinde C++ ile daha sağlıklı yazılabilirdi bence.
 
Uyarı: Bu konu açıldığından bu yana baya zaman geçmiş.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.
Geri
Üst