Ela tá bem grandinha. Poderia diminuir para ficar automático, mas algumas montarias não tem IDs certinhos (não sei explicar). Enfim,
tá aí.
void Racoes(int clientid, int SrcSlot, int DstSlot, int warp){ st_Mob *player = (st_Mob*)GetMobFromIndex(clientid); int mount = player->Equip[14].Index; if(player->Equip[14].Index >= 2360 && player->Equip[14].Index <= 2388) { int mountIndex; if(mount == 2360) mountIndex = 0; if(mount == 2361) mountIndex = 1; if(mount == 2362) mountIndex = 2; if(mount == 2363) mountIndex = 3; if(mount == 2364) mountIndex = 4; if(mount == 2365) mountIndex = 5; if(mount >= 2366 && mount <= 2370) mountIndex = 6; if(mount == 2371) mountIndex = 9; if(mount >= 2372 && mount <= 2375 || mount == 2387) mountIndex = 6; if(mount == 2376) mountIndex = 16; if(mount == 2378) mountIndex = 18; if(mount == 2371 || mount == 2381 || mount == 2382 || mount == 2383 || mount == 2388) mountIndex = 9; if(mount == 2377) mountIndex = 17; if(mount == 2380) mountIndex = 8; if(mount >= 2384 && mount <= 2386) mountIndex = 10; if((mountIndex + 2420) == player->Inventory[SrcSlot].Index) { /*EF2 = level EFV2 = vitalidade EF3 = ração EFV1 = HP*/ int val; if(player->Equip[14].EFV1 >= 120 || player->Equip[14].EFV1 == 0) return; val = player->Equip[14].EFV1 += 30; if(val > 100) val = 100; player->Equip[14].EFV1 = val; val = player->Equip[14].EF3 += 1; if(val > 100) val = 100; player->Equip[14].EF3 = val; AmountMinus(clientid, SrcSlot); AtualizaInvt(clientid); } else { SendClientMsg(clientid, "Tipo não confere"); return; } SendItens(clientid, 14); } else { SendClientMsg(clientid, "Usado apenas em montarias"); return; }}Créditos totais a Shepher + Supernov4 (lógica)
Nenhum comentário:
Postar um comentário