Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.08 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) * playerDamageReduction
  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 "Ela" or "Ele")
  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.." HP 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 damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  278. if isInArray(effectiveness[damageCombat].super, poketype1) then
  279. multiplier = multiplier + 0.5
  280. end
  281. if isInArray(effectiveness[damageCombat].super, poketype2) then
  282. multiplier = multiplier + 0.5
  283. end
  284. if isInArray(effectiveness[damageCombat].weak, poketype1) then
  285. multiplier = multiplier - 0.25
  286. end
  287. if isInArray(effectiveness[damageCombat].weak, poketype2) then
  288. multiplier = multiplier - 0.25
  289. end
  290. if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
  291. if isInArray(specialabilities["foresight"], getCreatureName(attacker)) then
  292. multiplier = 0.5
  293. end --alterado v1.6
  294. end
  295. elseif combat == COMBAT_PHYSICALDAMAGE then
  296. if isGhostPokemon(cid) then
  297. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --passiva Foresight!!
  298. doSendMagicEffect(getThingPos(cid), 3)
  299. return false
  300. end
  301. end
  302. local cd = getPlayerStorageValue(attacker, conds["Miss"])
  303. local cd2 = getPlayerStorageValue(attacker, conds["Confusion"])
  304. local cd3 = getPlayerStorageValue(attacker, conds["Stun"])
  305. if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
  306. if math.random(1, 100) > 50 then
  307. doSendMagicEffect(getThingPos(cid), 211)
  308. doSendAnimatedText(getThingPos(attacker), "MISS", 215)
  309. return false
  310. end
  311. end
  312. end
  313. --------------------------------------------------
  314. local valor = value
  315.  
  316. if multiplier == 1.5 and poketype2 == "no type" then
  317. multiplier = 2
  318. elseif multiplier == 1.5 and poketype2 ~= "no type" then
  319. multiplier = 1.75
  320. elseif multiplier == 1.25 then
  321. multiplier = 1
  322. end
  323.  
  324. --------------------------------------------------
  325. if isSummon(cid) and isSummon(attacker) then
  326. if getCreatureMaster(cid) == getCreatureMaster(attacker) then
  327. return false
  328. end
  329. if canAttackOther(cid, attacker) == "Cant" then
  330. return false
  331. end
  332. end
  333.  
  334. valor = valor * multiplier
  335.  
  336. if isSummon(attacker) then
  337. valor = valor * getHappinessRate(attacker)
  338. else
  339. valor = valor * summonReduction
  340. end
  341.  
  342. valor = math.floor(valor)
  343.  
  344. if combat == COMBAT_PHYSICALDAMAGE then
  345.  
  346. local value = getOffense(attacker) > 1000 and 3 or 2
  347. block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--'
  348. valor = (getOffense(attacker)/value) * block
  349.  
  350. if valor <= 0 then
  351. valor = math.random(5, 10) --alterado v1.9
  352. end
  353.  
  354. if isInArray(specialabilities["counter"], getCreatureName(cid)) then
  355. if math.random(1, 100) <= 10 then
  356. doCreatureAddHealth(attacker, -valor, 3, 180)
  357. valor = 0
  358. doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
  359. end
  360. end
  361. else
  362. valor = valor / getDefense(cid)
  363. end
  364.  
  365. -------------------------Edited CLAN SYSTEM-----------------------------------
  366. if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
  367. valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")
  368. elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
  369. valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
  370. end
  371. -----------------------------------------------------------------------
  372. ---------------------- FEAR / ROAR ------------------------------------
  373. if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then
  374. return true
  375. end
  376. --------------------------------------------------------------------------
  377. if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  378. if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
  379. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then
  380. valor = valor * 0
  381. end
  382. end
  383. end
  384.  
  385. if damageCombat == GROUNDDAMAGE then
  386. if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
  387. valor = 0
  388. end
  389. end
  390. -----------------------------------------------------------------------------
  391. local p = getThingPos(cid)
  392. if p.x == 1 and p.y == 1 and p.z == 10 then
  393. return false
  394. end
  395.  
  396. if getPlayerStorageValue(cid, 9658783) == 1 then
  397. return false --imune
  398. end
  399. -----------------------------------------------------------------------------
  400.  
  401. --------------- FIGHT MODE -----------------------
  402. if useOTClient then
  403. if isSummon(cid) then
  404. local master = getCreatureMaster(cid)
  405. if getPlayerStorageValue(master, 248759) == 1 then
  406. valor = valor * 1.1
  407. elseif getPlayerStorageValue(master, 248759) == 3 then
  408. valor = valor * 0.9
  409. end
  410. end
  411. if isSummon(attacker) then
  412. local master = getCreatureMaster(attacker)
  413. if getPlayerStorageValue(master, 248759) == 1 then
  414. valor = valor * 1.1
  415. elseif getPlayerStorageValue(master, 248759) == 3 then
  416. valor = valor * 0.9
  417. end
  418. end
  419. end
  420. -----------------------------------------------------------------------------
  421. local config = {
  422. sturdy = { --Pokémons que possuem a habilidade Sturdy. Configuração: ["nome_do_pokemon"] = lookType,
  423. ["Sudowoodo"] = 806,
  424. },
  425. cd = 20, --Cooldown da habilidade.
  426. duration = 6, --Duração, em segundos, do Sturdy.
  427. storages = {
  428. db = 8401,
  429. s = 8402,
  430. s_cd = 8403,
  431. },
  432. }
  433. if getPlayerStorageValue(cid, config.storages.s) > -1 then
  434. return false
  435. end
  436. local hp = getCreatureHealth(cid) - valor
  437. if not isPlayer(cid) then
  438. if hp <= 1 then
  439. if config.sturdy[getCreatureName(cid)] then
  440. local b = true
  441. if isSummon(cid) then
  442. local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
  443. if ball and getCD(ball.uid, "sturdy") > 0 then
  444. b = false
  445. end
  446. end
  447. if b then
  448. if hp < 1 then
  449. doCreatureAddHealth(cid, hp < 0 and (hp * -1) + 1 or 1)
  450. end
  451. setPlayerStorageValue(cid, config.storages.s, 1)
  452. if isSummon(cid) then
  453. local ball = getPlayerSlotItem(getCreatureMaster(cid), 8)
  454. if ball then
  455. setCD(ball.uid, "sturdy", config.duration + config.cd)
  456. end
  457. end
  458. doSetCreatureOutfit(cid, {lookType = config.sturdy[getCreatureName(cid)]}, config.duration * 1000)
  459. addEvent(function()
  460. if isCreature(cid) and getPlayerStorageValue(cid, config.storages.s) > -1 then
  461. setPlayerStorageValue(cid, config.storages.s, -1)
  462. doCreatureAddHealth(cid, -getCreatureHealth(cid))
  463. end
  464. end, config.duration * 1000)
  465. end
  466. end
  467. end
  468. end
  469. if valor >= getCreatureHealth(cid) then
  470. if isInArray(cannotKill, combat) and isPlayer(cid) then
  471. valor = getCreatureHealth(cid) - 1
  472. else
  473. valor = getCreatureHealth(cid)
  474. if not isPlayer(cid) and getPlayerStorageValue(cid, config.storages.db) > -1 then
  475. docastspell(cid, "DB")
  476. end
  477. end
  478. end
  479. valor = math.floor(valor)
  480.  
  481. ------------------ SKILLs Q CURAM O ATTACKER ---------------------------------
  482. local function doHeal(cid, amount)
  483. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  484. amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  485. end
  486. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  487. doCreatureAddHealth(cid, amount)
  488. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  489. end
  490. end
  491.  
  492. if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then
  493. if getPlayerStorageValue(attacker, 95487) >= 1 then
  494. doHeal(attacker, valor)
  495. setPlayerStorageValue(attacker, 95487, -1)
  496. end
  497. elseif damageCombat == SEED_BOMBDAMAGE then
  498. doHeal(attacker, valor)
  499. end
  500. --------------------------------------------
  501. ----------SACRED FIRE-----------------------
  502. if combat == SACREDDAMAGE and not ehNPC(cid) then
  503. local ret = {}
  504. ret.id = cid
  505. ret.cd = 9
  506. ret.check = getPlayerStorageValue(cid, conds["Silence"])
  507. ret.eff = 39
  508. ret.cond = "Silence"
  509.  
  510. doCondition2(ret)
  511. elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then
  512. local ret = {}
  513. ret.id = cid
  514. ret.cd = 9
  515. ret.eff = 34
  516. ret.check = getPlayerStorageValue(cid, conds["Miss"])
  517. ret.spell = "Mud Bomb" --alterado v1.9
  518. ret.cond = "Miss"
  519.  
  520. doCondition2(ret)
  521. end
  522. ---------------------------------------------
  523. --------------Passiva Lifesteal Clobat------------
  524. if isInArray({"zubat", "golbat", "crobat", "shiny zubat", "shiny golbat", "shiny crobat"}, getCreatureName(attacker):lower()) and (combat == 128 or combat == 1) then
  525. if isWild(attacker) then
  526. value = math.floor(value*9)
  527. end
  528.  
  529. value = math.floor(value*10)
  530. doCreatureAddHealth(attacker, math.floor(value))
  531. doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(value), 30)
  532. end
  533. --------------------------------------------
  534. --valor = math.abs(valor) --ANTIGO
  535. --if isSummon(attacker) then
  536. valor = math.abs(valor) -- POKE HP BAR
  537. if isSummon(cid) and valor >= getCreatureHealth(cid) then
  538. onPokeHealthChange(getCreatureMaster(cid), true)
  539. elseif isSummon(cid) then
  540. onPokeHealthChange(getCreatureMaster(cid))
  541. end
  542. if isSummon(attacker) then
  543. if combat == COMBAT_PHYSICALDAMAGE then
  544. doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
  545. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  546. else
  547. doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
  548. end
  549. else
  550. if combat ~= COMBAT_PHYSICALDAMAGE then
  551. doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor)
  552. else
  553. doCreatureAddHealth(cid, -valor, 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
  554. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  555. end
  556.  
  557. if isSummon(cid) and valor ~= 0 then
  558. --addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
  559. end
  560. end
  561.  
  562. local thick = {"Venusaur", "Shiny Venusaur", "Miltank"}
  563. if isInArray(thick, getCreatureName(cid)) and (combat == FIREDAMAGE or combat == ICEDAMAGE) then
  564. value = value * 0.2
  565. end
  566.  
  567. local adaptability = {"Beedrill", "Shiny Beedrill"}
  568. if isInArray(adaptability, getCreatureName(cid)) and (combat == psyDmg) then
  569. value = value * 1000
  570. end
  571.  
  572. if damageCombat == FIREDAMAGE and not isBurning(cid) then
  573. local ret = {}
  574. ret.id = cid
  575. ret.cd = math.random(5, 12)
  576. ret.check = getPlayerStorageValue(cid, conds["Burn"])
  577. ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
  578. ret.cond = "Burn"
  579.  
  580. doCondition2(ret)
  581. elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
  582. local ret = {}
  583. ret.id = cid
  584. ret.cd = math.random(6, 15)
  585. ret.check = getPlayerStorageValue(cid, conds["Poison"])
  586. local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
  587. ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
  588. ret.cond = "Poison"
  589.  
  590. doCondition2(ret)
  591. end
  592. --[[---------------CD BAR-----------------------
  593. if isSummon(cid) then
  594. doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread")
  595. end ]]
  596. ------------------------------------POTIONS-------------------------------------------
  597. if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  598. if getPlayerStorageValue(cid, 173) >= 1 then
  599. if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
  600. setPlayerStorageValue(cid, 173, -1)
  601. doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  602. end
  603. end
  604. end
  605. ----------------------------------------PASSIVAS-------------------------------------
  606. -------------------------------------------Counter Spin------------------------------------
  607. if passivesChances["Counter Spin"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Counter Spin"][getCreatureName(cid)] then
  608. docastspell(cid, "Counter Spin")
  609. end
  610. -------------------------------------------Counter Claw------------------------------------
  611. if passivesChances["Counter Claw"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Counter Claw"][getCreatureName(cid)] then
  612. docastspell(cid, "Counter Claw")
  613. end
  614. -------------------------------------------Counter Helix------------------------------------
  615. if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then
  616. docastspell(cid, "Counter Helix")
  617. end
  618. -------------------------------------------Lava Counter/Electricity----------------------------
  619. if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then
  620. docastspell(cid, "Lava-Electricity")
  621. end
  622. -------------------------------------------Electricity----------------------------
  623. if passivesChances["Electricity"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electricity"][getCreatureName(cid)] then
  624. docastspell(cid, "Electricity")
  625. end
  626. -------------------------------------------Lava Counter----------------------------
  627. if passivesChances["Lava Counter"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Lava Counter"][getCreatureName(cid)] then
  628. docastspell(cid, "Lava Counter")
  629. end
  630. ---------------------------------------Stunning Confusion-----------------------------------------
  631. if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then
  632. docastspell(cid, "Stunning Confusion")
  633. end
  634. -----------------------------------------Groundshock-----------------------------------
  635. if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then
  636. docastspell(cid, "Groundshock")
  637. end
  638. ------------------------------------- Spike Skin ---------------------------------------
  639. if passivesChances["Spike Skin"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spike Skin"][getCreatureName(cid)] then
  640. docastspell(cid, "Spike Skin")
  641. end
  642. --------------------------------------Electric Charge---------------------------------------------
  643. if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then
  644. docastspell(cid, "Electric Charge", 0, 0)
  645. end
  646. -------------------------------------Melody------------------------------------
  647. if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then
  648. docastspell(cid, "Melody")
  649. end
  650. ------------------------------------- Dragon Fury / Fury ---------------------------------------
  651. if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then
  652. docastspell(cid, "Dragon Fury", 0, 0)
  653. end
  654. ------------------------------------- Mega Drain ---------------------------------------
  655. if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then
  656. docastspell(cid, "Mega Drain")
  657. end
  658. ------------------------------------- Miracle Eye ---------------------------------------
  659. if passivesChances["Miracle Eye"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Miracle Eye"][getCreatureName(cid)] then
  660. docastspell(cid, "Miracle Eye", 0, 0)
  661. end
  662. ------------------------------------- Dark Accurate ---------------------------------------
  663. if passivesChances["Dark Accurate"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dark Accurate"][getCreatureName(cid)] then
  664. docastspell(cid, "Dark Accurate", 0, 0)
  665. end
  666. ------------------------------------- Spores Reaction ---------------------------------------
  667. if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then
  668. docastspell(cid, "Spores Reaction")
  669. end
  670. ------------------------------------ Uproar ----------------------------------------
  671. if passivesChances["Uproar"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Uproar"][getCreatureName(cid)] then
  672. docastspell(cid, "Uproar", 0, 0)
  673. end
  674. ------------------------------------ Amnesia ----------------------------------------
  675. if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then
  676. docastspell(cid, "Amnesia", 0, 0)
  677. end
  678. ------------------------------------ Static ----------------------------------------
  679. if passivesChances["Static"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Static"][getCreatureName(cid)] then
  680. docastspell(cid, "Static")
  681. end
  682. ------------------------------------ Flame Body ----------------------------------------
  683. if passivesChances["Flame Body"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Flame Body"][getCreatureName(cid)] then
  684. docastspell(cid, "Flame Body")
  685. end
  686. ----------------------------------- Zen Mind -----------------------------------------
  687. if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then
  688. docastspell(cid, "Zen Mind", 0, 0)
  689. end
  690. ---------------------------------- Mirror Coat ---------------------------------------
  691. if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then
  692. docastspell(cid, "Mirror Coat", 0, 0)
  693. end
  694. -------------------------------------------Bone Spin----------------------------
  695. if passivesChances["Bone Spin"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Bone Spin"][getCreatureName(cid)] then
  696. docastspell(cid, "Bone Spin")
  697. end
  698. --------------------------------- Illusion -----------------------------------------
  699. if passivesChances["Illusion"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Illusion"][getCreatureName(cid)] then
  700. docastspell(cid, "Illusion", 0, 0)
  701. end
  702. return false
  703. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement