Advertisement
Guest User

Untitled

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