Advertisement
Guest User

Untitled

a guest
Jun 14th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.31 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 "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. ---------------------- Script By: XZero/Smoke -------------------------
  265. -- Youtube: https://www.youtube.com/channel/UCA3kuuXTpwkQryh6GoyDPQg --
  266. -- Facebook: https://www.facebook.com/kero.zene.940 --
  267. -----------------------------------------------------------------------
  268. if not isCreature(cid) or getCreatureCondition(cid, CONDITION_INVISIBLE) then return false end
  269. local multiplier = 1
  270. local poketype1 = pokes[getCreatureName(cid)].type
  271. local poketype2 = pokes[getCreatureName(cid)].type2
  272. if not poketype1 then
  273. poketype1 = "no type"
  274. end
  275. if not poketype2 then
  276. poketype2 = "no type"
  277. end
  278. if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  279. local effst = effectiveness[damageCombat]
  280. if isInArray(effst.super, poketype1) or isInArray(effst.super, poketype2) then
  281. multiplier = multiplier + 0.5
  282. elseif isInArray(effst.weak, poketype1) or isInArray(effst.weak, poketype2) then
  283. multiplier = multiplier - 0.25
  284. elseif isInArray(effst.non, poketype1) or isInArray(effst.non, poketype2) then
  285. if isInArray(specialabilities["foresight"], getCreatureName(attacker)) then
  286. multiplier = 0.5
  287. else
  288. multiplier = 0
  289. end
  290. end
  291. end
  292. -------------------------------------------------------------------------->
  293. if isSummon(attacker) and isPlayer(getCreatureMaster(attacker)) then
  294. local TierArray = {8, 9, 10, 11, 12, 13, 14, 15, 16}
  295. local Tiers = {
  296. [8] = {bonus = AtkBonus1},
  297. [9] = {bonus = AtkBonus2},
  298. [10] = {bonus = AtkBonus3},
  299. [11] = {bonus = AtkBonus4},
  300. [12] = {bonus = AtkBonus5},
  301. [13] = {bonus = AtkBonus6},
  302. [14] = {bonus = AtkBonus7},
  303. [15] = {bonus = AtkBonus8},
  304. [16] = {bonus = AtkBonus9},
  305. }
  306. local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8)
  307. local Tier = getItemAttribute(ball.uid, "heldx")
  308. local bonusatk = {}
  309. if isInArray(TierArray, getItemAttribute(ball.uid, "heldx")) then
  310. bonusatk = Tiers[Tier].bonus
  311. else
  312. bonusatk = 1
  313. end
  314. multiplier = multiplier * bonusatk
  315. end
  316. -- X-Attack --
  317. elseif combat == COMBAT_PHYSICALDAMAGE then
  318. if isGhostPokemon(cid) then
  319. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --passiva Foresight!!
  320. doSendMagicEffect(getThingPos(cid), 3)
  321. return false
  322. end
  323. end
  324. local cd = getPlayerStorageValue(attacker, conds["Miss"])
  325. local cd2 = getPlayerStorageValue(attacker, conds["Confusion"])
  326. local cd3 = getPlayerStorageValue(attacker, conds["Stun"])
  327. if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
  328. if math.random(1, 100) > 50 then
  329. doSendMagicEffect(getThingPos(cid), 211)
  330. doSendAnimatedText(getThingPos(attacker), "MISS", 215)
  331. return false
  332. end
  333. end
  334. end
  335. --------------------------------------------------
  336. local valor = value
  337.  
  338. if multiplier == 1.5 and poketype2 == "no type" then
  339. multiplier = 2
  340. elseif multiplier == 1.5 and poketype2 ~= "no type" then
  341. multiplier = 1.75
  342. elseif multiplier == 1.25 then
  343. multiplier = 1
  344. end
  345.  
  346. --------------------------------------------------
  347. if isSummon(cid) and isSummon(attacker) then
  348. if getCreatureMaster(cid) == getCreatureMaster(attacker) then
  349. return false
  350. end
  351. if canAttackOther(cid, attacker) == "Cant" then
  352. return false
  353. end
  354. end
  355.  
  356. valor = valor * multiplier
  357.  
  358. if isSummon(attacker) then
  359. valor = valor * getHappinessRate(attacker)
  360. else
  361. valor = valor * summonReduction
  362. end
  363.  
  364. valor = math.floor(valor)
  365.  
  366. if combat == COMBAT_PHYSICALDAMAGE then
  367.  
  368. local value = getOffense(attacker) > 1000 and 3 or 2
  369. block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--'
  370. valor = (getOffense(attacker)/value) * block
  371.  
  372. if valor <= 0 then
  373. valor = math.random(5, 10) --alterado v1.9
  374. end
  375.  
  376. if isInArray(specialabilities["counter"], getCreatureName(cid)) then
  377. if math.random(1, 100) <= 10 then
  378. doCreatureAddHealth(attacker, -valor, 3, 180)
  379. valor = 0
  380. doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
  381. end
  382. end
  383. else
  384. valor = valor / getDefense(cid)
  385. end
  386.  
  387. -------------------------Edited CLAN SYSTEM-----------------------------------
  388. if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
  389. valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")
  390. elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then
  391. valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
  392. end
  393. -----------------------------------------------------------------------
  394. ---------------------- FEAR / ROAR ------------------------------------
  395. if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then
  396. return true
  397. end
  398. --------------------------------------------------------------------------
  399. if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  400. if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
  401. if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then
  402. valor = valor * 0
  403. end
  404. end
  405. end
  406.  
  407. if damageCombat == GROUNDDAMAGE then
  408. if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
  409. valor = 0
  410. end
  411. end
  412. -----------------------------------------------------------------------------
  413. local p = getThingPos(cid)
  414. if p.x == 1 and p.y == 1 and p.z == 10 then
  415. return false
  416. end
  417.  
  418. if getPlayerStorageValue(cid, 9658783) == 1 then
  419. return false --imune
  420. end
  421. -----------------------------------------------------------------------------
  422.  
  423. --------------- FIGHT MODE -----------------------
  424. if useOTClient then
  425. if isSummon(cid) then
  426. local master = getCreatureMaster(cid)
  427. if getPlayerStorageValue(master, 248759) == 1 then
  428. valor = valor * 1.1
  429. elseif getPlayerStorageValue(master, 248759) == 3 then
  430. valor = valor * 0.9
  431. end
  432. end
  433. if isSummon(attacker) then
  434. local master = getCreatureMaster(attacker)
  435. if getPlayerStorageValue(master, 248759) == 1 then
  436. valor = valor * 1.1
  437. elseif getPlayerStorageValue(master, 248759) == 3 then
  438. valor = valor * 0.9
  439. end
  440. end
  441. end
  442. -----------------------------------------------------------------------------
  443. if valor >= getCreatureHealth(cid) then
  444. if isInArray(cannotKill, combat) and isPlayer(cid) then
  445. valor = getCreatureHealth(cid) - 1
  446. else
  447. valor = getCreatureHealth(cid)
  448. end
  449. end
  450. valor = math.floor(valor)
  451.  
  452. ------------------ SKILLs Q CURAM O ATTACKER ---------------------------------
  453. local function doHeal(cid, amount)
  454. if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  455. amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
  456. end
  457. if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then
  458. doCreatureAddHealth(cid, amount)
  459. doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
  460. end
  461. end
  462.  
  463. if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then
  464. if getPlayerStorageValue(attacker, 95487) >= 1 then
  465. doHeal(attacker, valor)
  466. setPlayerStorageValue(attacker, 95487, -1)
  467. end
  468. elseif damageCombat == SEED_BOMBDAMAGE then
  469. doHeal(attacker, valor)
  470. end
  471. --------------------------------------------
  472. ----------SACRED FIRE-----------------------
  473. if combat == SACREDDAMAGE and not ehNPC(cid) then
  474. local ret = {}
  475. ret.id = cid
  476. ret.cd = 9
  477. ret.check = getPlayerStorageValue(cid, conds["Silence"])
  478. ret.eff = 39
  479. ret.cond = "Silence"
  480.  
  481. doCondition2(ret)
  482. elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then
  483. local ret = {}
  484. ret.id = cid
  485. ret.cd = 9
  486. ret.eff = 34
  487. ret.check = getPlayerStorageValue(cid, conds["Miss"])
  488. ret.spell = "Mud Bomb" --alterado v1.9
  489. ret.cond = "Miss"
  490.  
  491. doCondition2(ret)
  492. end
  493. ---------------------------------------------
  494. --------------Passiva Lifesteal Clobat------------
  495. if combat == COMBAT_PHYSICALDAMAGE then
  496. if getCreatureName(attacker) == "Crobat" then
  497. doCreatureAddHealth(attacker, math.floor(valor))
  498. doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)
  499. end
  500. end
  501. --------------------------------------------
  502. valor = math.abs(valor) --alterado v1.9
  503. if isSummon(attacker) then
  504. if combat == COMBAT_PHYSICALDAMAGE then
  505. doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
  506. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  507. else
  508. doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
  509. end
  510. else
  511. if combat ~= COMBAT_PHYSICALDAMAGE then
  512. doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor)
  513. else
  514. doCreatureAddHealth(cid, -valor, 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
  515. addEvent(doDoubleHit, 1000, attacker, cid, valor, races)
  516. end
  517.  
  518. if isSummon(cid) and valor ~= 0 then
  519. addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
  520. end
  521.  
  522. end
  523.  
  524. if damageCombat == FIREDAMAGE and not isBurning(cid) then
  525. local ret = {}
  526. ret.id = cid
  527. ret.cd = math.random(5, 12)
  528. ret.check = getPlayerStorageValue(cid, conds["Burn"])
  529. ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
  530. ret.cond = "Burn"
  531.  
  532. doCondition2(ret)
  533. elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
  534. local ret = {}
  535. ret.id = cid
  536. ret.cd = math.random(6, 15)
  537. ret.check = getPlayerStorageValue(cid, conds["Poison"])
  538. local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
  539. ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
  540. ret.cond = "Poison"
  541.  
  542. doCondition2(ret)
  543. end
  544. --[[---------------CD BAR-----------------------
  545. if isSummon(cid) then
  546. doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread")
  547. end ]]
  548. ------------------------------------POTIONS-------------------------------------------
  549. if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  550. if getPlayerStorageValue(cid, 173) >= 1 then
  551. if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
  552. setPlayerStorageValue(cid, 173, -1)
  553. doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  554. end
  555. end
  556. end
  557. ----------------------------------------PASSIVAS-------------------------------------
  558. -------------------------------------------Counter Helix------------------------------------
  559. if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then
  560. docastspell(cid, "Counter Helix")
  561. end
  562. -------------------------------------------Lava Counter/Electricity----------------------------
  563. if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then
  564. docastspell(cid, "Lava-Electricity")
  565. end
  566. ---------------------------------------Stunning Confusion-----------------------------------------
  567. if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then
  568. docastspell(cid, "Stunning Confusion")
  569. end
  570. ---------------------------------------Stunning ice-----------------------------------------
  571. if passivesChances["Stunning ice"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning ice"][getCreatureName(cid)] then
  572. docastspell(cid, "Stunning ice")
  573. end
  574. ---------------------------------------Stunning fire-----------------------------------------
  575. if passivesChances["Stunning fire"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning fire"][getCreatureName(cid)] then
  576. docastspell(cid, "Stunning fire")
  577. end
  578. ---------------------------------------Stunning Arceus-----------------------------------------
  579. if passivesChances["Stunning Arceus"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning Arceus"][getCreatureName(cid)] then
  580. docastspell(cid, "Stunning Arceus")
  581. end
  582. ---------------------------------------Stunning Deoxys-----------------------------------------
  583. if passivesChances["Stunning Deoxys"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning Deoxys"][getCreatureName(cid)] then
  584. docastspell(cid, "Stunning Deoxys")
  585. end
  586. ---------------------------------------Stunning Kami-----------------------------------------
  587. if passivesChances["Stunning Kami"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning Kami"][getCreatureName(cid)] then
  588. docastspell(cid, "Stunning Kami")
  589. end
  590. ---------------------------------------Stunning Lugia-----------------------------------------
  591. if passivesChances["Stunning Lugia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning Lugia"][getCreatureName(cid)] then
  592. docastspell(cid, "Stunning Lugia")
  593. end
  594. ---------------------------------------Stunning Zygarde-----------------------------------------
  595. if passivesChances["Stunning Zygarde"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning Zygarde"][getCreatureName(cid)] then
  596. docastspell(cid, "Stunning Zygarde")
  597. end
  598. -----------------------------------------Groundshock-----------------------------------
  599. if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then
  600. docastspell(cid, "Groundshock")
  601. end
  602. --------------------------------------Electric Charge---------------------------------------------
  603. if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then
  604. docastspell(cid, "Electric Charge", 0, 0)
  605. end
  606. -------------------------------------Melody------------------------------------
  607. if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then
  608. docastspell(cid, "Melody")
  609. end
  610. ------------------------------------- Dragon Fury / Fury ---------------------------------------
  611. if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then
  612. docastspell(cid, "Dragon Fury", 0, 0)
  613. end
  614. ------------------------------------- Mega Drain ---------------------------------------
  615. if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then
  616. docastspell(cid, "Mega Drain")
  617. end
  618. ------------------------------------- Spores Reaction ---------------------------------------
  619. if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then
  620. docastspell(cid, "Spores Reaction")
  621. end
  622. ------------------------------------ Amnesia ----------------------------------------
  623. if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then
  624. docastspell(cid, "Amnesia", 0, 0)
  625. end
  626. ----------------------------------- Zen Mind -----------------------------------------
  627. if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then
  628. docastspell(cid, "Zen Mind", 0, 0)
  629. end
  630. ---------------------------------- Mirror Coat ---------------------------------------
  631. if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then
  632. docastspell(cid, "Mirror Coat", 0, 0)
  633. end
  634. --------------------------------- Illusion -----------------------------------------
  635. return false
  636. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement