Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local combats = {
- [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
- [GRASSDAMAGE] = {cor = COLOR_GRASS},
- [POISONEDDAMAGE] = {cor = COLOR_GRASS},
- [MORTALGASDAMAGE] = {cor = COLOR_POISON},
- [FIREDAMAGE] = {cor = COLOR_FIRE2}, --COMPLETAMENTE EDITED
- [BURNEDDAMAGE] = {cor = COLOR_BURN},
- [WATERDAMAGE] = {cor = COLOR_WATER},
- [ICEDAMAGE] = {cor = COLOR_ICE},
- [NORMALDAMAGE] = {cor = COLOR_NORMAL},
- [GUILLOTINEDAMAGE] = {cor = COLOR_NORMAL},
- [FLYDAMAGE] = {cor = COLOR_FLYING},
- [GHOSTDAMAGE] = {cor = COLOR_GHOST},
- [NIGHTMAREDAMAGE] = {cor = COLOR_GHOST},
- [GROUNDDAMAGE] = {cor = COLOR_GROUND},
- [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
- [THUNDERWAVEDAMAGE] = {cor = COLOR_ELECTRIC},
- [ROCKDAMAGE] = {cor = COLOR_ROCK},
- [BUGDAMAGE] = {cor = COLOR_BUG},
- [FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
- [SEISMICTOSSDAMAGE] = {cor = COLOR_FIGHTING},
- [DRAGONDAMAGE] = {cor = COLOR_DRAGON},
- [POISONDAMAGE] = {cor = COLOR_POISON},
- [DARKDAMAGE] = {cor = COLOR_DARK},
- [STEELDAMAGE] = {cor = COLOR_STEEL},
- }
- --alterado v2.5 tabelas agora estao em lib/configuration.lua
- local function sendPlayerDmgMsg(cid, text)
- if not isCreature(cid) then return true end
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text)
- end
- local spcevo = {
- ["Poliwhirl"] = {"Poliwrath", "Politoed"},
- ["Gloom"] = {"Bellossom", "Vileplume"},
- ["Tyrogue"] = {"Hitmonchan", "Hitmontop", "Hitmonlee"}}
- local function doEvolveWild(cid)
- if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return true end
- local name = getCreatureName(cid)
- local evolution = "none"
- if spcevo[name] then
- evolution = spcevo[name][math.random(1, #spcevo[name])]
- elseif poevo[name] then
- evolution = poevo[name].evolution
- end
- local a = getPokemonStatus(name)
- if not a or evolution == "none" then return true end
- local pk = {}
- local players = getSpectators(getThingPos(cid), 7, 7)
- if players then
- for pp = 1, #players do
- local this = players[pp]
- if isCreature(this) and isPlayer(this) and (getCreatureTarget(this) == cid or getDamageMapPercent(this, cid) > 0) then
- doSendMagicEffect(getThingPos(this), 173)
- local expstring = cid.."expEx"
- pk[this] = getItemAttribute(getPlayerSlotItem(this, 8).uid, expstring)
- doItemSetAttribute(getPlayerSlotItem(this, 8).uid, expstring, 0)
- end
- end
- end
- local level = getPokemonLevel(cid)
- local pos = getThingPos(cid)
- local gender = getCreatureSkull(cid)
- local lifepercentage = 1 - ((getCreatureHealth(cid) * 1.3) / getCreatureMaxHealth(cid))
- local lookdir = getCreatureLookDir(cid)
- local status = {}
- status.offense = getOffense(cid) + a.off * 8
- status.defense = getDefense(cid) + a.def * 8
- status.agi = getSpeed(cid) + a.agi * 8
- status.spatk = getSpecialAttack(cid) + a.spatk * 8
- status.vit = getVitality(cid) + a.vit * 4
- doRemoveCreature(cid)
- local evo = doCreateMonster(evolution, pos)
- setWildPokemonLevel(evo, level, status)
- doCreatureSetLookDir(evo, lookdir)
- doCreatureSetSkullType(evo, gender)
- doCreatureAddHealth(evo, -getCreatureMaxHealth(evo) * lifepercentage)
- doSendMagicEffect(getThingPos(evo), 18)
- for attacker, experience in pairs (pk) do
- doWildAttackPlayer(evo, attacker)
- local expstring = evo.."expEx"
- local exp = experience or 0
- doItemSetAttribute(getPlayerSlotItem(attacker, 8).uid, expstring, exp)
- end
- sendFinishEvolutionEffect(evo, true)
- addEvent(sendFinishEvolutionEffect, 550, evo, true)
- addEvent(sendFinishEvolutionEffect, 1050, evo)
- end
- local races = {
- [4] = {cor = COLOR_FIRE2},
- [6] = {cor = COLOR_WATER},
- [7] = {cor = COLOR_NORMAL},
- [8] = {cor = COLOR_FIRE2},
- [9] = {cor = COLOR_FIGHTING},
- [10] = {cor = COLOR_FLYING},
- [11] = {cor = COLOR_GRASS},
- [12] = {cor = COLOR_POISON},
- [13] = {cor = COLOR_ELECTRIC},
- [14] = {cor = COLOR_GROUND},
- [15] = {cor = COLOR_PSYCHIC},
- [16] = {cor = COLOR_ROCK},
- [17] = {cor = COLOR_ICE},
- [18] = {cor = COLOR_BUG},
- [19] = {cor = COLOR_DRAGON},
- [20] = {cor = COLOR_GHOST},
- [21] = {cor = COLOR_STEEL},
- [22] = {cor = COLOR_DARK},
- [1] = {cor = 180},
- [2] = {cor = 180},
- [3] = {cor = 180},
- [5] = {cor = 180},
- }
- local damages = {MORTALGASDAMAGE, GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE, NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, SEISMICTOSSDAMAGE}
- local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
- local ignored = {NIGHTMAREDAMAGE, GUILLOTINEDAMAGE, MORTALGASDAMAGE, SEISMICTOSSDAMAGE, PSYCHOSHIFTDAMAGE, POISONEDDAMAGE, BURNEDDAMAGE}
- local ignoremiss = {NIGHTMAREDAMAGE, MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE}
- local ignorecritical = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}
- local cannotkill = {MORTALGASDAMAGE, BURNEDDAMAGE, POISONEDDAMAGE, NIGHTMAREDAMAGE}
- function onStatsChange(cid, attacker, type, combat, value)
- if combat == FLYSYSTEMDAMAGE then return false end
- if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
- local damageCombat = combat
- if damageCombat == THUNDERWAVEDAMAGE then
- damageCombat = ELECTRICDAMAGE
- elseif damageCombat == PSYCHOSHIFTDAMAGE then
- damageCombat = PSYCHICDAMAGE
- end
- if not isCreature(attacker) then --alterado v2.5 cid == attacker
- if not isInArray(fixdamages, combat) and combats[combat] then
- doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
- end
- return true
- end
- --------------------------------------------------
- if combat == SLEEP_POWDERDAMAGE then
- if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
- return false
- end
- if isPlayer(cid) and canAttackOther(attacker, cid) == "Cant" then
- return false
- end
- if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
- return false
- end
- if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then
- return false
- end
- if getPlayerStorageValue(cid, 21099) >= 1 then return false end
- local ret = {}
- ret.id = cid
- ret.cd = value
- ret.check = getPlayerStorageValue(cid, conds["Sleep"])
- ret.first = true --alterado v2.5
- ret.cond = "Sleep"
- doCondition2(ret)
- return false
- end
- --------------------------------------------------
- if combat == POISON_POWDERDAMAGE then
- if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then
- return false
- end
- if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then
- return false
- end
- if isSummon(cid) and isSummon(attacker) then
- if canAttackOther(cid, attacker) == "Cant" then
- return false
- end
- end
- local master = attacker
- if isSummon(attacker) then master = getCreatureMaster(attacker) end
- if getPlayerStorageValue(attacker, 21099) >= 1 then return false end
- local ret = {}
- ret.id = cid --alterado v1.5
- ret.cd = value
- ret.check = getPlayerStorageValue(cid, conds["Poison"])
- ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
- ret.cond = "Poison"
- doCondition2(ret)
- return false
- end
- --------------------------------------------------
- --------------------------------------------------
- if isPlayer(attacker) then
- local valor = value
- if valor > getCreatureHealth(cid) then
- valor = getCreatureHealth(cid)
- end
- if combat == COMBAT_PHYSICALDAMAGE then
- return false
- end
- if combat == PHYSICALDAMAGE then
- doSendMagicEffect(getThingPos(cid), 3)
- doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
- end
- if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
- doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
- end
- if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
- doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
- end
- return true
- end
- --------------------------------------------------
- if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
- return false
- end
- --------------------------------------------------
- if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then
- if isSummon(attacker) or isPlayer(attacker) then
- if canAttackOther(cid, attacker) == "Cant" then return false end
- end
- local valor = 0
- if combat == COMBAT_PHYSICALDAMAGE then
- valor = getOffense(attacker)
- else
- valor = getSpecialAttack(attacker)
- end
- valor = valor * playerDamageReduction
- valor = valor * math.random(83, 117) / 100
- if valor >= getCreatureHealth(cid) then
- valor = getCreatureHealth(cid)
- end
- valor = math.floor(valor)
- if valor >= getCreatureHealth(cid) then
- if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
- setPlayerStorageValue(cid, 6598754, -1)
- setPlayerStorageValue(cid, 6598755, -1)
- doRemoveCondition(cid, CONDITION_OUTFIT)
- end
- if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
- doRemoveCondition(cid, CONDITION_OUTFIT)
- setPlayerStorageValue(cid, 17000, 0)
- setPlayerStorageValue(cid, 17001, 0)
- setPlayerStorageValue(cid, 63215, -1)
- doChangeSpeed(cid, PlayerSpeed)
- local item = getPlayerSlotItem(cid, 8)
- local btype = getPokeballType(item.itemid)
- if #getCreatureSummons(cid) <= 0 then
- if isInArray(pokeballs[btype].all, item.itemid) then
- doTransformItem(item.uid, pokeballs[btype].off)
- doItemSetAttribute(item.uid, "hp", 0)
- end
- end
- end
- ------------Edited Golden Arena------------------
- if getPlayerStorageValue(cid, 22545) == 1 then
- if getGlobalStorageValue(22550) == 1 then
- doPlayerSendTextMessage(cid, 20, "You are the last survivor of the golden arena! Take your reward!")
- doPlayerAddItem(cid, 2152, 100) --premio
- setPlayerStorageValue(cid, 22545, -1)
- doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false) --alterado v2.4
- setGlobalStorageValue(22550, -1)
- doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
- valor = 0
- else
- setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
- setPlayerStorageValue(cid, 22545, -1)
- doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false) --alterado v2.4
- doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
- valor = 0
- end
- end
- -------------------------------------------
- end
- doCreatureAddHealth(cid, -valor, 3, 180)
- if not isPlayer(cid) then
- addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
- end
- return false
- end
- --------------------------------------------------
- if type == STATSCHANGE_HEALTHGAIN then
- if cid == attacker then
- return true
- end
- if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then
- return false
- end
- return true
- end
- --------------------------------------------------
- if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
- if isPlayer(cid) then
- return false
- end
- if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
- return false
- end
- end
- --------------------------------------------------
- if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
- if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
- return false
- end
- end
- --------------------------------------------------
- if ehMonstro(cid) and ehMonstro(attacker) then
- return false --edited monstro nao atacar monstro
- end
- ---------------------------------------------------
- local multiplier = 1
- --local miss = 10 ---(getSpeed(cid) - getSpeed(attacker)) * 0.26
- poketype1 = pokes[getCreatureName(cid)].type
- poketype2 = pokes[getCreatureName(cid)].type2
- if getCreatureCondition(cid, CONDITION_INVISIBLE) then
- return false
- end
- if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
- if isInArray(effectiveness[damageCombat].super, poketype1) then
- multiplier = multiplier + 0.5
- end
- if isInArray(effectiveness[damageCombat].super, poketype2) then
- multiplier = multiplier + 0.5
- end
- if isInArray(effectiveness[damageCombat].weak, poketype1) then
- multiplier = multiplier - 0.25 --alterado v2.3 efetividade q nem na pxg...
- end
- if isInArray(effectiveness[damageCombat].weak, poketype2) then
- multiplier = multiplier - 0.25
- end
- if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
- if isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --alterado v2.5
- multiplier = 0.5
- elseif getPlayerStorageValue(attacker, 999457) >= 1 then --alterado v2.5 dark eye/miracle eye, ainda vo refazer isso...
- multiplier = 0.5
- end
- end
- elseif combat == COMBAT_PHYSICALDAMAGE then
- if isGhostPokemon(cid) then --alterado v2.3
- if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --alterado v2.5
- doSendMagicEffect(getThingPos(cid), 3)
- return false
- end
- end
- local cd = getPlayerStorageValue(attacker, conds["Miss"])
- local cd2 = getPlayerStorageValue(attacker, conds["Confusion"]) --alterado v2.5
- local cd3 = getPlayerStorageValue(attacker, conds["Stun"])
- if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
- if math.random(1, 100) > 50 then --50% chance de da miss no atk fisico
- doSendMagicEffect(getThingPos(cid), 211)
- doSendAnimatedText(getThingPos(attacker), "MISS", 215)
- return false
- end
- end
- end
- --------------------------------------------------
- local valor = value
- if multiplier == 1.5 then
- multiplier = 1.75
- elseif multiplier == 1.25 then --alterado v2.3 efetividade q nem a pxg
- multiplier = 1
- end
- --------------------------------------------------
- if isSummon(cid) and isSummon(attacker) then
- if getCreatureMaster(cid) == getCreatureMaster(attacker) then
- return false
- end
- if canAttackOther(cid, attacker) == "Cant" then
- return false
- end
- end
- local randomRange = math.random(83, 117) / 100
- local block = 1
- if not isPlayer(cid) then
- if combat == COMBAT_PHYSICALDAMAGE then
- block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))
- if getPokemonGender(attacker) == SEX_MALE then
- block = block + 0.2
- end
- if getPokemonGender(cid) == SEX_FEMALE then
- block = block - 0.2
- end
- valor = getOffense(attacker) * block
- if isInArray(specialabilities["counter"], getCreatureName(cid)) then
- if math.random(1, 100) <= 10 then
- doCreatureAddHealth(attacker, -valor, 3, 180) --alterado v2.5
- valor = 0
- doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
- end
- end
- else
- block = 1 - (getDefense(cid) / (getSpecialAttack(attacker) + getDefense(cid)))
- valor = valor * block * generalSpecialAttackReduction
- if isSummon(cid) then
- valor = valor * summonSpecialDamageReduction - getPokemonLevel(cid) / 2
- end
- end
- end
- valor = valor * multiplier
- valor = valor * randomRange
- if isSummon(attacker) then
- valor = valor * getHappinessRate(attacker)
- else
- valor = valor * summonReduction
- end
- valor = math.floor(valor)
- if combat == BURNEDDAMAGE then
- valor = value * getResistance(cid, FIREDAMAGE)
- elseif combat == POISONEDDAMAGE then
- valor = value * getResistance(cid, POISONDAMAGE)
- end
- if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then
- doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)
- valor = valor * 2
- end
- -------------------------Edited CLAN SYSTEM-----------------------------------
- if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
- valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")
- elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then --alterado v2.3
- valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
- end
- -----------------------------------------------------------------------
- ---------------------- Edited Proteção --------------------------------
- if valor <= 10 then
- valor = math.random(15, 25)
- end
- -----------------------------------------------------------------------
- ---------------------- FEAR / ROAR ------------------------------------
- if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then --alterado v2.5!!
- return true
- end
- ---------------------------------------------------------------------------
- if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
- if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
- if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) and getPlayerStorageValue(attacker, 999457) <= 0 then
- valor = valor * 0 --alterado v2.5
- end
- end
- end
- if damageCombat == GROUNDDAMAGE then
- if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
- valor = 0 --alterado v2.5
- end
- end
- -----------------------------------------------------------------------------
- local p = getThingPos(cid) --poke na pos backup
- if p.x == 1 and p.y == 1 and p.z == 10 then
- return false --alterado v2.2
- end
- if getPlayerStorageValue(cid, 9658783) == 1 then
- return false --alterado v2.4 -- skill camuflage/future sight/acid armor e afins
- end
- -----------------------------------------------------------------------------
- if valor >= getCreatureHealth(cid) then
- if isInArray(cannotKill, combat) and isPlayer(cid) then
- valor = getCreatureHealth(cid) - 1
- else
- valor = getCreatureHealth(cid)
- end
- end
- valor = math.floor(valor) --alterado v2.5
- --------------------------------------------
- --------------Passiva Lifesteal Clobat------------
- if combat == COMBAT_PHYSICALDAMAGE then
- if getCreatureName(attacker) == "Crobat" then --alterado v2.4
- doCreatureAddHealth(attacker, math.floor(valor))
- doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)
- end
- end
- --------------------------------------------
- if isSummon(attacker) and not isSummon(cid) and not isPlayer(cid) then
- local expstring = cid.."expEx"
- if getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring) == null then
- doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring, 0)
- end
- local exp = valor / getCreatureMaxHealth(cid)
- local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8).uid
- doItemSetAttribute(ball, expstring, getItemAttribute(ball, expstring) + exp)
- if getItemAttribute(ball, expstring) > 1 then
- doItemSetAttribute(ball, expstring, 1)
- end
- end
- if isSummon(attacker) then
- if combat == COMBAT_PHYSICALDAMAGE then
- doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
- else
- doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255)
- end
- if not isSummon(cid) and not isPlayer(cid) and math.random(1, wildEvolveChance) == math.random(1, wildEvolveChance) then
- addEvent(doEvolveWild, math.random(1, 2500), cid)
- end
- else
- if combat ~= COMBAT_PHYSICALDAMAGE then
- doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
- else
- doCreatureAddHealth(cid, -math.abs(valor), 3, races[getMonsterInfo(getCreatureName(cid)).race].cor)
- end
- if isSummon(cid) then
- addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
- end
- end
- if damageCombat == FIREDAMAGE and not isBurning(cid) then
- local ret = {}
- ret.id = cid
- ret.cd = math.random(5, 12) --alterado v2.5
- ret.check = getPlayerStorageValue(cid, conds["Burn"])
- ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
- ret.cond = "Burn"
- doCondition2(ret)
- elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
- local ret = {}
- ret.id = cid
- ret.cd = math.random(6, 15) --alterado v2.5
- ret.check = getPlayerStorageValue(cid, conds["Poison"])
- local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
- ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
- ret.cond = "Poison"
- doCondition2(ret)
- end
- ------------------------------------POTIONS-------------------------------------------
- if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
- if getPlayerStorageValue(cid, 173) >= 1 then
- if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
- setPlayerStorageValue(cid, 174, 1)
- doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
- end
- end
- end
- ----------------------------------------PASSIVAS-----------------------------------------
- ------------------------------"Counter Helix" - "Giro Ball"------------------------------ alterado v2.5 \/ formula de dano de quase todas as passivas!!
- -- [nome] = {out = outfit girando, efeitos}
- local OutFit = {
- ["Scyther"] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --scyther
- ["Scizor"] = {out = 918, cima = 236, direita = 232, esquerda = 224, baixo = 233}, --Scizor
- ["Shiny Scyther"] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther
- ["Hitmontop"] = {out = 1193, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --Hitmontop
- ["Shiny Hitmontop"] = {out = 1451, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --Shiny Hitmontop --alterado v2.4
- ["Pineco"] = {out = 1194, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --pineco
- ["Forretress"] = {out = 1192, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --Forretress
- } --alterado v2.5 tabela agora ta por nomes
- if OutFit[getCreatureName(cid)] then --alterado v2.5
- local nome1 = getCreatureName(cid)
- local chance = (nome1 == "Hitmontop" or nome1 == "Shiny Hitmontop") and (16 + getPlayerStorageValue(cid, 465987)) or 15 --alterado v2.4
- if math.random(1, 100) <= chance then
- if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
- return false
- end
- local outfitt = OutFit[nome1] --alterado v2.5
- local min = (getSpecialAttack(cid)*25)*0.1
- local max = min + getPokemonLevel(cid) --alterado v2.5
- local function damage(cid, min, max)
- if isCreature(cid) then
- if isInArray({"Scyther", "Shiny Scyther"}, nome1) then --alterado v2.5
- doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), scyther5, -min, -max, CONST_ME_NONE)
- elseif isInArray({"Hitmontop", "Shiny Hitmontop"}, nome1) then --alterado v2.5
- doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), scyther5, -min, -max, CONST_ME_NONE)
- else
- doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), scyther5, -min, -max, CONST_ME_NONE)
- end
- doAreaCombatHealth(cid, null, getThingPos(cid), scythe1, 0, 0, outfitt.cima) --cima
- doAreaCombatHealth(cid, null, getThingPos(cid), scythe2, 0, 0, outfitt.baixo) --baixo
- doAreaCombatHealth(cid, null, getThingPos(cid), scythe3, 0, 0, outfitt.direita) --direita
- doAreaCombatHealth(cid, null, getThingPos(cid), scythe4, 0, 0, outfitt.esquerda) --esquerda
- end
- end
- setPlayerStorageValue(cid, 32623, 1) --proteçao
- doSetCreatureOutfit(cid, {lookType = outfitt.out}, -1)
- local function doChangeO(cid)
- if not isCreature(cid) then return true end
- setPlayerStorageValue(cid, 32623, 0) --proteçao
- if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then
- doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
- else
- doRemoveCondition(cid, CONDITION_OUTFIT)
- end
- end
- local delay = 200 -- não mexe
- for i = 1, 2 do
- addEvent(damage, delay*i, cid, min, max)
- end
- addEvent(doChangeO, 2 * 300 + 10, cid)
- end
- end
- -------------------------------------------Lava Counter / Electricity-------------------------------------
- local Fire_Thunder = {"Magmar", "Shiny Magmar", "Electabuzz", "Shiny Electabuzz", "Magby", "Elekid"}
- --["Nome"] = {effeito, damage}
- local eff = {
- ["Magmar"] = {15, FIREDAMAGE, 1461}, --alterado v2.5
- ["Magby"] = {15, FIREDAMAGE},
- ["Electabuzz"] = {207, ELECTRICDAMAGE, 1462},
- ["Shiny Electabuzz"] = {207, ELECTRICDAMAGE, 1460},
- ["Elekid"] = {207, ELECTRICDAMAGE},
- }
- if isInArray(Fire_Thunder, getCreatureName(cid)) and math.random(1, 100) <= 15 then
- if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
- return false
- end
- local min = (getSpecialAttack(cid)*10)*0.1 --alterado v2.5
- local max = min + getPokemonLevel(cid)
- local function sendFireEff(cid, dir, eff, damage)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, damage, getPosByDir(getThingPosWithDebug(cid), dir), 0, -min, -max, eff)
- end
- local function doSpinFire(cid)
- if not isCreature(cid) then return true end
- local t = {
- [1] = SOUTH,
- [2] = SOUTHEAST,
- [3] = EAST,
- [4] = NORTHEAST,
- [5] = NORTH,
- [6] = NORTHWEST,
- [7] = WEST,
- [8] = SOUTHWEST,
- } --alterado v2.5
- for a = 1, 8 do
- addEvent(sendFireEff, a * 140, cid, t[a], eff[getCreatureName(cid)][1], eff[getCreatureName(cid)][2])
- end
- addEvent(setPlayerStorageValue, 8*140, cid, 32623, 0) --proteçao
- end
- local out = eff[getCreatureName(cid)][3]
- if out then --alterado v2.5
- doSetCreatureOutfit(cid, {lookType = out}, 8*140)
- end
- setPlayerStorageValue(cid, 32623, 1) --proteçao
- doSpinFire(cid)
- end
- ---------------------------------------------Demon Kicker----------------------------------
- --[outfit] = outfit chutando,
- local hitmonlees = {
- ["Hitmonlee"] = 652, --hitmonlee --alterado v2.5, tabela por nome agora
- ["Shiny Hitmonlee"] = 878, --shiny hitmonlee
- }
- --alterado v2.5
- if isInArray({"Hitmonlee", "Shiny Hitmonlee"}, getCreatureName(cid)) and isCreature(getMasterTarget(cid)) then
- if math.random(1, 100) <= (21 + getPlayerStorageValue(cid, 465987)) then
- local nome = getCreatureName(cid) --alterado v1.5
- if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then
- return false
- end
- if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a passiva 2x seguidas...
- return false
- end
- local function doChangeHitmon(cid)
- if not isCreature(cid) then return true end
- setPlayerStorageValue(cid, 32623, 0) --proteçao
- if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then
- doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
- else
- doRemoveCondition(cid, CONDITION_OUTFIT)
- end
- end
- local min = (getOffense(cid)*45)*0.1 --alterado v2.5
- local max = min + getPokemonLevel(cid)
- setPlayerStorageValue(cid, 32623, 1) --proteçao
- doSetCreatureOutfit(cid, {lookType = hitmonlees[nome]}, -1) --alterado v2.5
- doTargetCombatHealth(cid, getMasterTarget(cid), FIGHTINGDAMAGE, -min, -max, 255)
- addEvent(doChangeHitmon, 700, cid)
- end
- end
- -------------------------------------------Demon Puncher-------------------------------------
- --alterado v2.5
- if isInArray({"Hitmonchan", "Shiny Hitmonchan"}, getCreatureName(cid)) and isCreature(getMasterTarget(cid)) then
- if math.random(1, 100) <= (21 + getPlayerStorageValue(cid, 465987)) then
- if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then
- return false
- end
- local name = getCreatureName(cid)
- local min = (getOffense(cid)*45)*0.1 --alterado v1.5
- local max = min + getPokemonLevel(cid)
- if ehMonstro(cid) then
- hands = 0
- else
- hands = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "hands")
- end
- doSendDistanceShoot(getThingPos(cid), getThingPos(getMasterTarget(cid)), 39)
- doTargetCombatHealth(cid, getMasterTarget(cid), hitmonchans[name][hands].type, -min, -max, 255)
- local target = getThingPos(getMasterTarget(cid))
- target.x = target.x + 1
- if hands == 4 then
- doSendMagicEffect(target, hitmonchans[name][hands].eff)
- else
- doSendMagicEffect(getThingPos(getMasterTarget(cid)), hitmonchans[getCreatureName(cid)][hands].eff)
- end
- end
- end
- ---------------------------------------Stunning Confusion------------------------------------------
- local ducks = {"Golduck", "Psyduck"} --alterado v1.5
- if isInArray(ducks, getCreatureName(cid)) and math.random(1, 100) <= 20 then
- if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 2x seguidas...
- return false
- end
- local min = (getSpecialAttack(cid)*10)*0.1 --alterado v2.5
- local max = min + getPokemonLevel(cid)
- local function damage(cid)
- if isCreature(cid) then
- doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPosWithDebug(cid), bombWee3, -min, -max, 136)
- end
- end
- setPlayerStorageValue(cid, 32623, 1) --proteçao
- for i = 1, 7 do
- addEvent(damage, i*500, cid)
- end
- addEvent(setPlayerStorageValue, 3500, cid, 32623, 0) --proteçao
- end
- -----------------------------------------Groundshock-----------------------------------
- --alterado v2.5
- if getCreatureName(cid) == "Kangaskhan" and math.random(1, 100) <= 20 then
- local min = (getSpecialAttack(cid)*40)*0.1 --alterado v2.5
- local max = min + getPokemonLevel(cid)
- doAreaCombatHealth(cid, NORMALDAMAGE, getThingPos(cid), scyther5, -min, -max, 255)
- local sps = getThingPos(cid)
- sps.x = sps.x+1
- sps.y = sps.y+1
- doSendMagicEffect(sps, 127)
- end
- --------------------------------------Electric Charge---------------------------------------------------
- local charge = {"Pikachu", "Raichu", "Shiny Raichu"} --alterado v2.5
- if isInArray(charge, getCreatureName(cid)) and math.random(1, 100) <= 15 then
- if getPlayerStorageValue(cid, 253) >= 1 then
- return true
- end
- setPlayerStorageValue(cid, 253, 1)
- doSendMagicEffect(getThingPos(cid), 207)
- doSendAnimatedText(getThingPos(cid), "FOCUS", 144)
- end
- -------------------------------------Melody------------------------------------
- if getCreatureName(cid) == "Wigglytuff" and math.random(1, 100) <= 10 then --alterado v1.5
- doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPos(cid), powders, -6, -10, 33)
- end
- ------------------------------------- Dragon Fury / Fury ---------------------------------------
- local DracoFury = {"Persian", "Gyarados", "Shiny Gyarados", "Dratini", "Shiny Dratini", "Dragonair", "Shiny Dragonair", "Dragonite", "Shiny Dragonite"}
- --alterado v2.5
- if isInArray(DracoFury, getCreatureName(cid)) and math.random(1, 100) <= 10 then
- if getPlayerStorageValue(cid, 32623) == 1 then
- return false
- end
- setPlayerStorageValue(cid, 32623, 1)
- if getCreatureName(cid) == "Persian" then
- doRaiseStatus(cid, 2, 0, 0, 10)
- else --alterado v2.5
- doRaiseStatus(cid, 2, 2, 0, 10)
- end
- for t = 1, 7 do --alterado v2.5
- addEvent(sendMoveEffect, t*1500, cid, 12)
- end
- addEvent(setPlayerStorageValue, 10000, cid, 32623, 0)--alterado v2.5
- end
- ------------------------------------- Mega Drain ---------------------------------------
- local mega = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela"}
- --alterado v2.5
- if isInArray(mega, getCreatureName(cid)) and math.random(1, 100) <= 10 then
- local min = (getSpecialAttack(cid)*20)*0.1 --alterado v2.5
- local max = min + getPokemonLevel(cid)
- local uid = checkAreaUid(getThingPos(cid), check, 1, 1)
- for _,pid in pairs(uid) do
- if isCreature(cid) and isCreature(pid) and pid ~= cid then
- if isPlayer(pid) and #getCreatureSummons(pid) >= 1 then return false end
- local life = getCreatureHealth(pid)
- doAreaCombatHealth(cid, GRASSDAMAGE, getThingPos(pid), 0, -min, -max, 14)
- local newlife = life - getCreatureHealth(pid)
- doSendMagicEffect(getThingPos(cid), 14)
- if newlife >= 1 then
- doCreatureAddHealth(cid, newlife)
- doSendAnimatedText(getThingPos(cid), "+"..newlife.."", 32)
- end
- end
- end
- end
- ------------------------------------- Spores Reaction ---------------------------------------
- local spores = {"Oddish", "Gloom", "Vileplume", "Shiny Vileplume"} --alterado v2.5
- if isInArray(spores, getCreatureName(cid)) and math.random(1, 100) <= 10 then
- local random = math.random(1, 3)
- if random == 1 then
- doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPos(cid), powders, -2, -3, 27)
- elseif random == 2 then
- local ret = {}
- ret.id = 0
- ret.cd = 9
- ret.eff = 0
- ret.check = 0 --alterado v2.5
- ret.spell = "none"
- ret.cond = "Stun"
- doMoveInArea2(cid, 85, confusion, GRASSDAMAGE, 0, 0, spell, ret)
- else
- doAreaCombatHealth(cid, POISON_POWDERDAMAGE, getThingPos(cid), powders, 6, 12, 84)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement