Questing rates(penya und exp) in constant.inc

  • Hi,
    My german is so bad so this guide will be in English :P
    Since my server died I tought I do release it here. None of the players actually used to quest :(.
    what does it do?
    It reads contant.inc and then loads the quest rates / other rates.
    Why load rates using constant.inc?
    Because doing rates via event.lua is just wrong :) event.lua is for events.
    Add the quest rates in event.lua yourself it won't be hard ^^


    Bugs: Penya and exp won't be shown correctly if I'm right. You can fix this easily in the source.(Not Sure)


    First define __QUGETQUESTFACTOR in versionCommon.h


    WorldServer


    VerisonCommon.h

    Code
    //Epic Quest factor
    #define __QUGETQUESTFACTOR


    Open DPCoreClient.cpp
    Look for


    And add this below it



    Now open up DPDatabaseClient.cpp
    Look for

    Code
    g_UserMng.AddGameRate( prj.m_fMonsterExpRate, GAME_RATE_MONSTEREXP );
    g_UserMng.AddGameRate( prj.m_fGoldDropRate, GAME_RATE_GOLDDROP );
    g_UserMng.AddGameRate( prj.m_fItemDropRate, GAME_RATE_ITEMDROP );    
    g_UserMng.AddGameRate( prj.m_fMonsterHitRate, GAME_RATE_MONSTERHIT );


    And add this below

    Code
    #ifdef __QUGETQUESTFACTOR
            g_UserMng.AddGameRate( prj.m_fQuestExpRate, GAME_RATE_QUEST_EXP );
            g_UserMng.AddGameRate( prj.m_fQuestPenRate, GAME_RATE_QUEST_PEN );
    #endif


    Open User.cpp and look for

    Code
    if( ((CMover*)this)->IsAuthHigher( AUTH_GAMEMASTER ) )
        {
            AddGameRate( prj.m_fItemDropRate, GAME_RATE_ITEMDROP );
            AddGameRate( prj.m_fGoldDropRate, GAME_RATE_GOLDDROP );
            AddGameRate( prj.m_fMonsterExpRate, GAME_RATE_MONSTEREXP );
            AddGameRate( prj.m_fMonsterHitRate, GAME_RATE_MONSTERHIT );


    And add this below


    Code
    #ifdef __QUGETQUESTFACTOR
            AddGameRate( prj.m_fQuestExpRate, GAME_RATE_QUEST_EXP );
            AddGameRate( prj.m_fQuestPenRate, GAME_RATE_QUEST_PEN );
    #endif


    Open MsgHdr.h and look for

    Code
    #define GAME_SKILL_EXPERTSP        (BYTE)0x11
    #define GAME_SKILL_PROSP        (BYTE)0x12
    
    
    
    
    #define GAME_RATE_SHOP_BUY        (BYTE)0x13
    #define GAME_RATE_SHOP_SELL        (BYTE)0x14


    And add this under it

    Code
    //#ifdef __QUGETQUESTFACTOR//IT might be better not to do a #if here ?:S
    #define GAME_RATE_QUEST_EXP        (BYTE)0x15
    #define GAME_RATE_QUEST_PEN        (BYTE)0x16
    //#endif


    Now open up Project.cpp
    Look for


    Code
    FLOAT    CProject::m_fItemDropRate = 1.0f;        // ¸ó½ºÅÍ ¾ÆÀÌÅÛ µå·Ó·ü
    FLOAT    CProject::m_fGoldDropRate = 1.0f;        // ¸ó½ºÅÍ Æä³Ä µå·Ó·ü
    FLOAT    CProject::m_fMonsterExpRate = 1.0f;        // ¸ó½ºÅÍ °æÇèÄ¡·ê
    FLOAT    CProject::m_fMonsterHitRate = 1.0f;        // ¸ó½ºÅÍ °ø°Ý·ü


    And add this under it


    Code
    #ifdef __QUGETQUESTFACTOR
    FLOAT    CProject::m_fQuestExpRate = 1.0f;
    FLOAT    CProject::m_fQuestPenRate = 1.0f;
    #endif


    In the same file look for

    Code
    #ifdef __WORLDSERVER
    void CProject::SetGlobal( UINT type, float fValue )
    {
        if( fValue < 0.1f )
            fValue = 0.1f;
        switch( type )
        {


    and this below


    Code
    #ifdef __QUGETQUESTFACTOR
        case GAME_RATE_QUEST_EXP:
            m_fQuestExpRate = fValue;
            printf("QuestPen:[%f]",m_fQuestExpRate);
            break;
        case GAME_RATE_QUEST_PEN:
            m_fQuestPenRate = fValue;
            printf("QuestPen:[%f]",m_fQuestPenRate);
            break;
    #endif


    In the same file look for


    And add



    Still in the same file :P hehe xD
    Look for

    Code
    script.GetToken(); // (
                    propQuest.m_nEndRewardGoldMin = script.GetNumber();
                    script.GetToken(); // ,
                    propQuest.m_nEndRewardGoldMax = script.GetNumber();


    And REPLACE it with


    Now look for


    Code
    script.GetToken(); // (
                    propQuest.m_nEndRewardExpMin = script.GetNumber();
                    script.GetToken(); // ,
                    propQuest.m_nEndRewardExpMax = script.GetNumber();


    REPLACE it with



    Now look for


    Code
    script.GetToken(); // (
                    propQuest.m_nEndRemoveGold = script.GetNumber();


    REPLACE it with



    yay we are done with project.cpp.


    Now open up project.h


    Look for


    Code
    public:
        static FLOAT                m_fItemDropRate;            // ¸ó½ºÅÍ ¾ÆÀÌÅÛ µå·Ó·ü
        static FLOAT                m_fGoldDropRate;            // ¸ó½ºÅÍ Æä³Ä µå·Ó·ü
        static FLOAT                m_fMonsterExpRate;            // ¸ó½ºÅÍ °æÇèÄ¡·ê
        static FLOAT                m_fMonsterHitRate;            // ¸ó½ºÅÍ °ø°Ý·ü


    And ADD under it

    Code
    #ifdef __QUGETQUESTFACTOR
        static    FLOAT                m_fQuestExpRate;
        static    FLOAT                m_fQuestPenRate;
    #endif


    Neuz
    VerisonCommon.h

    Code
    //Epic Quest factor
    #define __QUGETQUESTFACTOR


    Now check this for 4 seconds

    Externer Inhalt www.youtube.com
    Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
    Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.


    You are all done but wait! there is more
    open your Project.cpp
    find

    Code
    LoadConstant( "Constant.inc" );


    replace it with

    Code
    #ifndef __QUGETQUESTFACTOR
        LoadConstant( "Constant.inc" );
    #endif


    Now look for


    Code
    BOOL CProject::OpenProject( LPCTSTR lpszFileName )
    {
        CScanner scanner;
        if(scanner.Load( lpszFileName )==FALSE)
            return FALSE;
    #if !defined(__CLIENT)
        LoadPreFiles();
    #endif


    and add this under it


    Code
    #ifdef __QUGETQUESTFACTOR
    #ifdef __WORLDSERVER
        LoadConstant( "Constant.inc" );
    #endif
    #endif


    Now you are done with the source


    Now open up Constant.inc from your resource folder
    and add this at the bottom



    FAQ
    -Q what visual bugs occur?
    -A penya and exp you get won't be shown right.
    -
    -
    -
    -


    Credits
    Quget aka Misterkid 95% for making this and release it.
    Rose 5% for daring me to make this.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!