Yardım Çark Sistemi ! Syserr..

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

Afraz

Cehalet yenilmesi gereken en büyük düşmandır.
Yardımsever Üye
MT Üye
Mesaj
678
Çözümler
30
Beğeni
181
Puan
604
Ticaret Puanı
0
Çark sistemini ekliyorum , f5'e basınca birşey gelicek ve bir item sayesinde döndürülücek felan ( Google'ye Çark Sistemi Revize ) Yazarsanız bulabilirsiniz.

Herşeyi ekledim F5'e basınca login ekranına atıyor ve syserr veriyor.


Syserr;:
0304 20:35:18154 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/etc/buff/finish.mse) Error
0304 20:35:18154 :: CInstanceBase::RegisterEffect(eEftType=104, c_szEftAttachBone=, c_szEftName=d:/ymir work/effect/etc/buff/finish.mse, isCache=0) - Error
0304 20:35:18163 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/taglar/vip.mse) Error
0304 20:35:18163 :: CInstanceBase::RegisterEffect(eEftType=112, c_szEftAttachBone=, c_szEftName=d:/ymir work/taglar/vip.mse, isCache=0) - Error
0304 20:35:24619 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/tkmt2/effect/tkmt2_6.mse) Error
0304 20:35:25354 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/tkmt2/effect/tkmt2_6.mse) Error
0304 20:35:26587 :: mouseModule:357: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0304 20:35:26587 :: Traceback (most recent call last):

0304 20:35:26587 ::   File "mouseModule.py", line 357, in Update

0304 20:35:26587 :: RuntimeError
0304 20:35:26587 :: :
0304 20:35:26587 :: Failed to load image (filename: )
0304 20:35:26587 ::

0304 20:36:28659 :: CRaceManager::GetRaceDataPointer: cannot load data by dwRaceIndex 20404
0304 20:36:28659 :: CPythonCharacterManager::CreateInstance VID[3062] Race[20404]
0304 20:36:28757 :: Unknown Server Command RefreshDragonCoin 0 | RefreshDragonCoin
0304 20:36:28758 :: Unknown Server Command RefreshDragonMark 0 | RefreshDragonMark
0304 20:36:28971 :: Traceback (most recent call last):

0304 20:36:28971 ::   File "uiTaskBar.py", line 976, in OnUpdate

0304 20:36:28971 ::   File "uiTaskBar.py", line 720, in SetMp

0304 20:36:28971 :: IndexError
0304 20:36:28971 :: :
0304 20:36:28971 :: list index out of range
0304 20:36:28971 ::

0304 20:36:30884 :: Traceback (most recent call last):

0304 20:36:30884 ::   File "uiCharacter.py", line 1964, in OnUpdate

0304 20:36:30884 ::   File "ui.py", line 120, in __call__

0304 20:36:30884 ::   File "ui.py", line 102, in __call__

0304 20:36:30884 ::   File "uiCharacter.py", line 888, in Refreshing

0304 20:36:30885 ::   File "ui.py", line 5725, in GetChild

0304 20:36:30885 :: KeyError
0304 20:36:30885 :: :
0304 20:36:30885 :: 'PercentExp'
0304 20:36:30885 ::
Screenshot_1.png


Screenshot_2.png


Başka line isterseniz konuya dahil ederim.
 
game.py, interfacemodule.py, uitaskbar.py bunları indirebileceğim şekilde atarsan yardımcı olmaya çalışırım
 
Bu taskbar sorunu kullandığın illumina gibi etc ile alakalı olmalı, çarka ait başka bir syserr var mı ?
Başka syserr yok fakat bir quest yardımıyla bi çarkı bir mob'a ekledim. İstediğimde buydu zaten. Şimdi F5 Fonksiyonunu kaldırıcağım fakat quest içeriğini bi türlü kendime düzenleyemedim. Cıkıcak itemlerin şans'ını düzenlemek istiyorum fakat burada yok galiba :D Ücret'ini kendim başka bir item yapmak istiyorum fakat yang'da kalıyor. Son olarakda Cıkan itemlerin şanslarını düzenleyeceğim bir kısım yok.


quest:
quest vMbr0xoyZgyp begin
    state start begin
        function config(w)
            if w==1 then return {2, 22, 43, 65, 88, 109, 132, 156, 178, 202, 225, 250, 272, 295, 316, 340} -- BURAYA DOKUNMA!!!
            elseif w==2 then return {19, 30136, 30102, 49, 59, 69, 30136, 89, 30102, 109, 30136, 129, 30102, 149, 30136, 169} -- İtem kodları. Yukardaki sayılar çarkın koordinatları.
            elseif w==3 then return 1000000 -- Çevirme ücreti                                                        --- Her koordinata bir item denk geliyor.
            end
        end
        when login begin
            cmdchat("SCHICKSAL_RAD index/"..q.getcurrentquestindex().."/"..vMbr0xoyZgyp.config(3).."/"..pc.getqf("SCHICKSAL_RAD_FREE"))
        end
        when 30102.use with game.get_event_flag("destiny") == 1 begin -- Bir hak daha veren item Altın balta
            item.remove()
            pc.setqf("SCHICKSAL_RAD_FREE", pc.getqf("SCHICKSAL_RAD_FREE")+1)
            cmdchat("SCHICKSAL_RAD free/"..pc.getqf("SCHICKSAL_RAD_FREE"))
            syschat("Kader çarkını bir kez ücretsiz çevirmeye hak kazandın.")
        end
       
        when 30136.use with game.get_event_flag("destiny") == 1 begin -- Bir hak daha veren item Aşırı süslü yay
            item.remove()
            pc.setqf("SCHICKSAL_RAD_FREE", pc.getqf("SCHICKSAL_RAD_FREE")+1)
            cmdchat("SCHICKSAL_RAD free/"..pc.getqf("SCHICKSAL_RAD_FREE"))
            syschat("Kader çarkını bir kez ücretsiz çevirmeye hak kazandın.")
        end
       
        when button with game.get_event_flag("destiny") == 1 begin
            cmdchat("getinputbegin")
            local INPUT = input(cmdchat("SCHICKSAL_RAD input/"))
            cmdchat("getinputend")
            if INPUT == "-1" then
                local Kosten = vMbr0xoyZgyp.config(3)
                if pc.get_money()>=Kosten or pc.getqf("SCHICKSAL_RAD_FREE")>0 then
                    if pc.getqf("SCHICKSAL_RAD_FREE")>0 then
                        syschat("Ücretsiz çevirme hakkını kullandın.")
                        pc.setqf("SCHICKSAL_RAD_FREE", pc.getqf("SCHICKSAL_RAD_FREE")-1)
                    else
                        pc.change_money(-Kosten)
                    end
                    local F = vMbr0xoyZgyp.config(1)
                    local Random = number(1, table.getn(F))
                    local Grad, Spin, ItemId = F[Random], number(3, 6), vMbr0xoyZgyp.config(2)[Random]
                    pc.setqf("SCHICKSAL_RAD_SCHUTZ", ItemId)
                    cmdchat("SCHICKSAL_RAD Answer/1/"..Grad.."/"..Spin.."/"..ItemId.."/"..Random.."/"..pc.getqf("SCHICKSAL_RAD_FREE"))
                else
                    syschat("Yeterli yang yok.")
                    cmdchat("SCHICKSAL_RAD Answer/0/0/0/0/0")
                end
            elseif INPUT=="-2" then
                if pc.getqf("SCHICKSAL_RAD_SCHUTZ")!=0 then
                    local ITEM = pc.getqf("SCHICKSAL_RAD_SCHUTZ")
                    pc.setqf("SCHICKSAL_RAD_SCHUTZ", 0)
                    syschat("Tebrikler!")
                    pc.give_item2(ITEM, 1)
                else
                    syschat("Çevirme hakkın yok!")
                end
            end
        end
       
        when 33008.chat."Kader çarkı " with game.get_event_flag("destiny") == 1 begin
        cmdchat("SCHICKSAL_RAD_OPEN")
        setskin(NOWINDOW)
        end
       
        when 33008.chat."GM: Kader çarkı " with pc.is_gm() begin
            if game.get_event_flag("destiny") == 1 then
            say("Kader çarkı şu anda kullanımda. Kapatmak")
            say("istiyor musun?")
                if select("Evet","Hayır") == 2 then
                return
                end
            say("Etkinlik kapatıldı.")
            game.set_event_flag("destiny",0)
            else
            say("Kader çarkı şu anda kapalı. Açmak")
            say("istiyor musun?")
                if select("Evet","Hayır") == 2 then
                return
                end
            say("Etkinlik açıldı. Etkinliği düzgün bir şekilde")
            say("kullanmak için karakter atın.")
            game.set_event_flag("destiny",1)
            end
        end
    end
end
 
Başka syserr yok fakat bir quest yardımıyla bi çarkı bir mob'a ekledim. İstediğimde buydu zaten. Şimdi F5 Fonksiyonunu kaldırıcağım fakat quest içeriğini bi türlü kendime düzenleyemedim. Cıkıcak itemlerin şans'ını düzenlemek istiyorum fakat burada yok galiba :D Ücret'ini kendim başka bir item yapmak istiyorum fakat yang'da kalıyor. Son olarakda Cıkan itemlerin şanslarını düzenleyeceğim bir kısım yok.
Revize olan source ile çalışıyor, wheel_of_destiny.cpp içindeki item, yang ve şansı düzenleyebilirsin
 
wheel_of_destiny.cpp:
#include "stdafx.h"
#include "wheel_of_destiny.h"
#include "char.h"

#if defined(WHEEL_OF_DESTINY)

static constexpr auto WheelPrice = 1000000; // 1M
static constexpr auto WheelItemMax = 16;

//vnum, count(max 255), chance(max 255)
static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] =
{   
    { 11209, 1, 0 }, { 11219, 1, 0 }, { 11229, 1, 0 }, { 11239, 1, 0 },
    { 11249, 1, 0 }, { 11259, 1, 0 }, { 11269, 1, 0 }, { 11279, 1, 0 },
    { 11289, 1, 0 }, { 11299, 1, 0 }, { 19, 1, 100 }, { 279, 1, 0 },
    { 299, 1, 0 }, { 29, 1, 0 }, { 39, 1, 0 }, { 49, 1, 0 },
};

CWheelDestiny::CWheelDestiny(LPCHARACTER m_ch)
    : ch(m_ch), gift_vnum(0), gift_count(1), turn_count(0)
{
    for (auto i = 0; i < WheelItemMax; i++)
        ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_ICON %lu %d %d", std::get<0>(m_Data[i]), std::get<1>(m_Data[i]), i);
    ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_OPEN %d %d", WheelPrice, ch->GetWheelFreeCount());
}

CWheelDestiny::~CWheelDestiny() {
    if (GetGiftVnum())
        sys_log(0, "<CWheelDestiny> player(%s) didn't get his gift(vnum: %lu(%d.x))!!", ch->GetName(), GetGiftVnum(), GetGiftCount());
}

template <typename T> std::string NumberToMoneyString(T val)
{
    constexpr int comma = 3;
    auto str = std::to_string(val);
    auto pos = static_cast<int>(str.length()) - comma;
    
    while (pos > 0) {
        str.insert(pos, ".");
        pos -= comma;
    }
    
    return str;
}

void CWheelDestiny::TurnWheel()
{
    if (GetGiftVnum()) {
        ch->ChatPacket(CHAT_TYPE_INFO, "Wait!");
        return;
    }

    const auto WheelFreeCount = ch->GetWheelFreeCount();
    
    if (WheelFreeCount < 1 && ch->GetGold() < WheelPrice) {
        ch->ChatPacket(CHAT_TYPE_INFO, "You need %s yang for <Turning Wheel>", NumberToMoneyString(WheelPrice).c_str());
        return;
    }

    auto Rand = PickAGift();
    if (Rand == -1) {
        sys_err("CWheelDestiny::TurnWheel() Error Pick Gift (%s)", ch->GetName());
        return;
    }

    if (WheelFreeCount > 0) {
        ch->SetWheelFreeCount(-1);
        ch->ChatPacket(CHAT_TYPE_INFO, "FREE");
    }
    else
        ch->PointChange(POINT_GOLD, -WheelPrice);
    
    //vnum, count, spin count, pos
    ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_TURN %lu %d %d %d", GetGiftVnum(), GetGiftCount(), number(1, 8), Rand);

    turn_count++;
}

std::uint8_t CWheelDestiny::GetChance() const
{
#undef max
    const auto TurnCount = GetTurnCount();
    if (TurnCount >= 10 && TurnCount < 25)
        return 25;
    if (TurnCount >= 25 && TurnCount < 40)
        return 50;
    if (TurnCount >= 40)
        return std::numeric_limits<std::uint8_t>::max(); // 255
    return 0;
}

int CWheelDestiny::PickAGift()
{
    const auto Chance = GetChance();

    while (true) {
        const auto rand_pos = number(0, WheelItemMax - 1);
        const auto& [item, count, m_chance] = m_Data[rand_pos];

        if (Chance >= m_chance) {
            SetGift(item, count);
            return rand_pos;
        }
    }
    return -1; // error
}

void CWheelDestiny::SetGift(const DWORD vnum, const std::uint8_t count)
{
    gift_vnum = vnum;
    gift_count = count;
}

void CWheelDestiny::GiveMyFuckingGift()
{
    const auto GiftVnum = GetGiftVnum();

    if (GiftVnum) {
        ch->AutoGiveItem(GiftVnum, GetGiftCount());
        SetGift(0, 1); // reset
    }
    else
        sys_err("Dude, where is the gift_vnum? <player: %s>", ch->GetName());
}

DWORD CWheelDestiny::GetGiftVnum() const
{
    return gift_vnum;
}

std::uint8_t CWheelDestiny::GetGiftCount() const
{
    return gift_count;
}

std::uint16_t CWheelDestiny::GetTurnCount() const
{
    return turn_count;
}
#endif


Tam olarak hangilerini düzenlemem gerekki ? Örnek olarak şu item yok :/ 30102
 
wheel_of_destiny.cpp:
#include "stdafx.h"
#include "wheel_of_destiny.h"
#include "char.h"

#if defined(WHEEL_OF_DESTINY)

static constexpr auto WheelPrice = 1000000; // 1M
static constexpr auto WheelItemMax = 16;

//vnum, count(max 255), chance(max 255)
static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] =
{ 
    { 11209, 1, 0 }, { 11219, 1, 0 }, { 11229, 1, 0 }, { 11239, 1, 0 },
    { 11249, 1, 0 }, { 11259, 1, 0 }, { 11269, 1, 0 }, { 11279, 1, 0 },
    { 11289, 1, 0 }, { 11299, 1, 0 }, { 19, 1, 100 }, { 279, 1, 0 },
    { 299, 1, 0 }, { 29, 1, 0 }, { 39, 1, 0 }, { 49, 1, 0 },
};

CWheelDestiny::CWheelDestiny(LPCHARACTER m_ch)
    : ch(m_ch), gift_vnum(0), gift_count(1), turn_count(0)
{
    for (auto i = 0; i < WheelItemMax; i++)
        ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_ICON %lu %d %d", std::get<0>(m_Data[i]), std::get<1>(m_Data[i]), i);
    ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_OPEN %d %d", WheelPrice, ch->GetWheelFreeCount());
}

CWheelDestiny::~CWheelDestiny() {
    if (GetGiftVnum())
        sys_log(0, "<CWheelDestiny> player(%s) didn't get his gift(vnum: %lu(%d.x))!!", ch->GetName(), GetGiftVnum(), GetGiftCount());
}

template <typename T> std::string NumberToMoneyString(T val)
{
    constexpr int comma = 3;
    auto str = std::to_string(val);
    auto pos = static_cast<int>(str.length()) - comma;
  
    while (pos > 0) {
        str.insert(pos, ".");
        pos -= comma;
    }
  
    return str;
}

void CWheelDestiny::TurnWheel()
{
    if (GetGiftVnum()) {
        ch->ChatPacket(CHAT_TYPE_INFO, "Wait!");
        return;
    }

    const auto WheelFreeCount = ch->GetWheelFreeCount();
  
    if (WheelFreeCount < 1 && ch->GetGold() < WheelPrice) {
        ch->ChatPacket(CHAT_TYPE_INFO, "You need %s yang for <Turning Wheel>", NumberToMoneyString(WheelPrice).c_str());
        return;
    }

    auto Rand = PickAGift();
    if (Rand == -1) {
        sys_err("CWheelDestiny::TurnWheel() Error Pick Gift (%s)", ch->GetName());
        return;
    }

    if (WheelFreeCount > 0) {
        ch->SetWheelFreeCount(-1);
        ch->ChatPacket(CHAT_TYPE_INFO, "FREE");
    }
    else
        ch->PointChange(POINT_GOLD, -WheelPrice);
  
    //vnum, count, spin count, pos
    ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_WHEEL_TURN %lu %d %d %d", GetGiftVnum(), GetGiftCount(), number(1, 8), Rand);

    turn_count++;
}

std::uint8_t CWheelDestiny::GetChance() const
{
#undef max
    const auto TurnCount = GetTurnCount();
    if (TurnCount >= 10 && TurnCount < 25)
        return 25;
    if (TurnCount >= 25 && TurnCount < 40)
        return 50;
    if (TurnCount >= 40)
        return std::numeric_limits<std::uint8_t>::max(); // 255
    return 0;
}

int CWheelDestiny::PickAGift()
{
    const auto Chance = GetChance();

    while (true) {
        const auto rand_pos = number(0, WheelItemMax - 1);
        const auto& [item, count, m_chance] = m_Data[rand_pos];

        if (Chance >= m_chance) {
            SetGift(item, count);
            return rand_pos;
        }
    }
    return -1; // error
}

void CWheelDestiny::SetGift(const DWORD vnum, const std::uint8_t count)
{
    gift_vnum = vnum;
    gift_count = count;
}

void CWheelDestiny::GiveMyFuckingGift()
{
    const auto GiftVnum = GetGiftVnum();

    if (GiftVnum) {
        ch->AutoGiveItem(GiftVnum, GetGiftCount());
        SetGift(0, 1); // reset
    }
    else
        sys_err("Dude, where is the gift_vnum? <player: %s>", ch->GetName());
}

DWORD CWheelDestiny::GetGiftVnum() const
{
    return gift_vnum;
}

std::uint8_t CWheelDestiny::GetGiftCount() const
{
    return gift_count;
}

std::uint16_t CWheelDestiny::GetTurnCount() const
{
    return turn_count;
}
#endif


Tam olarak hangilerini düzenlemem gerekki ? Örnek olarak şu item yok :/ 30102

Kod:
static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] =
Buraya itemleri; item kodu, adet , şans olarak ekle daha sonra eklediğin item kadar WheelItemMax = 16; burayı düzenle

Kod:
std::uint8_t CWheelDestiny::GetChance() const
burayı şans için kullanıyorsun, çarkı çevirdiğin kadar şans oranın yükseliyor, örneğin 10-25 arası çevirirsen şansın: 25
eğer şansın, item eklerken kullandığın şanstan büyükse item elde ediliyor

Örnek
Kod:
{ 25041, 1, 40 },
Büyülü metal, 1 adet, gerekli şans min. 40
Oyuncunun büyülü metali elde edebilmesi için

Kod:
 if (TurnCount >= 25 && TurnCount < 40)
        return 50;

Minimum 25 kez çarkı çevirmesi gerek, ancak 25 den sonra büyülü metal elde etme "ihtimali" olabilir
Bu şans olayını farklı şekillerde de değiştirebilirsin.Aralıkları arttırabilirsin veya araştırmacının özütü gibi şans arttırıcı item yapabilirsin vs. hayal gücüne kalmış
Eğer çarkı yang yerine farklı bir şey yapmak istersen bir kaç yeri değiştirmen gerekecek
 
Kod:
static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] =
Buraya itemleri; item kodu, adet , şans olarak ekle daha sonra eklediğin item kadar WheelItemMax = 16; burayı düzenle

Kod:
std::uint8_t CWheelDestiny::GetChance() const
burayı şans için kullanıyorsun, çarkı çevirdiğin kadar şans oranın yükseliyor, örneğin 10-25 arası çevirirsen şansın: 25
eğer şansın, item eklerken kullandığın şanstan büyükse item elde ediliyor

Örnek
Kod:
{ 25041, 1, 40 },
Büyülü metal, 1 adet, gerekli şans min. 40
Oyuncunun büyülü metali elde edebilmesi için

Kod:
 if (TurnCount >= 25 && TurnCount < 40)
        return 50;

Minimum 25 kez çarkı çevirmesi gerek, ancak 25 den sonra büyülü metal elde etme "ihtimali" olabilir
Bu şans olayını farklı şekillerde de değiştirebilirsin.Aralıkları arttırabilirsin veya araştırmacının özütü gibi şans arttırıcı item yapabilirsin vs. hayal gücüne kalmış
Eğer çarkı yang yerine farklı bir şey yapmak istersen bir kaç yeri değiştirmen gerekecek
Aga cok güzel anlatmışsın ellerine sağlık. Aslında ben sandığı açar gibi bir şey istiyorum. 1 İtemi almak için 20 kere cevirmek felan değil aslında :D

Örnek = 1 Tane xx Kostümü %5 Şans ile cıkıyor.
1 Tane xxx Kostümü %95 şans ile cıkıyor.

Şansa bağlı o xx kostümünü atmasını istiyorum. Bunu kostümler ile donatıcağım önemli olan kostümlerin şansını az yapacağım.


static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] = şuan burada yazan itemler oyunda cıkmıyor. Quest'de yazanlar cıkıyor :/

Revize'yi kaldırıp eskisini kurduğumdamı aslında benim istediğim olucak :D

Seninle bu mevzuyu discord'da konusabilirmiyiz yada buradan özel mesaj yolu ile?

Kaldırdım , sistemi en iyisi sandık'tan yapmak istediğim şekil olmayacak galiba :DXd
 
Son düzenleme:
Aga cok güzel anlatmışsın ellerine sağlık. Aslında ben sandığı açar gibi bir şey istiyorum. 1 İtemi almak için 20 kere cevirmek felan değil aslında :D

Örnek = 1 Tane xx Kostümü %5 Şans ile cıkıyor.
1 Tane xxx Kostümü %95 şans ile cıkıyor.

Şansa bağlı o xx kostümünü atmasını istiyorum. Bunu kostümler ile donatıcağım önemli olan kostümlerin şansını az yapacağım.


static constexpr std::tuple<DWORD, std::uint8_t, std::uint8_t> m_Data[WheelItemMax] = şuan burada yazan itemler oyunda cıkmıyor. Quest'de yazanlar cıkıyor :/

Revize'yi kaldırıp eskisini kurduğumdamı aslında benim istediğim olucak :D

Seninle bu mevzuyu discord'da konusabilirmiyiz yada buradan özel mesaj yolu ile?

Kaldırdım , sistemi en iyisi sandık'tan yapmak istediğim şekil olmayacak galiba :DXd
Ya eskisini kullanıcaksın ya yenisini bu şekilde karışması normal :)
Dc kullanmıyorum buradan özelden yazarsan yardımcı olurum
 
Geri
Üst