Dirsovisk

FULL EXP 4VOC

Mar 5th, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Party::shareExperience(double experience, bool fromMonster, bool multiplied)
  2. {
  3.     double shareExperience = experience, bonus = 0;
  4.     int vocs[4], membros;
  5.     int soma = 0;
  6.  
  7.     for (int i = 0; i < 4; i++)
  8.         vocs[i] = 0;        // zera vetor
  9.  
  10.     if (experience >= (double)g_config.getNumber(ConfigManager::EXTRA_PARTY_LIMIT))
  11.         shareExperience += (experience * ((double)g_config.getNumber(ConfigManager::EXTRA_PARTY_PERCENT) / 100));
  12.  
  13.     membros = memberList.size() + 1;
  14.  
  15.     /*     LIDER      */
  16.     uint32_t vocId = leader->getVocationId();
  17.  
  18.     switch (vocId)
  19.     {
  20.     case SORC:
  21.         vocs[0] = 1;
  22.         break;
  23.  
  24.     case MSORC:
  25.         vocs[0] = 1;
  26.         break;
  27.  
  28.     case DRUID:
  29.         vocs[1] = 1;
  30.         break;
  31.  
  32.     case EDRUID:
  33.         vocs[1] = 1;
  34.         break;
  35.  
  36.     case PALA:
  37.         vocs[2] = 1;
  38.         break;
  39.  
  40.     case RPALA:
  41.         vocs[2] = 1;
  42.         break;
  43.  
  44.     case KINA:
  45.         vocs[3] = 1;
  46.         break;
  47.  
  48.     case EKINA:
  49.         vocs[3] = 1;
  50.         break;
  51.     }
  52.  
  53.     /*     MEMBROS      */
  54.     for (PlayerVector::iterator it = memberList.begin(); it != memberList.end(); ++it)
  55.     {
  56.         vocId = (*it)->getVocationId();
  57.  
  58.         switch (vocId)
  59.         {
  60.         case SORC:
  61.             vocs[0] = 1;
  62.             break;
  63.  
  64.         case MSORC:
  65.             vocs[0] = 1;
  66.             break;
  67.  
  68.         case DRUID:
  69.             vocs[1] = 1;
  70.             break;
  71.  
  72.         case EDRUID:
  73.             vocs[1] = 1;
  74.             break;
  75.  
  76.         case PALA:
  77.             vocs[2] = 1;
  78.             break;
  79.  
  80.         case RPALA:
  81.             vocs[2] = 1;
  82.             break;
  83.  
  84.         case KINA:
  85.             vocs[3] = 1;
  86.             break;
  87.  
  88.         case EKINA:
  89.             vocs[3] = 1;
  90.             break;
  91.         }                  
  92.  
  93.     }
  94.  
  95.     for (int i = 0; i < 4; i++)
  96.         if (vocs[i] == 1)
  97.             ++soma;     //soma vai contar qtas vocs diferentes pelos valores setados como 1
  98.  
  99.     /* Definição do fator bonus */
  100.     if (membros < 5)
  101.     {
  102.         switch (soma)
  103.         {
  104.  
  105.             case 1:
  106.                 bonus = 0.2;
  107.                 break;
  108.    
  109.             case 2:
  110.                 bonus = 0.3;
  111.                 break;
  112.    
  113.             case 3:
  114.                 bonus = 0.6;
  115.                 break;
  116.    
  117.             case 4:
  118.                 bonus = 4;
  119.                 break;
  120.         }
  121.     }
  122.  
  123.     //Cálculo bônus
  124.     bonus *= shareExperience;
  125.     shareExperience += bonus;
  126.     shareExperience /= membros;
  127.  
  128.     double tmpExperience = shareExperience;
  129.  
  130.     //envia exp para o lider
  131.     leader->onGainSharedExperience(tmpExperience, fromMonster, multiplied);
  132.  
  133.     // envia exp para a lista de membros
  134.     for (PlayerVector::iterator it = memberList.begin(); it != memberList.end(); ++it)
  135.     {
  136.         tmpExperience = shareExperience;
  137.         (*it)->onGainSharedExperience(tmpExperience, fromMonster, multiplied);
  138.     }
  139. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×