Advertisement
Julianozns

Untitled

Aug 23rd, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.69 KB | None | 0 0
  1. local combats = {
  2. [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
  3. [GRASSDAMAGE] = {cor = COLOR_GRASS},
  4. [POISONEDDAMAGE] = {cor = COLOR_GRASS},
  5. [FIREDAMAGE] = {cor = COLOR_FIRE2},
  6. [BURNEDDAMAGE] = {cor = COLOR_BURN},
  7. [WATERDAMAGE] = {cor = COLOR_WATER},
  8. [ICEDAMAGE] = {cor = COLOR_ICE},
  9. [NORMALDAMAGE] = {cor = COLOR_NORMAL},
  10. [FLYDAMAGE] = {cor = COLOR_FLYING},
  11. [GHOSTDAMAGE] = {cor = COLOR_GHOST},
  12. [GROUNDDAMAGE] = {cor = COLOR_GROUND},
  13. [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
  14. [ROCKDAMAGE] = {cor = COLOR_ROCK},
  15. [BUGDAMAGE] = {cor = COLOR_BUG},
  16. [FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
  17. [DRAGONDAMAGE] = {cor = COLOR_DRAGON},
  18. [POISONDAMAGE] = {cor = COLOR_POISON},
  19. [DARKDAMAGE] = {cor = COLOR_DARK},
  20. [STEELDAMAGE] = {cor = COLOR_STEEL},
  21. [MIRACLEDAMAGE] = {cor = COLOR_PSYCHIC},
  22. [DARK_EYEDAMAGE] = {cor = COLOR_GHOST},
  23. [SEED_BOMBDAMAGE] = {cor = COLOR_GRASS},
  24. [SACREDDAMAGE] = {cor = COLOR_FIRE2},
  25. [MUDBOMBDAMAGE] = {cor = COLOR_GROUND}, --alterado v1.9
  26. }
  27.  
  28. local function sendPlayerDmgMsg(cid, text)
  29. if not isCreature(cid) then return true end
  30. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
  31. end
  32.  
  33. local races = {
  34. [4] = {cor = COLOR_FIRE2},
  35. [6] = {cor = COLOR_WATER},
  36. [7] = {cor = COLOR_NORMAL},
  37. [8] = {cor = COLOR_FIRE2},
  38. [9] = {cor = COLOR_FIGHTING},
  39. [10] = {cor = COLOR_FLYING},
  40. [11] = {cor = COLOR_GRASS},
  41. [12] = {cor = COLOR_POISON},
  42. [13] = {cor = COLOR_ELECTRIC},
  43. [14] = {cor = COLOR_GROUND},
  44. [15] = {cor = COLOR_PSYCHIC},
  45. [16] = {cor = COLOR_ROCK},
  46. [17] = {cor = COLOR_ICE},
  47. [18] = {cor = COLOR_BUG},
  48. [19] = {cor = COLOR_DRAGON},
  49. [20] = {cor = COLOR_GHOST},
  50. [21] = {cor = COLOR_STEEL},
  51. [22] = {cor = COLOR_DARK},
  52. [1] = {cor = 180},
  53. [2] = {cor = 180},
  54. [3] = {cor = 180},
  55. [5] = {cor = 180},
  56. }
  57.  
  58. local damages = {GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE}
  59. local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
  60. local ignored = {POISONEDDAMAGE, BURNEDDAMAGE}
  61. local cannotkill = {BURNEDDAMAGE, POISONEDDAMAGE}
  62.  
  63. function onStatsChange(cid, attacker, type, combat, value)
  64.  
  65. if combat == FLYSYSTEMDAMAGE then return false end
  66. if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
  67.  
  68. if not isCreature(attacker) then
  69. if not isInArray(fixdamages, combat) and combats[combat] then
  70. doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
  71. end
  72. return true
  73. end
  74.  
  75. local damageCombat = combat
  76. --------------------------------------------------
  77. if type == STATSCHANGE_HEALTHGAIN then
  78. if cid == attacker then
  79. return true
  80. end
  81. if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then
  82. return false
  83. end
  84. return true
  85. end
  86. --------------------------------------------------
  87. if isMonster(cid) then
  88. local valor = value
  89. if not pokes[getCreatureName(cid)] and damageCombat == COMBAT_PHYSICALDAMAGE then
  90. valor = getOffense(attacker)
  91. doCreatureAddHealth(cid, -math.abs(valor), 3, races[7].cor)
  92. return false
  93. elseif not pokes[getCreatureName(cid)] and damageCombat ~= COMBAT_PHYSICALDAMAGE then
  94. doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
  95. return false
  96. end
  97. end
  98. --------------------------------------------------
  99. if isPlayer(attacker) then
  100.  
  101. local valor = value
  102. if valor > getCreatureHealth(cid) then
  103. valor = getCreatureHealth(cid)
  104. end
  105.  
  106. if combat == COMBAT_PHYSICALDAMAGE then
  107. return false
  108. end
  109.  
  110. if combat == PHYSICALDAMAGE then
  111. doSendMagicEffect(getThingPos(cid), 3)
  112. doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
  113. end
  114.  
  115. if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
  116. doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
  117. end
  118.  
  119. if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
  120. doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
  121. end
  122.  
  123. return true
  124. end
  125. --------------------------------------------------
  126. if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
  127. return false
  128. end
  129. --------------------------------------------------
  130. if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then
  131.  
  132. if isSummon(attacker) or isPlayer(attacker) then
  133. if canAttackOther(cid, attacker) == "Cant" then return false end
  134. end
  135.  
  136. local valor = 0
  137. if combat == COMBAT_PHYSICALDAMAGE then
  138. valor = getOffense(attacker)
  139. else
  140. valor = getSpecialAttack(attacker)
  141. end
  142.  
  143. valor = valor * playerDamageReduction
  144. valor = valor * math.random(83, 117) / 100
  145.  
  146. if valor >= getCreatureHealth(cid) then
  147. valor = getCreatureHealth(cid)
  148. end
  149.  
  150. valor = math.floor(valor)
  151.  
  152. if valor >= getCreatureHealth(cid) then
  153. if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
  154. setPlayerStorageValue(cid, 6598754, -1)
  155. setPlayerStorageValue(cid, 6598755, -1)
  156. doRemoveCondition(cid, CONDITION_OUTFIT)
  157. doTeleportThing(cid, posBackPVP, false)
  158. doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
  159. return false --alterado v1.8
  160. end
  161.  
  162. if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
  163. doRemoveCondition(cid, CONDITION_OUTFIT)
  164. setPlayerStorageValue(cid, 17000, 0)
  165. setPlayerStorageValue(cid, 17001, 0)
  166. setPlayerStorageValue(cid, 63215, -1)
  167. doChangeSpeed(cid, PlayerSpeed)
  168. local item = getPlayerSlotItem(cid, 8)
  169. local btype = getPokeballType(item.itemid)
  170. if #getCreatureSummons(cid) <= 0 then
  171. if isInArray(pokeballs[btype].all, item.itemid) then
  172. doTransformItem(item.uid, pokeballs[btype].off)
  173. doItemSetAttribute(item.uid, "hp", 0)
  174. end
  175. end
  176. end
  177.  
  178. if getPlayerStorageValue(cid, 22545) == 1 then
  179. if getGlobalStorageValue(22550) == 1 then
  180. doPlayerSendTextMessage(cid, 20, "You are the last survivor of the golden arena! Take your reward!")
  181. doPlayerAddItem(cid, 2152, getPlayerStorageValue(cid, 22551)*2)
  182. setPlayerStorageValue(cid, 22545, -1)
  183. doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false)
  184. doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
  185. setPlayerRecordWaves(cid)
  186. endGoldenArena()
  187. return false --alterado v1.8
  188. else
  189. setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
  190. setPlayerStorageValue(cid, 22545, -1)
  191. doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
  192. doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
  193. setPlayerRecordWaves(cid)
  194. return true
  195. end
  196. end
  197.  
  198. if getPlayerStorageValue(cid, 98796) >= 1 then
  199. setPlayerStorageValue(cid, 98796, -1)
  200. setPlayerStorageValue(cid, 98797, -1) --alterado v1.8
  201. doTeleportThing(cid, SafariOut, false)
  202. doSendMagicEffect(getThingPos(cid), 21)
  203. doPlayerSendTextMessage(cid, 27, "You die in the saffari... Best luck in the next time!")
  204. return false --alterado v1.8
  205. end
  206.  
  207. local corpse = doCreateItem(3058, 1, getThingPos(cid))
  208. doDecayItem(corpse)
  209. doItemSetAttribute(corpse, "pName", getCreatureName(cid)) --alterado v1.7 coloca corpse quando o player morre!
  210. doItemSetAttribute(corpse, "attacker", getCreatureName(attacker))
  211. doItemSetAttribute(corpse, "article", getPlayerSex(cid) == 0 and "She" or "He")
  212.  
  213. if getPlayerStorageValue(cid, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) <= 10 then
  214. setPlayerStorageValue(cid, Agatha.stoIni, -1)
  215. setPlayerStorageValue(cid, Agatha.stoRec, -1)
  216. setPlayerStorageValue(cid, Agatha.stoPer, -1)
  217. setPlayerStorageValue(cid, Agatha.stoEni, -1) --alterado v1.9 agatha quest
  218. setPlayerStorageValue(cid, Agatha.stoRes, -1)
  219. end
  220. end
  221. doCreatureAddHealth(cid, -valor, 3, 180)
  222. if not isPlayer(cid) then
  223. addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
  224. end
  225. return false
  226. end
  227. --------------------------------------------------
  228. if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
  229. if isPlayer(cid) then
  230. return false
  231. end
  232. if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
  233. return false
  234. end
  235. end
  236. --------------------------------------------------
  237. if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
  238. if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
  239. return false
  240. end
  241. end
  242. --------------------------------------------------
  243. if ehMonstro(cid) and ehMonstro(attacker) and not isSummon(cid) and not isSummon(attacker) then
  244. return false --alterado v1.9 /\
  245. end
  246. --------------------------------------------------
  247. --------------------REFLECT-----------------------
  248. if getPlayerStorageValue(cid, 21099) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
  249. if not isInArray({"Team Claw", "Team Slice"}, getPlayerStorageValue(attacker, 21102)) then
  250. doSendMagicEffect(getThingPosWithDebug(cid), 135)
  251. doSendAnimatedText(getThingPosWithDebug(cid), "REFLECT", COLOR_GRASS)
  252. addEvent(docastspell, 100, cid, getPlayerStorageValue(attacker, 21102))
  253. if getCreatureName(cid) == "Wobbuffet" then
  254. doRemoveCondition(cid, CONDITION_OUTFIT)
  255. end
  256. setPlayerStorageValue(cid, 21099, -1)
  257. setPlayerStorageValue(cid, 21100, 1)
  258. setPlayerStorageValue(cid, 21101, attacker)
  259. setPlayerStorageValue(cid, 21103, getTableMove(attacker, getPlayerStorageValue(attacker, 21102)).f)
  260. setPlayerStorageValue(cid, 21104, getCreatureOutfit(attacker).lookType)
  261. return false
  262. end
  263. end
  264. -------------------------------------------------
  265.  
  266. local multiplier = 1
  267.  
  268. if isCreature(cid) then
  269. poketype1 = pokes[getCreatureName(cid)].type
  270. poketype2 = pokes[getCreatureName(cid)].type2
  271. end
  272. if not poketype1 or not poketype2 then return false end
  273.  
  274. if getCreatureCondition(cid, CONDITION_INVISIBLE) then
  275. return false
  276. end
  277. if combat == COMBAT_PHYSICALDAMAGE then
  278. if isGhostPokemon(cid) then
  279. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --passiva Foresight!!
  280. doSendMagicEffect(getThingPos(cid), 3)
  281. return false
  282. end
  283. end
  284. local cd = getPlayerStorageValue(attacker, conds["Miss"])
  285. local cd2 = getPlayerStorageValue(attacker, conds["Confusion"])
  286. local cd3 = getPlayerStorageValue(attacker, conds["Stun"])
  287. if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
  288. if math.random(1, 100) > 50 then
  289. doSendMagicEffect(getThingPos(cid), 211)
  290. doSendAnimatedText(getThingPos(attacker), "MISS", 215)
  291. return false
  292. end
  293. end
  294. end
  295. --------------------------------------------------
  296. local valor = value
  297.  
  298. if multiplier == 1.5 and poketype2 == "no type" then
  299. multiplier = 2
  300. elseif multiplier == 1.5 and poketype2 ~= "no type" then
  301. multiplier = 1.75
  302. elseif multiplier == 1.25 then
  303. multiplier = 1
  304. end
  305.  
  306. --------------------------------------------------
  307. if isSummon(cid) and isSummon(attacker) then
  308. if getCreatureMaster(cid) == getCreatureMaster(attacker) then
  309. return false
  310. end
  311. if canAttackOther(cid, attacker) == "Cant" then
  312. return false
  313. end
  314. end
  315.  
  316. valor = valor * multiplier
  317.  
  318. if isSummon(attacker) then
  319. valor = valor * getHappinessRate(attacker)
  320. else
  321. valor = valor
  322. end
  323.  
  324. valor = math.floor(valor)
  325.  
  326. if combat == COMBAT_PHYSICALDAMAGE then
  327.  
  328. local value = getOffense(attacker) > 1000 and 3 or 2
  329. block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--'
  330. valor = (getOffense(attacker)/value) * block
  331.  
  332. if valor <= 0 then
  333. valor = math.random(5, 10) --alterado v1.9
  334. end
  335.  
  336. if isInArray(specialabilities["counter"], getCreatureName(cid)) then
  337. if math.random(1, 100) <= 10 then
  338. doCreatureAddHealth(attacker, -valor, 3, 180)
  339. valor = 0
  340. doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
  341. end
  342. end
  343. else
  344. valor = valor / getDefense(cid)
  345. end
  346.  
  347. -------------------------Edited CLAN SYSTEM-----------------------------------
  348. if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
  349. valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")
  350. elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
  351. valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
  352. onPokeBarLife(cid)
  353. end
  354. -----------------------------------------------------------------------
  355. ---------------------- FEAR / ROAR ------------------------------------
  356. if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then
  357. return true
  358. end
  359. --------------------------------------------------------------------------
  360. if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  361. if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
  362. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then
  363. valor = valor * 0
  364. end
  365. end
  366. end
  367.  
  368. if damageCombat == GROUNDDAMAGE then
  369. if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
  370. valor = 0
  371. end
  372. end
  373. -----------------------------------------------------------------------------
  374. local p = getThingPos(cid)
  375. if p.x == 1 and p.y == 1 and p.z == 10 then
  376. return false
  377. end
  378.  
  379. if getPlayerStorageValue(cid, 9658783) == 1 then
  380. return false --imune
  381. end
  382. -----------------------------------------------------------------------------
  383.  
  384. --------------- FIGHT MODE -----------------------
  385. if useOTClient then
  386. if isSummon(cid) then
  387. local master = getCreatureMaster(cid)
  388. if getPlayerStorageValue(master, 248759) == 1 then
  389. valor = valor * 1.1
  390. elseif getPlayerStorageValue(master, 248759) == 3 then
  391. valor = valor * 0.9
  392. end
  393. onPokeBarLife(cid)
  394. end
  395. if isSummon(attacker) then
  396. local master = getCreatureMaster(attacker)
  397. if getPlayerStorageValue(master, 248759) == 1 then
  398. valor = valor * 1.1
  399. elseif getPlayerStorageValue(master, 248759) == 3 then
  400. valor = valor * 0.9
  401. end
  402. end
  403. end
  404. -----------------------------------------------------------------------------
  405. if valor >= getCreatureHealth(cid) then
  406. if isInArray(cannotKill, combat) and isPlayer(cid) then
  407. valor = getCreatureHealth(cid) - 1
  408. else
  409. valor = getCreatureHealth(cid)
  410. end
  411. end
  412. valor = math.floor(valor)
  413.  
  414. ------------------ SKILLs Q CURAM O ATTACKER ---------------------------------
  415. local function doHeal(cid, amount)
  416. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  417. amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  418. end
  419. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  420. doCreatureAddHealth(cid, amount)
  421. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  422. end
  423. end
  424.  
  425. if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then
  426. if getPlayerStorageValue(attacker, 95487) >= 1 then
  427. doHeal(attacker, valor)
  428. setPlayerStorageValue(attacker, 95487, -1)
  429. end
  430. elseif damageCombat == SEED_BOMBDAMAGE then
  431. doHeal(attacker, valor)
  432. end
  433. --------------------------------------------
  434. ----------SACRED FIRE-----------------------
  435. if combat == SACREDDAMAGE and not ehNPC(cid) then
  436. local ret = {}
  437. ret.id = cid
  438. ret.cd = 9
  439. ret.check = getPlayerStorageValue(cid, conds["Silence"])
  440. ret.eff = 39
  441. ret.cond = "Silence"
  442.  
  443. doCondition2(ret)
  444. elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then
  445. local ret = {}
  446. ret.id = cid
  447. ret.cd = 9
  448. ret.eff = 34
  449. ret.check = getPlayerStorageValue(cid, conds["Miss"])
  450. ret.spell = "Mud Bomb" --alterado v1.9
  451. ret.cond = "Miss"
  452.  
  453. doCondition2(ret)
  454. end
  455. ---------------------------------------------
  456. --------------Passiva Lifesteal Clobat------------
  457. if combat == COMBAT_PHYSICALDAMAGE then
  458. if getCreatureName(attacker) == "Crobat" then
  459. doCreatureAddHealth(attacker, math.floor(valor))
  460. doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)
  461. end
  462. end
  463. --------------------------------------------
  464. valor = math.abs(valor) --alterado v1.9
  465. if isSummon(attacker) then
  466. if combat == COMBAT_PHYSICALDAMAGE then
  467. doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
  468. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  469. else
  470. doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
  471. end
  472. else
  473. if combat ~= COMBAT_PHYSICALDAMAGE then
  474. doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor)
  475. else
  476. doCreatureAddHealth(cid, -valor, 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
  477. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  478. end
  479.  
  480. if isSummon(cid) and valor ~= 0 then
  481. addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
  482. onPokeBarLife(cid)
  483. end
  484.  
  485. end
  486.  
  487. if damageCombat == FIREDAMAGE and not isBurning(cid) then
  488. local ret = {}
  489. ret.id = cid
  490. ret.cd = math.random(5, 12)
  491. ret.check = getPlayerStorageValue(cid, conds["Burn"])
  492. ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
  493. ret.cond = "Burn"
  494.  
  495. doCondition2(ret)
  496. elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
  497. local ret = {}
  498. ret.id = cid
  499. ret.cd = math.random(6, 15)
  500. ret.check = getPlayerStorageValue(cid, conds["Poison"])
  501. local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
  502. ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
  503. ret.cond = "Poison"
  504.  
  505. doCondition2(ret)
  506. end
  507. --[[---------------CD BAR-----------------------
  508. if isSummon(cid) then
  509. doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread")
  510. end ]]
  511. ------------------------------------POTIONS-------------------------------------------
  512. if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  513. if getPlayerStorageValue(cid, 173) >= 1 then
  514. if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
  515. setPlayerStorageValue(cid, 173, -1)
  516. doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  517. end
  518. end
  519. onPokeBarLife(cid)
  520. end
  521. ----------------------------------------PASSIVAS-------------------------------------
  522. -------------------------------------------Counter Helix------------------------------------
  523. if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then
  524. docastspell(cid, "Counter Helix")
  525. end
  526. -------------------------------------------Lava Counter/Electricity----------------------------
  527. if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then
  528. docastspell(cid, "Lava-Electricity")
  529. end
  530. ---------------------------------------Stunning Confusion-----------------------------------------
  531. if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then
  532. docastspell(cid, "Stunning Confusion")
  533. end
  534. -----------------------------------------Groundshock-----------------------------------
  535. if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then
  536. docastspell(cid, "Groundshock")
  537. end
  538. --------------------------------------Electric Charge---------------------------------------------
  539. if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then
  540. docastspell(cid, "Electric Charge", 0, 0)
  541. end
  542. -------------------------------------Melody------------------------------------
  543. if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then
  544. docastspell(cid, "Melody")
  545. end
  546. ------------------------------------- Dragon Fury / Fury ---------------------------------------
  547. if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then
  548. docastspell(cid, "Dragon Fury", 0, 0)
  549. end
  550. ------------------------------------- Mega Drain ---------------------------------------
  551. if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then
  552. docastspell(cid, "Mega Drain")
  553. end
  554. ------------------------------------- Spores Reaction ---------------------------------------
  555. if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then
  556. docastspell(cid, "Spores Reaction")
  557. end
  558. ------------------------------------ Amnesia ----------------------------------------
  559. if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then
  560. docastspell(cid, "Amnesia", 0, 0)
  561. end
  562. ----------------------------------- Zen Mind -----------------------------------------
  563. if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then
  564. docastspell(cid, "Zen Mind", 0, 0)
  565. end
  566. ---------------------------------- Mirror Coat ---------------------------------------
  567. if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then
  568. docastspell(cid, "Mirror Coat", 0, 0)
  569. end
  570. --------------------------------- Illusion -----------------------------------------
  571. return false
  572. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement