Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

@all

 

aqui ta virando zona

 

pessoal tem uma duvida ou pergunta faça somente uma vez espere alguém entra que saiba sana sua duvida

agora fica floodando o tópico com a mesma pergunta assim fica difícil então gente vamos evita comentários sem fundamento

o outro tópico foi fechado exatamente por causa disso

 

 

 

@Saiki

 

Daycare ja foi postado aqui no topico varias vezes

e so da uma procurada

Egg system foi liberado uma versão incompleta mais quase finalizada

aqui no topico tambem e so usa ferramenta "Search" pra acha qual pagina esta

 

@n3tt3rz1

 

e o seguinte não adianta muda so a pasta monster

tem que configura bastante coisa

exemplo precida add no arquivos configuration.lua na pasta lib

e alguns arquivos

 

@Riuzaky

 

nas primeiras versões sim mais agora não esta sem trva para limite de players

 

@Brunnoo

 

eu creio que não vai encontra as sprite aqui mais

vi em outros servidores bastantes sprinte de outras gerações

e so sair juntando

Editado por Nibelins
Link para o comentário
Compartilhar em outros sites

@patrickinho2011

 

 

vai em data/lib/configuration.lua e procure pela linha pokemonExpPerLevelRate = 1 << o valor que tiver quanto mais alto,mais rápido o pokemon vai upar.

 

 

@jefesson ta ai : Pokes Upam até lvl 200.

 

data/lib/level tables.lua

function getPokemonExperienceTable(pokemonname)

if isInArray(fastexppokes, pokemonname) then

return fastexptable

elseif isInArray(mediumfastexppokes, pokemonname) then

return mediumfastexptable

elseif isInArray(mediumslowexppokes, pokemonname) then

return mediumslowexptable

elseif isInArray(slowexppokes, pokemonname) then

return slowexptable

end

print(""..pokemonname.." doesn't have an experience table speed gain. Check it at data/lib/level tables.lua.")

return mediumfastexptable

end

 

fastexppokes = {"Clefairy", "Clefable", "Iglybuff", "Jigglypuff", "Wigglytuff", "Chansey", "Shiny Clefairy", "Shiny Clefable", "Shiny Iglybuff", "Shiny Jigglypuff", "Shiny Wigglytuff", "Shiny Chansey", "Ledyba", "Ledian", "Spinarak", "Ariados", "Cleffa", "Togepi", "Togetic", "Marill", "Azumarill", "Aipom", "Misdreavus", "Snubbull", "Granbull", "Corsola", "Delibird", "Smeargle", "Blissey"}

 

fastexptable = {

[1] = 0,

[2] = 51,

[3] = 172,

[4] = 409,

[5] = 800,

[6] = 1382,

[7] = 2195,

[8] = 3276,

[9] = 4665,

[10] = 6400,

[11] = 8518,

[12] = 11059,

[13] = 14060,

[14] = 17561,

[15] = 21600,

[16] = 26214,

[17] = 31443,

[18] = 37324,

[19] = 43897,

[20] = 51200,

[21] = 59270,

[22] = 68147,

[23] = 77868,

[24] = 88473,

[25] = 100000,

[26] = 112486,

[27] = 125971,

[28] = 140492,

[29] = 156089,

[30] = 172800,

[31] = 190662,

[32] = 209715,

[33] = 229996,

[34] = 251545,

[35] = 274400,

[36] = 298598,

[37] = 324179,

[38] = 351180,

[39] = 379641,

[40] = 409600,

[41] = 441094,

[42] = 474163,

[43] = 508844,

[44] = 545177,

[45] = 583200,

[46] = 622950,

[47] = 664467,

[48] = 707788,

[49] = 752953,

[50] = 800000,

[51] = 848966,

[52] = 899891,

[53] = 952812,

[54] = 1007769,

[55] = 1064800,

[56] = 1123942,

[57] = 1185235,

[58] = 1248716,

[59] = 1314425,

[60] = 1382400,

[61] = 1452678,

[62] = 1525299,

[63] = 1600300,

[64] = 1677721,

[65] = 1757600,

[66] = 1839974,

[67] = 1924883,

[68] = 2012364,

[69] = 2102457,

[70] = 2195200,

[71] = 2290630,

[72] = 2388787,

[73] = 2489708,

[74] = 2593433,

[75] = 2700000,

[76] = 2809446,

[77] = 2921811,

[78] = 3037132,

[79] = 3155449,

[80] = 3276800,

[81] = 3401222,

[82] = 3528755,

[83] = 3659436,

[84] = 3793305,

[85] = 3930400,

[86] = 4070758,

[87] = 4214419,

[88] = 4361420,

[89] = 4511801,

[90] = 4665600,

[91] = 4822854,

[92] = 4983603,

[93] = 5147884,

[94] = 5315737,

[95] = 5487200,

[96] = 5662310,

[97] = 5841107,

[98] = 6023628,

[99] = 6209913,

[100] = 6200000,

[101] = 6300000,

[102] = 6400000,

[103] = 6500000,

[104] = 6600000,

[105] = 6700000,

[106] = 6800000,

[107] = 6900000,

[108] = 7000000,

[109] = 7100000,

[110] = 7200000,

[111] = 7300000,

[112] = 7400000,

[113] = 7500000,

[114] = 7600000,

[115] = 7700000,

[116] = 7800000,

[117] = 7900000,

[118] = 80000000,

[119] = 81200000,

[120] = 82400000,

[121] = 83600000,

[122] = 84800000,

[123] = 85000000,

[124] = 85200000,

[125] = 87400000,

[126] = 88600000,

[127] = 89800000,

[128] = 90000000,

[129] = 91200000,

[130] = 92400000,

[131] = 93600000,

[132] = 94800000,

[133] = 95000000,

[134] = 96200000,

[135] = 97400000,

[136] = 98600000,

[137] = 99800000,

[138] = 100000000,

[139] = 101000000,

[140] = 102000000,

[141] = 104000000,

[142] = 106000000,

[143] = 108000000,

[144] = 110000000,

[145] = 111000000,

[146] = 112000000,

[147] = 113300000,

[148] = 114006000,

[149] = 115000000,

[150] = 116000000,

[151] = 117000000,

[152] = 118000000,

[153] = 119000000,

[154] = 120000000,

[155] = 121000000,

[156] = 122000000,

[157] = 123000000,

[158] = 124000000,

[159] = 125000000,

[160] = 126400000,

[161] = 127000000,

[162] = 128000000,

[163] = 129000000,

[164] = 130000000,

[165] = 131000000,

[166] = 132000000,

[167] = 133000000,

[168] = 134000000,

[169] = 135000000,

[170] = 136000000,

[171] = 137000000,

[172] = 138000000,

[173] = 139000000,

[174] = 140000000,

[175] = 141000000,

[176] = 142000000,

[177] = 143800000,

[178] = 144000000,

[179] = 145000000,

[180] = 146000000,

[181] = 147000000,

[182] = 148000000,

[183] = 149000000,

[184] = 150000000,

[185] = 151000000,

[186] = 152600000,

[187] = 153000000,

[188] = 154000000,

[189] = 155000000,

[190] = 156000000,

[191] = 157000000,

[192] = 158000000,

[193] = 159000000,

[194] = 160000000,

[195] = 161000000,

[196] = 162000000,

[197] = 163000000,

[198] = 164000000,

[199] = 165000000,

[200] = 16600000,

[201] = 999999999}

 

mediumfastexppokes = {"Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Rattata", "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Vulpix", "Ninetales", "Zubat", "Golbat", "Paras", "Parasect", "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Ponyta", "Rapidash", "Magnemite", "Magneton", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Onix", "Steelix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Tyrogue", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Mr. Mime", "Scyther", "Jynx", "Smoochum", "Electabuzz", "Magmar", "Ditto", "Eevee", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Shiny Caterpie", "Shiny Metapod", "Shiny Butterfree", "Shiny Weedle", "Shiny Kakuna", "Shiny Beedrill", "Shiny Rattata", "Shiny Raticate", "Shiny Spearow", "Shiny Fearow", "Shiny Ekans", "Shiny Arbok", "Shiny Pikachu", "Shiny Raichu", "Shiny Sandshrew", "Shiny Sandslash", "Shiny Vulpix", "Shiny Ninetales", "Shiny Zubat", "Shiny Golbat", "Shiny Paras", "Shiny Parasect", "Shiny Diglett", "Shiny Dugtrio", "Shiny Meowth", "Shiny Persian", "Shiny Psyduck", "Shiny Golduck", "Shiny Mankey", "Shiny Primeape", "Shiny Ponyta", "Shiny Rapidash", "Shiny Magnemite", "Shiny Magneton", "Shiny Doduo", "Shiny Dodrio", "Shiny Seel", "Shiny Dewgong", "Shiny Grimer", "Shiny Muk", "Shiny Onix", "Shiny Steelix", "Shiny Drowzee", "Shiny Hypno", "Shiny Krabby", "Shiny Kingler", "Shiny Voltorb", "Shiny Electrode", "Shiny Cubone", "Shiny Marowak", "Shiny Hitmonlee", "Tyrogue", "Shiny Hitmonchan", "Shiny Lickitung", "Shiny Koffing", "Shiny Weezing", "Shiny Kangaskhan", "Shiny Horsea", "Shiny Seadra", "Shiny Goldeen", "Shiny Seaking", "Shiny Mr. Mime", "Shiny Scyther", "Shiny Jynx", "Smoochum", "Shiny Electabuzz", "Shiny Magmar", "Shiny Ditto", "Shiny Eevee", "Shiny Jolteon", "Shiny Flareon", "Shiny Porygon", "Shiny Omanyte", "Shiny Omastar", "Shiny Kabuto", "Shiny Kabutops", "Sentret", "Furret", "Hoothoot", "Noctowl", "Crobat", "Pichu", "Natu", "Xatu", "Wooper", "Quagsire", "Espeon", "Umbreon", "Girafarig", "Pineco", "Forretress", "Dunsparce", "Qwilfish", "Scizor", "Magcargo", "Slugma", "Remoraid", "Octillery", "Kingdra", "Phanpy", "Donphan", "Porygon2", "Hitmontop", "Elekid", "Magby", "Vaporeon", "Shiny Vaporeon", "Venonat", "Venomoth", "Slowpoke", "Shiny Slowpoke", "Slowbro", "Slowking", "Farfetch'd", "Tangela", "Shiny Tangela", "Sudowoodo", "Yanma", "Unown", "Wobbuffet", "Teddiursa", "Ursaring"}

 

mediumfastexptable = {

[1] = 0,

[2] = 64,

[3] = 216,

[4] = 512,

[5] = 1000,

[6] = 1728,

[7] = 2744,

[8] = 4096,

[9] = 5832,

[10] = 8000,

[11] = 10648,

[12] = 13824,

[13] = 17576,

[14] = 21952,

[15] = 27000,

[16] = 32768,

[17] = 39304,

[18] = 46656,

[19] = 54872,

[20] = 64000,

[21] = 74088,

[22] = 85184,

[23] = 97336,

[24] = 110592,

[25] = 125000,

[26] = 140608,

[27] = 157464,

[28] = 175616,

[29] = 195112,

[30] = 216000,

[31] = 238328,

[32] = 262144,

[33] = 287496,

[34] = 314432,

[35] = 343000,

[36] = 373248,

[37] = 405224,

[38] = 438976,

[39] = 474552,

[40] = 512000,

[41] = 551368,

[42] = 592704,

[43] = 636056,

[44] = 681472,

[45] = 729000,

[46] = 778688,

[47] = 830584,

[48] = 884736,

[49] = 941192,

[50] = 1000000,

[51] = 1061208,

[52] = 1124864,

[53] = 1191016,

[54] = 1259712,

[55] = 1331000,

[56] = 1404928,

[57] = 1481544,

[58] = 1560896,

[59] = 1643032,

[60] = 1728000,

[61] = 1815848,

[62] = 1906624,

[63] = 2000376,

[64] = 2097152,

[65] = 2197000,

[66] = 2299968,

[67] = 2406104,

[68] = 2515456,

[69] = 2628072,

[70] = 2744000,

[71] = 2863288,

[72] = 2985984,

[73] = 3112136,

[74] = 3241792,

[75] = 3375000,

[76] = 3511808,

[77] = 3652264,

[78] = 3796416,

[79] = 3944312,

[80] = 4096000,

[81] = 4251528,

[82] = 4410944,

[83] = 4574296,

[84] = 4741632,

[85] = 4913000,

[86] = 5088448,

[87] = 5268024,

[88] = 5451776,

[89] = 5639752,

[90] = 5832000,

[91] = 6028568,

[92] = 6229504,

[93] = 6434856,

[94] = 6644672,

[95] = 6859000,

[96] = 7077888,

[97] = 7301384,

[98] = 7529536,

[99] = 7762392,

[100] = 8000000,

[101] = 8100000,

[102] = 8200000,

[103] = 8300000,

[104] = 8400000,

[105] = 8500000,

[106] = 8600000,

[107] = 8700000,

[108] = 8800000,

[109] = 8900000,

[110] = 9000000,

[111] = 9100000,

[112] = 9200000,

[113] = 9300000,

[114] = 9400000,

[115] = 9500000,

[116] = 9600000,

[117] = 9700000,

[118] = 98000000,

[119] = 99200000,

[120] = 10000000,

[121] = 10100000,

[122] = 10200000,

[123] = 10330000,

[124] = 10404000,

[125] = 10510500,

[126] = 10601060,

[127] = 10700107,

[128] = 10800000,

[129] = 10900000,

[130] = 11000000,

[131] = 11100000,

[132] = 11200000,

[133] = 11300000,

[134] = 11400000,

[135] = 11540000,

[136] = 11660000,

[137] = 11780000,

[138] = 11800000,

[139] = 11920000,

[140] = 12040000,

[141] = 12100000,

[142] = 12200000,

[143] = 12300000,

[144] = 12400000,

[145] = 12500000,

[146] = 12600000,

[147] = 12700000,

[148] = 12800000,

[149] = 12900000,

[150] = 13000000,

[151] = 13100000,

[152] = 13200000,

[153] = 13300000,

[154] = 13400000,

[155] = 13500000,

[156] = 13600000,

[157] = 13700000,

[158] = 13800000,

[159] = 13900000,

[160] = 14000000,

[161] = 14100000,

[162] = 14200000,

[163] = 14300000,

[164] = 14400000,

[165] = 14500000,

[166] = 14600000,

[167] = 14700000,

[168] = 14800000,

[169] = 14900000,

[170] = 15000000,

[171] = 15100000,

[172] = 15200000,

[173] = 15300000,

[174] = 15400000,

[175] = 15500000,

[176] = 15600000,

[177] = 15700000,

[178] = 15800000,

[179] = 15900000,

[180] = 16000000,

[181] = 16100000,

[182] = 16200000,

[183] = 16300000,

[184] = 16400000,

[185] = 16500000,

[186] = 16600000,

[187] = 16700000,

[188] = 16800000,

[189] = 16900000,

[190] = 17000000,

[191] = 17100000,

[192] = 17200000,

[193] = 17300000,

[194] = 17400000,

[195] = 17500000,

[196] = 17600000,

[197] = 17700000,

[198] = 17800000,

[199] = 17900000,

[200] = 18000000,

[201] = 999999999}

 

mediumslowexppokes = {"Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", "Pidgey", "Pidgeotto", "Pidgeot", "Nidoran Female", "Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Oddish", "Gloom", "Vileplume", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel", "Geodude", "Graveler", "Golem", "Gastly", "Haunter", "Gengar", "Mew", "Shiny Bulbasaur", "Shiny Ivysaur", "Shiny Venusaur", "Shiny Charmander", "Shiny Charmeleon", "Shiny Charizard", "Shiny Squirtle", "Shiny Wartortle", "Shiny Blastoise", "Shiny Pidgey", "Shiny Pidgeotto", "Shiny Pidgeot", "Shiny Nidoran Female", "Shiny Nidorina", "Shiny Nidoqueen", "Shiny Nidoran Male", "Shiny Nidorino", "Shiny Nidoking", "Shiny Oddish", "Shiny Gloom", "Shiny Vileplume", "Shiny Poliwag", "Shiny Poliwhirl", "Shiny Poliwrath", "Shiny Abra", "Shiny Kadabra", "Shiny Alakazam", "Shiny Machop", "Shiny Machoke", "Shiny Machamp", "Shiny Bellsprout", "Shiny Weepinbell", "Shiny Victreebel", "Shiny Geodude", "Shiny Graveler", "Shiny Golem", "Shiny Gastly", "Shiny Haunter", "Shiny Gengar", "Shiny Mew", "Chikorita", "Bayleef", "Meganium", "Cyndaquil", "Quilava", "Typhlosion", "Totodile", "Croconaw", "Feraligatr", "Mareep", "Flaaffy", "Ampharos", "Bellossom", "Politoed", "Hoppip", "Skiploom", "Jumpluff", "Sunkern", "Sunflora", "Murkrow", "Gligar", "Shuckle", "Sneasel", "Celebi"}

 

mediumslowexptable = {

[1] = 0,

[2] = 72,

[3] = 456,

[4] = 768,

[5] = 1080,

[6] = 1432,

[7] = 1888,

[8] = 2512,

[9] = 3352,

[10] = 4480,

[11] = 5936,

[12] = 7784,

[13] = 10088,

[14] = 12896,

[15] = 16280,

[16] = 20280,

[17] = 24960,

[18] = 30384,

[19] = 36600,

[20] = 43680,

[21] = 51664,

[22] = 60616,

[23] = 70600,

[24] = 81664,

[25] = 93880,

[26] = 107288,

[27] = 121952,

[28] = 137936,

[29] = 155288,

[30] = 174080,

[31] = 194352,

[32] = 216168,

[33] = 239592,

[34] = 264672,

[35] = 291480,

[36] = 320056,

[37] = 350464,

[38] = 382768,

[39] = 417016,

[40] = 453280,

[41] = 491600,

[42] = 532040,

[43] = 574664,

[44] = 619520,

[45] = 666680,

[46] = 716184,

[47] = 768096,

[48] = 822480,

[49] = 879384,

[50] = 938880,

[51] = 1001008,

[52] = 1065832,

[53] = 1133416,

[54] = 1203808,

[55] = 1277080,

[56] = 1353272,

[57] = 1432448,

[58] = 1514672,

[59] = 1599992,

[60] = 1688480,

[61] = 1780176,

[62] = 1875144,

[63] = 1973448,

[64] = 2075136,

[65] = 2180280,

[66] = 2288920,

[67] = 2401120,

[68] = 2516944,

[69] = 2636440,

[70] = 2759680,

[71] = 2886704,

[72] = 3017576,

[73] = 3152360,

[74] = 3291104,

[75] = 3433880,

[76] = 3580728,

[77] = 3731712,

[78] = 3886896,

[79] = 4046328,

[80] = 4210080,

[81] = 4378192,

[82] = 4550728,

[83] = 4727752,

[84] = 4909312,

[85] = 5095480,

[86] = 5286296,

[87] = 5481824,

[88] = 5682128,

[89] = 5887256,

[90] = 6097280,

[91] = 6312240,

[92] = 6532200,

[93] = 6757224,

[94] = 6987360,

[95] = 7222680,

[96] = 7463224,

[97] = 7709056,

[98] = 7960240,

[99] = 8216824,

[100] = 8478880,

[101] = 8600000,

[102] = 8800000,

[103] = 9000000,

[104] = 9200000,

[105] = 9400000,

[106] = 9600000,

[107] = 9800000,

[108] = 10000000,

[109] = 10200000,

[110] = 10400000,

[111] = 10600000,

[112] = 10800000,

[113] = 11000000,

[114] = 11200000,

[115] = 11400000,

[116] = 11600000,

[117] = 11800000,

[118] = 12000000,

[119] = 12200000,

[120] = 12400000,

[121] = 12600000,

[122] = 12800000,

[123] = 13030000,

[124] = 13204000,

[125] = 13460500,

[126] = 13601060,

[127] = 13800107,

[128] = 14000000,

[129] = 14200000,

[130] = 14400000,

[131] = 14600000,

[132] = 14800000,

[133] = 15000000,

[134] = 15200000,

[135] = 15440000,

[136] = 15660000,

[137] = 15880000,

[138] = 16000000,

[139] = 16220000,

[140] = 16440000,

[141] = 16600000,

[142] = 16800000,

[143] = 17000000,

[144] = 17200000,

[145] = 17400000,

[146] = 17600000,

[147] = 17800000,

[148] = 18000000,

[149] = 18200000,

[150] = 18400000,

[151] = 18600000,

[152] = 18800000,

[153] = 19000000,

[154] = 19200000,

[155] = 19400000,

[156] = 19600000,

[157] = 19800000,

[158] = 20000000,

[159] = 20200000,

[160] = 20400000,

[161] = 20600000,

[162] = 20800000,

[163] = 21000000,

[164] = 21200000,

[165] = 21400000,

[166] = 21600000,

[167] = 21800000,

[168] = 22000000,

[169] = 22200000,

[170] = 22400000,

[171] = 22600000,

[172] = 22800000,

[173] = 23000000,

[174] = 23200000,

[175] = 23400000,

[176] = 23600000,

[177] = 23800000,

[178] = 24000000,

[179] = 24200000,

[180] = 24400000,

[181] = 24600000,

[182] = 24800000,

[183] = 25000000,

[184] = 25200000,

[185] = 25400000,

[186] = 25600000,

[187] = 25800000,

[188] = 26000000,

[189] = 26200000,

[190] = 26400000,

[191] = 26600000,

[192] = 26800000,

[193] = 27000000,

[194] = 27200000,

[195] = 27400000,

[196] = 27600000,

[197] = 27800000,

[198] = 28000000,

[199] = 28200000,

[200] = 28400000,

[201] = 999999999}

 

slowexppokes = {"Ho-oh", "Growlithe", "Arcanine", "Tentacool", "Tentacruel", "Shellder", "Cloyster", "Exeggcute", "Exeggutor", "Rhyhorn", "Rhydon", "Staryu", "Starmie", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Aerodactyl", "Snorlax", "Articuno", "Zapdos", "Moltres", "Dratini", "Dragonair", "Dragonite", "Mewtwo", "Mew", "Chinchou", "Lanturn", "Heracross", "Swinub", "Piloswine", "Mantine", "Skarmory", "Houndour", "Houndoom", "Stantler", "Miltank", "Raikou", "Entei", "Suicune", "Larvitar", "Pupitar", "Tyranitar", "Lugia", "Shiny Growlithe", "Shiny Arcanine", "Shiny Tentacool", "Shiny Tentacruel", "Shiny Shellder", "Shiny Cloyster", "Shiny Exeggcute", "Shiny Exeggutor", "Shiny Rhyhorn", "Shiny Rhydon", "Shiny Staryu", "Shiny Starmie", "Shiny Pinsir", "Shiny Tauros", "Shiny Magikarp", "Shiny Gyarados", "Shiny Lapras", "Shiny Aerodactyl", "Shiny Snorlax", "Shiny Articuno", "Shiny Zapdos", "Shiny Moltres", "Shiny Dratini", "Shiny Dragonair", "Shiny Dragonite", "Shiny Mewtwo", "Shiny Mew",}

 

slowexptable = {

[1] = 0,

[2] = 80,

[3] = 270,

[4] = 640,

[5] = 1250,

[6] = 2160,

[7] = 3430,

[8] = 5120,

[9] = 7290,

[10] = 10000,

[11] = 13310,

[12] = 17280,

[13] = 21970,

[14] = 27440,

[15] = 33750,

[16] = 40960,

[17] = 49130,

[18] = 58320,

[19] = 68590,

[20] = 80000,

[21] = 92610,

[22] = 106480,

[23] = 121670,

[24] = 138240,

[25] = 156250,

[26] = 175760,

[27] = 196830,

[28] = 219520,

[29] = 243890,

[30] = 270000,

[31] = 297910,

[32] = 327680,

[33] = 359370,

[34] = 393040,

[35] = 428750,

[36] = 466560,

[37] = 506530,

[38] = 548720,

[39] = 593190,

[40] = 640000,

[41] = 689210,

[42] = 740880,

[43] = 795070,

[44] = 851840,

[45] = 911250,

[46] = 973360,

[47] = 1038230,

[48] = 1105920,

[49] = 1176490,

[50] = 1250000,

[51] = 1326510,

[52] = 1406080,

[53] = 1488770,

[54] = 1574640,

[55] = 1663750,

[56] = 1756160,

[57] = 1851930,

[58] = 1951120,

[59] = 2053790,

[60] = 2160000,

[61] = 2269810,

[62] = 2383280,

[63] = 2500470,

[64] = 2621440,

[65] = 2746250,

[66] = 2874960,

[67] = 3007630,

[68] = 3144320,

[69] = 3285090,

[70] = 3430000,

[71] = 3579110,

[72] = 3732480,

[73] = 3890170,

[74] = 4052240,

[75] = 4218750,

[76] = 4389760,

[77] = 4565330,

[78] = 4745520,

[79] = 4930390,

[80] = 5120000,

[81] = 5314410,

[82] = 5513680,

[83] = 5717870,

[84] = 5927040,

[85] = 6141250,

[86] = 6360560,

[87] = 6585030,

[88] = 6814720,

[89] = 7049690,

[90] = 7290000,

[91] = 7535710,

[92] = 7786880,

[93] = 8043570,

[94] = 8305840,

[95] = 8573750,

[96] = 8847360,

[97] = 9126730,

[98] = 9411920,

[99] = 9702990,

[100] = 10000000,

[101] = 10300000,

[102] = 10600000,

[103] = 10900000,

[104] = 11200000,

[105] = 11500000,

[106] = 11800000,

[107] = 12100000,

[108] = 12400000,

[109] = 12700000,

[110] = 13000000,

[111] = 13300000,

[112] = 13600000,

[113] = 13900000,

[114] = 14200000,

[115] = 14500000,

[116] = 14800000,

[117] = 15100000,

[118] = 15400000,

[119] = 15700000,

[120] = 16000000,

[121] = 16300000,

[122] = 16600000,

[123] = 16900000,

[124] = 17240000,

[125] = 17505000,

[126] = 17810060,

[127] = 18101007,

[128] = 18400000,

[129] = 18700000,

[130] = 19000000,

[131] = 19300000,

[132] = 19600000,

[133] = 19900000,

[134] = 20200000,

[135] = 20540000,

[136] = 20860000,

[137] = 21180000,

[138] = 21400000,

[139] = 21720000,

[140] = 22040000,

[141] = 22300000,

[142] = 22600000,

[143] = 22900000,

[144] = 23200000,

[145] = 23500000,

[146] = 23800000,

[147] = 24100000,

[148] = 24400000,

[149] = 24700000,

[150] = 25000000,

[151] = 25300000,

[152] = 25600000,

[153] = 25900000,

[154] = 26200000,

[155] = 26500000,

[156] = 26800000,

[157] = 27100000,

[158] = 27400000,

[159] = 27700000,

[160] = 28000000,

[161] = 28300000,

[162] = 28600000,

[163] = 28900000,

[164] = 29200000,

[165] = 29500000,

[166] = 29800000,

[167] = 30100000,

[168] = 30400000,

[169] = 30700000,

[170] = 31000000,

[171] = 31300000,

[172] = 31600000,

[173] = 31900000,

[174] = 32200000,

[175] = 32500000,

[176] = 32800000,

[177] = 33100000,

[178] = 33400000,

[179] = 33700000,

[180] = 34000000,

[181] = 34300000,

[182] = 34600000,

[183] = 34900000,

[184] = 35200000,

[185] = 35500000,

[186] = 35800000,

[187] = 36100000,

[188] = 36400000,

[189] = 36700000,

[190] = 37000000,

[191] = 37300000,

[192] = 37600000,

[193] = 37900000,

[194] = 38200000,

[195] = 38500000,

[196] = 38800000,

[197] = 39100000,

[198] = 39400000,

[199] = 39700000,

[200] = 40000000,

[201] = 999999999}

 

 

data/lib/level system.lua:

function getPokemonStatus(name, multiplier)

local a = pokes[name]

local m = 1

if not a then return false end

if not a.offense then return false end

if multiplier then m = multiplier end

local ret = {}

ret.off = a.offense * m

ret.offense = ret.off

 

ret.def = a.defense * m

ret.defense = ret.def

 

ret.agi = a.agility * m

ret.agility = ret.agi

 

ret.spatk = a.specialattack * m

ret.specialattack = ret.spatk

 

ret.vit = a.vitality * m

ret.vitality = ret.vit

return ret

end

 

function getPokemonXMLOutfit(name)

local a = "data/monster/pokes/"..name..".xml"

local b = io.open(a, "a+")

local c = b:read("*all")

b:close()

local d, e = c:find('look type="(.-)"')

c = string.sub(c, d + 11, e - 1)

return tonumber

end

 

function doEvolutionOutfit(cid, oldout, outfit)

if not isCreature(cid) then return true end

if getCreatureOutfit(cid).lookType == oldout then

doSetCreatureOutfit(cid, {lookType = outfit}, -1)

else

doSetCreatureOutfit(cid, {lookType = oldout}, -1)

end

end

 

function doStartEvolution(cid, evolution, seconds)

if not isCreature(cid) then return true end

local a = getPlayerStorageValue(cid, 1007)

local b = getCreatureHealth(cid) / getCreatureMaxHealth(cid)

local d = getThingPos(cid)

local e = getCreatureMaster(cid)

if getHappinessRate(cid) < 1 then return true end

local f = getCreatureOutfit(cid).lookType

local g = getItemAttribute(getPlayerSlotItem(e, 8).uid, "nick") or getCreatureName(cid)

local h = getPokemonXMLOutfit(evolution)

doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hp", b)

doCreatureSay(e, "What? My "..g.." is evolving!", TALKTYPE_SAY)

doSummonMonster(e, "Evolution")

doReturnPokemon(e, cid, getPlayerSlotItem(e, 8), 0, true)

local evo = getCreatureSummons(e)[1]

doEvolutionOutfit(evo, h, f)

doCreatureSetHideHealth(evo, true)

doCreatureSetLookDir(evo, 2)

setPlayerStorageValue(evo, 1007, g)

doTeleportThing(evo, d, false)

addEvent(sendSSJEffect, 250, evo)

doSendAnimatedText(getThingPos(evo), "EVOLUTION", COLOR_GRASS)

doSendEvolutionEffect(evo, getThingPos(evo), evolution, 20, false, false, f, h)

end

 

function doSendEvolutionEffect(cid, pos, evolution, turn, ssj, evolve, f, h)

if not isCreature(cid) then

doSendAnimatedText(pos, "CANCEL", 215)

return true end

if evolve then

doEvolvePokemon(getCreatureMaster(cid), {uid = cid}, evolution, 0, 0)

return true

end

doSendMagicEffect(pos, 18)

if ssj then

sendSSJEffect(evo)

end

doEvolutionOutfit(cid, f, h)

addEvent(doSendEvolutionEffect, math.pow(1900, turn/20), cid, getThingPos(cid), evolution, turn - 1, turn == 19, turn == 2, f, h)

end

 

function sendSSJEffect(cid)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

local pos2 = getThingPos(cid)

pos2.x = pos2.x + math.random(-1, 1)

pos2.y = pos2.y - math.random(1, 2)

doSendDistanceShoot(pos1, pos2, 37)

addEvent(sendSSJEffect, 45, cid)

end

 

function sendFinishEvolutionEffect(cid, alternate)

if not isCreature(cid) then return true end

local pos1 = getThingPos(cid)

 

if alternate then

local pos = {

[1] = {-2, 0},

[2] = {-1, -1},

[3] = {0, -2},

[4] = {1, -1},

[5] = {2, 0},

[6] = {1, 1},

[7] = {0, 2},

[8] = {-1, 1}}

for a = 1, 8 do

local pos2 = getThingPos(cid)

pos2.x = pos2.x + pos[a][1]

pos2.y = pos2.y + pos[a][2]

local pos = getThingPos(cid)

doSendDistanceShoot(pos2, pos, 37)

addEvent(doSendDistanceShoot, 300, pos, pos2, 37)

end

else

for a = 0, 3 do

doSendDistanceShoot(pos1, getPosByDir(pos1, a), 37)

end

for a = 4, 7 do

addEvent(doSendDistanceShoot, 600, pos1, getPosByDir(pos1, a), 37)

end

end

end

 

function doEvolvePokemon(cid, item2, theevo, stone1, stone2)

 

if not isCreature(cid) then return true end

 

if not pokes[theevo] or not pokes[theevo].offense then

doReturnPokemon(cid, item2.uid, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true)

return true

end

 

local owner = getCreatureMaster(item2.uid)

local pokeball = getPlayerSlotItem(cid, 8)

local description = "Contains a "..theevo.."."

local pct = getCreatureHealth(item2.uid) / getCreatureMaxHealth(item2.uid)

 

doItemSetAttribute(pokeball.uid, "hp", pct)

 

doItemSetAttribute(pokeball.uid, "poke", theevo)

doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".")

 

doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getPokeName(item2.uid).." evolved into a "..theevo.."!")

 

doSendMagicEffect(getThingPos(item2.uid), 18)

doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo])

doSendMagicEffect(getThingPos(cid), 173)

 

local oldpos = getThingPos(item2.uid)

local oldlod = getCreatureLookDir(item2.uid)

local oldlvl = getPokemonLevel(item2.uid)

doRemoveCreature(item2.uid)

 

doSummonMonster(cid, theevo)

local pk = getCreatureSummons(cid)[1]

 

doTeleportThing(pk, oldpos, false)

doCreatureSetLookDir(pk, oldlod)

 

sendFinishEvolutionEffect(pk, true)

addEvent(sendFinishEvolutionEffect, 550, pk, true)

addEvent(sendFinishEvolutionEffect, 1050, pk)

 

doPlayerRemoveItem(cid, stone1, 1)

doPlayerRemoveItem(cid, stone2, 1)

 

doAddPokemonInOwnList(cid, theevo)

 

local status = getPokemonStatus(getCreatureName(pk))

 

local off = status.off * 7.5

local def = status.def * 7.5

local agi = status.agi * 7.5

local spatk = status.spatk * 7.5

local vit = status.vit * 7

 

doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off)

doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def)

doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi)

doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk)

doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit)

 

doPlayerSendTextMessage(cid, 27, "Evolution bonus: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

 

local happy = getItemAttribute(pokeball.uid, "happy")

 

doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution)

 

if happy + happyGainedOnEvolution > 255 then

doItemSetAttribute(pokeball.uid, "happy", 255)

end

 

adjustStatus(pk, pokeball.uid, true, false)

 

if useKpdoDlls then

doUpdateMoves(cid)

end

end

 

 

 

 

 

function givePokemonExp(cid, item, expe, pct, rarecandy)

 

if expe <= 0 or not isCreature(cid) then return true end

 

local leveltable = getPokemonExperienceTable(getPokeballName(item.uid, true))

 

if getItemAttribute(item.uid, "exp") + expe > leveltable[200] then

givePokemonExp(cid, item, leveltable[200] - getItemAttribute(item.uid, "exp"))

return true

end

 

doItemSetAttribute(item.uid, "exp", getItemAttribute(item.uid, "exp") + expe)

doItemSetAttribute(item.uid, "happy", getItemAttribute(item.uid, "happy") + 1)

doItemSetAttribute(item.uid, "nextlevelexp", getItemAttribute(item.uid, "nextlevelexp") - expe)

 

 

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item.uid, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points ("..getItemAttribute(item.uid, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item.uid).." ["..getItemAttribute(item.uid, "level").."] has received "..expe.." experience points and has leveled up!")

end

end

 

if isBeingUsed(item.itemid) then

doSendAnimatedText(getThingPos(getCreatureSummons(cid)[1]), expe, 215)

end

 

if getItemAttribute(item.uid, "nextlevelexp") <= 0 then

local summon = getCreatureSummons(cid)[1]

 

if not isCreature(summon) then return true end

 

doSendFlareEffect(getThingPos(summon))

doSendAnimatedText(getThingPos(summon), "Level up!", 215)

 

adjustPokemonLevel(item.uid, cid, item.itemid)

end

end

 

 

function givePokemonExpInBp(cid, item, expe, ballid, pct, hidemessage)

 

if expe <= 0 or not isCreature(cid) then return true end

 

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

 

if getItemAttribute(item, "exp") + expe > leveltable[200] then

givePokemonExpInBp(cid, item, leveltable[200] - getItemAttribute(item, "exp"), ballid)

return true

end

 

doItemSetAttribute(item, "exp", getItemAttribute(item, "exp") + expe)

doItemSetAttribute(item, "happy", getItemAttribute(item, "happy") + 1)

doItemSetAttribute(item, "nextlevelexp", getItemAttribute(item, "nextlevelexp") - expe)

 

if not hidemessage then

if pct then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." has received "..expe.." experience points ("..pct.."%).")

else

if getItemAttribute(item, "nextlevelexp") > 0 then

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points inside his pokeball ("..getItemAttribute(item, "nextlevelexp").." to next level).")

else

doPlayerSendTextMessage(cid, 27, "Your "..getPokeballName(item).." ["..getItemAttribute(item, "level").."] has received "..expe.." experience points and has leveled up inside his pokeball.")

adjustPokemonLevel(item, cid, ballid)

end

end

end

end

 

 

 

function doMathDecimal(number, casas)

 

if math.floor(number) == number then return number end

 

local c = casas and casas + 1 or 3

 

for a = 0, 10 do

if math.floor(number) < math.pow(10, a) then

local str = string.sub(""..number.."", 1, a + c)

return tonumber(str)

end

end

 

return number

end

 

 

 

function adjustPokemonLevel(item, cid, id, rarecandy)

 

if not isCreature(cid) then return true end

 

local exp = getItemAttribute(item, "exp")

local level = getItemAttribute(item, "level")

local leveltable = getPokemonExperienceTable(getPokeballName(item, true))

local newlevel = 1

 

for x = 1, 200 do

if exp >= leveltable[x] and exp < leveltable[x+1] then

newlevel = x

end

end

 

if newlevel <= 1 then return true end

 

local levelsup = (newlevel - level)

local pokemon = getItemAttribute(item, "poke")

local happy = getItemAttribute(item, "happy")

local rate = happy / 100

local newhappiness = happy

 

if happy >= 250 then

newhappiness = 255

elseif happy >= 230 then

newhappiness = happy + 4

elseif happy >= 210 then

newhappiness = happy + 6

elseif happy >= 180 then

newhappiness = happy + 8

elseif happy >= 140 then

newhappiness = happy + 10

elseif happy >= 110 then

newhappiness = happy + 12

else

newhappiness = happy + 15

end

 

local status = getPokemonStatus(pokemon)

 

local off = status.off * rate * levelsup

local def = status.def * rate * levelsup

local agi = status.agi * rate * levelsup

local spatk = status.spatk * rate * levelsup

local vit = status.vit * rate * levelsup

 

doItemSetAttribute(item, "level", newlevel)

 

if not rarecandy then

doItemSetAttribute(item, "happy", newhappiness)

end

 

local nextexp = leveltable[newlevel + 1] - exp

doItemSetAttribute(item, "nextlevelexp", nextexp)

 

doItemSetAttribute(item, "offense", getItemAttribute(item, "offense") + off)

doItemSetAttribute(item, "defense", getItemAttribute(item, "defense") + def)

doItemSetAttribute(item, "speed", getItemAttribute(item, "speed") + agi)

doItemSetAttribute(item, "specialattack", getItemAttribute(item, "specialattack") + spatk)

doItemSetAttribute(item, "vitality", getItemAttribute(item, "vitality") + vit)

 

if newlevel > getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer then

addEvent(doPlayerSendTextMessage, 30, cid, 18, "Warning: Your "..getPokeballName(item).."'s ["..newlevel.."] level is much higher than yours, so you will not be able to call him to battles.")

end

 

if isCreature(cid) and id >= 1 and isBeingUsed(id) then

adjustStatus(getCreatureSummons(cid)[1], item, false, true)

doPlayerSendTextMessage(cid, 27, "• Level: "..newlevel.." (+"..levelsup..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

 

if happy < minHappyToEvolve then return true end

 

if pokemonsCanEvolveByLevel then

 

local summon = getCreatureSummons(cid)[1]

 

local reqlevel = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].level or -1

local level = getItemAttribute(item, "level")

local evolution = "none"

local name = getCreatureName(summon)

 

if name == "Tyrogue" and level >= 20 then

if getOffense(summon) == getDefense(summon) then

evolution = "Hitmontop"

elseif getOffense(summon) > getDefense(summon) then

evolution = "Hitmonlee"

else

evolution = "Hitmonchan"

end

elseif name == "Eevee" then

if happy >= maxHappyToEvolve then

if isDay() then

evolution = "Espeon"

else

evolution = "Umbreon"

end

end

elseif name == "Slowpoke" and level >= 28 then

evolution = "Slowbro"

elseif name == "Poliwhirl" and level >= 36 then

evolution = "Poliwrath"

elseif reqlevel > 4 and level >= reqlevel then

evolution = poevo[getCreatureName(summon)].evolution

elseif reqlevel == 2 and happy >= maxHappyToEvolve then

evolution = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].evolution or "none"

end

 

if evolution ~= "none" then

doStartEvolution(summon, evolution, 4)

end

end

end

end

 

function adjustStatus(pk, item, health, vite, conditions)

 

if not isCreature(pk) then return true end

 

local bonusoffense = getItemAttribute(item, boffense) or 0

local bonusdefense = getItemAttribute(item, bdefense) or 0

local bonusagility = getItemAttribute(item, bagility) or 0

local bonussattack = getItemAttribute(item, bsattack) or 0

 

setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level"))

setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense)

setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense)

setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility)

setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack)

 

local gender = getItemAttribute(item, "gender") and getItemAttribute(item, "gender") or 0

doCreatureSetSkullType(pk, gender)

 

if vite == true then

local pct = getCreatureHealth(pk) / getCreatureMaxHealth(pk)

local vit = getItemAttribute(item, "vitality") - getPlayerStorageValue(pk, 1004)

setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + ( vit * HPperVIT ))

doCreatureAddHealth(pk, pct * vit * HPperVIT)

end

 

setPlayerStorageValue(pk, 1004, getItemAttribute(item, "vitality"))

 

doRegainSpeed(pk)

 

local nick = getItemAttribute(item, "poke")

 

if getItemAttribute(item, "nick") then

nick = getItemAttribute(item, "nick")

end

 

setPlayerStorageValue(pk, 1007, nick)

 

local boostlevel = getItemAttribute(item, "boost") or 0

local boostshow = hideBoost and "]" or " + "..boostlevel.."]"

local lvlstr = ""

 

if showBoostSeparated then

boostshow = hideBoost and "]" or "] [+"..boostlevel.."]"

end

 

if hideSummonsLevel then

if not hideBoost then

nick = nick.." [+"..boostlevel.."]"

end

else

nick = nick.." ["..getItemAttribute(item, "level")..""..boostshow..""

end

 

doCreatureSetNick(pk, nick)

 

if not getItemAttribute(item, "happy") then

doItemSetAttribute(item, "happy", 120)

end

 

if not getItemAttribute(item, "hunger") then

doItemSetAttribute(item, "hunger", 5)

end

 

local happy = getItemAttribute(item, "happy")

if happy < 0 then

happy = 0

end

setPlayerStorageValue(pk, 1008, happy)

 

local hunger = getItemAttribute(item, "hunger")

setPlayerStorageValue(pk, 1009, hunger)

 

if health == true then

local mh = getCreatureMaxHealth(pk) + HPperVIT * getVitality(pk)

local rd = 1 - (tonumber(getItemAttribute(item, "hp")))

setCreatureMaxHealth(pk, mh)

doCreatureAddHealth(pk, getCreatureMaxHealth(pk))

doCreatureAddHealth(pk, -(getCreatureMaxHealth(pk) * rd))

end

 

if isSummon(pk) and conditions then

local burn = getItemAttribute(item, "burn")

if burn and burn >= 0 then

addEvent(doAdvancedBurn, 5000, pk, pk, getItemAttribute(item, "burndmg"), burn - 1)

end

 

local poison = getItemAttribute(item, "poison")

if poison and poison >= 0 then

addEvent(doAdvancedPoison, 2500, pk, pk, getItemAttribute(item, "poisondmg"), poison - 1)

end

 

if getItemAttribute(item, "confuse") and getItemAttribute(item, "confuse") >= 1 then

addEvent(doAdvancedConfuse, 1200, pk, getItemAttribute(item, "confuse"), getPlayerStorageValue(pk, 3891))

end

 

if getItemAttribute(item, "blind") and getItemAttribute(item, "blind") >= 1 then

addEvent(doBlind, 300, pk, getItemAttribute(item, "blind"), getItemAttribute(item, "blindef"))

end

 

if getItemAttribute(item, "sleep") and getItemAttribute(item, "sleep") >= 1 then

doSleep(pk, getItemAttribute(item, "sleep"))

end

end

 

return true

end

 

function setWildPokemonLevel(cid, optionalLevel, optionalStatus, optionalNick, optionalExtraExp)

 

if not isCreature(cid) then return true end

 

local levelRange = 0

local off = 0

local def = 0

local agi = 0

local spatk = 0

local vit = 0

local this = getCreatureName(cid)

local ee = 1

 

if optionalExtraExp then

ee = optionalExtraExp

end

 

 

if optionalLevel and tonumber(optionalLevel) >= 1 then

if optionalLevel <= 200 then

levelRange = optionalLevel

else

levelRange = 200

end

elseif getCreatureOutfit(cid).lookHead and getCreatureOutfit(cid).lookBody and getCreatureOutfit(cid).lookHead <= getCreatureOutfit(cid).lookBody then

levelRange = math.random(getCreatureOutfit(cid).lookHead, getCreatureOutfit(cid).lookBody)

else

levelRange = math.random(20, 30)

end

 

local status = getPokemonStatus(this)

if status then

off = status.off

def = status.def

agi = status.agi

vit = status.vit

spatk = status.spatk

end

 

setPlayerStorageValue(cid, 1000, levelRange)

 

if optionalStatus and optionalStatus.off then

setPlayerStorageValue(cid, 1001, optionalStatus.offense)

setPlayerStorageValue(cid, 1002, optionalStatus.defense)

setPlayerStorageValue(cid, 1003, optionalStatus.agility)

setPlayerStorageValue(cid, 1004, optionalStatus.vitality)

setPlayerStorageValue(cid, 1005, optionalStatus.specialattack)

setPlayerStorageValue(cid, 1011, optionalStatus.offense)

setPlayerStorageValue(cid, 1012, optionalStatus.defense)

setPlayerStorageValue(cid, 1013, optionalStatus.agility)

setPlayerStorageValue(cid, 1014, optionalStatus.vitality)

setPlayerStorageValue(cid, 1015, optionalStatus.specialattack)

else

setPlayerStorageValue(cid, 1001, 5 + math.random(off * levelRange * 0.9, off * levelRange * 1.8))

setPlayerStorageValue(cid, 1002, 5 + math.random(def * levelRange * 0.9, def * levelRange * 1.8))

setPlayerStorageValue(cid, 1003, math.random(agi * levelRange * 0.9, agi * levelRange * 1.8))

setPlayerStorageValue(cid, 1004, math.random(vit * levelRange * 0.9, vit * levelRange * 1.8))

setPlayerStorageValue(cid, 1005, 5 + math.random(spatk * levelRange * 0.9, spatk * levelRange * 1.8))

setPlayerStorageValue(cid, 1011, getPlayerStorageValue(cid, 1001))

setPlayerStorageValue(cid, 1012, getPlayerStorageValue(cid, 1002))

setPlayerStorageValue(cid, 1013, getPlayerStorageValue(cid, 1003))

setPlayerStorageValue(cid, 1014, getPlayerStorageValue(cid, 1004))

setPlayerStorageValue(cid, 1015, getPlayerStorageValue(cid, 1005))

end

 

doRegainSpeed(cid)

 

setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + getPlayerStorageValue(cid, 1004) * HPperVIT * vitReductionForWild)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

 

if pokes[getCreatureName(cid)].exp then

--getMonsterInfo(getCreatureName(cid)).experience

local exp = (50 + pokes[getCreatureName(cid)].exp) * baseExpRate + pokes[getCreatureName(cid)].vitality * levelRange * pokemonExpPerLevelRate

setPlayerStorageValue(cid, 1006, exp * generalExpRate * ee)

end

 

local wildshow = wildBeforeNames and "Wild " or ""

if optionalNick then

if hideWildsLevel then

doCreatureSetNick(cid, optionalNick)

else

doCreatureSetNick(cid, optionalNick.." ["..getWildPokemonLevel(cid).."]")

end

else

if hideWildsLevel then

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).."")

else

doCreatureSetNick(cid, ""..wildshow..""..getCreatureName(cid).." ["..getWildPokemonLevel(cid).."]")

end

end

end

 

function getOffense(cid)

if not isCreature(cid) then return 0 end

 

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1001)) / 2

end

 

return tonumber(getPlayerStorageValue(cid, 1001))

end

 

function getDefense(cid)

if not isCreature(cid) then return 0 end

 

if getPlayerStorageValue(cid, 3894) >= 1 then

return tonumber(getPlayerStorageValue(cid, 1002)) / 2

end

 

return tonumber(getPlayerStorageValue(cid, 1002))

end

 

function getSpeed(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1003))

end

 

function getVitality(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1004))

end

 

function getSpecialAttack(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1005))

end

 

function getHappiness(cid)

if not isCreature(cid) then return 0 end

return tonumber(getPlayerStorageValue(cid, 1008))

end

 

function getSpecialDefense(cid)

if not isCreature(cid) then return 0 end

return getSpecialAttack(cid) * 0.85 + getDefense(cid) * 0.2

end

 

function getWildPokemonExp(cid)

return getPlayerStorageValue(cid, 1006)

end

 

function getWildPokemonLevel(cid)

return getPlayerStorageValue(cid, 1000)

end

 

function getLevel(cid)

if isSummon(cid) then

return getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "level")

end

return getPlayerStorageValue(cid, 1000)

end

 

function getPokeName(cid)

if not isSummon(cid) then return getCreatureName(cid) end

if getCreatureName(cid) == "Evolution" then return getPlayerStorageValue(cid, 1007) end

local item = getPlayerSlotItem(getCreatureMaster(cid), 8)

if getItemAttribute(item.uid, "nick") then

return getItemAttribute(item.uid, "nick")

end

return getCreatureName(cid)

end

 

function getPokeballName(item, truename)

if not truename and getItemAttribute(item, "nick") then

return getItemAttribute(item, "nick")

end

return getItemAttribute(item, "poke")

end

 

function getPokemonName(cid)

return getCreatureName(cid)

end

 

function getPokemonLevel(cid)

if not isCreature(cid) then return 0 end

return getPlayerStorageValue(cid, 1000)

end

 

function getPokemonGender(cid)

return getCreatureSkullType(cid)

end

 

 

Ve se da certo ae Jefesson e dps vse avisa aqui. (: ja era pra eu ter postado, porém a porra da luz tinha acabado '-'

Editado por MaatheeuusYuurii
Link para o comentário
Compartilhar em outros sites

Você viu que eu postei as sprites né?Mas tem gente que não sabe onde tem então eu postei

 

 

aeaoeoaoeaoea Spr sao do client Centarium kospkossokspok spoksopk sim as Spr estao bem boa que pena q no meu server jha estao todas e os poke configurados com m1-evo-Order

Link para o comentário
Compartilhar em outros sites

Você viu que eu postei as sprites né?Mas tem gente que não sabe onde tem então eu postei

 

 

aeaoeoaoeaoea Spr sao do client Centarium kospkossokspok spoksopk sim as Spr estao bem boa que pena q no meu server jha estao todas e os poke configurados com m1-evo-Order

 

ei kois é centurion xd, iai gostou dos sprites? xd

 

e vou lança a v2 com base no dash ^^

Editado por cacaiu
Link para o comentário
Compartilhar em outros sites

@ All emergencia

 

Alguem pode imaginar oque pode estar causando esse erro chato?

 

amigo disse que deve ser na low effetc e super effect?

 

 

[13/04/2012 17:37:39] [Error - CreatureScript Interface] 
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:onStatsChange
[13/04/2012 17:37:39] Description: 
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:330: attempt to perform arithmetic on a nil value
[13/04/2012 17:37:39] stack traceback:
[13/04/2012 17:37:39]  data/creaturescripts/scripts/exp.lua:330: in function <data/creaturescripts/scripts/exp.lua:129>

 

 

 

local combats = {
[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
[GRASSDAMAGE] = {cor = COLOR_GRASS},
[POISONEDDAMAGE] = {cor = COLOR_GRASS},
[MORTALGASDAMAGE] = {cor = COLOR_POISON},
[FIREDAMAGE] = {cor = COLOR_FIRE2},
[bURNEDDAMAGE] = {cor = COLOR_BURN},
[WATERDAMAGE] = {cor = COLOR_WATER},
[iCEDAMAGE] = {cor = COLOR_ICE},
[NORMALDAMAGE] = {cor = COLOR_NORMAL},
[GUILLOTINEDAMAGE] = {cor = COLOR_NORMAL},
[FLYDAMAGE] = {cor = COLOR_FLYING},
[GHOSTDAMAGE] = {cor = COLOR_GHOST},
[NIGHTMAREDAMAGE] = {cor = COLOR_GHOST},
[GROUNDDAMAGE] = {cor = COLOR_GROUND},
[ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
[THUNDERWAVEDAMAGE] = {cor = COLOR_ELECTRIC},
[ROCKDAMAGE] = {cor = COLOR_ROCK},
[bUGDAMAGE] = {cor = COLOR_BUG},
[FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
[sEISMICTOSSDAMAGE] = {cor = COLOR_FIGHTING},
[DRAGONDAMAGE] = {cor = COLOR_DRAGON},
[POISONDAMAGE] = {cor = COLOR_POISON},
[DARKDAMAGE] = {cor = COLOR_DARK},
[sTEELDAMAGE] = {cor = COLOR_STEEL},
}

local function doHeal(cid, amount)
doCreatureAddHealth(cid, amount)
doSendMagicEffect(getThingPos(cid), 12)
doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65)
end

local function sendPlayerDmgMsg(cid, text)
if not isCreature(cid) then return true end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
end

local spcevo = {
["Poliwhirl"] = {"Poliwrath", "Politoed"},
["Gloom"] = {"Bellossom", "Vileplume"},
["Tyrogue"] = {"Hitmonchan", "Hitmontop", "Hitmonlee"}}

local function doEvolveWild(cid)
if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return true end
local name = getCreatureName(cid)
local evolution = "none"
if spcevo[name] then
evolution = spcevo[name][math.random(1, #spcevo[name])]
elseif poevo[name] then
evolution = poevo[name].evolution
end
local a = getPokemonStatus(name)
if not a or evolution == "none" then return true end
local pk = {}
local players = getSpectators(getThingPos(cid), 7, 7)
if players then
for pp = 1, #players do
local this = players[pp]
if isCreature(this) and isPlayer(this) and (getCreatureTarget(this) == cid or getDamageMapPercent(this, cid) > 0) then
doSendMagicEffect(getThingPos(this), 173)
local expstring = cid.."expEx"
pk[this] = getItemAttribute(getPlayerSlotItem(this, 8).uid, expstring)
doItemSetAttribute(getPlayerSlotItem(this, 8).uid, expstring, 0)
end
end
end
local level = getPokemonLevel(cid)
local pos = getThingPos(cid)
local gender = getCreatureSkull(cid)
local lifepercentage = 1 - ((getCreatureHealth(cid) * 1.3) / getCreatureMaxHealth(cid))
local lookdir = getCreatureLookDir(cid)
local status = {}
status.offense = getOffense(cid) + a.off * 8
status.defense = getDefense(cid) + a.def * 8
status.agi = getSpeed(cid) + a.agi * 8
status.spatk = getSpecialAttack(cid) + a.spatk * 8
status.vit = getVitality(cid) + a.vit * 4
doRemoveCreature(cid)
local evo = doCreateMonster(evolution, pos)
setWildPokemonLevel(evo, level, status)
doCreatureSetLookDir(evo, lookdir)
doCreatureSetSkullType(evo, gender)
doCreatureAddHealth(evo, -getCreatureMaxHealth(evo) * lifepercentage)
doSendMagicEffect(getThingPos(evo), 18)
for attacker, experience in pairs (pk) do
doWildAttackPlayer(evo, attacker)
local expstring = evo.."expEx"
local exp = experience or 0
doItemSetAttribute(getPlayerSlotItem(attacker, 8).uid, expstring, exp)
end
sendFinishEvolutionEffect(evo, true)
addEvent(sendFinishEvolutionEffect, 550, evo, true)
addEvent(sendFinishEvolutionEffect, 1050, evo)
end

local races = {
[4] = {cor = COLOR_FIRE2},
[6] = {cor = COLOR_WATER},
[7] = {cor = COLOR_NORMAL},
[8] = {cor = COLOR_FIRE2},
[9] = {cor = COLOR_FIGHTING},
[10] = {cor = COLOR_FLYING},
[11] = {cor = COLOR_GRASS},
[12] = {cor = COLOR_POISON},
[13] = {cor = COLOR_ELECTRIC},
[14] = {cor = COLOR_GROUND},
[15] = {cor = COLOR_PSYCHIC},
[16] = {cor = COLOR_ROCK},
[17] = {cor = COLOR_ICE},
[18] = {cor = COLOR_BUG},
[19] = {cor = COLOR_DRAGON},
[20] = {cor = COLOR_GHOST},
[21] = {cor = COLOR_STEEL},
[22] = {cor = COLOR_DARK},
[1] = {cor = 180},
[2] = {cor = 180},
[3] = {cor = 180},
[5] = {cor = 180},
}

local damages = {MORTALGASDAMAGE, GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE, NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, SEISMICTOSSDAMAGE}
local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
local ignored = {NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, MORTALGASDAMAGE, SEISMICTOSSDAMAGE, PSYCHOSHIFTDAMAGE, POISONEDDAMAGE, BURNEDDAMAGE}
local ignoremiss = {NIGHTMAREDAMAGE, MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE}
local ignorecritical = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}
local cannotkill = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}

function onStatsChange(cid, attacker, type, combat, value)

if combat == FLYSYSTEMDAMAGE then return false end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local damageCombat = combat
if damageCombat == THUNDERWAVEDAMAGE then
damageCombat = ELECTRICDAMAGE
elseif damageCombat == PSYCHOSHIFTDAMAGE then
damageCombat = PSYCHICDAMAGE
end

if getPlayerStorageValue(cid, 33) >= 1 then  -- funcionamento do self destruction
if isCreature(attacker) then
return false
end
return true
end

if not isCreature(attacker) or cid == attacker then
if not isInArray(fixdamages, combat) and combats[combat] then
doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
end
return true
end

--------------------------------------------------
if combat == SLEEP_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isPlayer(cid) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end
doSleep(cid, value, true)
return false
end
--------------------------------------------------
if combat == HEALINGDAMAGE then

local healing = math.abs(value)

if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
doHeal(cid, healing)
return false
end
if isSummon(cid) and isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(cid), 990) >= 1 then
return false
end
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
end
return false
end
--------------------------------------------------
if combat == POISON_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

local master = attacker
if isSummon(attacker) then master = getCreatureMaster(attacker) end

addEvent(doAdvancedPoison, 2500, attacker, master, cid, getPlayerStorageValue(attacker, 919231), value, getPlayerStorageValue(cid, 3893))

return false
end
--------------------------------------------------
if isPlayer(attacker) then

local valor = value
if valor > getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

if combat == COMBAT_PHYSICALDAMAGE then
return false
end

if combat == PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 3)
doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
end

if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
end

return true
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
return true																		   --muda isso
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then

local valor = 0
if combat == COMBAT_PHYSICALDAMAGE then
valor = getOffense(attacker)
else
valor = getSpecialAttack(attacker)
end

valor = valor * playerDamageReduction
valor = valor * math.random(83, 117) / 100

if valor >= getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

valor = math.floor(valor)

if valor >= getCreatureHealth(cid) then
   if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
	  doRemoveCondition(cid, CONDITION_OUTFIT)
	  setPlayerStorageValue(cid, 17000, 0)
	  setPlayerStorageValue(cid, 17001, 0)
	  setPlayerStorageValue(cid, 63215, -1)
	  doChangeSpeed(cid, PlayerSpeed)
local item = getPlayerSlotItem(cid, 8)
local btype = getPokeballType(item.itemid)
  if #getCreatureSummons(cid) <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
end
  end
  end
end
doCreatureAddHealth(cid, -valor, 3, 180)
if not isPlayer(cid) then
addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
return false
end
--------------------------------------------------
if type == STATSCHANGE_HEALTHGAIN then
if cid == attacker then
return true
end
if not isSummon(cid) and isSummon(attacker) then
return false
end
if isSummon(cid) and isSummon(attacker) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
return true
end
--------------------------------------------------
if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
if isPlayer(cid) then
return false
end
if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
--------------------------------------------------

local multiplier = 1
local miss = (getSpeed(cid) - getSpeed(attacker)) * 0.26

local poketype1 = pokes[getCreatureName(cid)].type
local poketype2 = pokes[getCreatureName(cid)].type2

if getCreatureCondition(cid, CONDITION_INVISIBLE) then
return false
end

if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
if isInArray(effectiveness[damageCombat].super, poketype1) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].super, poketype2) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].weak, poketype1) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].weak, poketype2) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
multiplier = multiplier * 0
end
elseif combat == COMBAT_PHYSICALDAMAGE then
if isGhostPokemon(cid) and not isGhostPokemon(attacker) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then
if not isInArray({"Clefable", "Wigglytuff"}, getCreatureName(attacker)) then
return false
end
end
if miss > 0 and math.random(1, 100) <= miss and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
return false
end
end
--------------------------------------------------
local valor = value

if multiplier > 2 then
multiplier = 2
elseif multiplier == 0.25 then
multiplier = 0.5
end

--------------------------------------------------


local function resetMiss(cid)
if not isCreature(cid) then return true end
setPlayerStorageValue(cid, 88726, -1)
end

if getPlayerStorageValue(cid, 88726) ~= 1 and miss > 0 and math.random(1, 100) <= miss and damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignoremiss, combat) and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(cid)), false)
doSendMagicEffect(getThingPos(cid), 211)
doFaceCreature(cid, getThingPos(attacker))
setPlayerStorageValue(cid, 88726, 1)
addEvent(resetMiss, 2200, cid)
return false
end

if not isSummon(attacker) and not isSummon(cid) then
return false
end

if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end															--party system
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

if isSleeping(attacker) then
return false
end

local randomRange = math.random(83, 117) / 100
local block = 0

if combat == COMBAT_PHYSICALDAMAGE then
block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))
if getPokemonGender(attacker) == SEX_MALE then
block = block + 0.2
end
if getPokemonGender(cid) == SEX_FEMALE then
block = block - 0.2
end
valor = getOffense(attacker) * block
else
block = 1 - (getSpecialDefense(cid) / (getSpecialAttack(attacker) + getSpecialDefense(cid)))
valor = valor * block * generalSpecialAttackReduction
if isSummon(cid) then
valor = valor * summonSpecialDamageReduction - getPokemonLevel(cid) / 2
end
end

valor = valor * multiplier
valor = valor * randomRange

if isSummon(attacker) then
valor = valor * getHappinessRate(attacker)
else
valor = valor * summonReduction
end

valor = math.floor(valor)

if combat == NIGHTMAREDAMAGE then
local div = 8
if isSummon(attacker) and not isSummon(cid) then
div = 4
end
valor = math.floor(getCreatureMaxHealth(cid)/div)
elseif combat == GUILLOTINEDAMAGE then
if isGhostPokemon(cid) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
local gDmg = 0.5
if isSummon(attacker) and not isSummon(cid) then
gDmg = 0.7
end
valor = getCreatureMaxHealth(cid) * gDmg
elseif combat == SEISMICTOSSDAMAGE then
valor = getPokemonLevel(attacker) * 10
elseif combat == BURNEDDAMAGE then
valor = value * getResistance(cid, FIREDAMAGE)
elseif combat == POISONEDDAMAGE then
valor = value * getResistance(cid, POISONDAMAGE)
end

if valor <= 0 then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end

if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then
doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)
valor = valor * 2
end

if combat == PSYCHOSHIFTDAMAGE and isCreature(cid) then

if not isPlayer(cid) then

local pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
for a = 1, 6 do
if not canWalkOnPos(pos, true, true, true, true, false) or not isSightClear(getThingPos(cid), pos, false) then
pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
end
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getClosestFreeTile(cid, getThingPos(cid))
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getThingPos(cid)
end

doTeleportThing(cid, pos, false)

end

doSendMagicEffect(getThingPos(cid), math.random(12, 14))
end

if combat == THUNDERWAVEDAMAGE then
doCreatureAddCondition(cid, thunderwavecondition)
end

if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
end
end

--- REFLECT --------------------------------
if not isPlayer(cid) and getPlayerStorageValue(cid, 34) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 135)
doSendAnimatedText(getThingPos(cid), "REFLECT", COLOR_GRASS)
setPlayerStorageValue(cid, 34, -1)
return false
end
--------------------------------------------

if hasMimicWall(cid) then
doSendMagicEffect(getThingPos(cid), 135)
local dmgText = ""..valor..""
local a = getPlayerStorageValue(cid, 878)
setPlayerStorageValue(cid, 878, a - valor)
local k = getPlayerStorageValue(cid, 878)
if k <= 0 then
local b = getTileItemById(getThingPos(cid), 11440)
if b.uid > 1 then doRemoveItem(b.uid, 1) end
local c = getTileItemById(getThingPos(cid), 11439)
if c.uid > 1 then doRemoveItem(c.uid, 1) end
dmgText = ""..a..""
doSendMagicEffect(getThingPos(cid), 3)
end
doSendAnimatedText(getThingPos(cid), dmgText, 215)
return false
end

if isSummon(attacker) and not isSummon(cid) and not isPlayer(cid) then

local expstring = cid.."expEx"

if getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring) == null then
doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring, 0)
end

local exp = valor / getCreatureMaxHealth(cid)
local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8).uid

doItemSetAttribute(ball, expstring, getItemAttribute(ball, expstring) + exp)
if getItemAttribute(ball, expstring) > 1 then
doItemSetAttribute(ball, expstring, 1)
end
end

if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.08) and not exhaustion.get(getCreatureMaster(cid), 88726) then
exhaustion.set(getCreatureMaster(cid), 88726, 11)
doSendMagicEffect(getThingPos(cid), 178)
end

if isSummon(attacker) then
if combat == COMBAT_PHYSICALDAMAGE then
doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
else
doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
end

if not isSummon(cid) and not isPlayer(cid) and math.random(1, wildEvolveChance) == math.random(1, wildEvolveChance) then
addEvent(doEvolveWild, math.random(1, 2500), cid)
end
else
if combat ~= COMBAT_PHYSICALDAMAGE then
doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
else
doCreatureAddHealth(cid, -math.abs(valor), 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if isSummon(cid) then
addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end

end

local percent = 8 + math.ceil(valor / getCreatureMaxHealth(cid) * 100)
if getCreatureHealth(cid) == 0 or percent <= 0 then return false end
local runCond = false

if math.random(100) <= percent then
runCond = true
end

if runCond then

local condPos = getThingPos(cid)
local color = 215
local text = ""
local effect = 2

if damageCombat == FIREDAMAGE and not isBurning(cid) then
doAdvancedBurn(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(5, 12))
color = COLOR_FIRE2
text = "BURNING"
effect = 15
elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) and randomCond == checkCond then
doAdvancedPoison(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(4, 20))
color = COLOR_GRASS
text = "POISONED"
effect = 8
end

doSendMagicEffect(getThingPos(cid), effect)
addEvent(doSendAnimatedText, 5, condPos, text, color)
end
------------------------------------POTIONS-------------------------------------------
if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  if getPlayerStorageValue(cid, 173) >= 1 then
  if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
	 setPlayerStorageValue(cid, 174, 1)
	 doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  end
  end
end
----------------------------------------PASSIVAS-----------------------------------------
------------------------------"Counter Helix" - "Giro Ball"------------------------------
-- [outfit normal] = {out = outfit girando, efeitos}
local OutFit = {
[366] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --scyther
[912] = {out = 918, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --Scizor
[1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther
[952] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop
[909] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco
[910] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress
}

--acima do efeito 255 n aparece -pelo menos aki- entao fica esse por enquanto... ;x
--efeito vermelho =>   {cima = 261, direita = 263, esquerda = 264, baixo = 262}

if isSummon(cid) then
if OutFit[getCreatureOutfit(cid).lookType] then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local outfitt =  OutFit[getCreatureOutfit(cid).lookType]
  local function doWingAttack(cid, a, damage, min, max)
		local damagearea = {}
  local effectpos = getThingPosWithDebug(cid)
  local effect = 255
		if a == 0 then
		   effect = outfitt.cima
  effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y - 1
  damagearea = wingdn
   elseif a == 1 then
		   effect = outfitt.direita
		   effectpos.x = effectpos.x + 2
  effectpos.y = effectpos.y + 1
  damagearea = wingde
   elseif a == 2 then
	  effect = outfitt.baixo
		   effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y + 2
  damagearea = wingds
   elseif a == 3 then
		   effect = outfitt.esquerda
		   effectpos.x = effectpos.x - 1
  effectpos.y = effectpos.y + 1
  damagearea = wingdw
   end
  doSendMagicEffect(effectpos, effect)
  if damage then
  local look = getCreatureOutfit(cid).lookType
  if look == 366 or look == 1317 then   --scyther e shiny scyther
	 doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   elseif look == 952 then			   --hitmontop
			  doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   else								  --resto
			  doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   end
		end
  end

local dire = getCreatureLookDir(cid)
local cpos = getThingPosWithDebug(cid)
local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...

  setPlayerStorageValue(cid, 32623, 1)		--proteçao
doSetCreatureOutfit(cid, {lookType = OutFit[getCreatureOutfit(cid).lookType].out}, -1)

local function doDance(cid, dir, damage, min, max)
if not isCreature(cid) then return true end
	doCreatureSetLookDir(cid, dir)
  doWingAttack(cid, dir, damage, min, max)
end

for times = 0, 2 do
	for directions = 0, 3 do
addEvent(doDance, times * 300, cid, directions, true, min, max)
end
end

local function doChangeO(cid, dir, pos)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
if getThingPosWithDebug(cid).x == pos.x and getThingPosWithDebug(cid).y == pos.y then
doCreatureSetLookDir(cid, dir)
end
 end

addEvent(doChangeO, 2 * 300 + 10, cid, dire, cpos)
end
end
end
-------------------------------------------Lava Counter / Electricity-------------------------------------

---------------------------------------------Demon Kicker----------------------------------
--[outfit] = outfit chutando,
local hitmonlees = {
[371] =  652,	  --hitmonlee
[1300] =  652,	  --shiny hitmonlee
[877] = 878,  --elite hitmonlee  PxG
}

--DETALHE: shiny hitmonlee n tem a sprite dele chutando.. pelo menos eu n achei..
--entao deixei a sprite do hitmonlee normal atacando...

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if name == "Shiny Hitmonlee" or name == "Hitmonlee" then
  if isCreature(getCreatureTarget(getCreatureMaster(cid))) then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if isSleeping(cid) then return true end

  if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then
  return false
  end
  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local function doChangeHitmon(cid)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
  end

	 local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
	 local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...


	 setPlayerStorageValue(cid, 32623, 1)		--proteçao
	 doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookType]}, -1)
	 doTargetCombatHealth(cid, getMasterTarget(cid), FIGHTINGDAMAGE, -min, -max, 255)

	 addEvent(doChangeHitmon, 700, cid)	
  end
  end
  end
end
-------------------------------------------Demon Puncher-------------------------------------

---------------------------------------Stunning Confusion------------------------------------------

-----------------------------------------Groundshock-----------------------------------

--------------------------------------Electric Charge---------------------------------------------------

-------------------------------------Melody------------------------------------

------------------------------------- Mega Drain ---------------------------------------

------------------------------------- Spores Reaction ---------------------------------------
arr = {
{0, 0, 0, 0, 0},
{0, 1, 1, 1, 0},
{0, 1, 2, 1, 0},
{0, 1, 1, 1, 0},
{0, 0, 0, 0, 0}
}

local spores = {"Oddish", "Gloom", "Vileplume", "Shiny Oddish", "Shiny Gloom", "Shiny Vileplume"}

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if isInArray(spores, name) then
  if math.random(1, 100) <= 10 then	-- Porcentagem de chance pro poke usar a passiva... 20 = 20% +/-
	 doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPosWithDebug(cid), powders, -2, -3, 27)
  end
  end
end


return false
end

Editado por vudi
Link para o comentário
Compartilhar em outros sites

Você viu que eu postei as sprites né?Mas tem gente que não sabe onde tem então eu postei

 

 

aeaoeoaoeaoea Spr sao do client Centarium kospkossokspok spoksopk sim as Spr estao bem boa que pena q no meu server jha estao todas e os poke configurados com m1-evo-Order

 

ei kois é centurion xd, iai gostou dos sprites? xd

 

e vou lança a v2 com base no dash ^^

sim mais a maioria das SPR eu tinha no meu Client soh algumas q nao mais belo trabalho pelas as Spr

malz por erra o nome

Link para o comentário
Compartilhar em outros sites

Gente não sei se é só aqui mas como faço pra habilitar os outfits?? Pois não tem npc de roupa ://

Se alguém puder passar o npc de roupa ou só passar como eu habilito?

PS: Sim sou novata, tenha paciencia.

Beijos

Link para o comentário
Compartilhar em outros sites

@ All emergencia

 

Alguem pode imaginar oque pode estar causando esse erro chato?

 

amigo disse que deve ser na low effetc e super effect?

 

 

[13/04/2012 17:37:39] [Error - CreatureScript Interface]
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:onStatsChange
[13/04/2012 17:37:39] Description:
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:330: attempt to perform arithmetic on a nil value
[13/04/2012 17:37:39] stack traceback:
[13/04/2012 17:37:39]  data/creaturescripts/scripts/exp.lua:330: in function <data/creaturescripts/scripts/exp.lua:129>

 

 

 

local combats = {
[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
[GRASSDAMAGE] = {cor = COLOR_GRASS},
[POISONEDDAMAGE] = {cor = COLOR_GRASS},
[MORTALGASDAMAGE] = {cor = COLOR_POISON},
[FIREDAMAGE] = {cor = COLOR_FIRE2},
[bURNEDDAMAGE] = {cor = COLOR_BURN},
[WATERDAMAGE] = {cor = COLOR_WATER},
[iCEDAMAGE] = {cor = COLOR_ICE},
[NORMALDAMAGE] = {cor = COLOR_NORMAL},
[GUILLOTINEDAMAGE] = {cor = COLOR_NORMAL},
[FLYDAMAGE] = {cor = COLOR_FLYING},
[GHOSTDAMAGE] = {cor = COLOR_GHOST},
[NIGHTMAREDAMAGE] = {cor = COLOR_GHOST},
[GROUNDDAMAGE] = {cor = COLOR_GROUND},
[ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
[THUNDERWAVEDAMAGE] = {cor = COLOR_ELECTRIC},
[ROCKDAMAGE] = {cor = COLOR_ROCK},
[bUGDAMAGE] = {cor = COLOR_BUG},
[FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
[sEISMICTOSSDAMAGE] = {cor = COLOR_FIGHTING},
[DRAGONDAMAGE] = {cor = COLOR_DRAGON},
[POISONDAMAGE] = {cor = COLOR_POISON},
[DARKDAMAGE] = {cor = COLOR_DARK},
[sTEELDAMAGE] = {cor = COLOR_STEEL},
}

local function doHeal(cid, amount)
doCreatureAddHealth(cid, amount)
doSendMagicEffect(getThingPos(cid), 12)
doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65)
end

local function sendPlayerDmgMsg(cid, text)
if not isCreature(cid) then return true end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
end

local spcevo = {
["Poliwhirl"] = {"Poliwrath", "Politoed"},
["Gloom"] = {"Bellossom", "Vileplume"},
["Tyrogue"] = {"Hitmonchan", "Hitmontop", "Hitmonlee"}}

local function doEvolveWild(cid)
if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return true end
local name = getCreatureName(cid)
local evolution = "none"
if spcevo[name] then
evolution = spcevo[name][math.random(1, #spcevo[name])]
elseif poevo[name] then
evolution = poevo[name].evolution
end
local a = getPokemonStatus(name)
if not a or evolution == "none" then return true end
local pk = {}
local players = getSpectators(getThingPos(cid), 7, 7)
if players then
for pp = 1, #players do
local this = players[pp]
if isCreature(this) and isPlayer(this) and (getCreatureTarget(this) == cid or getDamageMapPercent(this, cid) > 0) then
doSendMagicEffect(getThingPos(this), 173)
local expstring = cid.."expEx"
pk[this] = getItemAttribute(getPlayerSlotItem(this, 8).uid, expstring)
doItemSetAttribute(getPlayerSlotItem(this, 8).uid, expstring, 0)
end
end
end
local level = getPokemonLevel(cid)
local pos = getThingPos(cid)
local gender = getCreatureSkull(cid)
local lifepercentage = 1 - ((getCreatureHealth(cid) * 1.3) / getCreatureMaxHealth(cid))
local lookdir = getCreatureLookDir(cid)
local status = {}
status.offense = getOffense(cid) + a.off * 8
status.defense = getDefense(cid) + a.def * 8
status.agi = getSpeed(cid) + a.agi * 8
status.spatk = getSpecialAttack(cid) + a.spatk * 8
status.vit = getVitality(cid) + a.vit * 4
doRemoveCreature(cid)
local evo = doCreateMonster(evolution, pos)
setWildPokemonLevel(evo, level, status)
doCreatureSetLookDir(evo, lookdir)
doCreatureSetSkullType(evo, gender)
doCreatureAddHealth(evo, -getCreatureMaxHealth(evo) * lifepercentage)
doSendMagicEffect(getThingPos(evo), 18)
for attacker, experience in pairs (pk) do
doWildAttackPlayer(evo, attacker)
local expstring = evo.."expEx"
local exp = experience or 0
doItemSetAttribute(getPlayerSlotItem(attacker, 8).uid, expstring, exp)
end
sendFinishEvolutionEffect(evo, true)
addEvent(sendFinishEvolutionEffect, 550, evo, true)
addEvent(sendFinishEvolutionEffect, 1050, evo)
end

local races = {
[4] = {cor = COLOR_FIRE2},
[6] = {cor = COLOR_WATER},
[7] = {cor = COLOR_NORMAL},
[8] = {cor = COLOR_FIRE2},
[9] = {cor = COLOR_FIGHTING},
[10] = {cor = COLOR_FLYING},
[11] = {cor = COLOR_GRASS},
[12] = {cor = COLOR_POISON},
[13] = {cor = COLOR_ELECTRIC},
[14] = {cor = COLOR_GROUND},
[15] = {cor = COLOR_PSYCHIC},
[16] = {cor = COLOR_ROCK},
[17] = {cor = COLOR_ICE},
[18] = {cor = COLOR_BUG},
[19] = {cor = COLOR_DRAGON},
[20] = {cor = COLOR_GHOST},
[21] = {cor = COLOR_STEEL},
[22] = {cor = COLOR_DARK},
[1] = {cor = 180},
[2] = {cor = 180},
[3] = {cor = 180},
[5] = {cor = 180},
}

local damages = {MORTALGASDAMAGE, GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE, NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, SEISMICTOSSDAMAGE}
local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
local ignored = {NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, MORTALGASDAMAGE, SEISMICTOSSDAMAGE, PSYCHOSHIFTDAMAGE, POISONEDDAMAGE, BURNEDDAMAGE}
local ignoremiss = {NIGHTMAREDAMAGE, MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE}
local ignorecritical = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}
local cannotkill = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}

function onStatsChange(cid, attacker, type, combat, value)

if combat == FLYSYSTEMDAMAGE then return false end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local damageCombat = combat
if damageCombat == THUNDERWAVEDAMAGE then
damageCombat = ELECTRICDAMAGE
elseif damageCombat == PSYCHOSHIFTDAMAGE then
damageCombat = PSYCHICDAMAGE
end

if getPlayerStorageValue(cid, 33) >= 1 then  -- funcionamento do self destruction
if isCreature(attacker) then
return false
end
return true
end

if not isCreature(attacker) or cid == attacker then
if not isInArray(fixdamages, combat) and combats[combat] then
doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
end
return true
end

--------------------------------------------------
if combat == SLEEP_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isPlayer(cid) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end
doSleep(cid, value, true)
return false
end
--------------------------------------------------
if combat == HEALINGDAMAGE then

local healing = math.abs(value)

if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
doHeal(cid, healing)
return false
end
if isSummon(cid) and isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(cid), 990) >= 1 then
return false
end
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
end
return false
end
--------------------------------------------------
if combat == POISON_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

local master = attacker
if isSummon(attacker) then master = getCreatureMaster(attacker) end

addEvent(doAdvancedPoison, 2500, attacker, master, cid, getPlayerStorageValue(attacker, 919231), value, getPlayerStorageValue(cid, 3893))

return false
end
--------------------------------------------------
if isPlayer(attacker) then

local valor = value
if valor > getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

if combat == COMBAT_PHYSICALDAMAGE then
return false
end

if combat == PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 3)
doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
end

if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
end

return true
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
return true																		   --muda isso
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then

local valor = 0
if combat == COMBAT_PHYSICALDAMAGE then
valor = getOffense(attacker)
else
valor = getSpecialAttack(attacker)
end

valor = valor * playerDamageReduction
valor = valor * math.random(83, 117) / 100

if valor >= getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

valor = math.floor(valor)

if valor >= getCreatureHealth(cid) then
   if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
	  doRemoveCondition(cid, CONDITION_OUTFIT)
	  setPlayerStorageValue(cid, 17000, 0)
	  setPlayerStorageValue(cid, 17001, 0)
	  setPlayerStorageValue(cid, 63215, -1)
	  doChangeSpeed(cid, PlayerSpeed)
local item = getPlayerSlotItem(cid, 8)
local btype = getPokeballType(item.itemid)
  if #getCreatureSummons(cid) <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
end
  end
  end
end
doCreatureAddHealth(cid, -valor, 3, 180)
if not isPlayer(cid) then
addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
return false
end
--------------------------------------------------
if type == STATSCHANGE_HEALTHGAIN then
if cid == attacker then
return true
end
if not isSummon(cid) and isSummon(attacker) then
return false
end
if isSummon(cid) and isSummon(attacker) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
return true
end
--------------------------------------------------
if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
if isPlayer(cid) then
return false
end
if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
--------------------------------------------------

local multiplier = 1
local miss = (getSpeed(cid) - getSpeed(attacker)) * 0.26

local poketype1 = pokes[getCreatureName(cid)].type
local poketype2 = pokes[getCreatureName(cid)].type2

if getCreatureCondition(cid, CONDITION_INVISIBLE) then
return false
end

if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
if isInArray(effectiveness[damageCombat].super, poketype1) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].super, poketype2) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].weak, poketype1) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].weak, poketype2) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
multiplier = multiplier * 0
end
elseif combat == COMBAT_PHYSICALDAMAGE then
if isGhostPokemon(cid) and not isGhostPokemon(attacker) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then
if not isInArray({"Clefable", "Wigglytuff"}, getCreatureName(attacker)) then
return false
end
end
if miss > 0 and math.random(1, 100) <= miss and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
return false
end
end
--------------------------------------------------
local valor = value

if multiplier > 2 then
multiplier = 2
elseif multiplier == 0.25 then
multiplier = 0.5
end

--------------------------------------------------


local function resetMiss(cid)
if not isCreature(cid) then return true end
setPlayerStorageValue(cid, 88726, -1)
end

if getPlayerStorageValue(cid, 88726) ~= 1 and miss > 0 and math.random(1, 100) <= miss and damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignoremiss, combat) and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(cid)), false)
doSendMagicEffect(getThingPos(cid), 211)
doFaceCreature(cid, getThingPos(attacker))
setPlayerStorageValue(cid, 88726, 1)
addEvent(resetMiss, 2200, cid)
return false
end

if not isSummon(attacker) and not isSummon(cid) then
return false
end

if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end															--party system
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

if isSleeping(attacker) then
return false
end

local randomRange = math.random(83, 117) / 100
local block = 0

if combat == COMBAT_PHYSICALDAMAGE then
block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))
if getPokemonGender(attacker) == SEX_MALE then
block = block + 0.2
end
if getPokemonGender(cid) == SEX_FEMALE then
block = block - 0.2
end
valor = getOffense(attacker) * block
else
block = 1 - (getSpecialDefense(cid) / (getSpecialAttack(attacker) + getSpecialDefense(cid)))
valor = valor * block * generalSpecialAttackReduction
if isSummon(cid) then
valor = valor * summonSpecialDamageReduction - getPokemonLevel(cid) / 2
end
end

valor = valor * multiplier
valor = valor * randomRange

if isSummon(attacker) then
valor = valor * getHappinessRate(attacker)
else
valor = valor * summonReduction
end

valor = math.floor(valor)

if combat == NIGHTMAREDAMAGE then
local div = 8
if isSummon(attacker) and not isSummon(cid) then
div = 4
end
valor = math.floor(getCreatureMaxHealth(cid)/div)
elseif combat == GUILLOTINEDAMAGE then
if isGhostPokemon(cid) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
local gDmg = 0.5
if isSummon(attacker) and not isSummon(cid) then
gDmg = 0.7
end
valor = getCreatureMaxHealth(cid) * gDmg
elseif combat == SEISMICTOSSDAMAGE then
valor = getPokemonLevel(attacker) * 10
elseif combat == BURNEDDAMAGE then
valor = value * getResistance(cid, FIREDAMAGE)
elseif combat == POISONEDDAMAGE then
valor = value * getResistance(cid, POISONDAMAGE)
end

if valor <= 0 then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end

if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then
doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)
valor = valor * 2
end

if combat == PSYCHOSHIFTDAMAGE and isCreature(cid) then

if not isPlayer(cid) then

local pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
for a = 1, 6 do
if not canWalkOnPos(pos, true, true, true, true, false) or not isSightClear(getThingPos(cid), pos, false) then
pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
end
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getClosestFreeTile(cid, getThingPos(cid))
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getThingPos(cid)
end

doTeleportThing(cid, pos, false)

end

doSendMagicEffect(getThingPos(cid), math.random(12, 14))
end

if combat == THUNDERWAVEDAMAGE then
doCreatureAddCondition(cid, thunderwavecondition)
end

if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
end
end

--- REFLECT --------------------------------
if not isPlayer(cid) and getPlayerStorageValue(cid, 34) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 135)
doSendAnimatedText(getThingPos(cid), "REFLECT", COLOR_GRASS)
setPlayerStorageValue(cid, 34, -1)
return false
end
--------------------------------------------

if hasMimicWall(cid) then
doSendMagicEffect(getThingPos(cid), 135)
local dmgText = ""..valor..""
local a = getPlayerStorageValue(cid, 878)
setPlayerStorageValue(cid, 878, a - valor)
local k = getPlayerStorageValue(cid, 878)
if k <= 0 then
local b = getTileItemById(getThingPos(cid), 11440)
if b.uid > 1 then doRemoveItem(b.uid, 1) end
local c = getTileItemById(getThingPos(cid), 11439)
if c.uid > 1 then doRemoveItem(c.uid, 1) end
dmgText = ""..a..""
doSendMagicEffect(getThingPos(cid), 3)
end
doSendAnimatedText(getThingPos(cid), dmgText, 215)
return false
end

if isSummon(attacker) and not isSummon(cid) and not isPlayer(cid) then

local expstring = cid.."expEx"

if getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring) == null then
doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring, 0)
end

local exp = valor / getCreatureMaxHealth(cid)
local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8).uid

doItemSetAttribute(ball, expstring, getItemAttribute(ball, expstring) + exp)
if getItemAttribute(ball, expstring) > 1 then
doItemSetAttribute(ball, expstring, 1)
end
end

if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.08) and not exhaustion.get(getCreatureMaster(cid), 88726) then
exhaustion.set(getCreatureMaster(cid), 88726, 11)
doSendMagicEffect(getThingPos(cid), 178)
end

if isSummon(attacker) then
if combat == COMBAT_PHYSICALDAMAGE then
doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
else
doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
end

if not isSummon(cid) and not isPlayer(cid) and math.random(1, wildEvolveChance) == math.random(1, wildEvolveChance) then
addEvent(doEvolveWild, math.random(1, 2500), cid)
end
else
if combat ~= COMBAT_PHYSICALDAMAGE then
doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
else
doCreatureAddHealth(cid, -math.abs(valor), 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if isSummon(cid) then
addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end

end

local percent = 8 + math.ceil(valor / getCreatureMaxHealth(cid) * 100)
if getCreatureHealth(cid) == 0 or percent <= 0 then return false end
local runCond = false

if math.random(100) <= percent then
runCond = true
end

if runCond then

local condPos = getThingPos(cid)
local color = 215
local text = ""
local effect = 2

if damageCombat == FIREDAMAGE and not isBurning(cid) then
doAdvancedBurn(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(5, 12))
color = COLOR_FIRE2
text = "BURNING"
effect = 15
elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) and randomCond == checkCond then
doAdvancedPoison(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(4, 20))
color = COLOR_GRASS
text = "POISONED"
effect = 8
end

doSendMagicEffect(getThingPos(cid), effect)
addEvent(doSendAnimatedText, 5, condPos, text, color)
end
------------------------------------POTIONS-------------------------------------------
if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  if getPlayerStorageValue(cid, 173) >= 1 then
  if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
	 setPlayerStorageValue(cid, 174, 1)
	 doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  end
  end
end
----------------------------------------PASSIVAS-----------------------------------------
------------------------------"Counter Helix" - "Giro Ball"------------------------------
-- [outfit normal] = {out = outfit girando, efeitos}
local OutFit = {
[366] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --scyther
[912] = {out = 918, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --Scizor
[1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther
[952] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop
[909] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco
[910] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress
}

--acima do efeito 255 n aparece -pelo menos aki- entao fica esse por enquanto... ;x
--efeito vermelho =>   {cima = 261, direita = 263, esquerda = 264, baixo = 262}

if isSummon(cid) then
if OutFit[getCreatureOutfit(cid).lookType] then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local outfitt =  OutFit[getCreatureOutfit(cid).lookType]
  local function doWingAttack(cid, a, damage, min, max)
		local damagearea = {}
  local effectpos = getThingPosWithDebug(cid)
  local effect = 255
		if a == 0 then
		   effect = outfitt.cima
  effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y - 1
  damagearea = wingdn
   elseif a == 1 then
		   effect = outfitt.direita
		   effectpos.x = effectpos.x + 2
  effectpos.y = effectpos.y + 1
  damagearea = wingde
   elseif a == 2 then
	  effect = outfitt.baixo
		   effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y + 2
  damagearea = wingds
   elseif a == 3 then
		   effect = outfitt.esquerda
		   effectpos.x = effectpos.x - 1
  effectpos.y = effectpos.y + 1
  damagearea = wingdw
   end
  doSendMagicEffect(effectpos, effect)
  if damage then
  local look = getCreatureOutfit(cid).lookType
  if look == 366 or look == 1317 then   --scyther e shiny scyther
	 doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   elseif look == 952 then			   --hitmontop
			  doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   else								  --resto
			  doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   end
		end
  end

local dire = getCreatureLookDir(cid)
local cpos = getThingPosWithDebug(cid)
local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...

  setPlayerStorageValue(cid, 32623, 1)		--proteçao
doSetCreatureOutfit(cid, {lookType = OutFit[getCreatureOutfit(cid).lookType].out}, -1)

local function doDance(cid, dir, damage, min, max)
if not isCreature(cid) then return true end
	doCreatureSetLookDir(cid, dir)
  doWingAttack(cid, dir, damage, min, max)
end

for times = 0, 2 do
	for directions = 0, 3 do
addEvent(doDance, times * 300, cid, directions, true, min, max)
end
end

local function doChangeO(cid, dir, pos)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
if getThingPosWithDebug(cid).x == pos.x and getThingPosWithDebug(cid).y == pos.y then
doCreatureSetLookDir(cid, dir)
end
 end

addEvent(doChangeO, 2 * 300 + 10, cid, dire, cpos)
end
end
end
-------------------------------------------Lava Counter / Electricity-------------------------------------

---------------------------------------------Demon Kicker----------------------------------
--[outfit] = outfit chutando,
local hitmonlees = {
[371] =  652,	  --hitmonlee
[1300] =  652,	  --shiny hitmonlee
[877] = 878,  --elite hitmonlee  PxG
}

--DETALHE: shiny hitmonlee n tem a sprite dele chutando.. pelo menos eu n achei..
--entao deixei a sprite do hitmonlee normal atacando...

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if name == "Shiny Hitmonlee" or name == "Hitmonlee" then
  if isCreature(getCreatureTarget(getCreatureMaster(cid))) then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if isSleeping(cid) then return true end

  if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then
  return false
  end
  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local function doChangeHitmon(cid)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
  end

	 local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
	 local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...


	 setPlayerStorageValue(cid, 32623, 1)		--proteçao
	 doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookType]}, -1)
	 doTargetCombatHealth(cid, getMasterTarget(cid), FIGHTINGDAMAGE, -min, -max, 255)

	 addEvent(doChangeHitmon, 700, cid)	
  end
  end
  end
end
-------------------------------------------Demon Puncher-------------------------------------

---------------------------------------Stunning Confusion------------------------------------------

-----------------------------------------Groundshock-----------------------------------

--------------------------------------Electric Charge---------------------------------------------------

-------------------------------------Melody------------------------------------

------------------------------------- Mega Drain ---------------------------------------

------------------------------------- Spores Reaction ---------------------------------------
arr = {
{0, 0, 0, 0, 0},
{0, 1, 1, 1, 0},
{0, 1, 2, 1, 0},
{0, 1, 1, 1, 0},
{0, 0, 0, 0, 0}
}

local spores = {"Oddish", "Gloom", "Vileplume", "Shiny Oddish", "Shiny Gloom", "Shiny Vileplume"}

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if isInArray(spores, name) then
  if math.random(1, 100) <= 10 then	-- Porcentagem de chance pro poke usar a passiva... 20 = 20% +/-
	 doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPosWithDebug(cid), powders, -2, -3, 27)
  end
  end
end


return false
end

@ All emergencia

 

Alguem pode imaginar oque pode estar causando esse erro chato?

 

amigo disse que deve ser na low effetc e super effect?

 

 

[13/04/2012 17:37:39] [Error - CreatureScript Interface]
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:onStatsChange
[13/04/2012 17:37:39] Description:
[13/04/2012 17:37:39] data/creaturescripts/scripts/exp.lua:330: attempt to perform arithmetic on a nil value
[13/04/2012 17:37:39] stack traceback:
[13/04/2012 17:37:39]  data/creaturescripts/scripts/exp.lua:330: in function <data/creaturescripts/scripts/exp.lua:129>

 

 

 

local combats = {
[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
[GRASSDAMAGE] = {cor = COLOR_GRASS},
[POISONEDDAMAGE] = {cor = COLOR_GRASS},
[MORTALGASDAMAGE] = {cor = COLOR_POISON},
[FIREDAMAGE] = {cor = COLOR_FIRE2},
[bURNEDDAMAGE] = {cor = COLOR_BURN},
[WATERDAMAGE] = {cor = COLOR_WATER},
[iCEDAMAGE] = {cor = COLOR_ICE},
[NORMALDAMAGE] = {cor = COLOR_NORMAL},
[GUILLOTINEDAMAGE] = {cor = COLOR_NORMAL},
[FLYDAMAGE] = {cor = COLOR_FLYING},
[GHOSTDAMAGE] = {cor = COLOR_GHOST},
[NIGHTMAREDAMAGE] = {cor = COLOR_GHOST},
[GROUNDDAMAGE] = {cor = COLOR_GROUND},
[ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
[THUNDERWAVEDAMAGE] = {cor = COLOR_ELECTRIC},
[ROCKDAMAGE] = {cor = COLOR_ROCK},
[bUGDAMAGE] = {cor = COLOR_BUG},
[FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
[sEISMICTOSSDAMAGE] = {cor = COLOR_FIGHTING},
[DRAGONDAMAGE] = {cor = COLOR_DRAGON},
[POISONDAMAGE] = {cor = COLOR_POISON},
[DARKDAMAGE] = {cor = COLOR_DARK},
[sTEELDAMAGE] = {cor = COLOR_STEEL},
}

local function doHeal(cid, amount)
doCreatureAddHealth(cid, amount)
doSendMagicEffect(getThingPos(cid), 12)
doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65)
end

local function sendPlayerDmgMsg(cid, text)
if not isCreature(cid) then return true end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
end

local spcevo = {
["Poliwhirl"] = {"Poliwrath", "Politoed"},
["Gloom"] = {"Bellossom", "Vileplume"},
["Tyrogue"] = {"Hitmonchan", "Hitmontop", "Hitmonlee"}}

local function doEvolveWild(cid)
if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return true end
local name = getCreatureName(cid)
local evolution = "none"
if spcevo[name] then
evolution = spcevo[name][math.random(1, #spcevo[name])]
elseif poevo[name] then
evolution = poevo[name].evolution
end
local a = getPokemonStatus(name)
if not a or evolution == "none" then return true end
local pk = {}
local players = getSpectators(getThingPos(cid), 7, 7)
if players then
for pp = 1, #players do
local this = players[pp]
if isCreature(this) and isPlayer(this) and (getCreatureTarget(this) == cid or getDamageMapPercent(this, cid) > 0) then
doSendMagicEffect(getThingPos(this), 173)
local expstring = cid.."expEx"
pk[this] = getItemAttribute(getPlayerSlotItem(this, 8).uid, expstring)
doItemSetAttribute(getPlayerSlotItem(this, 8).uid, expstring, 0)
end
end
end
local level = getPokemonLevel(cid)
local pos = getThingPos(cid)
local gender = getCreatureSkull(cid)
local lifepercentage = 1 - ((getCreatureHealth(cid) * 1.3) / getCreatureMaxHealth(cid))
local lookdir = getCreatureLookDir(cid)
local status = {}
status.offense = getOffense(cid) + a.off * 8
status.defense = getDefense(cid) + a.def * 8
status.agi = getSpeed(cid) + a.agi * 8
status.spatk = getSpecialAttack(cid) + a.spatk * 8
status.vit = getVitality(cid) + a.vit * 4
doRemoveCreature(cid)
local evo = doCreateMonster(evolution, pos)
setWildPokemonLevel(evo, level, status)
doCreatureSetLookDir(evo, lookdir)
doCreatureSetSkullType(evo, gender)
doCreatureAddHealth(evo, -getCreatureMaxHealth(evo) * lifepercentage)
doSendMagicEffect(getThingPos(evo), 18)
for attacker, experience in pairs (pk) do
doWildAttackPlayer(evo, attacker)
local expstring = evo.."expEx"
local exp = experience or 0
doItemSetAttribute(getPlayerSlotItem(attacker, 8).uid, expstring, exp)
end
sendFinishEvolutionEffect(evo, true)
addEvent(sendFinishEvolutionEffect, 550, evo, true)
addEvent(sendFinishEvolutionEffect, 1050, evo)
end

local races = {
[4] = {cor = COLOR_FIRE2},
[6] = {cor = COLOR_WATER},
[7] = {cor = COLOR_NORMAL},
[8] = {cor = COLOR_FIRE2},
[9] = {cor = COLOR_FIGHTING},
[10] = {cor = COLOR_FLYING},
[11] = {cor = COLOR_GRASS},
[12] = {cor = COLOR_POISON},
[13] = {cor = COLOR_ELECTRIC},
[14] = {cor = COLOR_GROUND},
[15] = {cor = COLOR_PSYCHIC},
[16] = {cor = COLOR_ROCK},
[17] = {cor = COLOR_ICE},
[18] = {cor = COLOR_BUG},
[19] = {cor = COLOR_DRAGON},
[20] = {cor = COLOR_GHOST},
[21] = {cor = COLOR_STEEL},
[22] = {cor = COLOR_DARK},
[1] = {cor = 180},
[2] = {cor = 180},
[3] = {cor = 180},
[5] = {cor = 180},
}

local damages = {MORTALGASDAMAGE, GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE, NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, SEISMICTOSSDAMAGE}
local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
local ignored = {NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, MORTALGASDAMAGE, SEISMICTOSSDAMAGE, PSYCHOSHIFTDAMAGE, POISONEDDAMAGE, BURNEDDAMAGE}
local ignoremiss = {NIGHTMAREDAMAGE, MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE}
local ignorecritical = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}
local cannotkill = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}

function onStatsChange(cid, attacker, type, combat, value)

if combat == FLYSYSTEMDAMAGE then return false end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV

local damageCombat = combat
if damageCombat == THUNDERWAVEDAMAGE then
damageCombat = ELECTRICDAMAGE
elseif damageCombat == PSYCHOSHIFTDAMAGE then
damageCombat = PSYCHICDAMAGE
end

if getPlayerStorageValue(cid, 33) >= 1 then  -- funcionamento do self destruction
if isCreature(attacker) then
return false
end
return true
end

if not isCreature(attacker) or cid == attacker then
if not isInArray(fixdamages, combat) and combats[combat] then
doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
end
return true
end

--------------------------------------------------
if combat == SLEEP_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isPlayer(cid) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end
doSleep(cid, value, true)
return false
end
--------------------------------------------------
if combat == HEALINGDAMAGE then

local healing = math.abs(value)

if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
doHeal(cid, healing)
return false
end
if isSummon(cid) and isSummon(attacker) then
if getPlayerStorageValue(getCreatureMaster(cid), 990) >= 1 then
return false
end
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
doHeal(cid, healing)
return false
end
end
return false
end
--------------------------------------------------
if combat == POISON_POWDERDAMAGE then
if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
return false
end
if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
return false
end
if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

local master = attacker
if isSummon(attacker) then master = getCreatureMaster(attacker) end

addEvent(doAdvancedPoison, 2500, attacker, master, cid, getPlayerStorageValue(attacker, 919231), value, getPlayerStorageValue(cid, 3893))

return false
end
--------------------------------------------------
if isPlayer(attacker) then

local valor = value
if valor > getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

if combat == COMBAT_PHYSICALDAMAGE then
return false
end

if combat == PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 3)
doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
end

if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
end

return true
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
return true																		   --muda isso
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then

local valor = 0
if combat == COMBAT_PHYSICALDAMAGE then
valor = getOffense(attacker)
else
valor = getSpecialAttack(attacker)
end

valor = valor * playerDamageReduction
valor = valor * math.random(83, 117) / 100

if valor >= getCreatureHealth(cid) then
valor = getCreatureHealth(cid)
end

valor = math.floor(valor)

if valor >= getCreatureHealth(cid) then
   if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
	  doRemoveCondition(cid, CONDITION_OUTFIT)
	  setPlayerStorageValue(cid, 17000, 0)
	  setPlayerStorageValue(cid, 17001, 0)
	  setPlayerStorageValue(cid, 63215, -1)
	  doChangeSpeed(cid, PlayerSpeed)
local item = getPlayerSlotItem(cid, 8)
local btype = getPokeballType(item.itemid)
  if #getCreatureSummons(cid) <= 0 then
if isInArray(pokeballs[btype].all, item.itemid) then
doTransformItem(item.uid, pokeballs[btype].off)
doItemSetAttribute(item.uid, "hp", 0)
end
  end
  end
end
doCreatureAddHealth(cid, -valor, 3, 180)
if not isPlayer(cid) then
addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
return false
end
--------------------------------------------------
if type == STATSCHANGE_HEALTHGAIN then
if cid == attacker then
return true
end
if not isSummon(cid) and isSummon(attacker) then
return false
end
if isSummon(cid) and isSummon(attacker) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
return true
end
--------------------------------------------------
if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
if isPlayer(cid) then
return false
end
if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
--------------------------------------------------

local multiplier = 1
local miss = (getSpeed(cid) - getSpeed(attacker)) * 0.26

local poketype1 = pokes[getCreatureName(cid)].type
local poketype2 = pokes[getCreatureName(cid)].type2

if getCreatureCondition(cid, CONDITION_INVISIBLE) then
return false
end

if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
if isInArray(effectiveness[damageCombat].super, poketype1) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].super, poketype2) then
multiplier = multiplier * 2
end
if isInArray(effectiveness[damageCombat].weak, poketype1) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].weak, poketype2) then
multiplier = multiplier * 0.5
end
if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
multiplier = multiplier * 0
end
elseif combat == COMBAT_PHYSICALDAMAGE then
if isGhostPokemon(cid) and not isGhostPokemon(attacker) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then
if not isInArray({"Clefable", "Wigglytuff"}, getCreatureName(attacker)) then
return false
end
end
if miss > 0 and math.random(1, 100) <= miss and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
return false
end
end
--------------------------------------------------
local valor = value

if multiplier > 2 then
multiplier = 2
elseif multiplier == 0.25 then
multiplier = 0.5
end

--------------------------------------------------


local function resetMiss(cid)
if not isCreature(cid) then return true end
setPlayerStorageValue(cid, 88726, -1)
end

if getPlayerStorageValue(cid, 88726) ~= 1 and miss > 0 and math.random(1, 100) <= miss and damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignoremiss, combat) and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then
doSendMagicEffect(getThingPos(cid), 211)
doSendAnimatedText(getThingPos(cid), "MISS", 215)
doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(cid)), false)
doSendMagicEffect(getThingPos(cid), 211)
doFaceCreature(cid, getThingPos(attacker))
setPlayerStorageValue(cid, 88726, 1)
addEvent(resetMiss, 2200, cid)
return false
end

if not isSummon(attacker) and not isSummon(cid) then
return false
end

if isSummon(cid) and isSummon(attacker) then
if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then
return false
end															--party system
if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
return false
end
end

if isSleeping(attacker) then
return false
end

local randomRange = math.random(83, 117) / 100
local block = 0

if combat == COMBAT_PHYSICALDAMAGE then
block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))
if getPokemonGender(attacker) == SEX_MALE then
block = block + 0.2
end
if getPokemonGender(cid) == SEX_FEMALE then
block = block - 0.2
end
valor = getOffense(attacker) * block
else
block = 1 - (getSpecialDefense(cid) / (getSpecialAttack(attacker) + getSpecialDefense(cid)))
valor = valor * block * generalSpecialAttackReduction
if isSummon(cid) then
valor = valor * summonSpecialDamageReduction - getPokemonLevel(cid) / 2
end
end

valor = valor * multiplier
valor = valor * randomRange

if isSummon(attacker) then
valor = valor * getHappinessRate(attacker)
else
valor = valor * summonReduction
end

valor = math.floor(valor)

if combat == NIGHTMAREDAMAGE then
local div = 8
if isSummon(attacker) and not isSummon(cid) then
div = 4
end
valor = math.floor(getCreatureMaxHealth(cid)/div)
elseif combat == GUILLOTINEDAMAGE then
if isGhostPokemon(cid) then
doSendMagicEffect(getThingPos(cid), 3)
return false
end
local gDmg = 0.5
if isSummon(attacker) and not isSummon(cid) then
gDmg = 0.7
end
valor = getCreatureMaxHealth(cid) * gDmg
elseif combat == SEISMICTOSSDAMAGE then
valor = getPokemonLevel(attacker) * 10
elseif combat == BURNEDDAMAGE then
valor = value * getResistance(cid, FIREDAMAGE)
elseif combat == POISONEDDAMAGE then
valor = value * getResistance(cid, POISONDAMAGE)
end

if valor <= 0 then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end

if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then
doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)
valor = valor * 2
end

if combat == PSYCHOSHIFTDAMAGE and isCreature(cid) then

if not isPlayer(cid) then

local pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
for a = 1, 6 do
if not canWalkOnPos(pos, true, true, true, true, false) or not isSightClear(getThingPos(cid), pos, false) then
pos = getThingPos(cid)
pos.x = pos.x + math.random(-4,4)
pos.y = pos.y + math.random(-4,4)
end
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getClosestFreeTile(cid, getThingPos(cid))
end

if not canWalkOnPos(pos, true, true, true, true, false) then
pos = getThingPos(cid)
end

doTeleportThing(cid, pos, false)

end

doSendMagicEffect(getThingPos(cid), math.random(12, 14))
end

if combat == THUNDERWAVEDAMAGE then
doCreatureAddCondition(cid, thunderwavecondition)
end

if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
end
end

--- REFLECT --------------------------------
if not isPlayer(cid) and getPlayerStorageValue(cid, 34) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 135)
doSendAnimatedText(getThingPos(cid), "REFLECT", COLOR_GRASS)
setPlayerStorageValue(cid, 34, -1)
return false
end
--------------------------------------------

if hasMimicWall(cid) then
doSendMagicEffect(getThingPos(cid), 135)
local dmgText = ""..valor..""
local a = getPlayerStorageValue(cid, 878)
setPlayerStorageValue(cid, 878, a - valor)
local k = getPlayerStorageValue(cid, 878)
if k <= 0 then
local b = getTileItemById(getThingPos(cid), 11440)
if b.uid > 1 then doRemoveItem(b.uid, 1) end
local c = getTileItemById(getThingPos(cid), 11439)
if c.uid > 1 then doRemoveItem(c.uid, 1) end
dmgText = ""..a..""
doSendMagicEffect(getThingPos(cid), 3)
end
doSendAnimatedText(getThingPos(cid), dmgText, 215)
return false
end

if isSummon(attacker) and not isSummon(cid) and not isPlayer(cid) then

local expstring = cid.."expEx"

if getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring) == null then
doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring, 0)
end

local exp = valor / getCreatureMaxHealth(cid)
local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8).uid

doItemSetAttribute(ball, expstring, getItemAttribute(ball, expstring) + exp)
if getItemAttribute(ball, expstring) > 1 then
doItemSetAttribute(ball, expstring, 1)
end
end

if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.08) and not exhaustion.get(getCreatureMaster(cid), 88726) then
exhaustion.set(getCreatureMaster(cid), 88726, 11)
doSendMagicEffect(getThingPos(cid), 178)
end

if isSummon(attacker) then
if combat == COMBAT_PHYSICALDAMAGE then
doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
else
doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
end

if not isSummon(cid) and not isPlayer(cid) and math.random(1, wildEvolveChance) == math.random(1, wildEvolveChance) then
addEvent(doEvolveWild, math.random(1, 2500), cid)
end
else
if combat ~= COMBAT_PHYSICALDAMAGE then
doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
else
doCreatureAddHealth(cid, -math.abs(valor), 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end

if isSummon(cid) then
addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end

end

local percent = 8 + math.ceil(valor / getCreatureMaxHealth(cid) * 100)
if getCreatureHealth(cid) == 0 or percent <= 0 then return false end
local runCond = false

if math.random(100) <= percent then
runCond = true
end

if runCond then

local condPos = getThingPos(cid)
local color = 215
local text = ""
local effect = 2

if damageCombat == FIREDAMAGE and not isBurning(cid) then
doAdvancedBurn(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(5, 12))
color = COLOR_FIRE2
text = "BURNING"
effect = 15
elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) and randomCond == checkCond then
doAdvancedPoison(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(4, 20))
color = COLOR_GRASS
text = "POISONED"
effect = 8
end

doSendMagicEffect(getThingPos(cid), effect)
addEvent(doSendAnimatedText, 5, condPos, text, color)
end
------------------------------------POTIONS-------------------------------------------
if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  if getPlayerStorageValue(cid, 173) >= 1 then
  if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
	 setPlayerStorageValue(cid, 174, 1)
	 doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  end
  end
end
----------------------------------------PASSIVAS-----------------------------------------
------------------------------"Counter Helix" - "Giro Ball"------------------------------
-- [outfit normal] = {out = outfit girando, efeitos}
local OutFit = {
[366] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --scyther
[912] = {out = 918, cima = 128, direita = 129, esquerda = 130, baixo = 131},  --Scizor
[1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther
[952] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop
[909] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco
[910] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress
}

--acima do efeito 255 n aparece -pelo menos aki- entao fica esse por enquanto... ;x
--efeito vermelho =>   {cima = 261, direita = 263, esquerda = 264, baixo = 262}

if isSummon(cid) then
if OutFit[getCreatureOutfit(cid).lookType] then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local outfitt =  OutFit[getCreatureOutfit(cid).lookType]
  local function doWingAttack(cid, a, damage, min, max)
		local damagearea = {}
  local effectpos = getThingPosWithDebug(cid)
  local effect = 255
		if a == 0 then
		   effect = outfitt.cima
  effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y - 1
  damagearea = wingdn
   elseif a == 1 then
		   effect = outfitt.direita
		   effectpos.x = effectpos.x + 2
  effectpos.y = effectpos.y + 1
  damagearea = wingde
   elseif a == 2 then
	  effect = outfitt.baixo
		   effectpos.x = effectpos.x + 1
  effectpos.y = effectpos.y + 2
  damagearea = wingds
   elseif a == 3 then
		   effect = outfitt.esquerda
		   effectpos.x = effectpos.x - 1
  effectpos.y = effectpos.y + 1
  damagearea = wingdw
   end
  doSendMagicEffect(effectpos, effect)
  if damage then
  local look = getCreatureOutfit(cid).lookType
  if look == 366 or look == 1317 then   --scyther e shiny scyther
	 doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   elseif look == 952 then			   --hitmontop
			  doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   else								  --resto
			  doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)
		   end
		end
  end

local dire = getCreatureLookDir(cid)
local cpos = getThingPosWithDebug(cid)
local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...

  setPlayerStorageValue(cid, 32623, 1)		--proteçao
doSetCreatureOutfit(cid, {lookType = OutFit[getCreatureOutfit(cid).lookType].out}, -1)

local function doDance(cid, dir, damage, min, max)
if not isCreature(cid) then return true end
	doCreatureSetLookDir(cid, dir)
  doWingAttack(cid, dir, damage, min, max)
end

for times = 0, 2 do
	for directions = 0, 3 do
addEvent(doDance, times * 300, cid, directions, true, min, max)
end
end

local function doChangeO(cid, dir, pos)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
if getThingPosWithDebug(cid).x == pos.x and getThingPosWithDebug(cid).y == pos.y then
doCreatureSetLookDir(cid, dir)
end
 end

addEvent(doChangeO, 2 * 300 + 10, cid, dire, cpos)
end
end
end
-------------------------------------------Lava Counter / Electricity-------------------------------------

---------------------------------------------Demon Kicker----------------------------------
--[outfit] = outfit chutando,
local hitmonlees = {
[371] =  652,	  --hitmonlee
[1300] =  652,	  --shiny hitmonlee
[877] = 878,  --elite hitmonlee  PxG
}

--DETALHE: shiny hitmonlee n tem a sprite dele chutando.. pelo menos eu n achei..
--entao deixei a sprite do hitmonlee normal atacando...

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if name == "Shiny Hitmonlee" or name == "Hitmonlee" then
  if isCreature(getCreatureTarget(getCreatureMaster(cid))) then
  if math.random(1, 100) <= 20 then	-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

  if isSleeping(cid) then return true end

  if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then
  return false
  end
  if getPlayerStorageValue(cid, 32623) == 1 then  --proteçao pra n usar a spell 2x seguidas...
  return false
  end

  local function doChangeHitmon(cid)
if not isCreature(cid) then return true end
	 setPlayerStorageValue(cid, 32623, 0)		 --proteçao
doRemoveCondition(cid, CONDITION_OUTFIT)
  end

	 local min = getPokemonLevel(cid)*15	 --nao sei como funciona o sistema de dano...
	 local max = getPokemonLevel(cid)*20	 --nao sei como funciona o sistema de dano...


	 setPlayerStorageValue(cid, 32623, 1)		--proteçao
	 doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookType]}, -1)
	 doTargetCombatHealth(cid, getMasterTarget(cid), FIGHTINGDAMAGE, -min, -max, 255)

	 addEvent(doChangeHitmon, 700, cid)	
  end
  end
  end
end
-------------------------------------------Demon Puncher-------------------------------------

---------------------------------------Stunning Confusion------------------------------------------

-----------------------------------------Groundshock-----------------------------------

--------------------------------------Electric Charge---------------------------------------------------

-------------------------------------Melody------------------------------------

------------------------------------- Mega Drain ---------------------------------------

------------------------------------- Spores Reaction ---------------------------------------
arr = {
{0, 0, 0, 0, 0},
{0, 1, 1, 1, 0},
{0, 1, 2, 1, 0},
{0, 1, 1, 1, 0},
{0, 0, 0, 0, 0}
}

local spores = {"Oddish", "Gloom", "Vileplume", "Shiny Oddish", "Shiny Gloom", "Shiny Vileplume"}

if isSummon(cid) then
local e = getCreatureMaster(cid)
local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")
  if isInArray(spores, name) then
  if math.random(1, 100) <= 10 then	-- Porcentagem de chance pro poke usar a passiva... 20 = 20% +/-
	 doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPosWithDebug(cid), powders, -2, -3, 27)
  end
  end
end


return false
end

Estou com o mesmo erro quando eu sumono um shiny ^^

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...