shepher

Rações

May 22nd, 2012
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.85 KB | None | 0 0
  1. void Racoes(int clientid, int SrcSlot, int DstSlot, int warp)
  2. {
  3.     st_Mob *player = (st_Mob*)GetMobFromIndex(clientid);
  4.     int mount = player->Equip[14].Index;
  5.     if(player->Equip[14].Index >= 2360 && player->Equip[14].Index <= 2388)
  6.     {
  7.         int mountIndex;
  8.         if(mount == 2360) mountIndex = 0;
  9.         if(mount == 2361) mountIndex = 1;
  10.         if(mount == 2362) mountIndex = 2;
  11.         if(mount == 2363) mountIndex = 3;
  12.         if(mount == 2364) mountIndex = 4;
  13.         if(mount == 2365) mountIndex = 5;
  14.         if(mount >= 2366 && mount <= 2370) mountIndex = 6;
  15.         if(mount == 2371) mountIndex = 9;
  16.         if(mount >= 2372 && mount <= 2375 || mount == 2387) mountIndex = 6;
  17.         if(mount == 2376) mountIndex = 16;
  18.         if(mount == 2378) mountIndex = 18;
  19.         if(mount == 2371 || mount == 2381 || mount == 2382 || mount == 2383 || mount == 2388)
  20.             mountIndex = 9;
  21.         if(mount == 2377) mountIndex = 17;
  22.         if(mount == 2380) mountIndex = 8;
  23.         if(mount >= 2384 && mount <= 2386) mountIndex = 10;
  24.         if((mountIndex + 2420) == player->Inventory[SrcSlot].Index)
  25.         {
  26.             /*EF2 = level
  27.             EFV2 = vitalidade
  28.             EF3 = ração
  29.             EFV1 = HP*/
  30.             int val;
  31.             if(player->Equip[14].EFV1 >= 120 || player->Equip[14].EFV1 == 0)
  32.                 return;
  33.             val = player->Equip[14].EFV1 += 30;
  34.             if(val > 100)
  35.                 val = 100;
  36.             player->Equip[14].EFV1 = val;
  37.             val = player->Equip[14].EF3 += 1;
  38.             if(val > 100)
  39.                 val = 100;
  40.             player->Equip[14].EF3 = val;
  41.             if(player->Inventory[SrcSlot].EF1 == 61)
  42.             {
  43.                 if(player->Inventory[SrcSlot].EFV1 > 1)
  44.                 {
  45.                     player->Inventory[SrcSlot].EFV1--;
  46.                 } else {
  47.                     player->Inventory[SrcSlot].Index = 0;
  48.                 }
  49.             } else {
  50.                 player->Inventory[SrcSlot].Index = 0;
  51.             }
  52.             AtualizaInvt(clientid);
  53.         } else {
  54.             SendClientMsg(clientid, "Tipo não confere");
  55.             return;
  56.         }
  57.         SendItens(clientid, 14);
  58.     } else {
  59.         SendClientMsg(clientid, "Usado apenas em montarias");
  60.         return;
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment