Yardım quest timer hakkında bilgi?

  • Konuyu açan Konuyu açan bosymax
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 2
  • Gösterim Gösterim 406
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

bosymax

Geliştirici
Geliştirici
MT Üye
Mesaj
222
Çözümler
14
Beğeni
110
Puan
749
Ticaret Puanı
0
herkese merhaba, tüm serverin etkileneceği bir timer için bu kod yeterli mi ? yoksa server_timer'da var o mu daha mantıklı bu işlem için.
Örnek olarak
timer("test", 10 )
bu timer başlatıldığında 10 saniye sonra
diğer aşamaya geçsin ama oyuncuya göre bekletme değilde server boyu bekletmek istiyorum ?
 
server_timer kullanabilirsiniz
bu kullanım yanlış mı ? timer çalıştığı an oyun core verdi

C++:
Genişlet Daralt Kopyala
        when 2093.kill with game.get_event_flag("kule_boss") > 0 and pc.get_channel_id() == 1 begin
            -- local stime = 60*60*3
            local stime = 10
            if pc.get_map_index() == 65 then
                server_timer("shadow_warrior_timer_61", stime)
            end
            notice_all(string.format("Gölge Savaşçısı katledildi! %s dakika sonra tekrar dönecek.", stime/60/60))
        end
       
        when shadow_warrior_timer_61.server_timer begin
            mob.spawn(2093,517,633,0,0)
            clear_server_timer("shadow_warrior_timer_61")
        end


//edit
mob spawn kodunda hata varmış core'u açıp hatayı inceledim ve yeni mob spawn etme kodu ekledim, siz haritada olmasanız bile spawn ediyor
eklemek isteyenler;
C++:
Genişlet Daralt Kopyala
questlua_global.cpp

void RegisterGlobalFunctionTable(lua_State* L)

// ARAT ÜSTÜNE EKLE

int mob_spawn_ext(lua_State* L)
    {
        if(false == lua_isnumber(L, 1) || false == lua_isnumber(L, 2) || false == lua_isnumber(L, 3)
            || false == lua_isnumber(L, 4) || false == lua_isnumber(L, 5) || false == lua_isboolean(L, 6) )
        {
            lua_pushnumber(L, 0);
            return 0;
        }

        const DWORD mobVnum = static_cast<DWORD>(lua_tonumber(L, 1));
        const long mapIndex = static_cast<long>(lua_tonumber(L, 2));
        const int x = static_cast<int>(lua_tonumber(L, 3));
        const int y = static_cast<int>(lua_tonumber(L, 4));
        const size_t count = MINMAX(1, static_cast<size_t>(lua_tonumber(L, 5)), 10);
        const bool isAggresive = static_cast<bool>(lua_toboolean(L, 6));


        size_t SpawnCount = 0;

        const CMob* pMonster = CMobManager::instance().Get( mobVnum );

        if( NULL != pMonster )
        {
            //const LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();
            for( size_t i=0 ; i < count ; ++i )
            {
                const LPCHARACTER pSpawnMonster = CHARACTER_MANAGER::instance().SpawnMobRange( mobVnum,
                        mapIndex,
                        x - number(100, 200),
                        y - number(100, 200),
                        x + number(100, 200),
                        y + number(100, 200),
                        true,
                        pMonster->m_table.bType == CHAR_TYPE_STONE,
                        isAggresive );

                if( NULL != pSpawnMonster )
                {
                    ++SpawnCount;
                }
            }

            sys_log(0, "QUEST Spawn Monstster: VNUM(%u) COUNT(%u) isAggresive(%b)", mobVnum, SpawnCount, isAggresive);
        }

        lua_pushnumber(L, SpawnCount);

        return 1;
    }
//#########################################################
{    "spawn_mob",                    _spawn_mob                        },
// ARAT ALTINA EKLE
{    "spawn_mob_ext",                    mob_spawn_ext                        },



// quest_functions ekle
spawn_mob_ext


//kullanımı
            spawn_mob_ext(MOB_KODU,MAP_INDEX,KORDINAT_X,KORDINAT_Y,MOB_SAYISI,AGRASIFMI)
            spawn_mob_ext(101,43,873200,241800,1,false)
 
Son düzenleme:
Üst