Questing rates(penya und exp) in constant.inc

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • 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

      Quellcode

      1. //Epic Quest factor
      2. #define __QUGETQUESTFACTOR



      Open DPCoreClient.cpp
      Look for

      Quellcode

      1. void CDPCoreClient::OnGameRate( CAr & ar, DPID, DPID, OBJID )
      2. {
      3. FLOAT fRate;
      4. BYTE nFlag;
      5. ar >> fRate;
      6. ar >> nFlag;
      7. switch( nFlag )
      8. {
      9. case GAME_RATE_SHOPCOST:
      10. {
      11. prj.m_fShopCost = fRate;
      12. }
      13. break;
      Alles anzeigen

      And add this below it


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. case GAME_RATE_QUEST_EXP:
      3. {
      4. prj.m_fQuestExpRate = fRate;
      5. }
      6. break;
      7. case GAME_RATE_QUEST_PEN:
      8. {
      9. prj.m_fQuestPenRate = fRate;
      10. }
      11. break;
      12. #endif
      Alles anzeigen



      Now open up DPDatabaseClient.cpp
      Look for

      Quellcode

      1. g_UserMng.AddGameRate( prj.m_fMonsterExpRate, GAME_RATE_MONSTEREXP );
      2. g_UserMng.AddGameRate( prj.m_fGoldDropRate, GAME_RATE_GOLDDROP );
      3. g_UserMng.AddGameRate( prj.m_fItemDropRate, GAME_RATE_ITEMDROP );
      4. g_UserMng.AddGameRate( prj.m_fMonsterHitRate, GAME_RATE_MONSTERHIT );

      And add this below

      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. g_UserMng.AddGameRate( prj.m_fQuestExpRate, GAME_RATE_QUEST_EXP );
      3. g_UserMng.AddGameRate( prj.m_fQuestPenRate, GAME_RATE_QUEST_PEN );
      4. #endif





      Open User.cpp and look for

      Quellcode

      1. if( ((CMover*)this)->IsAuthHigher( AUTH_GAMEMASTER ) )
      2. {
      3. AddGameRate( prj.m_fItemDropRate, GAME_RATE_ITEMDROP );
      4. AddGameRate( prj.m_fGoldDropRate, GAME_RATE_GOLDDROP );
      5. AddGameRate( prj.m_fMonsterExpRate, GAME_RATE_MONSTEREXP );
      6. AddGameRate( prj.m_fMonsterHitRate, GAME_RATE_MONSTERHIT );

      And add this below


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. AddGameRate( prj.m_fQuestExpRate, GAME_RATE_QUEST_EXP );
      3. AddGameRate( prj.m_fQuestPenRate, GAME_RATE_QUEST_PEN );
      4. #endif



      Open MsgHdr.h and look for

      Quellcode

      1. #define GAME_SKILL_EXPERTSP (BYTE)0x11
      2. #define GAME_SKILL_PROSP (BYTE)0x12
      3. #define GAME_RATE_SHOP_BUY (BYTE)0x13
      4. #define GAME_RATE_SHOP_SELL (BYTE)0x14

      And add this under it

      Quellcode

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



      Now open up Project.cpp
      Look for


      Quellcode

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



      And add this under it


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. FLOAT CProject::m_fQuestExpRate = 1.0f;
      3. FLOAT CProject::m_fQuestPenRate = 1.0f;
      4. #endif



      In the same file look for

      Quellcode

      1. #ifdef __WORLDSERVER
      2. void CProject::SetGlobal( UINT type, float fValue )
      3. {
      4. if( fValue < 0.1f )
      5. fValue = 0.1f;
      6. switch( type )
      7. {



      and this below


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. case GAME_RATE_QUEST_EXP:
      3. m_fQuestExpRate = fValue;
      4. printf("QuestPen:[%f]",m_fQuestExpRate);
      5. break;
      6. case GAME_RATE_QUEST_PEN:
      7. m_fQuestPenRate = fValue;
      8. printf("QuestPen:[%f]",m_fQuestPenRate);
      9. break;
      10. #endif



      In the same file look for

      Quellcode

      1. void CProject::ReadConstant( CScript& script )
      2. {
      3. do
      4. {
      5. script.GetToken();
      6. if( script.Token == "itemDropRate" )
      7. {
      8. script.GetToken();// bypass '='
      9. SetGlobal( GAME_RATE_ITEMDROP, script.GetFloat() );
      10. }
      11. else if( script.Token == "monsterExpRate" )
      12. {
      13. script.GetToken();// bypass '='
      14. SetGlobal( GAME_RATE_MONSTEREXP, script.GetFloat() );
      15. }
      16. else if( script.Token == "monsterHitRate" )
      17. {
      18. script.GetToken();// bypass '='
      19. SetGlobal( GAME_RATE_MONSTERHIT, script.GetFloat() );
      20. }
      Alles anzeigen

      And add


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. else if ( script.Token == "questExpRate" )
      3. {
      4. script.GetToken();// bypass '='
      5. SetGlobal( GAME_RATE_QUEST_EXP, script.GetFloat() );
      6. }
      7. else if( script.Token == "questPenRate" )
      8. {
      9. script.GetToken();// bypass '='
      10. SetGlobal( GAME_RATE_QUEST_PEN, script.GetFloat() );
      11. }
      12. #endif
      Alles anzeigen



      Still in the same file :P hehe xD
      Look for

      Quellcode

      1. script.GetToken(); // (
      2. propQuest.m_nEndRewardGoldMin = script.GetNumber();
      3. script.GetToken(); // ,
      4. propQuest.m_nEndRewardGoldMax = script.GetNumber();

      And REPLACE it with

      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. script.GetToken(); // (
      3. propQuest.m_nEndRewardGoldMin = script.GetNumber() * prj.m_fQuestPenRate;
      4. if(propQuest.m_nEndRewardGoldMin > 1000000000 || propQuest.m_nEndRewardGoldMin < 0)
      5. {
      6. propQuest.m_nEndRewardGoldMin = 1000000000;
      7. }
      8. script.GetToken(); // (
      9. propQuest.m_nEndRewardGoldMax = script.GetNumber() * prj.m_fQuestPenRate;
      10. if(propQuest.m_nEndRewardGoldMax > 1000000000 || propQuest.m_nEndRewardGoldMax < 0)
      11. {
      12. propQuest.m_nEndRewardGoldMax = 1000000000;
      13. }
      14. #else
      15. script.GetToken(); // (
      16. propQuest.m_nEndRewardGoldMin = script.GetNumber();
      17. script.GetToken(); // ,
      18. propQuest.m_nEndRewardGoldMax = script.GetNumber();
      19. #endif
      Alles anzeigen



      Now look for


      Quellcode

      1. script.GetToken(); // (
      2. propQuest.m_nEndRewardExpMin = script.GetNumber();
      3. script.GetToken(); // ,
      4. propQuest.m_nEndRewardExpMax = script.GetNumber();



      REPLACE it with


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. script.GetToken(); // (
      3. propQuest.m_nEndRewardExpMin = script.GetNumber() * prj.m_fQuestExpRate;
      4. if(propQuest.m_nEndRewardExpMin < 0)
      5. {
      6. propQuest.m_nEndRewardExpMin = 2000000000;//Change if you like
      7. }
      8. script.GetToken();// ,
      9. propQuest.m_nEndRewardExpMax = script.GetNumber() * prj.m_fQuestExpRate;
      10. if(propQuest.m_nEndRewardExpMax < 0)
      11. {
      12. propQuest.m_nEndRewardExpMax = 2000000000;//Change if you like
      13. }
      14. #else
      15. script.GetToken(); // (
      16. propQuest.m_nEndRewardExpMin = script.GetNumber();
      17. script.GetToken(); // ,
      18. propQuest.m_nEndRewardExpMax = script.GetNumber();
      19. #endif
      Alles anzeigen



      Now look for


      Quellcode

      1. script.GetToken(); // (
      2. propQuest.m_nEndRemoveGold = script.GetNumber();



      REPLACE it with


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. script.GetToken(); // (
      3. propQuest.m_nEndRemoveGold = script.GetNumber() * prj.m_fQuestPenRate;
      4. if(propQuest.m_nEndRemoveGold > 1000000000 || propQuest.m_nEndRemoveGold < 0)
      5. {
      6. propQuest.m_nEndRemoveGold = 1000000000;// Max
      7. }
      8. #else
      9. script.GetToken(); // (
      10. propQuest.m_nEndRemoveGold = script.GetNumber();
      11. #endif
      Alles anzeigen



      yay we are done with project.cpp.


      Now open up project.h


      Look for


      Quellcode

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

      And ADD under it

      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. static FLOAT m_fQuestExpRate;
      3. static FLOAT m_fQuestPenRate;
      4. #endif



      Neuz
      VerisonCommon.h

      Quellcode

      1. //Epic Quest factor
      2. #define __QUGETQUESTFACTOR

      Now check this for 4 seconds



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

      Quellcode

      1. LoadConstant( "Constant.inc" );

      replace it with

      Quellcode

      1. #ifndef __QUGETQUESTFACTOR
      2. LoadConstant( "Constant.inc" );
      3. #endif

      Now look for


      Quellcode

      1. BOOL CProject::OpenProject( LPCTSTR lpszFileName )
      2. {
      3. CScanner scanner;
      4. if(scanner.Load( lpszFileName )==FALSE)
      5. return FALSE;
      6. #if !defined(__CLIENT)
      7. LoadPreFiles();
      8. #endif

      and add this under it


      Quellcode

      1. #ifdef __QUGETQUESTFACTOR
      2. #ifdef __WORLDSERVER
      3. LoadConstant( "Constant.inc" );
      4. #endif
      5. #endif



      Now you are done with the source


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


      Quellcode

      1. lang LANG_USA// YOUR COMPILED LANGUAGE!
      2. {
      3. formula
      4. {
      5. itemDropRate = 1//Item drop rate
      6. goldDropRate = 1 //Gold drop rate
      7. monsterExpRate = 1// Exp rate
      8. questExpRate = 100//quest exp rate
      9. questPenRate = 100//Quest penya rate
      10. monsterHitRate = 1.0//Monster hit rate(How hard monsters hit)
      11. dwVagSP = 1//Vagrant skill cost
      12. dwExpertSP = 2//Expert job skill cost
      13. dwProSP = 3//Pro job skill cost
      14. }
      15. }
      Alles anzeigen



      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.
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )