Register for your free account! | Forgot your password?

Go Back   elitepvpers › Popular Games › Metin2 › Metin2 Private Server › Metin2 PServer Guides & Strategies
You last visited: Today at 06:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



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

Discussion on Removing Skill Book Delaying With GM Code Very Simple... (Without DIFF + C++ Code.) within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Removing Skill Book Delaying With GM Code Very Simple... (Without DIFF + C++ Code.)

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.
-TÜRK- is offline  
Thanks
6 Users
Old   #2
 
elite*gold: 0
Join Date: May 2012
Posts: 13
Received Thanks: 2
Thanks a lot. It's easy and useful.
metin2sozluk is offline  
Thanks
1 User
Old   #3
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
Quote:
Originally Posted by metin2sozluk View Post
Thanks a lot. It's easy and useful.
Evet =) Sanada.
-TÜRK- is offline  
Thanks
1 User
Old   #4

 
elite*gold: 0
Join Date: Dec 2008
Posts: 2,825
Received Thanks: 1,538
nice....very useful
.Colossus. is offline  
Thanks
1 User
Old   #5
 
blackwolf96's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 60
Received Thanks: 100
Thanks a lot!
blackwolf96 is offline  
Thanks
1 User
Old   #6
 
elite*gold: 0
Join Date: Aug 2011
Posts: 14
Received Thanks: 2
Hey, I'm new in editing the gamefile... how do I apply this C code?
segiop13 is offline  
Old   #7
 
elite*gold: 0
Join Date: Mar 2010
Posts: 25
Received Thanks: 3
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
ImmiRlz is offline  
Old   #8
 
Mashkin's Avatar
 
elite*gold: 44
Join Date: May 2010
Posts: 2,053
Received Thanks: 1,747
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?
Mashkin is offline  
Old   #9
 
-TÜRK-'s Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 328
Received Thanks: 434
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.
-TÜRK- is offline  
Reply


Similar Threads Similar Threads
[TUT][Diff][1875][2019][2089]Changing time of removing items thrown on the ground
02/18/2013 - Metin2 PServer Guides & Strategies - 29 Replies
Hallo, today I want to share with you my new dif. This dif changes time of deleting items on the ground thrown by players or allows to disable it. The items will be on the ground forever then :D And i want to say to you one tip :> Locale strings there is information that items thrown on the ground will be removed after 3 minutes, but it's always 300 sec, and it's 5 minutes either! In this dif I will change it to 1 minute :> Dif - disabled removing items thrown on the ground by player (they...
[Tutorial][For who can't Code] Code Simple NPC (CoEmu)
10/15/2009 - CO2 Private Server - 13 Replies
First i will release the npc and explain you alot of good things The npc Ok .. here is the npc jail in TwinCity (Enter the jail and go out the jail) in Handlers / NpcTalk.cs Search for default: { Text("NPC " + ID + "'s dialog is not coded.", CSocket);
About Removing image Vertication Code -(Answer Poll)-
06/09/2009 - Silkroad Online - 11 Replies
Poll of Removing image vertication Code So Please Answer The Poll :D
Removing Guide Book
01/03/2009 - EO PServer Hosting - 4 Replies
How would I go about removing the Guide Book that players start with. Any and all help would be appreciated. Thanks in advance..



All times are GMT +1. The time now is 06:38.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.