Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.94 KB | None | 0 0
  1. // Znajdz w Battle.cpp
  2.            
  3.             if ((int)time_attack_bow < limit_as) {
  4.                 ch->SendGMHackLog("BOW_HACK");
  5.                 if (test_server) {
  6.                     ch->ChatPacket(CHAT_TYPE_INFO, "@@BAD AS = %d | limit = %d", time_attack_bow, limit_as);   
  7.                 }
  8.                 return true;
  9.             }
  10.            
  11. // Zamień na:
  12.  
  13.             if ((int)time_attack_bow < limit_as)
  14.             {
  15.                 if(!ch->IsGM())
  16.                     {
  17.                         ch->SendGMHackLog("BOW_HACK");
  18.                     #ifdef LOGOUT_DETECT_HACK
  19.                         ch->GetDesc()->SetPhase(PHASE_CLOSE);
  20.                     #endif
  21.                     }
  22.                     else
  23.                         ch->ChatPacket(CHAT_TYPE_INFO, "[TEST] Wykryto Hacka(BOW_HACK) w battle.cpp - Logout!");
  24.                
  25.                 if (test_server)
  26.                 {
  27.                     ch->ChatPacket(CHAT_TYPE_INFO, "@@BAD AS = %d | limit = %d", time_attack_bow, limit_as);   
  28.                 }
  29.                 return true;
  30.             }
  31.            
  32.            
  33. // Znajdź:
  34.  
  35.             //ch->SendGMHackLog("WAIT_HACK");
  36.            
  37. // Dodaj pod:
  38.        
  39.             if(!ch->IsGM())
  40.             {
  41.                 ch->SendGMHackLog("WAIT_HACK1");
  42.         #ifdef LOGOUT_DETECT_HACK  
  43.                 ch->GetDesc()->SetPhase(PHASE_CLOSE);
  44.         #endif
  45.             }
  46.             else
  47.                 ch->ChatPacket(CHAT_TYPE_INFO, "[TEST] Wykryto Hacka (WAIT_HACK1 w Battle.cpp) - Logout!");
  48.  
  49.  
  50.  
  51. // Znajdź w Input_main.cpp
  52.  
  53.     #ifdef FIX_SYNC_HACK
  54.         if (OXEVENT_MAP_INDEX != ch->GetMapIndex() && ch->CheckSyncPosition(true))
  55.         {
  56.             if (ch->GetWear(WEAR_ARROW) && ch->GetWear(WEAR_ARROW)->GetVnum() > 0)
  57.             {
  58.                 sys_log(0, "#(HACK)# (%s) sync_check error", ch->GetName());
  59.                 ch->SendGMHackLog("SYNC_HACK");
  60.                 ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
  61.                 ch->Stop();
  62.                 //GetDesc()->SetPhase(PHASE_CLOSE);
  63.                 return;
  64.             }
  65.         }
  66.     #endif 
  67.    
  68. // Zamień na:
  69.  
  70.     #ifdef FIX_SYNC_HACK
  71.         if (OXEVENT_MAP_INDEX != ch->GetMapIndex() && ch->CheckSyncPosition(true))
  72.         {
  73.             if (ch->GetWear(WEAR_ARROW) && ch->GetWear(WEAR_ARROW)->GetVnum() > 0)
  74.             {
  75.                 sys_log(0, "#(HACK)# (%s) sync_check error", ch->GetName());
  76.                
  77.                 if(!ch->IsGM())
  78.                 {
  79.                     ch->SendGMHackLog("SYNC_HACK1");
  80.                 #ifdef LOGOUT_DETECT_HACK  
  81.                     ch->GetDesc()->SetPhase(PHASE_CLOSE);
  82.                 #endif
  83.                 }
  84.                 else
  85.                     ch->ChatPacket(CHAT_TYPE_INFO, "[TEST] Wykryto Hacka (SYNC_HACK1 w input_main.cpp) - Logout!");
  86.                
  87.                 //ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
  88.                 //ch->Stop();
  89.                 return;
  90.             }
  91.         }
  92.     #endif 
  93.    
  94.    
  95.    
  96.  
  97. // Znajdź :
  98.    
  99. #ifdef FIX_SYNC_HACK
  100.         if (OXEVENT_MAP_INDEX != ch->GetMapIndex()) {
  101.             int fDist = DISTANCE_SQRT((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100);
  102.             ch->SetSyncPosition(pinfo->lX, pinfo->lY);
  103.  
  104.             if (((false == ch->IsRiding() && fDist > 25) || fDist > 40)) {
  105.                 sys_log(0, "#(HACK)# (%s) sync fDist = %d, limit = 16", ch->GetName(), fDist);
  106.                 ch->SendGMHackLog("SYNC_HACK");
  107.                 ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
  108.                 ch->Stop();
  109.                 return;
  110.             }
  111.  
  112.             int il = 0;
  113.             if (((false == ch->IsRiding() && fDist > 20) || fDist > 35)) {
  114.                 il = DISTANCE_SQRT((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100) * 3;
  115.             }
  116.  
  117.             ch->CheckSyncPosition() ? il += 1 : il += 3;
  118.             ch->SetSyncCount(il);
  119.         }
  120. #endif
  121.  
  122. // Zamień na:
  123.  
  124.  
  125. #ifdef FIX_SYNC_HACK
  126.         if (OXEVENT_MAP_INDEX != ch->GetMapIndex()) {
  127.             int fDist = DISTANCE_SQRT((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100);
  128.             ch->SetSyncPosition(pinfo->lX, pinfo->lY);
  129.  
  130.             if (((false == ch->IsRiding() && fDist > 25) || fDist > 40))
  131.             {
  132.                 sys_log(0, "#(HACK)# (%s) sync fDist = %d, limit = 16", ch->GetName(), fDist);
  133.                
  134.                 if(!ch->IsGM())
  135.                 {
  136.                     ch->SendGMHackLog("SYNC_HACK2");
  137.             #ifdef LOGOUT_DETECT_HACK  
  138.                     ch->GetDesc()->SetPhase(PHASE_CLOSE);
  139.             #endif
  140.                 }
  141.                 else
  142.                 {
  143.                     ch->ChatPacket(CHAT_TYPE_INFO, "[TEST] Wykryto Hacka (SYNC_HACK2 w input_main.cpp) - Logout!");
  144.                 }
  145.                
  146.                 ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
  147.                 ch->Stop();
  148.                 return;
  149.             }
  150.  
  151.             int il = 0;
  152.             if (((false == ch->IsRiding() && fDist > 20) || fDist > 35)) {
  153.                 il = DISTANCE_SQRT((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100) * 3;
  154.             }
  155.  
  156.             ch->CheckSyncPosition() ? il += 1 : il += 3;
  157.             ch->SetSyncCount(il);
  158.         }
  159. #endif
  160.  
  161.  
  162. // Znajdź w char.cpp
  163.  
  164.     bool CHARACTER::IsAttackHack()
  165.     {
  166.     float fAPS = CalculateAttacksPerSecond();
  167.     float fAllowedAPS = GetAllowedAttacksPerSecond();
  168.    
  169. #ifdef ANTI_ATTACK_HACK_TEST_MODE
  170.     ChatPacket(CHAT_TYPE_INFO, "<AntyDMG> Twoje hity: %.2f Dozwolone hity: %.2f", fAPS, fAllowedAPS);
  171. #else
  172.     if (fAPS > fAllowedAPS)
  173.     {
  174.         CleanOutdatedAttackCounters(true);
  175.         GetDesc()->SetPhase(PHASE_CLOSE);
  176.        
  177.         //LogManager::instance().AttackHackLog(GetPlayerID(), fAPS, fAllowedAPS, GetMapIndex(), GetX(), GetY());
  178.         SendGMHackLog("WAIT_HACK");
  179.         // ChatPacket(CHAT_TYPE_INFO, "<awh> store report in database");
  180.        
  181.         return false;
  182.     }
  183. #endif
  184.    
  185.     return false;
  186.     }
  187.    
  188. // Zamień na :
  189.  
  190. bool CHARACTER::IsAttackHack()
  191. {
  192.     float fAPS = CalculateAttacksPerSecond();
  193.     float fAllowedAPS = GetAllowedAttacksPerSecond();
  194.    
  195. #ifdef ANTI_ATTACK_HACK_TEST_MODE
  196.     ChatPacket(CHAT_TYPE_INFO, "<AntyDMG> Twoje hity: %.2f Dozwolone hity: %.2f", fAPS, fAllowedAPS);
  197. #else
  198.     if (fAPS > fAllowedAPS)
  199.     {
  200.         CleanOutdatedAttackCounters(true);
  201.         if(!IsGM())
  202.         {
  203.             SendGMHackLog("WAIT_HACK2");
  204.         #ifdef LOGOUT_DETECT_HACK
  205.             GetDesc()->SetPhase(PHASE_CLOSE);
  206.         #endif
  207.        
  208.         }
  209.         else
  210.             ChatPacket(CHAT_TYPE_INFO, "[TEST] Wykryto Hacka (WAIT_HACK2) w char.cpp (ADAMS) - Logout!");
  211.         //LogManager::instance().AttackHackLog(GetPlayerID(), fAPS, fAllowedAPS, GetMapIndex(), GetX(), GetY());
  212.         // ChatPacket(CHAT_TYPE_INFO, "<awh> store report in database");
  213.        
  214.         return false;
  215.     }
  216. #endif
  217.    
  218.     return false;
  219. }
  220.  
  221.  
  222. // service.h
  223. // Pod:
  224.  
  225. #define ANTY_DMG_ADAMS                                                      // Włącza AntyDMG od Adams
  226.  
  227. Dodaj pod:
  228.  
  229. #define LOGOUT_DETECT_HACK                                                  // Wylogowywuje postać od wykrycia Adams i Sielu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement