Facebook
From Queen Tamarin, 7 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 280
  1. void CInputMain::Refine(LPCHARACTER ch, const char* c_pData)
  2. {
  3.         const TPacketCGRefine* p = reinterpret_cast<const TPacketCGRefine*>(c_pData);
  4.        
  5.        
  6.                         ch->ChatPacket(CHAT_TYPE_INFO, "type %d", p->type);
  7.        
  8.                        
  9.                        
  10.         ch->ChatPacket(CHAT_TYPE_INFO, "Begging of refine");
  11.        
  12.        
  13.        
  14.        
  15.         if (ch->GetExchange() || ch->IsOpenSafebox() || ch->GetShopOwner() || ch->GetMyShop() || ch->IsCubeOpen())
  16.         {
  17.                 ch->ChatPacket(CHAT_TYPE_INFO,  LC_TEXT("â°í,°Ĺ·ˇĂ˘µîŔĚ ż­¸° »óĹÂżˇĽ­´Â °ł·®Ŕ» ÇŇĽö°ˇ ľř˝Ŕ´Ď´Ů"));
  18.                 ch->ClearRefineMode();
  19.                 return;
  20.         }
  21.  
  22.         if (p->type == 255)
  23.         {
  24.                 ch->ClearRefineMode();
  25.                 return;
  26.         }
  27.  
  28.         if (p->pos >= INVENTORY_MAX_NUM)
  29.         {
  30.                 ch->ClearRefineMode();
  31.                 return;
  32.         }
  33.  
  34.         LPITEM item = ch->GetInventoryItem(p->pos);
  35.        
  36.         if (!item)
  37.         {
  38.                 ch->ClearRefineMode();
  39.                 return;
  40.         }
  41.  
  42.         ch->SetRefineTime();
  43.  
  44.                 ch->ChatPacket(CHAT_TYPE_INFO, "Part 2");
  45.                 ch->ChatPacket(CHAT_TYPE_INFO, " ": REFINE_TYPE_NORMAL);
  46.         if (p->type == REFINE_TYPE_NORMAL)
  47.         {
  48.                             ch->ChatPacket(CHAT_TYPE_INFO, "Part 3");
  49.  
  50.                 sys_log (0, "refine_type_noraml");
  51.                 ch->DoRefine(item);
  52.         }
  53.         else if (p->type == REFINE_TYPE_SCROLL || p->type == REFINE_TYPE_HYUNIRON || p->type == REFINE_TYPE_MUSIN || p->type == REFINE_TYPE_BDRAGON)
  54.         {
  55.                                         ch->ChatPacket(CHAT_TYPE_INFO, "Part 4");
  56.                                        
  57.                 sys_log (0, "refine_type_scroll, ...");
  58.                 ch->DoRefineWithScroll(item);
  59.         }
  60.         else if (p->type == REFINE_TYPE_MONEY_ONLY)
  61.         {
  62.                 const LPITEM item = ch->GetInventoryItem(p->pos);
  63.                                         ch->ChatPacket(CHAT_TYPE_INFO, "Part 5");
  64.  
  65.                 if (NULL != item)
  66.                 {
  67.                         if (500 <= item->GetRefineSet())
  68.                         {
  69.                                 LogManager::instance().HackLog("DEVIL_TOWER_REFINE_HACK", ch);
  70.                         }
  71.                         else
  72.                         {
  73.                                 if (ch->GetQuestFlag("deviltower_zone.can_refine"))
  74.                                 {
  75.                                         ch->DoRefine(item, true);
  76.                                         ch->SetQuestFlag("deviltower_zone.can_refine", 0);
  77.                                 }
  78.                                 else
  79.                                 {
  80.                                         ch->ChatPacket(CHAT_TYPE_INFO, "»ç±Í Ÿżö żĎ·á ş¸»óŔş ÇŃąř±îÁö »çżë°ˇ´ÉÇŐ´Ď´Ů.");
  81.                                 }
  82.                         }
  83.                 }
  84.         } else {
  85.             /**
  86.              *  DO USUNIĘCIA ELSE
  87.              */
  88.                     ch->ChatPacket(CHAT_TYPE_INFO, "else");
  89.                         ch->ChatPacket(CHAT_TYPE_INFO, "End of input_main.cpp");
  90.                 ch->DoRefineWithScroll(item);
  91.                 ch->DoRefineWithScroll(item);
  92.         }
  93.                
  94.              
  95.  
  96.         ch->ClearRefineMode();