Advertisement
xFaelz

Correção Odin

Apr 24th, 2018
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.87 KB | None | 0 0
  1. //Source Code By Faelz && Thiagodp
  2. #include "ProcessClientMessage.h"
  3.  
  4. void Exec_MSG_CombineItemOdin(int conn, char *pMsg)
  5. {
  6.     MSG_CombineItem *m = (MSG_CombineItem*)pMsg;
  7.  
  8.     for (int i = 0; i < MAX_COMBINE; i++)
  9.     {
  10.         if (m->Item[i].sIndex == 0)
  11.             continue;
  12.  
  13.         int invPos = m->InvenPos[i];
  14.  
  15.         if (invPos < 0 || invPos >= pMob[conn].MaxCarry)
  16.         {
  17.             RemoveTrade(conn);
  18.             return;
  19.         }
  20.  
  21.         if (memcmp(&pMob[conn].MOB.Carry[invPos], &m->Item[i], sizeof(STRUCT_ITEM)))
  22.         {
  23.             ItemLog("err,msg_CombineOdin - item remove or changed.", pUser[conn].AccountName, pUser[conn].IP);
  24.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  25.             return;
  26.         }
  27.     }
  28.  
  29.     int combine = GetMatchCombineOdin(m->Item);
  30.  
  31.     if (combine == 2)
  32.     {
  33.         int sAgua = 0;
  34.         int sTerra = 0;
  35.         int sSol = 0;
  36.         int sVento = 0;
  37.  
  38.         if(m->Item[3].sIndex == 5334 || m->Item[4].sIndex == 5334 || m->Item[5].sIndex == 5334 || m->Item[6].sIndex == 5334)
  39.             sAgua = 1;
  40.  
  41.         if(m->Item[3].sIndex == 5335 || m->Item[4].sIndex == 5335 || m->Item[5].sIndex == 5335 || m->Item[6].sIndex == 5335)
  42.             sTerra = 1;
  43.  
  44.         if(m->Item[3].sIndex == 5336 || m->Item[4].sIndex == 5336 || m->Item[5].sIndex == 5336 || m->Item[6].sIndex == 5336)
  45.             sSol = 1;
  46.  
  47.         if(m->Item[3].sIndex == 5337 || m->Item[4].sIndex == 5337 || m->Item[5].sIndex == 5337 || m->Item[6].sIndex == 5337)
  48.             sVento = 1;
  49.  
  50.         if((sAgua && (sTerra == 0 || sSol == 0 || sVento == 0)) || (sTerra && (sAgua == 0 || sSol == 0 || sVento == 0)) || (sSol && (sAgua == 0 || sTerra == 0 || sVento == 0)) || (sVento && (sAgua == 0 || sTerra == 0 || sSol == 0)))
  51.         {
  52.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  53.             return;
  54.         }
  55.     }
  56.  
  57.     if (combine == 2 && (BASE_GetItemSanc(&m->Item[2]) >= REF_15 || BASE_GetItemAbility(&m->Item[2], EF_MOBTYPE) == 3))
  58.     {
  59.         SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  60.         return;
  61.     }
  62.  
  63.     if (combine == 4 && (pMob[conn].MOB.CurrentScore.Level != 39 || pMob[conn].extra.QuestInfo.Celestial.Lv40 == 1 || pMob[conn].extra.ClassMaster != CELESTIAL))
  64.     {
  65.         SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  66.         return;
  67.     }
  68.  
  69.     if (combine == 11 && (pMob[conn].extra.ClassMaster == MORTAL || pMob[conn].extra.ClassMaster == ARCH || BASE_GetItemSanc(&pMob[conn].MOB.Equip[15]) >= 9))
  70.     {                                
  71.         SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  72.         return;
  73.     }
  74.  
  75.  
  76.     for (int i = 0; i < MAX_COMBINE; i++)
  77.     {
  78.         if (m->Item[i].sIndex == 0)
  79.             continue;
  80.  
  81.         memset(&pMob[conn].MOB.Carry[m->InvenPos[i]], 0, sizeof(STRUCT_ITEM));
  82.         SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[i], &pMob[conn].MOB.Carry[m->InvenPos[i]]);
  83.     }
  84.  
  85.     ItemLog("*** Item combine odin. ***", pUser[conn].AccountName, pUser[conn].IP);
  86.  
  87.     for (int i = 0; i < MAX_COMBINE; i++)
  88.     {
  89.         if (m->Item[i].sIndex)
  90.         {
  91.             char itemlog[2048];
  92.                                      
  93.             BASE_GetItemCode(&m->Item[i], itemlog);
  94.                                      
  95.             strcat(temp, itemlog);
  96.         }
  97.     }
  98.     ItemLog(temp, pUser[conn].AccountName, pUser[conn].IP);
  99.     ItemLog("*** ------------------- ***", pUser[conn].AccountName, pUser[conn].IP);
  100.  
  101.     //srand(time(NULL) / 5 * (rand() % 500) * 5);//Garante valores realmente aleatorio
  102.     srand(time(NULL) / 5 * (rand() % 500) * 5);//Garante valores realmente aleatorio
  103.     int _rand = rand() % 199;;
  104.     if (_rand > 100)
  105.     {
  106.         _rand = _rand - 99;
  107.     }
  108.  
  109.  
  110.     if (combine == 0)//Composição de Sets
  111.     {
  112.         srand(time(NULL) / 5 * (rand() % 500) * 5);//Garante valores realmente aleatorio
  113.         int _chance_r = (g_pOdinRate[combine] + rand() % 5);
  114.         if (_rand <= _chance_r || LOCALSERVER)
  115.  
  116.         {
  117.  
  118.             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[1]], &m->Item[1], sizeof(STRUCT_ITEM));
  119.  
  120.             pMob[conn].MOB.Carry[m->InvenPos[1]].sIndex = g_pItemList[m->Item[0].sIndex].Extra;//Usa o número referente ao Extra na itemlist para definir o item a ser entregue:
  121.             //Exemplo :1902,Eithna_selado,2892.1,0.0.0.0.0,42,270000,1,3626,0,EF_CLASS,255,EF_GRID,0,EF_ITEMLEVEL,5 >> 3626 é o item a ser entregue caso use Eithna Selado
  122.             BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[1]], 0, 0);
  123.            
  124.             char tt[256];
  125.  
  126.             SendNotice(g_pMessageStringTable[_SS_Combin_12Succ]);
  127.  
  128.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  129.  
  130.             sprintf(temp, "%s ", pUser[conn].AccountName);
  131.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[1]], tt);
  132.             strcat(temp, tt);
  133.  
  134.             ItemLog(temp, "*** Combine odin sucess celestial ***", pUser[conn].IP);
  135.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[1], &pMob[conn].MOB.Carry[m->InvenPos[1]]);
  136.            
  137.             sprintf(temp, "%s  %d/%d", "Sucesso ao combinar.", _rand, _chance_r);
  138.             SendClientMessage(conn, temp);
  139.  
  140.             return;
  141.         }
  142.         else
  143.         {
  144.             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[1]], &m->Item[1], sizeof(STRUCT_ITEM));
  145.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[1], &pMob[conn].MOB.Carry[m->InvenPos[1]]);
  146.  
  147.             sprintf(temp, "%s  %d/%d", "Falha ao combinar.", _rand, _chance_r);
  148.             SendClientMessage(conn, temp);
  149.  
  150.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  151.             ItemLog("*** Combine odin fail cele ***", pUser[conn].AccountName, pUser[conn].IP);
  152.  
  153.             return;
  154.         }
  155.     }
  156.  
  157.     else if (combine == 1)//Composição de armas
  158.     {
  159.  
  160.         srand(time(NULL) / 5 * (rand() % 500) * 5);//Garante valores realmente aleatorio
  161.         int _chance_r = (g_pOdinRate[combine] + rand() % 5);
  162.         if (_rand <= _chance_r || LOCALSERVER)
  163.  
  164.         {
  165.  
  166.             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[1]], &m->Item[1], sizeof(STRUCT_ITEM));
  167.  
  168.             pMob[conn].MOB.Carry[m->InvenPos[1]].sIndex = g_pItemList[m->Item[0].sIndex].Extra; //Usa o número referente ao Extra na itemlist para definir o item a ser entregue:
  169.             //Exemplo :1902,Eithna_selado,2892.1,0.0.0.0.0,42,270000,1,3626,0,EF_CLASS,255,EF_GRID,0,EF_ITEMLEVEL,5 >> 3626 é o item a ser entregue caso use Eithna Selado
  170.             BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[1]], 0, 0);
  171.  
  172.             char tt[256];
  173.  
  174.             SendNotice(g_pMessageStringTable[_SS_Combin_12Succ]);
  175.  
  176.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  177.  
  178.             sprintf(temp, "%s ", pUser[conn].AccountName);
  179.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[1]], tt);
  180.             strcat(temp, tt);
  181.  
  182.             ItemLog(temp, "*** Combine odin sucess celestial ***", pUser[conn].IP);
  183.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[1], &pMob[conn].MOB.Carry[m->InvenPos[1]]);
  184.  
  185.             sprintf(temp, "%s  %d/%d", "Sucesso ao combinar.", _rand, _chance_r);
  186.             SendClientMessage(conn, temp);
  187.  
  188.             return;
  189.         }
  190.         else
  191.         {
  192.             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[1]], &m->Item[1], sizeof(STRUCT_ITEM));
  193.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[1], &pMob[conn].MOB.Carry[m->InvenPos[1]]);
  194.  
  195.             sprintf(temp, "%s  %d/%d", "Falha ao combinar.", _rand, _chance_r);
  196.             SendClientMessage(conn, temp);
  197.  
  198.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  199.             ItemLog("*** Combine odin fail cele ***", pUser[conn].AccountName, pUser[conn].IP);
  200.  
  201.             return;
  202.         }
  203.     }
  204.  
  205.     else if (combine == 2)//Item +12+
  206.     {
  207.         int rate = g_pOdinRate[combine];
  208.  
  209.         int protect = 0;
  210.  
  211.         for (int i = 0; i < MAX_COMBINE; i++)
  212.         {
  213.             if (m->Item[2].sIndex == 3464)
  214.             {
  215.                 SendClientMessage(conn, "Não é possivel refinar Amunras! Use P.L e P.O");
  216.                 return;
  217.             }
  218.            
  219.             if (m->Item[i].sIndex >= 5334 && m->Item[i].sIndex <= 5337)
  220.                 rate += g_pItemSancRate12[0];
  221.  
  222.             if (m->Item[i].sIndex == 4043)
  223.                 protect++;
  224.  
  225.             if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 0)
  226.                 rate += g_pItemSancRate12[1];
  227.  
  228.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 1)
  229.                 rate += g_pItemSancRate12[2];
  230.  
  231.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 2)
  232.                 rate += g_pItemSancRate12[3];
  233.  
  234.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 3)
  235.                 rate += g_pItemSancRate12[4];
  236.  
  237.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 4)
  238.                 rate += g_pItemSancRate12[5];
  239.  
  240.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 5)
  241.                 rate += g_pItemSancRate12[6];
  242.  
  243.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 6)
  244.                 rate += g_pItemSancRate12[7];
  245.  
  246.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 7)
  247.                 rate += g_pItemSancRate12[8];
  248.  
  249.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 8)
  250.                 rate += g_pItemSancRate12[9];
  251.  
  252.             else if (m->Item[i].sIndex == 3338 && BASE_GetItemSanc(&m->Item[i]) == 9)
  253.                 rate += g_pItemSancRate12[10];
  254.         }
  255.  
  256.         if (BASE_GetItemSanc(&m->Item[2]) <= REF_10 || BASE_GetItemSanc(&m->Item[2]) >= REF_15)
  257.         {
  258.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 0);
  259.             return;
  260.         }
  261.  
  262.         if (BASE_GetItemSanc(&m->Item[2]) == REF_12)
  263.             rate -= g_pItemSancRate12Minus[0];
  264.                                    
  265.         else if (BASE_GetItemSanc(&m->Item[2]) == REF_13)
  266.             rate -= g_pItemSancRate12Minus[1];
  267.                                      
  268.         else if (BASE_GetItemSanc(&m->Item[2]) == REF_14)
  269.             rate -= g_pItemSancRate12Minus[2];
  270.                                      
  271.         else if (BASE_GetItemSanc(&m->Item[2]) == REF_15)
  272.             rate -= g_pItemSancRate12Minus[3];
  273.  
  274.         if (rate >= _rand || LOCALSERVER)
  275.         {
  276.             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[2]], &m->Item[2], sizeof(STRUCT_ITEM));
  277.  
  278.             int sanc = BASE_GetItemSanc(&m->Item[2]);
  279.             int gem = BASE_GetItemGem(&m->Item[2]);
  280.  
  281.             int NewSanc = 0;
  282.  
  283.             if (sanc == REF_11)
  284.             {
  285.                 BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 12, gem);
  286.                 NewSanc = 12;
  287.             }
  288.             else if (sanc == REF_12)
  289.             {
  290.                 BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 13, gem);
  291.                 NewSanc = 13;
  292.             }
  293.             else if (sanc == REF_13)
  294.             {
  295.                 BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 14, gem);
  296.                 NewSanc = 14;
  297.             }
  298.             else if (sanc == REF_14)
  299.             {
  300.                 BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 15, gem);
  301.                 NewSanc = 15;
  302.             }
  303.             char tt[256];
  304.  
  305.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  306.  
  307.             sprintf(temp, "%s ", pUser[conn].AccountName);
  308.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[2]], tt);
  309.             strcat(temp, tt);
  310.  
  311.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  312.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[2], &pMob[conn].MOB.Carry[m->InvenPos[2]]);
  313.  
  314.             SendNotice(g_pMessageStringTable[_SS_Combin_12Succ]);
  315.  
  316.             return;
  317.         }
  318.         else
  319.         {
  320.             if(rate <= 9 && BASE_GetItemAbility(&m->Item[2], EF_MOBTYPE) == 1)
  321.             {//Possivel quebra
  322.  
  323.                 //Escudos
  324.                 if(g_pItemList[m->Item[2].sIndex].nPos == 128)
  325.                     goto Label_VoltaRef;
  326.  
  327.                 if(rate <= 9)//Tentou com secretas
  328.                 {
  329.                     if(rand()%1 == 0)
  330.                     {
  331.                         if(protect == 2)
  332.                         {
  333.                             memcpy(&pMob[conn].MOB.Carry[m->InvenPos[2]], &m->Item[2], sizeof(STRUCT_ITEM));
  334.  
  335.                             pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex = 3021;
  336.  
  337.                             pMob[conn].MOB.Carry[m->InvenPos[2]].stEffect[0].cEffect = EF_ITEMLEVEL;
  338.                             pMob[conn].MOB.Carry[m->InvenPos[2]].stEffect[0].cValue = 10;
  339.                                                          
  340.                             if(g_pItemList[m->Item[2].sIndex].nPos == 4)
  341.                             pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex++;
  342.  
  343.                             else if(g_pItemList[m->Item[2].sIndex].nPos == 8)
  344.                             pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex += 2;
  345.  
  346.                             else if(g_pItemList[m->Item[2].sIndex].nPos == 16)
  347.                             pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex += 3;
  348.  
  349.                             else if(g_pItemList[m->Item[2].sIndex].nPos == 32)
  350.                             pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex += 4;
  351.                                                          
  352.                             else
  353.                             {
  354.                                 pMob[conn].MOB.Carry[m->InvenPos[2]].sIndex = 3026;
  355.                                 pMob[conn].MOB.Carry[m->InvenPos[2]].stEffect[0].cValue = 11;
  356.                             }
  357.  
  358.            
  359.  
  360.                             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[2], &pMob[conn].MOB.Carry[m->InvenPos[2]]);
  361.                         }
  362.                         else
  363.                         {
  364.                             memset(&pMob[conn].MOB.Carry[m->InvenPos[2]], 0, sizeof(STRUCT_ITEM));
  365.                             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[2], &pMob[conn].MOB.Carry[m->InvenPos[2]]);
  366.                         }
  367.                     }
  368.                     else
  369.                         goto Label_VoltaRef;
  370.                 }
  371.             }
  372.             else
  373.             {
  374. Label_VoltaRef:
  375.                 memcpy(&pMob[conn].MOB.Carry[m->InvenPos[2]], &m->Item[2], sizeof(STRUCT_ITEM));
  376.  
  377.                 int sanc = BASE_GetItemSanc(&m->Item[2]);
  378.                 int gem = BASE_GetItemGem(&m->Item[2]);
  379.  
  380.                 if (sanc == REF_11)
  381.                     BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 10, gem);
  382.  
  383.                 else if (sanc == REF_12)
  384.                     BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 11, gem);
  385.  
  386.                 else if (sanc == REF_13)
  387.                     BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 12, gem);
  388.  
  389.                 else if (sanc == REF_14)
  390.                     BASE_SetItemSanc(&pMob[conn].MOB.Carry[m->InvenPos[2]], 13, gem);
  391.  
  392.                 SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[2], &pMob[conn].MOB.Carry[m->InvenPos[2]]);
  393.             }
  394.             sprintf(temp, "%s", g_pMessageStringTable[_NN_CombineFailed]);
  395.             SendClientMessage(conn, temp);
  396.  
  397.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  398.             ItemLog("*** Combine odin fail mais1215 ***", pUser[conn].AccountName, pUser[conn].IP);
  399.  
  400.             return;
  401.         }
  402.                                      
  403.     }
  404.  
  405.     else if (combine == 3)//Pista de runas
  406.     {
  407.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  408.         {
  409.             pMob[conn].MOB.Carry[m->InvenPos[0]].sIndex = 5134;
  410.  
  411.             char tt[256];
  412.  
  413.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  414.  
  415.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  416.  
  417.             sprintf(temp, "%s ", pUser[conn].AccountName);
  418.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[0]], tt);
  419.             strcat(temp, tt);
  420.  
  421.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  422.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[0], &pMob[conn].MOB.Carry[m->InvenPos[0]]);
  423.  
  424.             return;
  425.         }
  426.         else
  427.         {
  428.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  429.  
  430.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  431.             ItemLog("*** Combine odin fail pista ***", pUser[conn].AccountName, pUser[conn].IP);
  432.  
  433.             return;
  434.         }
  435.     }
  436.  
  437.     else if (combine == 4)//Destrave Lv40
  438.     {
  439.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  440.         {
  441.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  442.  
  443.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  444.  
  445.             sprintf(temp, "destrave,mobname:%s lv:40", pMob[conn].MOB.MobName);
  446.  
  447.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  448.  
  449.             pMob[conn].extra.QuestInfo.Celestial.Lv40 = 1;
  450.  
  451.             return;
  452.         }
  453.         else
  454.         {
  455.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  456.  
  457.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  458.             ItemLog("*** Combine odin fail destrave40 ***", pUser[conn].AccountName, pUser[conn].IP);
  459.  
  460.             return;
  461.         }
  462.     }
  463.  
  464.     else if (combine == 5)//Pedra da fúria
  465.     {
  466.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  467.         {
  468.             pMob[conn].MOB.Carry[m->InvenPos[0]].sIndex = 3020;
  469.  
  470.             char tt[512];
  471.  
  472.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  473.  
  474.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  475.  
  476.             sprintf(temp, "%s ", pUser[conn].AccountName);
  477.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[0]], tt);
  478.             strcat(temp, tt);
  479.  
  480.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  481.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[0], &pMob[conn].MOB.Carry[m->InvenPos[0]]);
  482.  
  483.             return;
  484.         }
  485.         else
  486.         {
  487.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  488.  
  489.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  490.             ItemLog("*** Combine odin fail pedra furia ***", pUser[conn].AccountName, pUser[conn].IP);
  491.  
  492.             return;
  493.         }
  494.     }
  495.  
  496.     else if (combine >= 6 && combine <= 9)//Pedra da agua - terra - sol - vento
  497.     {
  498.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  499.         {
  500.             pMob[conn].MOB.Carry[m->InvenPos[0]].sIndex = 5334 + (combine - 6);
  501.  
  502.             char tt[512];
  503.  
  504.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  505.  
  506.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  507.  
  508.             sprintf(temp, "%s ", pUser[conn].AccountName);
  509.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[0]], tt);
  510.             strcat(temp, tt);
  511.  
  512.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  513.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[0], &pMob[conn].MOB.Carry[m->InvenPos[0]]);
  514.  
  515.             return;
  516.         }
  517.         else
  518.         {
  519.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  520.  
  521.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  522.             ItemLog("*** Combine odin fail secreta ***", pUser[conn].AccountName, pUser[conn].IP);
  523.  
  524.             return;
  525.         }
  526.     }
  527.  
  528.     else if (combine == 10)//Semente de cristal
  529.     {
  530.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  531.         {
  532.             pMob[conn].MOB.Carry[m->InvenPos[0]].sIndex = 4032;
  533.  
  534.             char tt[512];
  535.  
  536.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  537.  
  538.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  539.  
  540.             sprintf(temp, "%s ", pUser[conn].AccountName);
  541.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[0]], tt);
  542.             strcat(temp, tt);
  543.  
  544.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  545.             SendItem(conn, ITEM_PLACE_CARRY, m->InvenPos[0], &pMob[conn].MOB.Carry[m->InvenPos[0]]);
  546.  
  547.             return;
  548.         }
  549.         else
  550.         {
  551.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  552.  
  553.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  554.             ItemLog("*** Combine odin fail semente ***", pUser[conn].AccountName, pUser[conn].IP);
  555.  
  556.             return;
  557.         }
  558.     }
  559.  
  560.     else if (combine == 11)//Capa celestial
  561.     {
  562.         if (_rand <= g_pOdinRate[combine] || LOCALSERVER)
  563.         {
  564.             int sanc = BASE_GetItemSanc(&pMob[conn].MOB.Equip[15]);
  565.  
  566.             if (sanc == 0)
  567.             {
  568.                 if (pMob[conn].MOB.Equip[15].stEffect[0].cEffect && pMob[conn].MOB.Equip[15].stEffect[0].cEffect != 43 && (pMob[conn].MOB.Equip[15].stEffect[0].cEffect && pMob[conn].MOB.Equip[15].stEffect[0].cEffect < 116 || pMob[conn].MOB.Equip[15].stEffect[0].cEffect && pMob[conn].MOB.Equip[15].stEffect[0].cEffect > 125))
  569.                 {
  570.                     if (pMob[conn].MOB.Equip[15].stEffect[1].cEffect && pMob[conn].MOB.Equip[15].stEffect[1].cEffect != 43 && (pMob[conn].MOB.Equip[15].stEffect[1].cEffect && pMob[conn].MOB.Equip[15].stEffect[1].cEffect < 116 || pMob[conn].MOB.Equip[15].stEffect[1].cEffect && pMob[conn].MOB.Equip[15].stEffect[1].cEffect > 125))
  571.                     {
  572.                         if (pMob[conn].MOB.Equip[15].stEffect[2].cEffect && pMob[conn].MOB.Equip[15].stEffect[2].cEffect != 43 && (pMob[conn].MOB.Equip[15].stEffect[2].cEffect && pMob[conn].MOB.Equip[15].stEffect[2].cEffect < 116 || pMob[conn].MOB.Equip[15].stEffect[2].cEffect && pMob[conn].MOB.Equip[15].stEffect[2].cEffect > 125))
  573.                         {
  574.                             SendClientMessage(conn, g_pMessageStringTable[_NN_Cant_Refine_More]);
  575.                             return;
  576.                         }
  577.                         pMob[conn].MOB.Equip[15].stEffect[2].cEffect = 43;
  578.                         pMob[conn].MOB.Equip[15].stEffect[2].cValue = 0;
  579.                     }
  580.                     else
  581.                     {
  582.                         pMob[conn].MOB.Equip[15].stEffect[1].cEffect = 43;
  583.                         pMob[conn].MOB.Equip[15].stEffect[1].cValue = 0;
  584.                     }
  585.                 }
  586.                 else
  587.                 {
  588.                     pMob[conn].MOB.Equip[15].stEffect[0].cEffect = 43;
  589.                     pMob[conn].MOB.Equip[15].stEffect[0].cValue = 0;
  590.                 }
  591.             }
  592.  
  593.             BASE_SetItemSanc(&pMob[conn].MOB.Equip[15], sanc + 1, 0);
  594.  
  595.             char tt[256];
  596.  
  597.             SendClientMessage(conn, g_pMessageStringTable[_NN_Processing_Complete]);
  598.  
  599.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 1);
  600.  
  601.             sprintf(temp, "%s ", pUser[conn].AccountName);
  602.             BASE_GetItemCode(&pMob[conn].MOB.Carry[m->InvenPos[0]], tt);
  603.             strcat(temp, tt);
  604.  
  605.             ItemLog(temp, "*** Combine odin sucess ***", pUser[conn].IP);
  606.             SendItem(conn, ITEM_PLACE_EQUIP, 15, &pMob[conn].MOB.Equip[15]);
  607.  
  608.             return;
  609.         }
  610.         else
  611.         {
  612.             SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  613.  
  614.             SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  615.             ItemLog("*** Combine odin fail capa ***", pUser[conn].AccountName, pUser[conn].IP);
  616.  
  617.             return;
  618.         }
  619.     }
  620.  
  621.     else
  622.     {
  623.         SendClientMessage(conn, g_pMessageStringTable[_NN_CombineFailed]);
  624.  
  625.         SendClientSignalParm(conn, ESCENE_FIELD, _MSG_CombineComplete, 2);
  626.         ItemLog("*** Combine odin fail geral ***", pUser[conn].AccountName, pUser[conn].IP);
  627.  
  628.         return;
  629.     }
  630. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement