Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

@Slicer

Cara ficando dando esse erro no console constante:

 

[02/09/2012 10:48:09] [Error - CreatureScript Interface]

[02/09/2012 10:48:09] data/creaturescripts/scripts/exp2.0.lua:onStatsChange

[02/09/2012 10:48:09] Description:

[02/09/2012 10:48:09] data/creaturescripts/scripts/exp2.0.lua:341: attempt to perform arithmetic on a nil value

[02/09/2012 10:48:09] stack traceback:

[02/09/2012 10:48:09] data/creaturescripts/scripts/exp2.0.lua:341: in function <data/creaturescripts/scripts/exp2.0.lua:72>

 

 

 

sabe como concertar ? ;x vlw.

Link para o comentário
Compartilhar em outros sites

@Slicer

exp2.0

 

--NIGHTMAREDAMAGE

--GUILLOTINEDAMAGE

--SEISMICTOSSDAMAGE

--PSYCHOSHIFTDAMAGE

--THUNDERWAVEDAMAGE

 

local combats = {

[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},

[GRASSDAMAGE] = {cor = COLOR_GRASS},

[POISONEDDAMAGE] = {cor = COLOR_GRASS},

[MORTALGASDAMAGE] = {cor = COLOR_POISON},

[FIREDAMAGE] = {cor = COLOR_FIRE2},

[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 v1.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 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

 

if not isCreature(attacker) then --alterado v1.5 cid == attacker

if not isInArray(fixdamages, combat) and combats[combat] then

doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)

end

return true

end

 

local damageCombat = combat

--------------------------------------------------

if combat == SLEEP_POWDERDAMAGE then

if ehMonstro(cid) and ehMonstro(attacker) then

return false

end

if canAttackOther(cid, attacker) == "Cant" then

return false

end

if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker 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

ret.cond = "Sleep"

 

doCondition2(ret)

return false

end

--------------------------------------------------

if combat == POISON_POWDERDAMAGE then

if ehMonstro(cid) and ehMonstro(attacker) then

return false

end

if isNpcSummon(cid) and getCreatureTarget(cid) ~= attacker then

return false

end

if canAttackOther(cid, attacker) == "Cant" then

return false

end

if getPlayerStorageValue(attacker, 21099) >= 1 then return false end

 

local ret = {}

ret.id = cid

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 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 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, 2160, 5) --premio

setPlayerStorageValue(cid, 22545, -1)

doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false) --alterado v1.4

setGlobalStorageValue(22550, -1)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

return true

else

setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)

setPlayerStorageValue(cid, 22545, -1)

doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false) --alterado v1.4

doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

return true

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 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

 

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 --Edited effetivenes = pxg... ;p

multiplier = multiplier - 0.25

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 v1.5

multiplier = 0.5

elseif getPlayerStorageValue(attacker, 999457) >= 1 then --alterado v1.5

multiplier = 0.5

end

end

elseif combat == COMBAT_PHYSICALDAMAGE then

if isGhostPokemon(cid) then --alterado v1.3

 

if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --passiva Foresight!!

doSendMagicEffect(getThingPos(cid), 3)

return false

end

end

local cd = getPlayerStorageValue(attacker, conds["Miss"])

local cd2 = getPlayerStorageValue(attacker, conds["Confusion"])

local cd3 = getPlayerStorageValue(attacker, conds["Stun"])

if cd >= 0 or cd2 >= 0 or cd3 >= 0 then

if math.random(1, 100) > 50 then --Edited miss system -- 50% chance de da miss no atk fisico

doSendMagicEffect(getThingPos(cid), 211)

doSendAnimatedText(getThingPos(attacker), "MISS", 215) --alterado v1.5

return false

end

end

end

--------------------------------------------------

local valor = value

 

if multiplier == 1.5 then

multiplier = 1.75

elseif multiplier == 1.25 then --edited effetivines = 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

 

valor = valor * multiplier

 

if isSummon(attacker) then

valor = valor * getHappinessRate(attacker)

else

valor = valor * summonReduction

end

 

valor = math.floor(valor)

 

if combat == COMBAT_PHYSICALDAMAGE then

block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))

valor = getOffense(attacker) * block

 

if isInArray(specialabilities["counter"], getCreatureName(cid)) then

if math.random(1, 100) <= 10 then

doCreatureAddHealth(attacker, -valor, 3, 180) --alterado v1.5

valor = 0

doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)

end

end

 

else

valor = valor / getDefense(cid)

end

 

-------------------------Edited CLAN SYSTEM-----------------------------------

if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then

valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk") --alterado v1.3

elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then

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) --alterado v1.5

end

------------------------]]-----------------------------------------------

---------------------- FEAR / ROAR ------------------------------------

if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then --alterado!!

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 v1.5

end

end

end

 

if damageCombat == GROUNDDAMAGE then

if isInArray(specialabilities["levitate"], getCreatureName(cid)) then

valor = 0 --alterado v1.5

end

end

-----------------------------------------------------------------------------

local p = getThingPos(cid)

if p.x == 1 and p.y == 1 and p.z == 10 then

return false

end

 

if getPlayerStorageValue(cid, 9658783) == 1 then

return false --imune

end

-----------------------------------------------------------------------------

if valor >= getCreatureHealth(cid) then

if isInArray(cannotKill, combat) and isPlayer(cid) then

valor = getCreatureHealth(cid) - 1

else

valor = getCreatureHealth(cid)

end

end

--------------------------------------------

--------------Passiva Lifesteal Clobat------------

if combat == COMBAT_PHYSICALDAMAGE then

if getCreatureName(attacker) == "Crobat" then --alterado v1.4

doCreatureAddHealth(attacker, math.floor(valor))

doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)

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

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) and valor ~= 0 then

valor = math.floor(valor)

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)

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)

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

--[[---------------CD BAR-----------------------

if isSummon(cid) then

doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread")

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 v1.5 \/ formula de dano de quase todas as passivas!!

-- [outfit normal] = {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 v1.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

}

 

if OutFit[getCreatureName(cid)] then

local nome1 = getCreatureName(cid)

local chance = (nome1 == "Hitmontop" or nome1 == "Shiny Hitmontop") and (16 + getPlayerStorageValue(cid, 465987)) or 15 --alterado v1.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]

 

local min = (getSpecialAttack(cid)*55)*0.1

local max = min + getPokemonLevel(cid) --alterado v1.5

 

local function damage(cid, min, max)

if isCreature(cid) then

if isInArray({"Scyther", "Shiny Scyther"}, nome1) then

doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), scyther5, -min, -max, CONST_ME_NONE)

elseif isInArray({"Hitmontop", "Shiny Hitmontop"}, nome1) then

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)

doSetCreatureOutfit(cid, {lookType = outfitt.out}, -1)

 

 

local function doChangeO(cid)

if not isCreature(cid) then return true end

setPlayerStorageValue(cid, 32623, 0)

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", "Electabuzz", "Shiny Electabuzz", "Magby", "Elekid"}

 

--["Nome"] = {effeito, damage}

local eff = {

["Magmar"] = {5, FIREDAMAGE, 1461},

["Magby"] = {5, FIREDAMAGE}, --alterado v1.5

["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)*15)*0.1

local max = min + getPokemonLevel(cid)

 

local function sendFireEff(cid, dir, eff, damage)

if not isCreature(cid) then return true end

doAreaCombatHealth(cid, damage, getPosByDir(getThingPos(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,

}

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

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

["Shiny Hitmonlee"] = 878, --shiny hitmonlee

}

 

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)

 

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

local max = min + getPokemonLevel(cid)

 

 

setPlayerStorageValue(cid, 32623, 1) --proteçao

 

doSetCreatureOutfit(cid, {lookType = hitmonlees[nome]}, -1)

doTargetCombatHealth(cid, getMasterTarget(cid), FIGHTINGDAMAGE, -min, -max, 255)

 

addEvent(doChangeHitmon, 700, cid)

end

end

-------------------------------------------Demon Puncher-------------------------------------

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

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[name][hands].eff)

end

end

end

---------------------------------------Stunning Confusion------------------------------------------

local ducks = {"Golduck", "Psyduck"}

 

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

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-----------------------------------

if getCreatureName(cid) == "Kangaskhan" and math.random(1, 100) <= 20 then

 

local min = (getSpecialAttack(cid)*40)*0.1

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"}

 

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

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"}

 

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 v1.5

doRaiseStatus(cid, 2, 2, 0, 10)

end

 

for t = 1, 7 do --alterado v1.5

addEvent(sendMoveEffect, t*1500, cid, 12)

end

addEvent(setPlayerStorageValue, 10000, cid, 32623, 0) --alterado v1.5

end

------------------------------------- Mega Drain ---------------------------------------

local mega = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Vileplume", "Shiny Tangela"}

 

if isInArray(mega, getCreatureName(cid)) and math.random(1, 100) <= 10 then

 

local min = (getSpecialAttack(cid)*20)*0.1

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"}

 

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) --2 3

elseif random == 2 then

local ret = {}

ret.id = 0

ret.cd = 6

ret.eff = 0

ret.check = 0

ret.spell = "none"

ret.cond = "Stun"

 

doMoveInArea2(cid, 85, confusion, GRASSDAMAGE, 0, 0, spell, ret)

else

doAreaCombatHealth(cid, POISON_POWDERDAMAGE, getThingPos(cid), powders, 6, 10, 84)

end

end

------------------------------------ Passiva Amnesia ---------------------------------------- daki pra baixo foi alterado v1.4 \/

local amnesia = {"Wooper", "Quagsire", "Swinub", "Piloswine"}

 

if isInArray(amnesia, getCreatureName(cid)) and math.random(1, 100) <= 10 then

doCreatureSay(cid, "????", 20) --a espera do efeito certo.. kk

doSendMagicEffect(getThingPos(cid), 132)

setPlayerStorageValue(cid, 253, 1)

end

 

----------------------------------- Passiva Zen Mind -----------------------------------------

 

if getCreatureName(cid) == "Slowking" and math.random(1, 100) <= 10 and isWithCondition(cid) then

function doCure(cid)

if not isCreature(cid) then return true end

if isSummon(cid) then

doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")

end

doCureStatus(cid, "all")

end

 

addEvent(doCure, 1000, cid)

doSetCreatureOutfit(cid, {lookType = 1001}, 2000)

end

 

---------------------------------- Passiva Mirror Coat ---------------------------------------

 

if getCreatureName(cid) == "Wobbuffet" and math.random(1, 100) <= 10 then

if getPlayerStorageValue(cid, 21099) <= 0 then

setPlayerStorageValue(cid, 21099, 1)

doSetCreatureOutfit(cid, {lookType = 1447}, -1)

end

end

 

--------------------------------- Passiva Illusion -----------------------------------------

--Talvez na proxima atualizaçao kkk passiva tensa...

 

 

 

return false

end

 

Editado por Wiisht
Link para o comentário
Compartilhar em outros sites

@Wiisht

estranhu mano... pelo q intendi o erro ta dizendo q algum poke ae n tem offense ou defense.. ;x tenta esperar a atualizaçao pra ver... ;x

 

@maguito

nao n vai ter ainda.. ;x

Link para o comentário
Compartilhar em outros sites

Quando a pessoa cria um novo char ele ganha os itens referentes a bag, vara de pescar, order, dex e etc... Estou certo? Existe a possibilidade de colocar a bag no local do coins e a coins no local da bag igua ao do pxg?

Link para o comentário
Compartilhar em outros sites

@Slicer

Estava testando bugs possiveis no ot e descobri que voce esqueceu de por isso no somefunctions.lua

 

 

if #getCreatureSummons(cid) > 1 then

BackTeam(cid, getCreatureSummons(cid))

end

 

cooldown bar quando voce da team slice e muda de pokemon buga :|

Link para o comentário
Compartilhar em outros sites

@PkNfan

LOL LOL LOL LOL como q eu nunca vi isso? LOL uahuah vlw ae ms.. kkk

 

@pedrowarlock

oia.. da... ate da... mais muitos scripts estao programados para verificar a bag no slot 3... entao se tu mudar de lugar tera q achar TODOS os scripts q fazem essa verificaçao e trocar para o novo slot... isso vai da um trampo lgl e tb tem muitaaaaaa change de bugar geral... ;x

anyway, o script q da os itens iniciais eh o data/mods/firstitems.xml... good luck ae... ;x

 

 

 

@EDIT

como prometido postei o atualizaçao 1.6/2.6!

como essa vai ser a ultima atualizaçao por um bom tempo, postei a versao 1.6/2.6 full tb para ajudar quem começar a usar meu serv agora

minhas aulas começam amanha, entao vo passar menos tempo olhando o forum, mas ainda ajudarei noq puder, e caso apareça algum bug novo e importante eu postarei algum patch de correçao tb...

espero q gostem dos novos sistemas e q continuem a reportar bugs! ^^

--nao esqueçam de olhar o change log!!

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

Verdade mano, tava com um poke teste aqui.

Você não colocou o melee pela fórmula do lvl ? Fica feio todos batendo igual.

Não sabia que dava pra fazer aquele channel. FIcou perfeito pra duel. Agora mais pra frente da pra finalizar o duel system.(daqui uns 6 meses ..rsrs)

Reflect até agora 100 %.

Sò achei um problema sério, to começando a tomar debug do nada.

E como eu faço pra quando meu poke tomar hypnose aparecer o looktytpe atual dele, e não o corpse ou o looktype do xml.

 

@Edit

Aparentemente o debug é causado pro causa do duel system. Se eu to vendo 2 pessoas duelar, quando ela perde eu tomo debug o.O

Editado por Maguito
Link para o comentário
Compartilhar em outros sites

@Maguito

n coloquei o melee la pq como flei se por pra dividir pela def do cid o atk melee ficaria entre 10~80.. ;x

creditos do channel pro lucas, criador do topico ^^

sobre o duel, eh tava pensando em depois tirar o duel por Party, para deixar o sistema de party, caçar em grupo, certo.. e dai deixar o duel soh pelo PVP em time e o duel ms... e para fazer o duel em time ja seria mais complicadin.. hehe

sobre o debug n sei oq flar.. ;x nenhum erro no console nem nd? pode ser problemas no mapa sei la..

teria q editar bastante coisa... ;x

 

edit

pegase o novo client? inclusive o .pic? pq eu tive q colocar o "desenho" da pokeball e do '?' nas skulls q tavam sobrando...

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...