Guest User

Untitled

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