Çözüldü Src üzerinden başlangıç leveli ve statüsünü verme

Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

nesterali

Üye
Üye
Mesaj
149
Beğeni
62
Puan
726
Ticaret Puanı
0
Merhabalar oyun kaynak dosyalarından başlangıç leveli ayarlamayı ve levele göre statü vermeyi nasıl ayarlayabilirim
 
Çözüm
Konulara sürekli güncel yazmayınız. Bilgisi olan yanıt verecektir.
game/src/input_login.cpp dosyasını açın ve şunu aratın;
C++:
bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE shape, BYTE bEmpire)

Burada yeni oluşturulan karakterler için tanımlanan varsayılan ayarlar mevcut.
Bende şu şekilde;
C++:
bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE shape, BYTE bEmpire)
{
    if (race >= MAIN_RACE_MAX_NUM)
    {
        sys_err("NewPlayerTable2.OUT_OF_RACE_RANGE(%d >= max(%d))\n", race, MAIN_RACE_MAX_NUM);
        return false;
    }

    unsigned job;

    if (!RaceToJob(race, &job))
    {
        sys_err("NewPlayerTable2.RACE_TO_JOB_ERROR(%d)\n", race);
        return false...
Oyun Ftp ine bağlanıp
Kod:
/usr/game/share/locale/turkey/quest/object/notarget/login
Dizinine git orda" give_basic_weapon.start" isimli dosyaya sağ tık düzenle deyip orda açılan sayfada
"Give_Exp "yazısının yanındakin parantez içindeki sayıları vereceğin levelin expine göre değiştir

Örnek :
18L LEVEL:
pc . give_exp2 ( 820600 )

34 LEVEL:
pc . give_exp2 ( 19599000 )
pc . give_exp2 ( 3145000 )


45 LEVEL:
pc . give_exp2 ( 19599000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )


55 LEVEL:
pc . give_exp2 ( 19599000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 11000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )


70 LEVEL:
pc . give_exp2 ( 19599000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 11000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 27000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
pc . give_exp2 ( 25000000 )
;


99 LEVEL:
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
pc . give_exp2 ( 300000000 )
 
Son düzenleme:
sizin belirttiğiniz 99 leveli yaptığımda 95 lv olarak başlıyor
karakter atıp tekrar girdiğimde 99 oluyor ben filesten kaynaklımı bilmiyorum problem yaşıyorum src üzerinden yapmam daha mantıklı geldi görmüştüm ama şuanda bulamıyorum o konuyu
 
quest artıklarını silip baştan okutursan sorun kalkar hocam uğraşma src ile sonra değiştirmek istersin bi dünya uğraşırsın
 
Konulara sürekli güncel yazmayınız. Bilgisi olan yanıt verecektir.
game/src/input_login.cpp dosyasını açın ve şunu aratın;
C++:
bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE shape, BYTE bEmpire)

Burada yeni oluşturulan karakterler için tanımlanan varsayılan ayarlar mevcut.
Bende şu şekilde;
C++:
bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE shape, BYTE bEmpire)
{
    if (race >= MAIN_RACE_MAX_NUM)
    {
        sys_err("NewPlayerTable2.OUT_OF_RACE_RANGE(%d >= max(%d))\n", race, MAIN_RACE_MAX_NUM);
        return false;
    }

    unsigned job;

    if (!RaceToJob(race, &job))
    {
        sys_err("NewPlayerTable2.RACE_TO_JOB_ERROR(%d)\n", race);
        return false;
    }

    sys_log(0, "NewPlayerTable2(name=%s, race=%d, job=%d)", name, race, job);

    memset(table, 0, sizeof(TPlayerTable));

    strlcpy(table->name, name, sizeof(table->name));

    table->level        = 1;
    table->job            = race;    // 직업대신 종족을 넣는다
    table->voice        = 0;
    table->part_base    = shape;

    table->st        = JobInitialPoints[job].st;
    table->dx        = JobInitialPoints[job].dx;
    table->ht        = JobInitialPoints[job].ht;
    table->iq        = JobInitialPoints[job].iq;

    table->hp        = JobInitialPoints[job].max_hp + table->ht * JobInitialPoints[job].hp_per_ht;
    table->sp        = JobInitialPoints[job].max_sp + table->iq * JobInitialPoints[job].sp_per_iq;
    table->stamina    = JobInitialPoints[job].max_stamina;

    table->x        = CREATE_START_X(bEmpire) + number(-300, 300);
    table->y        = CREATE_START_Y(bEmpire) + number(-300, 300);
    table->z        = 0;
    table->dir        = 0;
    table->playtime = 0;
    table->gold     = 0;

    table->skill_group = 0;

    return true;
}

Kod bloğunda işaretli olan yerden leveli belirleyebilirsiniz. Mesela 30 levelde başlatmak için.
C++:
    table->level        = 30;


Fakat kaynak kodlarında çin serveri için bu işlemi yapan kod var. bool NewPlayerTable( fonksiyonunun alt kısmında şöyle bir kod mevcut. Sanırsam tam istediğiniz şeyi karşılıyor.
C++:
    if (china_event_server)
    {
        table->level = 35;

        for (int i = 1; i < 35; ++i)
        {
            int iHP = number(JobInitialPoints[job].hp_per_lv_begin, JobInitialPoints[job].hp_per_lv_end);
            int iSP = number(JobInitialPoints[job].sp_per_lv_begin, JobInitialPoints[job].sp_per_lv_end);
            table->sRandomHP += iHP;
            table->sRandomSP += iSP;
            table->stat_point += 3;
        }

        table->hp += table->sRandomHP;
        table->sp += table->sRandomSP;

        table->gold = 1000000;
    }


Buradaki kodu alıp bool NewPlayerTable2 fonksiyonunda table->skill_group = 0; sonrasına şu şekilde ekleyebilirsiniz. 30 level için örnek.
C++:
    table->level = 30;

    for (int i = 1; i < 30; ++i)
    {
        int iHP = number(JobInitialPoints[job].hp_per_lv_begin, JobInitialPoints[job].hp_per_lv_end);
        int iSP = number(JobInitialPoints[job].sp_per_lv_begin, JobInitialPoints[job].sp_per_lv_end);
        table->sRandomHP += iHP;
        table->sRandomSP += iSP;
        table->stat_point += 3;
    }

    table->hp += table->sRandomHP;
    table->sp += table->sRandomSP;
 
Çözüm
teşekkür ederim level kısmı tamam fakat statü için bu kod bloğunumu ekleyeceğim dediğiniz kısma
C++:
    table->level = 30;

    for (int i = 1; i < 30; ++i)
    {
        int iHP = number(JobInitialPoints[job].hp_per_lv_begin, JobInitialPoints[job].hp_per_lv_end);
        int iSP = number(JobInitialPoints[job].sp_per_lv_begin, JobInitialPoints[job].sp_per_lv_end);
        table->sRandomHP += iHP;
        table->sRandomSP += iSP;
        table->stat_point += 3;
    }

    table->hp += table->sRandomHP;
    table->sp += table->sRandomSP;
 
Aynen onu ekleyebilirsiniz. Test edemedim ama. Sorunuza yanıt verebilmek için kaynak kodlarını biraz inceledim. Umarım istediğiniz şekilde olur.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst