Removing Skill Book Delaying With GM Code Very Simple... (Without DIFF + C++ Code.)

05/26/2012 13:23 -TÜRK-#1
How2 Enable:

Very simple, login with GM char and write this code:

/e no_read_delay 1

---------

e = change event flag

no_read_delay = removing skill book delay code (in game file)

1 = active event flag

---------

How2 Disable:

Again login with GM char and write this code:

/e no_read_delay 0

Are event flag codes not affected by reboot and other things. Dont worry. ;)

Here is the C++ Code:

PHP Code:
signed int __cdecl CHARACTER__LearnSkillByBook(int a1, unsigned int a2, unsigned __int8 a3)
{
  
int v3; // eax@1
  
signed int result; // eax@2
  
int v5; // edi@2
  
char *v6; // eax@5
  
__int32 v7; // ebx@11
  
int v8; // edx@13
  
int v9; // ecx@14
  
int v10; // ebx@14
  
int v11; // eax@14
  
char *v19; // eax@17
  
char *v20; // eax@30
  
char *v21; // eax@30
  
int v22; // eax@31
  
int v23; // ebx@31
  
int v24; // edi@31
  
int v25; // esi@31
  
char *v26; // eax@31
  
int v27; // edx@32
  
const char *v28; // ecx@32
  
char *v29; // eax@36
  
char *v30; // eax@36
  
int v31; // ebx@43
  
int v32; // eax@43
  
int v33; // eax@43
  
int v34; // ebx@45
  
int v35; // edx@52
  
int v36; // ecx@54
  
int v44; // ecx@58
  
int v52; // ecx@60
  
unsigned __int32 v60; // eax@61
  
char *v61; // eax@65
  
char *v62; // eax@65
  
int v63; // ebx@72
  
__int32 v64; // eax@72
  
const char *v65; // [sp+0h] [bp-108h]@4
  
const char *v66; // [sp+0h] [bp-108h]@64
  
unsigned int v67; // [sp+4h] [bp-104h]@27
  
char v68; // [sp+8h] [bp-100h]@27
  
int v69; // [sp+Ch] [bp-FCh]@5
  
int v70; // [sp+Ch] [bp-FCh]@25
  
signed int v71; // [sp+24h] [bp-E4h]@55
  
int v72; // [sp+28h] [bp-E0h]@54
  
int v73; // [sp+2Ch] [bp-DCh]@53
  
int v74; // [sp+30h] [bp-D8h]@52
  
unsigned __int8 v75; // [sp+37h] [bp-D1h]@23
  
signed int v76; // [sp+38h] [bp-D0h]@8
  
char v77; // [sp+3Fh] [bp-C9h]@1
  
char s; // [sp+40h] [bp-C8h]@54
  
char v79; // [sp+C0h] [bp-48h]@54
  
char v80; // [sp+D0h] [bp-38h]@13
  
int v81; // [sp+E0h] [bp-28h]@13

  
v77 = a3;
  
v3 = singleton_CSkillManager___ms_singleton;
  if ( !
singleton_CSkillManager___ms_singleton )
  {
    
v69 = (int)"ms_singleton";
    
__assert("instance", "../../common/singleton.h", 26);
    
v3 = singleton_CSkillManager___ms_singleton;
  }
  
v5 = CSkillManager__Get(v3, a2);
  
result = 0;
  if ( 
v5 )
  {
    if ( !
CHARACTER__IsLearnableSkill(a1, a2) )
    {
      
v65 = "¼";
LABEL_5:
      
v6 = locale_find(v65, g_iUseLocale);
      
CHARACTER__ChatPacket(a1, 1, v6, v69);
      return 
0;
    }
    
v76 = 0;
    if ( !
LC_IsYMIR() )
    {
      if ( !
LC_IsCIBN() )
      {
        
v76 = 20000;
        if ( *(
_DWORD *)(a1 + 1284) <= 0x4E1Fu )
        {
          
v65 = (const char *)&unk_81F90A0;
          goto 
LABEL_5;
        }
      }
    }
    
v7 = get_global_time();
    if ( 
v7 < CHARACTER__GetSkillNextReadTime(a1, a2) )
    {
      if ( !
test_server )
        goto 
LABEL_79;
      
std__string__string(&v81, "no_read_delay", &v80);
      
v8 = singleton_quest__CQuestManager___ms_singleton;
      if ( !
singleton_quest__CQuestManager___ms_singleton )
      {
        
v69 = (int)"ms_singleton";
        
__assert("instance", "../../common/singleton.h", 26);
        
v8 = singleton_quest__CQuestManager___ms_singleton;
      }
      
v11 = quest__CQuestManager__GetEventFlag(v8, (int)&v81);
      
_EDX = v81;
      
v10 = v11;
      
_EAX = -1;
      
v9 = v81 - 12;
      
__asm { lock xadd [edx-4], eax }
      if ( 
_EAX <= 0 )
        
std__string___Rep___M_destroy(v9, &v79);
      if ( !
v10 )
      {
LABEL_79:
        if ( !
CHARACTER__FindAffect(a1, 513, 0) )
        {
          
v63 = CHARACTER__GetSkillNextReadTime(a1, a2);
          
v64 = get_global_time();
          
CHARACTER__SkillLearnWaitMoreTimeMessage(a1, v63 - v64);
          return 
0;
        }
        
CHARACTER__RemoveAffect(a1, 513);
        
v19 = locale_find("Á־ȼ", g_iUseLocale);
        
CHARACTER__ChatPacket(a1, 1, v19, v69);
      }
    }
    if ( *(
_DWORD *)(v5 + 68) && CHARACTER__GetSkillMasterType(a1, a2) != 1 )
    {
      if ( 
CHARACTER__GetSkillMasterType(a1, a2) <= 1 )
        
v65 = (const char *)&unk_81F8E80;
      else
        
v65 = (const char *)&unk_81F8E40;
      goto 
LABEL_5;
    }
    
v75 = CHARACTER__GetSkillLevel(a1, a2);
    if ( 
a3 )
    {
      if ( 
CHARACTER__FindAffect(a1, 512, 0) )
      {
        
v77 = (a3 >> 1) + a3;
        
CHARACTER__RemoveAffect(a1, 512);
      }
      
sys_log(0, "LearnSkillByBook Pct %d", (unsigned __int8)v77, v69);
      if ( (
signed int)number_ex(1, 100, (int)"char_skill.cpp", 381) > (unsigned __int8)v77 )
      {
        if ( 
test_server )
          
sys_log(0, "LearnSkillByBook %s", "FAIL");
        goto 
LABEL_29;
      }
      if ( 
test_server )
        
sys_log(0, "LearnSkillByBook %s", "SUCC");
      
v68 = 1;
      
v67 = a2;
    }
    else
    {
      
v32 = CHARACTER__GetSkillLevel(a1, a2);
      
v31 = MIN(9, v32 - 20);
      
v33 = CHARACTER__GetName(a1);
      
sys_log(0, "LearnSkillByBook %s table idx %d value %d", v33, v31, *(&aiSkillBookCountForLevelUp + v31));
      if ( !
LC_IsYMIR() && !LC_IsCIBN() )
      {
        
v74 = CHARACTER__GetSkillLevel(a1, a2) - 20;
        
CHARACTER__PointChange(a1, 3u, -v76, 0, 0);
        
v35 = singleton_quest__CQuestManager___ms_singleton;
        if ( !
singleton_quest__CQuestManager___ms_singleton )
        {
          
v70 = (int)"ms_singleton";
          
__assert("instance", "../../common/singleton.h", 26);
          
v35 = singleton_quest__CQuestManager___ms_singleton;
        }
        
v73 = quest__CQuestManager__GetPC(v35, *(_DWORD *)(a1 + 240));
        if ( 
v73 )
        {
          
memset(&s, 0, 0x80u);
          
snprintf(&s, 0x80u, "traning_master_skill.%lu.read_count", a2);
          
std__string__string(&v81, &s, &v79);
          
v72 = quest__PC__GetFlag(v73, (int)&v81);
          
_EDX = -1;
          
_EAX = v81;
          
v36 = v81 - 12;
          
__asm { lock xadd [eax-4], edx }
          if ( 
_EDX <= 0 )
            
std__string___Rep___M_destroy(v36, &v80);
          
v71 = 65;
          if ( 
CHARACTER__FindAffect(a1, 512, 0) )
          {
            
v71 = 0;
            
CHARACTER__RemoveAffect(a1, 512);
          }
          if ( (
signed int)number_ex(1, 100, (int)"char_skill.cpp", 424) > v71 )
          {
            if ( 
v72 < v74 )
            {
              
std__string__string(&v81, &s, &v79);
              
quest__PC__SetFlag(v73, (int)&v81, v72 + 1, 0);
              
_EAX = v81;
              
_EDX = -1;
              
v52 = v81 - 12;
              
__asm { lock xadd [eax-4], edx }
              if ( 
_EDX <= 0 )
                
std__string___Rep___M_destroy(v52, &v80);
              
v60 = number_ex(1, 3, (int)"char_skill.cpp", 440);
              if ( 
v60 == 2 )
              {
                
v66 = (const char *)&unk_81F9060;
              }
              else
              {
                if ( (
signed int)v60 <= 2 && v60 == 1 )
                  
v66 = (const char *)&unk_81F9020;
                else
                  
v66 = "¿*½ÉÈ";
              }
              
v61 = locale_find(v66, g_iUseLocale);
              
CHARACTER__ChatPacket(a1, 0, v61);
              
v62 = locale_find("%d ±ÇÀ» ´", g_iUseLocale);
              
CHARACTER__ChatPacket(a1, 1, v62, v74 - v72);
              return 
1;
            }
            
CHARACTER__SkillLevelUp(a1, a2, 1);
            
std__string__string(&v81, &s, &v79);
            
quest__PC__SetFlag(v73, (int)&v81, 0, 0);
            
_EAX = v81;
            
_EDX = -1;
            
v44 = v81 - 12;
            
__asm { lock xadd [eax-4], edx }
            if ( 
_EDX <= 0 )
              
std__string___Rep___M_destroy(v44, &v80);
            goto 
LABEL_31;
          }
        }
LABEL_29:
        if ( 
v75 == CHARACTER__GetSkillLevel(a1, a2) )
        {
          
v29 = locale_find("Å©À¹, ±â°¡ ¿ª·", g_iUseLocale);
          
CHARACTER__ChatPacket(a1, 0, v29, v70);
          
v30 = locale_find("¼", g_iUseLocale);
          
CHARACTER__ChatPacket(a1, 1, v30);
          
v22 = singleton_LogManager___ms_singleton;
          
v23 = *(_DWORD *)(a1 + 40);
          
v24 = *(_DWORD *)(a1 + 36);
          
v25 = *(_DWORD *)(a1 + 240);
          if ( !
singleton_LogManager___ms_singleton )
          {
            
__assert("instance", "../../common/singleton.h", 26);
            
v22 = singleton_LogManager___ms_singleton;
          }
          
v28 = &byte_81F5C80;
          
v27 = 136289016;
          goto 
LABEL_33;
        }
        
v20 = locale_find("¸", g_iUseLocale);
        
CHARACTER__ChatPacket(a1, 0, v20, v70);
        
v21 = locale_find("¶ß°Å¿î ¹«¾", g_iUseLocale);
        
CHARACTER__ChatPacket(a1, 0, v21);
LABEL_31:
        
v26 = locale_find("Ã¥À¸·Î ´", g_iUseLocale);
        
CHARACTER__ChatPacket(a1, 1, v26);
        
v22 = singleton_LogManager___ms_singleton;
        
v23 = *(_DWORD *)(a1 + 40);
        
v24 = *(_DWORD *)(a1 + 36);
        
v25 = *(_DWORD *)(a1 + 240);
        if ( !
singleton_LogManager___ms_singleton )
        {
          
__assert("instance", "../../common/singleton.h", 26);
          
v22 = singleton_LogManager___ms_singleton;
        }
        
v28 = &byte_81F5C80;
        
v27 = 136289000;
LABEL_33:
        
LogManager__CharLog(v22, v25, v24, v23, a2, v27, v28);
        return 
1;
      }
      
v34 = *(&aiSkillBookCountForLevelUp + v31);
      if ( 
CHARACTER__FindAffect(a1, 512, 0) )
      {
        if ( 
v34 & 1 )
          
v34 = v34 / 2 + 1;
        else
          
v34 /= 2;
        
CHARACTER__RemoveAffect(a1, 512);
      }
      if ( 
number_ex(1, v34, (int)"char_skill.cpp", 482) != 2 )
        goto 
LABEL_29;
      
v68 = 1;
      
v67 = a2;
    }
    
CHARACTER__SkillLevelUp(a1, v67, v68);
    goto 
LABEL_29;
  }
  return 
result;
} 
Greetings from Turkey ;)
Ah i forgot, this code is tested and %100 working.
05/26/2012 13:43 metin2sozluk#2
Thanks a lot. It's easy and useful.
05/26/2012 13:47 -TÜRK-#3
Quote:
Originally Posted by metin2sozluk View Post
Thanks a lot. It's easy and useful.
Evet =) Sanada.
05/26/2012 14:44 .Colossus.#4
nice....very useful
05/26/2012 14:57 blackwolf96#5
Thanks a lot!
05/29/2012 17:58 segiop13#6
Hey, I'm new in editing the gamefile... how do I apply this C code?
05/29/2012 18:53 ImmiRlz#7
Quote:
Originally Posted by segiop13 View Post
Hey, I'm new in editing the gamefile... how do I apply this C code?
You don't. It's an extract of pseudo-code from the game showing that there is such a thing; all you have to do is run the command of /e no_read_delay 1
05/29/2012 19:49 Mashkin#8
Code:
      if ( !test_server )
        goto LABEL_79;
      std__string__string(&v81, "no_read_delay", &v80);
I would have thought that the event flag only works in test mode because else there is a jump to "LABEL_79" handling the skill wait time message.

Do you have test mode enabled? Or have you tested it in production environment?
05/29/2012 22:03 -TÜRK-#9
Quote:
Originally Posted by M@shkin View Post
Code:
      if ( !test_server )
        goto LABEL_79;
      std__string__string(&v81, "no_read_delay", &v80);
I would have thought that the event flag only works in test mode because else there is a jump to "LABEL_79" handling the skill wait time message.

Do you have test mode enabled? Or have you tested it in production environment?
Both working... No problem. Tested.