Ir para conteúdo

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


lucashgas

Posts Recomendados

dando uma mao ae

digodigo2

 

gugaevt

 

o coloka na pasta data/action/script

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local addons = {

[7446] = {pokemon= "Scyther" , looktype = 912},

}

 

if #getCreatureSummons(cid) > 0 then

doPlayerSendCancel(cid, "Please back your pokemon.")

return false

end

local numero = addons[item.itemid].looktype

 

local pb = getPlayerSlotItem(cid, 8).uid

local pk = addons[item.itemid].pokemon

 

if getItemAttribute(pb,"poke") ~= pk then

doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")

return false

end

 

if getItemAttribute(pb,"addon") < 1 then

doRemoveItem(item.uid, 1)

doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")

doSetItemAttribute(pb,"addon",numero)

return true

end

 

return true

end

 

Tirando Duvida agora

 

local addons = {

[7446] = {pokemon= "Scyther" , looktype = 912},

}

 

eu acho onde está "[7446]=é o id do addon, explicando ID que voce terá que da "use" para colokar o addon

 

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

 

{pokemon="Scyther" <-- ai é o nome do pokemon que voce iria adicionar o addon

 

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

looktype =912 <-- Ai, é o loocktype que voce adiciono no seu client, o scyther com o addon é só pega o loocktype e

 

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

 

colokar ai

e Dps na pasta action Adicione isso\/
<action itemid="7446" event="script" value="addons.lua"/>

 

se eu errei em alguma coisa me avisa uhsdhsd

agradeção ao ricardo por te feito a 'base' huadsuhsd

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

 

 

no quita sangre ayudaaaaaaaaa

no mueree

 

evolve.png

 

como pongo count catch aqui..

stonegm.png

 

 

 

Você está querendo saber como por para aparecer a quantidade de Pokémons capturados é?

1º Você não deve capturar um pokémon no (/cb Snorlax, 80, 0, male)

2º Não entendi, o pokémon não está hitando o outro é?

Se for issu olhe no seu Console e veja qual é o erro que está aparecendo lá.

Daí é só postar o erro aqui, que eu posso dar uma olhada.happy.png

______________________________________________________________________________________________________________________________

@StyloMaldoso

Essa base é para colocar o system de addons no pokémon

Mais ai pelo oque parece só há 1 Pokémon, não tem como alguém seilá quem disponibilizar ele pelo o menos com mais alguns?

E as sprites, de onde vamos tirar?

sleep.png

 

@ClackBoom

 

 

eu peguei ele postado do cleberadmin ja tava assim mais nem tinha reparado.

 

@Eternaus

 

uma quest por chest:

 

crie um arquivo.lua com o nome que quiser e coloque isso dentro da pasta actions/scripts/quest

 

 

function onUse(cid, item, frompos, item2, topos)

if item.uid == XXXXX then

queststatus = getPlayerStorageValue(cid,889911)

if queststatus == -1 then

doPlayerSendTextMessage(cid,22,"frase para quem for abrir o bau!")

doPlayerAddItem(cid,YYYYYY,10)

setPlayerStorageValue(cid,889911,1)

else

doPlayerSendTextMessage(cid,22,"Você já fez essa quest!.")

end

end

end

 

 

onde e XXXXX e o unique id vc tem que colocar ele no remeres nas propriedades do bau.( ID inventado =])

 

YYYYY e o id do item que o player vai ganhar quando abrir o bau.(e o 10 na frente e a quantidade do item que ele vai ganhar).

 

e isso aqui coloca no actions.xml

 

 

<action uniqueid="UNIQUE ID QUE VC COLOCOU NO BAU" event="script" value="quests/NOME DO ARQUIVO>LUA CRIADO NA PASTA QUEST.lua"/>

 

 

@Kurobisu

 

eu olhei aqui e nao vi comando /ban nao parece que nao tem.

 

@Jhonsy

 

ai mano vc tem um comando que troca o addon do poke, eu vi no sistema do ricardo e nao tem como trocar a addon.

 

@gugaevt

 

pra tirar aquele codigo e simples vá na pasta lib e depois configuration.lua e procure por:

 

 

useKpdoDlls = true -- coloque true pra usar as barras de cooldown.

mude para false.

 

 

 

 

Velho pelo que pude ver essa quest daí não iria funcionar se for para pegar algum Pokémon, anão ser se você criar uma Box para cada Pokémon e jogar ali o ID e pronto.

Ja tentei fazer um jeito assim mais não deu certo.

 

Quanto ao comando, tem sim só você tentar prestar atenção. Um membro de minha Staff ja baniu um player que ficou dismoralizando os outros, então concerteza tem este comando, só deve ser diferente do (/ban) é so saber procurar.

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

Alguem me ajuda por favor , os pokemons selvagens atacam os players mais nao hitam nada, o player nao sofre com os atakes dos pokes selvagens.

Link para o comentário
Compartilhar em outros sites

@FlamesAdmin

Mano me passa esse system, posso dar uma olhada nele pra ver se acho um jeito de melhorar, e até responder está dúvida.

 

@Taiger

Veja se está dando algum (erro) no seu Console, caso esteja dando poste-o aqui para eu dar uma olhada. Pode ser o erro do seu (exp.lua)

 

E ai alguém pode me ajudar com o meu erro?

 

1º Erro:

Spoiler

 

 

 

[12/07/2012 15:16:55] [Error - CreatureScript Interface]

[12/07/2012 15:16:55] data/creaturescripts/scripts/exp.lua:onStatsChange

[12/07/2012 15:16:55] Description:

[12/07/2012 15:16:55] data/creaturescripts/scripts/exp.lua:532: attempt to call global 'hasMimicWall' (a nil value)

[12/07/2012 15:16:55] stack traceback:

[12/07/2012 15:16:55] data/creaturescripts/scripts/exp.lua:532: in function <data/creaturescripts/scripts/exp.lua:129>

 

 

2º Erro:

Spoiler

 

 

[12/07/2012 15:16:42] [Error - CreatureScript Interface]

[12/07/2012 15:16:42] In a timer event called from:

[12/07/2012 15:16:42] data/creaturescripts/scripts/exp.lua:onStatsChange

[12/07/2012 15:16:42] Description:

[12/07/2012 15:16:42] data/lib/status library.lua:214: attempt to call global 'canAttackOther' (a nil value)

[12/07/2012 15:16:42] stack traceback:

[12/07/2012 15:16:42] data/lib/status library.lua:214: in function <data/lib/status library.lua:211>

[

 

 

Vou postar o (Exp.lua) novamente:

 

 

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

}

 

local Foresight = {"Machamp", "Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Machamp"} --passiva Foresight!!

local counter = {"Machamp", "Machoke", "Hitmonchan", "Hitmonlee", "Magmar", "Electabuzz", "Scyther", "Shiny Scyther", "Shiny Hitmonchan",

"Shiny Hitmonlee", "Shiny Machamp", "Shiny Machoke", "Shiny Magmar", "Shiny Electabuzz"}

local tooBad = {"Scyther", "Scizor", "Hitmonlee", "Hitmonchan", "Hitmontop", "Tyrogue", "Shiny Scyther", "Shiny Hitmonchan", "Shiny Hitmonlee"}

 

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) or cid == attacker then

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

doSleep(cid, value, true)

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

addEvent(doAdvancedPoison, 2500, attacker, master, cid, getPlayerStorageValue(attacker, 919231), value, getPlayerStorageValue(cid, 3893))

 

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 canAttackOther(cid, attacker) == "Cant" then return false 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

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

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

 

local nameP = getCreatureName(cid)

 

if damageCombat == GROUNDDAMAGE then

if pokes[nameP].type == "flying" or pokes[nameP].type2 == "flying" then

return false

end

elseif damageCombat == ELECTRICDAMAGE then --rever isso

if (pokes[nameP].type == "ground") or (pokes[nameP].type2 == "ground") then

return false

end

end

 

local multiplier = 1

local miss = 20 ---(getSpeed(cid) - getSpeed(attacker)) * 0.26

 

--if pokes[getCreatureName(cid)] then

poketype1 = pokes[getCreatureName(cid)].type

poketype2 = pokes[getCreatureName(cid)].type2

--end

 

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

end

if isInArray(effectiveness[damageCombat].super, poketype2) then

multiplier = multiplier * 2

end

if isInArray(effectiveness[damageCombat].weak, poketype1) then

multiplier = multiplier * 0.5

end

if isInArray(effectiveness[damageCombat].weak, poketype2) then

multiplier = multiplier * 0.5

end

if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then

multiplier = multiplier * 0

end

elseif combat == COMBAT_PHYSICALDAMAGE then

if isGhostPokemon(cid) and not isGhostPokemon(attacker) then

 

if not isInArray(Foresight, getCreatureName(attacker)) then --passiva Foresight!!

doSendMagicEffect(getThingPos(cid), 3)

return false

end

end

 

if isCreature(attacker) and isCreature(cid) then

if not isCreature(getMasterTarget(attacker)) then

return false

end

end

if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then

local tabela = {"Clefable", "Wigglytuff", "Alakazam", "Kadabra", "Mr. Mime", "Porygon", "Shiny Alakazam", "Shiny Porygon",

"Shiny Kadabra", "Shiny Mr. Mime", "Shiny Clefable", "Shiny Wigglytuff"}

if not isInArray(tabela, getCreatureName(attacker)) then

return false --editei

end

end

local cd = getPlayerStorageValue(attacker, 32659)

local cd2 = getPlayerStorageValue(attacker, 3891)

if cd > 0 or cd2 > 0 then

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

doSendMagicEffect(getThingPos(cid), 211)

doSendAnimatedText(getThingPos(cid), "MISS", 215)

return false

end

end

end

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

local valor = value

 

if multiplier > 2 then

multiplier = 2.5

elseif multiplier == 0.25 then

multiplier = 0.5

end

 

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

--damageCombat ~= COMBAT_PHYSICALDAMAGE and not getCreatureCondition(cid, CONDITION_PARALYZE)

if miss > 0 and math.random(1, 100) <= miss and not isInArray(ignoremiss, combat) then

if isInArray(tooBad, getCreatureName(cid)) and getCreatureTarget(attacker) == cid then

doSendMagicEffect(getThingPos(cid), 211)

doSendAnimatedText(getThingPos(cid), "Too Bad", 215)

doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(attacker)), false)

doSendMagicEffect(getThingPos(cid), 211)

doFaceCreature(cid, getThingPos(attacker)) --ver aki

end

return false

end

 

--if not isSummon(attacker) and not isSummon(cid) then

--return false -- ?

--end

 

if isSummon(cid) and isSummon(attacker) then

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

return false

end

end

 

local randomRange = math.random(83, 117) / 100

local block = 0

 

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(Foresight, getCreatureName(attacker)) then --passiva Foresight!!

valor = valor / 2

end

if isInArray(counter, getCreatureName(cid)) then

if (math.random(1, 100) <= 10) then --% chance do poke dar counter -> 10 = 10% chance

doSendAnimatedText(getThingPos(cid), "Counter", 215)

doTargetCombatHealth(cid, attacker, COMBAT_PHYSICALDAMAGE, valor, valor, 3)

valor = 0

end

end

else

block = 1 - (getSpecialDefense(cid) / (getSpecialAttack(attacker) + getSpecialDefense(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)

 

--NIGHTMAREDAMAGE

--GUILLOTINEDAMAGE

--SEISMICTOSSDAMAGE

--PSYCHOSHIFTDAMAGE

--THUNDERWAVEDAMAGE

 

if combat == BURNEDDAMAGE then

valor = value * getResistance(cid, FIREDAMAGE)

elseif combat == POISONEDDAMAGE then

valor = value * getResistance(cid, POISONDAMAGE)

end

 

if valor <= 0 then

doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

return false

end

 

if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then

doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)

valor = valor * 2

end

 

 

if valor >= getCreatureHealth(cid) then

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

valor = getCreatureHealth(cid) - 1

else

valor = getCreatureHealth(cid)

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

 

local percent = 8 + math.ceil(valor / getCreatureMaxHealth(cid) * 100)

if getCreatureHealth(cid) == 0 or percent <= 0 then return false end

local runCond = false

 

if math.random(100) <= percent then

runCond = true

end

 

if runCond then

 

local condPos = getThingPos(cid)

local color = 215

local text = ""

local effect = 2

 

if damageCombat == FIREDAMAGE and not isBurning(cid) then

doAdvancedBurn(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(5, 12))

color = COLOR_FIRE2

text = "BURNING"

effect = 15

elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) and randomCond == checkCond then

doAdvancedPoison(attacker, isPlayer(getCreatureMaster(attacker)) and getCreatureMaster(attacker) or 0, cid, getPokemonLevel(attacker) * 2, math.random(4, 20))

color = COLOR_GRASS

text = "POISONED"

effect = 8

end

 

doSendMagicEffect(getThingPos(cid), effect)

addEvent(doSendAnimatedText, 5, condPos, text, color)

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

-- [outfit normal] = {out = outfit girando, efeitos}

local OutFit = {

[366] = {out = 496, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --scyther

[912] = {out = 918, cima = 236, direita = 232, esquerda = 224, baixo = 233}, --Scizor

[1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther

[952] = {out = 1193, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --Hitmontop

[909] = {out = 1194, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --pineco

[910] = {out = 1192, cima = 251, direita = 253, esquerda = 254, baixo = 252}, --Forretress

}

 

local helix = {"Scyther", "Scizor", "Shiny Scyther", "Hitmontop", "Pineco", "Forretress"}

 

if isSummon(cid) then

if OutFit[getCreatureOutfit(cid).lookType] or getCreatureOutfit(cid).lookType == 0 then

local chance = getCreatureName(cid) == "Hitmontop" and (21 + getPlayerStorageValue(cid, 465987)) or 20

if math.random(1, 100) <= chance then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 2x seguidas...

return false

end

 

if not isInArray(helix, getCreatureName(cid)) then return false end

 

local outfitt = OutFit[getCreatureOutfit(cid).lookType] or OutFit[getPlayerStorageValue(cid, 98654)]

local look = getCreatureOutfit(cid).lookType

 

local min = getPokemonLevel(cid)*5

local max = getPokemonLevel(cid)*10

 

local function damage(cid, min, max)

if isCreature(cid) then

if look == 366 or look == 1317 then --scyther e shiny scyther

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

elseif look == 952 then --hitmontop

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

else --resto

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

end

-------------------------------------------Lava Counter / Electricity-------------------------------------

local Fire_Thunder = {"Magmar", "Shiny Magmar", "Electabuzz", "Shiny Electabuzz", "Magby", "Elekid"}

 

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

local eff = {

["Magmar"] = {15, FIREDAMAGE},

["Shiny Magmar"] = {15, FIREDAMAGE},

["Magby"] = {15, FIREDAMAGE},

["Electabuzz"] = {207, ELECTRICDAMAGE},

["Shiny Electabuzz"] = {207, ELECTRICDAMAGE},

["Elekid"] = {207, ELECTRICDAMAGE},

}

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

if isInArray(Fire_Thunder, getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")) then

if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 2x seguidas...

return false

end

 

local min = getPokemonLevel(cid)*5

local max = getPokemonLevel(cid)*10

 

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] = SOUTHWEST,

[2] = SOUTH,

[3] = SOUTHEAST,

[4] = EAST,

[5] = NORTHEAST,

[6] = NORTH,

[7] = NORTHWEST,

[8] = WEST,

[9] = SOUTHWEST,

}

for a = 1, 17 do

if not t[a] then

addEvent(sendFireEff, a * 140, cid, t[a-8], eff[getCreatureName(cid)][1], eff[getCreatureName(cid)][2])

else

addEvent(sendFireEff, a * 140, cid, t[a], eff[getCreatureName(cid)][1], eff[getCreatureName(cid)][2])

end

end

addEvent(setPlayerStorageValue, 17*140, cid, 32623, 0) --proteçao

end

 

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

doSpinFire(cid)

end

end

end

---------------------------------------------Demon Kicker----------------------------------

--[outfit] = outfit chutando,

local hitmonlees = {

[371] = 652, --hitmonlee

[877] = 878, --shiny hitmonlee PxG

[11891] = 652, --hitmonlee durmindo

}

 

--DETALHE: shiny hitmonlee n tem a sprite dele chutando.. pelo menos eu n achei..

--entao deixei a sprite do hitmonlee normal atacando...

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if name == "Shiny Hitmonlee" or name == "Hitmonlee" then

if isCreature(getMasterTarget(cid)) then

if math.random(1, 100) <= (21 + getPlayerStorageValue(cid, 465987)) then

-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then

return false

end

if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 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)*1.1 --getPokemonLevel(cid)*15

local max = getOffense(cid)*1.2 --getPokemonLevel(cid)*20

 

 

setPlayerStorageValue(cid, 32623, 1) --proteçao --arrumar isso!!!

if isSleeping(cid) and getMonsterInfo(getCreatureName(cid)).lookCorpse ~= 0 then

doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookTypeEx]}, -1)

else

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

end

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

 

addEvent(doChangeHitmon, 700, cid)

end

end

end

end

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

local hitmonchans = {

["Hitmonchan"] = {

[0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1075, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1078, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1076, eff = 140, type = GHOSTDAMAGE} --outfit ghost

},

 

["Shiny Hitmonchan"] = {

--aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...

[0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1080, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1082, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1079, eff = 140, type = GHOSTDAMAGE} --outfit ghost

}

}

local monchanOUT = {837, 1080, 1081, 1082, 1079}

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if name == "Shiny Hitmonchan" or name == "Hitmonchan" then

if isCreature(getMasterTarget(cid)) then

if math.random(1, 100) <= (21 + getPlayerStorageValue(cid, 465987)) then

-- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

if getDistanceBetween(getThingPos(cid), getThingPos(getMasterTarget(cid))) > 1 then

return false

end

if getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke") == "Shiny Hitmonchan" and not isInArray(monchanOUT, getCreatureOutfit(cid).lookType) then

return false --proteçao pro script n funcionar com o shiny monchan com outfit diferente da do elite...

end --script soh funciona com outfit do elite hirmonchan do PO...

 

 

local min = getOffense(cid)*1.1 --getPokemonLevel(cid)*15

local max = getOffense(cid)*1.2 --getPokemonLevel(cid)*20

 

local hands = getItemAttribute(getPlayerSlotItem(e, 8).uid, "hands")

 

 

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

end

end

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

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

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if isInArray(ducks, name) then

if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

if getPlayerStorageValue(cid, 32623) == 1 then --proteçao pra n usar a spell 2x seguidas...

return false

end

 

local min = getPokemonLevel(cid)*5 --nao sei como funciona o sistema de dano...

local max = getPokemonLevel(cid)*10 --nao sei como funciona o sistema de dano...

 

local function damage(cid)

if isCreature(cid) then

doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPosWithDebug(cid), confusion, -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

end

end

-----------------------------------------Groundshock-----------------------------------

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if name == "Kangaskhan" or name == "Shiny Kangaskhan" then

if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

 

local min = getPokemonLevel(cid)*10 --nao sei como funciona o sistema de dano...

local max = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano...

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPosWithDebug(cid), scyther5, -min, -max, 255)

 

local sps = getThingPosWithDebug(cid)

sps.x = sps.x+1

sps.y = sps.y+1

doSendMagicEffect(sps, 127)

end

end

end

--------------------------------------Electric Charge---------------------------------------------------

local charge = {"Pikachu", "Shiny Pikachu", "Raichu", "Shiny Raichu"}

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if isInArray(charge, name) then

if getPlayerStorageValue(cid, 253) >= 0 then

return true

end

if math.random(1, 100) <= 15 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

setPlayerStorageValue(cid, 253, 1)

doSendMagicEffect(getThingPos(cid), 207)

doSendAnimatedText(getThingPos(cid), "FOCUS", 144)

end

end

end

-------------------------------------Melody------------------------------------

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if name == "Wigglytuff" or name == "Shiny Wigglytuff" then

if math.random(1, 100) <= 10 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/-

doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPosWithDebug(cid), powders, -6, -10, 33)

end

end

end

------------------------------------- Dragon Fury / Fury ---------------------------------------

local DracoFury = {"Persian", "Shiny Persian", "Gyarados", "Shiny Gyarados", "Dratini", "Shiny Dratini", "Dragonair", "Shiny Dragonair", "Dragonite", "Shiny Dragonite"}

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if isInArray(DracoFury, name) then

if math.random(1, 100) <= 10 then --Chance 10 = 10% edite como quiser...

if getPlayerStorageValue(cid, 32623) == 1 then

return false

end

 

setPlayerStorageValue(cid, 32623, 1)

 

if getCreatureName(cid) == "Persian" or getCreatureName(cid) == "Shiny Persian" then

doRaiseStatus(cid, true, false, false, 2, 15000)

else

doRaiseStatus(cid, true, true, false, 2, 15000)

end

 

for t = 1, 10 do

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

end

addEvent(setPlayerStorageValue, 15000, cid, 32623, 0)

end

end

end

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

arr = {

{0, 0, 0, 0, 0},

{0, 1, 1, 1, 0},

{0, 1, 2, 1, 0},

{0, 1, 1, 1, 0},

{0, 0, 0, 0, 0}

}

 

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

"Shiny Gloom", "Shiny Vileplume", "Shiny Kabuto", "Shiny Kabutops", "Shiny Parasect", "Shiny Tangela"}

 

local min = getPokemonLevel(cid)*3 --nao sei como funciona o sistema de dano...

local max = getPokemonLevel(cid)*5 --nao sei como funciona o sistema de dano...

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if isInArray(mega, name) then

if math.random(1, 100) <= 10 then -- Porcentagem de chance pro poke usar a passiva... 20 = 20%

local uid = checkAreaUid(getThingPos(cid), arr, 1, 1)

for _,pid in pairs(uid) do

if (isMonster(pid) or (isSummon(pid) and canAttackOther(cid, pid)) == "Can" or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) then

if getCreatureTarget(pid) == cid then

local hp = getCreatureHealth(pid)

local drain = choose(min, max)

if hp-drain >= 1 then

doCreatureAddHealth(pid, -drain)

doCreatureAddHealth(cid, drain)

doSendAnimatedText(getThingPos(pid), "-"..drain.."", 144)

doSendAnimatedText(getThingPos(cid), "+"..drain.."", 32)

end

end

end

end

end

end

end

------------------------------------- Spores Reaction ---------------------------------------

local spores = {"Oddish", "Gloom", "Vileplume", "Shiny Oddish", "Shiny Gloom", "Shiny Vileplume"}

 

if isSummon(cid) then

local e = getCreatureMaster(cid)

local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke")

if isInArray(spores, name) then

if math.random(1, 100) <= 10 then -- Porcentagem de chance pro poke usar a passiva... 20 = 20% +/-

doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPosWithDebug(cid), powders, -2, -3, 27)

end

end

end

 

return false

end

 

 

Bem ta aí o meu Exp.lua

 

Agora vou postar meu (Status Library.lua):

 

 

function isSleeping(cid)

if isCreature(cid) then

if getPlayerStorageValue(cid, 98271) >= 1 then

return true

end

end

return false

end

 

function doSendSleepEffect(cid)

if not isCreature(cid) or not isSleeping(cid) then return true end

doSendMagicEffect(getThingPos(cid), 32)

addEvent(doSendSleepEffect, 1500, cid)

end

 

 

function doSleep(target, rounds, first)

 

local cid = target

 

if not isCreature(target) then

return true

end

 

if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect

if getPlayerStorageValue(target, 98271) >= 1 and rounds ~= 0 then return true end --edited pra nao contar os efeitos

 

if not isSleeping(target) then

addEvent(doSendSleepEffect, 500, target)

end

 

if isSleeping(target) and first then

setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) + rounds)

return true

end

 

local outfits = {366, 912, 1317, 952, 909, 910}

if isInArray(outfits, getCreatureOutfit(target).lookType) then

setPlayerStorageValue(target, 98654, getCreatureOutfit(target).lookType) --edited pra da passivas ms quando esta durmindo!!

end

 

doChangeSpeed(target, -getCreatureSpeed(target))

 

local passivaOutfit = {652, 878, 496, 918, 849, 1193, 1194, 1192}

local Info = getMonsterInfo(getCreatureName(target)).lookCorpse --edited pra da passivas ms quando esta durmindo!!

local look = getCreatureOutfit(target)

 

if isMonster(target) then

if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then

local InfoDitto = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse

if InfoDitto ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then

doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse}, -1)

end

else --edited pra da passivas ms quando esta durmindo!!

if Info ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then

doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(target)).lookCorpse}, -1)

end

end

end

 

if rounds and rounds > 0 then

setPlayerStorageValue(target, 98271, rounds)

if isSummon(target) then

doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", rounds)

end

end

 

setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) - 1)

 

if getPlayerStorageValue(target, 98271) <= 0 then

doRegainSpeed(target)

if not isPlayer(target) then

if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then

doSetCreatureOutfit(target, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(target), 8).uid, "transOutfit")}, -1)

else

doRemoveCondition(target, CONDITION_OUTFIT)

end

if getPlayerStorageValue(target, 98654) >= 1 then

setPlayerStorageValue(target, 98654, -1)

end

end

return true

end

 

if isSummon(target) then

doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", getPlayerStorageValue(cid, 98271))

end

addEvent(doSleep, 1100, target, 0, false)

return true

end

 

function doAdvancedConfuse(target, rounds, check, cid)

if not isCreature(target) then return true end

if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect

if cid and canAttackOther(cid, target) == "Cant" then return true end --edited PVP system

if isPlayer(target) and getPlayerStorageValue(target, 6598754) <= 0 and getPlayerStorageValue(target, 6598755) <= 0 then

return true

end

if getPlayerStorageValue(target, 3891) >= 1 and rounds ~= -1 then return true end --edited pra nao contar os efeitos

 

if check and check ~= getPlayerStorageValue(target, 3891) then return true end

 

if not check and getPlayerStorageValue(target, 3891) >= 1 then

setPlayerStorageValue(target, 3891, getPlayerStorageValue(target, 3891) + rounds - 1)

else

setPlayerStorageValue(target, 3891, getPlayerStorageValue(target, 3891) + rounds)

end

 

local a = getPlayerStorageValue(target, 3891)

 

if isSummon(target) then

local item = getPlayerSlotItem(getCreatureMaster(target), 8)

doItemSetAttribute(item.uid, "confuse", a)

end

 

if a <= -1 then if getCreatureCondition(target, CONDITION_PARALYZE) then addEvent(doRegainSpeed, 4000, target) else doRegainSpeed(target) end setPlayerStorageValue(target, 3891, -1) return true end

 

local p = getThingPos(target)

 

if math.random(1, 6) >= 4 then

doSendMagicEffect(getThingPos(target), 31)

end

 

doChangeSpeed(target, -getCreatureSpeed(target))

doChangeSpeed(target, 100)

if not isSleeping(target) and getPlayerStorageValue(target, 654878) <= 0 then

doPushCreature(target, math.random(0, 3), 1, 0)

end

doChangeSpeed(target, -100)

 

local pos = getThingPos(target)

addEvent(doSendMagicEffect, math.random(0, 450), pos, 31)

 

addEvent(doAdvancedConfuse, 1000, target, -1, a)

end

 

local feardirections = {

[NORTH] = {SOUTH, WEST, EAST},

[sOUTH] = {NORTH, WEST, EAST},

[WEST] = {SOUTH, NORTH, EAST},

[EAST] = {SOUTH, WEST, NORTH}}

 

local roardirections = {

[NORTH] = {SOUTH},

[sOUTH] = {NORTH},

[WEST] = {EAST}, --edited sistema de roar

[EAST] = {WEST}}

 

function doAdvancedFear(target, rounds, check, cid, spell, baseoff) --baseoff

if not isCreature(target) then return true end

if not isCreature(cid) then return true end

if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect

if cid and canAttackOther(cid, target) == "Cant" then return true end --edited PVP system

if isPlayer(target) and getPlayerStorageValue(target, 6598754) <= 0 and getPlayerStorageValue(target, 6598755) <= 0 then

return true

end

if getPlayerStorageValue(target, 3894) >= 1 and rounds ~= -1 then return true end --edited pra nao contar os efeitos

 

if check and check ~= getPlayerStorageValue(target, 3894) then return true end

 

if not check and getPlayerStorageValue(target, 3894) >= 1 then

setPlayerStorageValue(target, 3894, getPlayerStorageValue(target, 3894) + rounds - 1)

else

setPlayerStorageValue(target, 3894, getPlayerStorageValue(target, 3894) + rounds)

end

 

local a = getPlayerStorageValue(target, 3894)

 

if isSummon(target) then

local item = getPlayerSlotItem(getCreatureMaster(target), 8)

doItemSetAttribute(item.uid, spell, a)

end

 

if a <= -1 then

doRegainSpeed(target)

setPlayerStorageValue(target, 3894, -1)

return true

end

 

local p = getThingPos(target)

 

if spell == "Roar" then

eff = 244

else --edited Roar

eff = 139

end

 

if math.random(1, 6) >= 4 then

doSendMagicEffect(getThingPos(target), eff)

end

 

local dir = getCreatureDirectionToTarget(target, cid)

 

doChangeSpeed(target, -getCreatureSpeed(target))

doChangeSpeed(target, 100)

local delay = getNextStepDelay(target, 0)

 

if not isSleeping(target) then

if isCreature(getCreatureTarget(target)) then --edited attacker precisa ter cid como target

doPushCreature(target, roardirections[dir][1], 1, 0)

end

doChangeSpeed(target, -100)

end

 

local pos = getThingPos(target)

addEvent(doSendMagicEffect, math.random(0, 450), pos, eff)

addEvent(doAdvancedFear, delay, target, -1, a, cid, spell)

end

 

 

function doAdvancedPoison(cid, master, target, damage, rounds, check)

if not isCreature(target) then return true end

if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect

if cid and canAttackOther(cid, target) == "Cant" then return true end --edited PVP System

if isPlayer(target) and getPlayerStorageValue(target, 6598754) <= 0 and getPlayerStorageValue(target, 6598755) <= 0 then

return true

end

if getPlayerStorageValue(target, 3893) >= 1 and rounds ~= -1 then return true end --edited pra nao contar os efeitos

 

if isSummon(target) then

local x = getCreatureMaster(target)

local y = getPlayerSlotItem(x, 8).uid

doItemSetAttribute(y, "poisondmg", damage)

end

 

if check and check ~= getPlayerStorageValue(target, 3893) then return true end

 

if not check and getPlayerStorageValue(target, 3893) >= 1 then

setPlayerStorageValue(target, 3893, getPlayerStorageValue(target, 3893) + rounds - 1)

else

setPlayerStorageValue(target, 3893, getPlayerStorageValue(target, 3893) + rounds)

end

local a = getPlayerStorageValue(target, 3893)

 

if isSummon(target) and a >= 0 then

doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(target), 8).uid, "poison", getPlayerStorageValue(target, 3893))

end

 

if a <= -1 then setPlayerStorageValue(target, 3893, -1) return true end

 

local x = math.abs(damage)

if not isCreature(cid) and isCreature(master) then

x = x * getResistance(target, POISONDAMAGE)

end

if isPlayer(target) and getCreatureHealth(target) <= x then

x = getCreatureHealth(target) - 1

end

doSendMagicEffect(getThingPos(target), 8)

if isCreature(cid) and cid ~= target then

doAreaCombatHealth(cid, POISONEDDAMAGE, getThingPos(target), 0, -x, -x, 8)

elseif not isCreature(cid) and isCreature(master) then

doAreaCombatHealth(master, POISONEDDAMAGE, getThingPos(target), 0, -x, -x, 8)

else

doCreatureAddHealth(target, -x, 8, COLOR_GRASS)

end

addEvent(doAdvancedPoison, 2500, cid, master, target, damage, -1, a)

end

 

function doAdvancedBurn(cid, master, target, damage, rounds, check)

if not isCreature(target) then return true end

if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect

if cid and canAttackOther(cid, target) == "Cant" then return true end --edited PVP system

if isPlayer(target) and getPlayerStorageValue(target, 6598754) <= 0 and getPlayerStorageValue(target, 6598755) <= 0 then

return true

end

if getPlayerStorageValue(target, 3892) >= 1 and rounds ~= -1 then return true end --edited pra nao contar os efeitos

 

if isSummon(target) then

local x = getCreatureMaster(target)

local y = getPlayerSlotItem(x, 8).uid

doItemSetAttribute(y, "burndmg", damage)

end

 

if check and check ~= getPlayerStorageValue(target, 3892) then return true end

 

if not check and getPlayerStorageValue(target, 3892) >= 1 then

setPlayerStorageValue(target, 3892, getPlayerStorageValue(target, 3892) + rounds - 1)

else

setPlayerStorageValue(target, 3892, getPlayerStorageValue(target, 3892) + rounds)

end

local a = getPlayerStorageValue(target, 3892)

 

if isSummon(target) then

local item = getPlayerSlotItem(getCreatureMaster(target), 8)

doItemSetAttribute(item.uid, "burn", a)

end

 

if a <= -1 then setPlayerStorageValue(target, 3892, -1) return true end

 

local x = math.abs(damage)

if not isCreature(cid) and isCreature(master) then

x = x * getResistance(target, FIREDAMAGE)

end

if isPlayer(target) and getCreatureHealth(target) <= x then

x = getCreatureHealth(target) - 1

end

doSendMagicEffect(getThingPos(target), 15)

if isCreature(cid) and cid ~= target then

doAreaCombatHealth(cid, BURNEDDAMAGE, getThingPos(target), 0, -x, -x, 15)

elseif not isCreature(cid) and isCreature(master) then

doAreaCombatHealth(master, BURNEDDAMAGE, getThingPos(target), 0, -x, -x, 15)

else

doCreatureAddHealth(target, -x, 15, COLOR_BURN)

end

addEvent(doAdvancedBurn, 5000, cid, master, target, damage, -1, a)

end

 

local injuries = {

[1] = {n = "burn", m = 3892},

[2] = {n = "poison", m = 3893},

[3] = {n = "confuse", m = 3891},

[4] = {n = "Fear", m = 3894},

[5] = {n = "sleep", m = 98271},

[6] = {n = "missSyst", m = 32659}, --edited novos sistemas

[7] = {n = "Roar", m = 3894},

}

 

 

 

function doCureStatus(cid, type, playerballs)

if not isCreature(cid) then return true end

if playerballs and isPlayer(cid) then

local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

local mb = getPlayerSlotItem(cid, 8)

if isPokeball(mb.itemid) then

if not type or type == "all" then

for b = 1, #injuries do

doItemSetAttribute(mb.uid, ""..injuries.n.."", -1)

end

else

doItemSetAttribute(mb.uid, ""..type.."", -1)

end

end

--for balls = 1, 8 do

for bname, balls in pairs (pokeballs) do

for times = 1,3 do

local items = getItemsInContainerById(bp.uid, balls.all[times])

for _, uid in pairs(items) do

if not type or type == "all" then

for b = 1, #injuries do

doItemSetAttribute(uid, ""..injuries.n.."", -1)

end

else

doItemSetAttribute(uid, ""..type.."", -1)

end

end

end

end

end

if type == "all" then

for a = 1, #injuries do

setPlayerStorageValue(cid, injuries[a].m, -1)

end

return true

end

for a, b in pairs (injuries) do

if b.n == type then

setPlayerStorageValue(cid, b.m, -1)

end

end

end

 

function doCureBallStatus(item, type)

if not type or type == "all" then

for b = 1, #injuries do

doItemSetAttribute(item, ""..injuries.n.."", -1)

end

else

doItemSetAttribute(item, ""..type.."", -1)

end

end

 

 

function getRoundsLeft(cid, type)

if not isCreature(cid) then return 0 end

for a, b in pairs (injuries) do

if b.n == type then

return getPlayerStorageValue(cid, b.m) + 1

end

end

print("Error on function getRoundsLeft(cid, type) - type doesn't exist.")

return 0

end

 

function isBurning(cid)

if not isCreature(cid) then return false end

if getPlayerStorageValue(cid, 3892) >= 0 then return true end

return false

end

 

function isPoisoned(cid)

if not isCreature(cid) then return false end

if getPlayerStorageValue(cid, 3893) >= 0 then return true end

return false

end

 

 

Pronto, mais ainda tem alguns erros.

Como aquele do(move1.lua):

Depois eu arrumo esse Move.1.lua se eu conseguir

 

Olha esse:

 

 

[13/07/2012 11:10:36] [Error - Spell Interface]

[13/07/2012 11:10:36] data/spells/scripts/ps/String Shot.lua:onCastSpell

[13/07/2012 11:10:36] Description:

[13/07/2012 11:10:36] data/lib/pokemon moves.lua:479: attempt to call global 'doAdvancedBlind' (a nil value)

[13/07/2012 11:10:36] stack traceback:

[13/07/2012 11:10:36] data/lib/pokemon moves.lua:479: in function 'docastspell'

[13/07/2012 11:10:36] data/spells/scripts/ps/String Shot.lua:5: in function <data/spells/scripts/ps/String Shot.lua:1>

 

 

Cruzes não entendo de onde vem tanto erro

Vo postar o (String Shot.lua) e o (pokemon moves.lua)

 

String Shot.lua:

 

 

function onCastSpell(cid, var)

 

if isSummon(cid) then return true end

 

docastspell(cid, "String Shot")

 

return true

end

 

 

 

Pokemon Moves.lua:

 

 

 

 

local hitmonchans = {

["Hitmonchan"] = {

[0] = {out = 559, eff = 112}, --outfit normal

[1] = {out = 1075, eff = 35}, --outfit fogo

[2] = {out = 1077, eff = 48}, --outfit raio

[3] = {out = 1078, eff = 43}, --outfit gelo

[4] = {out = 1076, eff = 140} --outfit ghost

},

 

["Shiny Hitmonchan"] = {

--aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...

[0] = {out = 837, eff = 112}, --outfit normal

[1] = {out = 1080, eff = 35}, --outfit fogo

[2] = {out = 1081, eff = 48}, --outfit raio

[3] = {out = 1082, eff = 43}, --outfit gelo

[4] = {out = 1079, eff = 140} --outfit ghost

}

}

 

function getMasterTarget(cid)

return getCreatureTarget(getCreatureMaster(cid))

end

 

function doAreaCombatWithDelay(cid, target, pos, area, type, effect, a, b)

if not isCreature(cid) then return true end

local topos = {}

if isCreature(target) then topos = getThingPosWithDebug(target) else topos = pos end

doAreaCombatHealth(cid, type, topos, area, -math.abs(a), -math.abs(b), effect)

end

 

function doAreaCombatHealthAtDistance(cid, type, pos, area, min, max, effect)

local delay = 0

if isCreature(cid) and isCreature(getMasterTarget(cid)) then

delay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(getMasterTarget(cid))) * const_distance_delay

addEvent(doAreaCombatWithDelay, delay, cid, getMasterTarget(cid), getThingPosWithDebug(getMasterTarget(cid)), area, type, effect, -min, -max)

return true

end

doAreaCombatHealth(cid, type, pos, area, min, max, effect)

end

 

function docastspell(cid, spell, mina, maxa)

 

local getThingPositionWithDebug = getThingPosWithDebug

 

if not isCreature(cid) or getCreatureHealth(cid) <= 0 then return false end

if isSleeping(cid) then return true end

if getPlayerStorageValue(cid, 6) >= 1 then doSendAnimatedText(getThingPositionWithDebug(cid), "DISABLED", 152) return true end

if isMonster(cid) and not isSummon(cid) then

if getCreatureCondition(cid, CONDITION_EXHAUST) then

return true

end

doCreatureAddCondition(cid, wildexhaust)

end

 

local mydir = isCreature(getMasterTarget(cid)) and getCreatureDirectionToTarget(cid, getMasterTarget(cid)) or getCreatureLookDir(cid)

local target = 0

local getDistDelay = 0

 

if isCreature(getMasterTarget(cid)) then

target = getMasterTarget(cid)

getDistDelay = getDistanceBetween(getThingPositionWithDebug(cid), getThingPositionWithDebug(target)) * const_distance_delay

end

 

local movetype = getSpecialAttack(cid)

 

local min = 0

local max = 0

local healMultiplier = 1

 

if mina and maxa then

min = math.abs(mina)

max = math.abs(maxa)

elseif not isPlayer(cid) then

if movesinfo[spell] then

if movesinfo[spell].t == "fighting" then

movetype = getOffense(cid) * 1.4 + getSpecialAttack(cid) * 0.45

elseif movesinfo[spell].t == "normal" then

movetype = movetype * 0.6 + getOffense(cid) * 0.6

end

min = 5 + getPokemonLevel(cid) + (movesinfo[spell].f / 100 * movetype * specialoffenseRate)

max = min + getPokemonLevel(cid) * levelFactor

if not isSummon(cid) then

doCreatureSay(cid, string.upper(spell).."!", TALKTYPE_MONSTER)

end

if isNpcSummon(cid) then

local mnn = {" use ", " "}

local use = mnn[math.random(#mnn)]

doCreatureSay(getCreatureMaster(cid), getPlayerStorageValue(cid, 1007)..","..use..""..doCorrectString(spell).."!", 1)

end

else

print("Error trying to use move "..spell..", move not specified in moves table.")

end

 

end

--- CONFUSED -------------------------------

if getPlayerStorageValue(cid, 3891) >= 1 then

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

doSendAnimatedText(getThingPositionWithDebug(cid), "SELF HIT", 180)

doTargetCombatHealth(cid, cid, COMBAT_PHYSICALDAMAGE, -min/3, -max/3, 3)

return true

end

end

--- BLIND ----------------------------------

if getPlayerStorageValue(cid, 3890) >= 1 then

doSendAnimatedText(getThingPositionWithDebug(cid), "MISS", 215)

setPlayerStorageValue(cid, 3890, -1)

return true

end

--- FOCUS ----------------------------------

if getPlayerStorageValue(cid, 253) >= 0 and movesinfo[spell] and movesinfo[spell].f ~= 0 then

min = min * 3

max = max * 3

healMultiplier = 3

setPlayerStorageValue(cid, 253, -1)

end

---- MIMIC ---------------------------------

setPlayerStorageValue(cid, 877, spell)

---- COUNTER -------------------------------

if isCreature(target) and getPlayerStorageValue(target, 879) >= 1 and getDistanceBetween(getThingPositionWithDebug(cid), getThingPositionWithDebug(target)) <= 2 and spell ~= "Counter" then

if movesinfo[spell] and movesinfo[spell].t == "fighting" or movesinfo[spell].t == "normal" then

if not isInArray({"Hyper Beam", "Hyper Voice", "Counter"}, spell) then

docastspell(target, spell, min * 2, max * 2)

doSendAnimatedText(getThingPositionWithDebug(target), "COUNTER", 215)

setPlayerStorageValue(target, 879, -1)

end

end

end

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

 

 

if spell == "Dynamic Punch" then

 

local dirs = {

[1] = 0,

[2] = 4,

[3] = 6,

[4] = 1,

[5] = 3,

[6] = 2

}

 

doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 112)

local targetarea = getThingPositionWithDebug(getMasterTarget(cid))

for effcs = 1, 6 do

addEvent(doSendMagicEffect, 150 * effcs, getPosByDir(getThingPositionWithDebug(getMasterTarget(cid)), dirs[effcs]), 17)

end

 

elseif spell == "Quick Attack" then

 

doSendMagicEffect(getThingPositionWithDebug(cid), 211)

local x = getClosestFreeTile(cid, getThingPositionWithDebug(getMasterTarget(cid)))

doTeleportThing(cid, x, false)

doFaceCreature(cid, getThingPositionWithDebug(getMasterTarget(cid)))

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Slam" then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 118)

 

elseif spell == "Rapid Hit" then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

local hitalvo = getMasterTarget(cid)

 

local function sendef(cid)

if isCreature(cid) then

doSendMagicEffect(getThingPositionWithDebug(cid), 3)

end

end

 

for times = 0, 3 do

addEvent(sendef, 200*times+80, hitalvo)

end

 

elseif spell == "Bite" or tonumber(spell) == 5 then

 

doAreaCombatHealth(cid, DARKDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 146)

 

elseif spell == "Slash" or tonumber(spell) == 6 then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 160)

 

elseif spell == "Splash" or tonumber(spell) == 7 then

 

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255)

doSendMagicEffect(getThingPositionWithDebug(cid), 53)

 

elseif spell == "Doubleslap" then

 

local slapalvo = getMasterTarget(cid)

local summon = cid

local function doSlap(cid, target)

if isCreature(cid) and isCreature(target) then

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 3)

end

end

 

addEvent(doSlap, 0, summon, slapalvo)

addEvent(doSlap, 600, summon, slapalvo)

 

elseif spell == "Mega Punch" then

 

doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 112)

 

elseif spell == "Scratch" then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 142)

 

elseif spell == "Confusion" then

 

doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPositionWithDebug(cid), confusion, -min, -max, 133)

 

elseif spell == "Psychic" then

 

doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPositionWithDebug(cid), psychic, -min, -max, 136)

 

elseif spell == "Absorb" or spell == "Leech Life" then

 

local life = getCreatureHealth(getMasterTarget(cid))

 

doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 14)

 

local newlife = life - getCreatureHealth(getMasterTarget(cid))

 

doSendMagicEffect(getThingPositionWithDebug(cid), 14)

if newlife >= 1 then

doCreatureAddHealth(cid, newlife)

doSendAnimatedText(getThingPositionWithDebug(cid), "+"..newlife.."", 32)

end

 

elseif spell == "Mud Shot" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 1)

 

local function doEffect(cid, target)

if not isCreature(cid) or not isCreature(target) then return true end

doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 34)

if math.random(1, 100) >= 78 then

local rounds = math.random(6, 10)

rounds = rounds + math.floor(getPokemonLevel(cid) / 20)

doAdvancedBlind(target, rounds, getPlayerStorageValue(target, 3890), 34)

end

end

 

addEvent(doEffect, getDistDelay, cid, target)

 

elseif spell == "Bubbles" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 2)

doAreaCombatHealthAtDistance(cid, WATERDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 25)

 

elseif spell == "Water Spout" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), {x=getThingPositionWithDebug(cid).x, y=getThingPositionWithDebug(cid).y-5, z=getThingPositionWithDebug(cid).z}, 2)

 

local function spout(params)

if isCreature(params.cid) then

for x = -2,2 do

for y = -2,2 do

local newpos = getThingPositionWithDebug(params.cid)

newpos.x = newpos.x+x

newpos.y = newpos.y+y

doSendDistanceShoot({x=getThingPositionWithDebug(params.cid).x, y=getThingPositionWithDebug(params.cid).y-5, z=getThingPositionWithDebug(params.cid).z}, newpos, 2)

end

end

end

end

 

 

local function spdmg(params)

if isCreature(params.cid) then

doAreaCombatHealth(params.cid, WATERDAMAGE, getThingPositionWithDebug(params.cid), waterspout, -min, -max, 68)

end

end

 

addEvent(spout, 300, {cid = cid})

addEvent(spdmg, 450, {cid = cid})

 

elseif spell == "Horn Attack" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 15)

--doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

addEvent(doAreaCombatWithDelay, getDistDelay, cid, target, getThingPositionWithDebug(target), 0, NORMALDAMAGE, 3, -min, -max)

 

elseif spell == "Rock Throw" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 11)

doAreaCombatHealthAtDistance(cid, ROCKDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Headbutt" or spell == "Pound" or spell == "Tackle" then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Super Sonic" or spell == "Confuse Ray" then

 

local target = getMasterTarget(cid)

local rounds = math.random(4, 7)

rounds = rounds + math.floor(getPokemonLevel(cid) / 35)

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 32)

doAdvancedConfuse(target, rounds, getPlayerStorageValue(target, 3891))

 

elseif spell == "Fury Attack" then

 

local alvo = getMasterTarget(cid)

 

local function doFuryAttack(cid, target, round, rounds)

if not isCreature(cid) then return true end

if round > rounds then

doSendAnimatedText(getThingPositionWithDebug(cid), ""..rounds.." HITS", 35)

return true

end

if isCreature(getMasterTarget(cid)) and getMasterTarget(cid) ~= target then

doSendAnimatedText(getThingPositionWithDebug(cid), ""..rounds.." HITS", 35)

return true

end

if not isCreature(getMasterTarget(cid)) then

doSendAnimatedText(getThingPositionWithDebug(cid), ""..rounds.." HITS", 35)

return true

end

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 15)

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

addEvent(doFuryAttack, 700, cid, target, round + 1, rounds)

end

 

local ther = math.random(1, 200)

if ther <= 75 then

maxr = 2

elseif ther >= 76 and ther <= 100 then

maxr = 4

elseif ther >= 101 and ther <= 175 then

maxr = 3

elseif ther >= 176 then

maxr = 5

end

 

doFuryAttack(cid, alvo, 1, maxr)

 

elseif spell == "Water Gun" then

 

if mydir == 0 then

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg1n, -min, -max, 74)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg2n, -min, -max, 75)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg3n, -min, -max, 76)

elseif mydir == 2 then

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg1s, -min, -max, 77)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg2s, -min, -max, 75)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg3s, -min, -max, 78)

elseif mydir == 1 then

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg1e, -min, -max, 69)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg2e, -min, -max, 70)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg3e, -min, -max, 71)

elseif mydir == 3 then

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg1w, -min, -max, 72)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg2w, -min, -max, 70)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), wg3w, -min, -max, 73)

end

 

elseif spell == "Peck" then

 

doAreaCombatHealth(cid, FLYINGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Pluck" then

 

doAreaCombatHealth(cid, FLYINGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), pluck, -min, -max, 2)

 

elseif spell == "Sand Attack" then

 

local posicao = getThingPositionWithDebug(cid)

 

local function sandattack(params)

if isCreature(params.cid) and isSightClear(posicao, params.ar, false) then

doAreaCombatHealth(params.cid, GROUNDDAMAGE, params.ar, sand1, -min, -max, params.ef)

end

end

 

if mydir == 0 then

addEvent(sandattack, 0, {cid = cid, ar = {x=posicao.x, y=posicao.y-1, z=posicao.z}, ef = 120})

addEvent(sandattack, 400, {cid = cid, ar = {x=posicao.x, y=posicao.y-2, z=posicao.z}, ef = 120})

addEvent(sandattack, 800, {cid = cid, ar = {x=posicao.x, y=posicao.y-3, z=posicao.z}, ef = 120})

elseif mydir == 2 then

addEvent(sandattack, 0, {cid = cid, ar = {x=posicao.x, y=posicao.y+1, z=posicao.z}, ef = 122})

addEvent(sandattack, 400, {cid = cid, ar = {x=posicao.x, y=posicao.y+2, z=posicao.z}, ef = 122})

addEvent(sandattack, 800, {cid = cid, ar = {x=posicao.x, y=posicao.y+3, z=posicao.z}, ef = 122})

elseif mydir == 1 then

addEvent(sandattack, 0, {cid = cid, ar = {x=posicao.x+1, y=posicao.y, z=posicao.z}, ef = 121})

addEvent(sandattack, 400, {cid = cid, ar = {x=posicao.x+2, y=posicao.y, z=posicao.z}, ef = 121})

addEvent(sandattack, 800, {cid = cid, ar = {x=posicao.x+3, y=posicao.y, z=posicao.z}, ef = 121})

elseif mydir == 3 then

addEvent(sandattack, 0, {cid = cid, ar = {x=posicao.x-1, y=posicao.y, z=posicao.z}, ef = 119})

addEvent(sandattack, 400, {cid = cid, ar = {x=posicao.x-2, y=posicao.y, z=posicao.z}, ef = 119})

addEvent(sandattack, 800, {cid = cid, ar = {x=posicao.x-3, y=posicao.y, z=posicao.z}, ef = 119})

end

 

elseif spell == "Spark" then

 

local function spark(params)

if isCreature(params.cid) then

doSendDistanceShoot(getThingPositionWithDebug(params.cid), params.cidpos, 40)

doAreaCombatHealth(cid, ELECTRICDAMAGE, params.cidpos, 0, -min, -max, 48)

end

end

for a = -1, 1 do

for b = -1, 1 do

cidpos = getThingPositionWithDebug(cid)

cidpos.x = cidpos.x+a

cidpos.y = cidpos.y+b

addEvent(spark, math.abs(a)*350 + math.abs(b)*650, {cid = cid, cidpos = cidpos})

end

end

 

elseif spell == "Razor Leaf" then

 

local alvo = getMasterTarget(cid)

 

local function throw(cid, target)

if isCreature(cid) then

if isCreature(target) then

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 8)

addEvent(doAreaCombatWithDelay, getDistanceBetween(getThingPositionWithDebug(cid), getThingPositionWithDebug(target)) * 60, cid, target, getThingPositionWithDebug(target), 0, GRASSDAMAGE, 3, -min, -max)

end

end

end

 

addEvent(throw, 0, cid, alvo)

addEvent(throw, 550, cid, alvo)

 

elseif spell == "Waterball" then

 

local function throw(params)

if isCreature(params.cid) then

if isCreature(getMasterTarget(params.cid)) then

doSendDistanceShoot(getThingPositionWithDebug(params.cid), getThingPositionWithDebug(getMasterTarget(params.cid)), 2)

addEvent(doAreaCombatWithDelay, getDistDelay, cid, target, getThingPositionWithDebug(target), waba, WATERDAMAGE, 68, -min, -max)

end

end

end

 

addEvent(throw, 0, {cid = cid})

 

elseif spell == "Restore" or spell == "Selfheal" or spell == "Recover" then

 

local amount = getSpecialAttack(cid) * 2 * healMultiplier

doSendMagicEffect(getThingPositionWithDebug(cid), 14)

doCreatureAddHealth(cid, amount)

doSendAnimatedText(getThingPositionWithDebug(cid), "+"..amount.."", 35)

 

elseif spell == "Acid" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 14)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 20)

 

elseif spell == "Thundershock" or spell == "Thunder Shock" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 40)

doAreaCombatHealthAtDistance(cid, ELECTRICDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 48)

 

elseif spell == "Water Pulse" then

 

local function throw(params)

if isCreature(params.cid) then

if isCreature(getMasterTarget(params.cid)) then

doSendDistanceShoot(getThingPositionWithDebug(params.cid), getThingPositionWithDebug(getMasterTarget(params.cid)), 33)

addEvent(doAreaCombatWithDelay, getDistDelay, cid, target, getThingPositionWithDebug(target), 0, WATERDAMAGE, 68, -min, -max)

end

end

end

 

addEvent(throw, 0, {cid = cid})

 

elseif spell == "String Shot" then

 

local target = getMasterTarget(cid)

local rounds = math.random(6, 10)

rounds = rounds + math.floor(getPokemonLevel(cid) / 20)

doAdvancedBlind(target, rounds, getPlayerStorageValue(target, 3890), 137)

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 23)

 

elseif spell == "Thunder Wave" then

 

if mydir == 0 then

doAreaCombatHealth(cid, THUNDERWAVEDAMAGE, getThingPositionWithDebug(cid), tsn, -min, -max, 48)

elseif mydir == 1 then

doAreaCombatHealth(cid, THUNDERWAVEDAMAGE, getThingPositionWithDebug(cid), tse, -min, -max, 48)

elseif mydir == 2 then

doAreaCombatHealth(cid, THUNDERWAVEDAMAGE, getThingPositionWithDebug(cid), tss, -min, -max, 48)

elseif mydir == 3 then

doAreaCombatHealth(cid, THUNDERWAVEDAMAGE, getThingPositionWithDebug(cid), tsw, -min, -max, 48)

end

 

elseif spell == "Leech Seed" then

 

local leecher = cid

local leeched = getMasterTarget(cid)

local dmg = 1.5 * getPokemonLevel(cid)

 

local function drain(cid, target)

if isCreature(cid) and isCreature(target) then

local life = getCreatureHealth(target)

doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(target), 0, -dmg, -dmg, 45)

local newlife = life - getCreatureHealth(leeched)

if newlife >= 1 then

doSendMagicEffect(getThingPositionWithDebug(leecher), 14)

doCreatureAddHealth(leecher, newlife)

doSendAnimatedText(getThingPositionWithDebug(leecher), "+"..newlife.."", 32)

end

end

end

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 1)

for rounds = 1, 5 do

addEvent(drain, 2000 * rounds, leecher, leeched)

end

 

elseif spell == "Sludge" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 6)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 116)

 

elseif spell == "Poison Sting" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 15)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 8)

 

elseif spell == "Bug Bite" then

 

doAreaCombatHealth(cid, BUGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Pin Missile" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 13)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Rock Slide" then

 

local function doRockHurt(cid, target)

if not isCreature(target) or not isCreature(cid) then return true end

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 44)

end

 

local function doFallRock(cid, target)

if not isCreature(target) or not isCreature(cid) then return true end

local pos = getThingPositionWithDebug(target)

pos.x = pos.x + math.random(-3, 1)

local ry = math.random(5, 7)

pos.y = pos.y - ry

doSendDistanceShoot(pos, getThingPositionWithDebug(target), 11)

addEvent(doRockHurt, ry * 52, cid, target)

end

 

local alvo = getMasterTarget(cid)

 

for rocks = 0, 4 do

addEvent(doFallRock, rocks * 65, cid, alvo)

end

 

elseif spell == "Gust" then

 

local posicao = getThingPositionWithDebug(cid)

 

local function gust(params)

if isCreature(params.cid) and isSightClear(posicao, params.ar, false) then

doAreaCombatHealth(cid, FLYINGDAMAGE, params.ar, sand1, -min, -max, 42)

end

end

 

if mydir == 0 then

for b = 0, 3 do

addEvent(gust, 350 * b, {cid = cid, ar = {x=posicao.x, y=posicao.y-(b+1), z=posicao.z}})

end

elseif mydir == 2 then

for b = 0, 3 do

addEvent(gust, 350 * b, {cid = cid, ar = {x=posicao.x, y=posicao.y+(b+1), z=posicao.z}})

end

elseif mydir == 1 then

for b = 0, 3 do

addEvent(gust, 350 * b, {cid = cid, ar = {x=posicao.x+(1+b), y=posicao.y, z=posicao.z}})

end

elseif mydir == 3 then

for b = 0, 3 do

addEvent(gust, 350 * b, {cid = cid, ar = {x=posicao.x-(1+b), y=posicao.y, z=posicao.z}})

end

end

 

elseif spell == "Whirlwind" then

 

local posicao = getThingPositionWithDebug(cid)

 

local function wwind(params)

if isCreature(cid) and isSightClear(posicao, params.ar, false) then

doAreaCombatHealth(cid, FLYINGDAMAGE, params.ar, params.br, -min, -max, 42)

end

end

 

if mydir == 0 then

addEvent(wwind, 0, {cid = cid, ar = {x=posicao.x, y=posicao.y-1, z=posicao.z}, br = sand1})

addEvent(wwind, 350, {cid = cid, ar = {x=posicao.x, y=posicao.y-2, z=posicao.z}, br = whirl3})

addEvent(wwind, 700, {cid = cid, ar = {x=posicao.x, y=posicao.y-3, z=posicao.z}, br = whirl5})

addEvent(wwind, 1050, {cid = cid, ar = {x=posicao.x, y=posicao.y-4, z=posicao.z}, br = whirl5})

elseif mydir == 2 then

addEvent(wwind, 0, {cid = cid, ar = {x=posicao.x, y=posicao.y+1, z=posicao.z}, br = sand1})

addEvent(wwind, 350, {cid = cid, ar = {x=posicao.x, y=posicao.y+2, z=posicao.z}, br = whirl3})

addEvent(wwind, 700, {cid = cid, ar = {x=posicao.x, y=posicao.y+3, z=posicao.z}, br = whirl5})

addEvent(wwind, 1050, {cid = cid, ar = {x=posicao.x, y=posicao.y+4, z=posicao.z}, br = whirl5})

elseif mydir == 1 then

addEvent(wwind, 0, {cid = cid, ar = {x=posicao.x+1, y=posicao.y, z=posicao.z}, br = sand1})

addEvent(wwind, 350, {cid = cid, ar = {x=posicao.x+2, y=posicao.y, z=posicao.z}, br = whirl32})

addEvent(wwind, 700, {cid = cid, ar = {x=posicao.x+3, y=posicao.y, z=posicao.z}, br = whirl52})

addEvent(wwind, 1050, {cid = cid, ar = {x=posicao.x+4, y=posicao.y, z=posicao.z}, br = whirl52})

elseif mydir == 3 then

addEvent(wwind, 0, {cid = cid, ar = {x=posicao.x-1, y=posicao.y, z=posicao.z}, br = sand1})

addEvent(wwind, 350, {cid = cid, ar = {x=posicao.x-2, y=posicao.y, z=posicao.z}, br = whirl32})

addEvent(wwind, 700, {cid = cid, ar = {x=posicao.x-3, y=posicao.y, z=posicao.z}, br = whirl52})

addEvent(wwind, 1050, {cid = cid, ar = {x=posicao.x-4, y=posicao.y, z=posicao.z}, br = whirl52})

end

 

elseif spell == "Hyper Fang" then

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 159)

 

elseif spell == "Rollout" then

 

 

if getCreatureName(cid) == "Voltorb" then

doSetCreatureOutfit(cid, voltorb, 8300)

elseif getCreatureName(cid) == "Electrode" then

doSetCreatureOutfit(cid, electrode, 8300)

elseif getCreatureName(cid) == "Sandshrew" then

doSetCreatureOutfit(cid, sandshrew, 8300)

elseif getCreatureName(cid) == "Sandslash" then

doSetCreatureOutfit(cid, sandslash, 8300)

elseif getCreatureName(cid) == "Phanpy" then

doSetCreatureOutfit(cid, phanpy, 8300)

elseif getCreatureName(cid) == "Dolphan" then

doSetCreatureOutfit(cid, dolphan, 8300)

elseif getCreatureName(cid) == "Miltank" then

doSetCreatureOutfit(cid, miltank, 8300)

elseif getCreatureName(cid) == "Golem" then

doSetCreatureOutfit(cid, golem, 8300)

elseif getCreatureName(cid) == "Shiny Electrode" then

doSetCreatureOutfit(cid, shinyelectrode, 8300)

elseif getCreatureName(cid) == "Shiny Sandshrew" then

doSetCreatureOutfit(cid, shinysandshrew, 8300)

elseif getCreatureName(cid) == "Shiny Sandslash" then

doSetCreatureOutfit(cid, shinysandslash, 8300)

elseif getCreatureName(cid) == "Shiny Golem" then

doSetCreatureOutfit(cid, shinygolem, 8300)

elseif getCreatureName(cid) == "Shiny Voltorb" then

doSetCreatureOutfit(cid, shinyvoltorb, 8300)

end

 

doCreatureAddCondition(cid, rollspeedcondition)

 

local outfit = getCreatureOutfit(cid).lookType

 

local function roll(cid, outfit)

if not isCreature(cid) then return true end

if getCreatureOutfit(cid).lookType ~= outfit then return true end

doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255)

end

 

for r = 1, 8 do

addEvent(roll, 750 * r, cid, outfit)

end

 

elseif spell == "Vine Whip" then

 

local area = getThingPositionWithDebug(cid)

local dano = {}

local effect = 255

 

if mydir == 0 then

area.x = area.x + 1

area.y = area.y - 1

dano = whipn

effect = 80

elseif mydir == 1 then

area.x = area.x + 2

area.y = area.y + 1

dano = whipe

effect = 83

elseif mydir == 2 then

area.x = area.x + 1

area.y = area.y + 2

dano = whips

effect = 81

elseif mydir == 3 then

area.x = area.x - 1

area.y = area.y + 1

dano = whipw

effect = 82

end

 

doSendMagicEffect(area, effect)

doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(cid), dano, -min, -max, 255)

 

elseif spell == "Psycho Shift" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39)

doAreaCombatHealthAtDistance(cid, PSYCHOSHIFTDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 134)

 

elseif spell == "Poison Bomb" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 14)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), bomb, -min, -max, 114)

 

elseif spell == "Toxic Needle" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 15)

doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 8)

 

elseif spell == "Harden" then

 

local function effect(params)

if isCreature(params.cid) then

doSendMagicEffect(getThingPositionWithDebug(params.cid), 144)

end

end

 

local function doReduceDefense(cid, qnt)

if not isCreature(cid) then return true end

local a = getDefense(cid)

setPlayerStorageValue(cid, 1002, a - qnt)

end

 

local function doDoubleDefense(cid)

if not isCreature(cid) then return true end

local a = getDefense(cid)

setPlayerStorageValue(cid, 1002, a * 2)

local b = getDefense(cid)

local c = b - a

addEvent(doReduceDefense, 11 * 1500 + 40, cid, c)

end

 

doDoubleDefense(cid)

 

for times = 0, 11 do

addEvent(effect, 1500 * times + 40, {cid = cid})

end

 

elseif spell == "Fireball" then

 

doSendMoveEffect(cid, getMasterTarget(cid), 3)

 

local function damage(cid, target)

if not isCreature(cid) or not isCreature(target) then return true end

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(target), waba, -min, -max, 5)

end

 

addEvent(damage, 100, cid, getMasterTarget(cid))

 

elseif spell == "Toxic" then

 

if mydir == 0 then

areaa = toxicn

elseif mydir == 1 then

areaa = toxice

elseif mydir == 2 then

areaa = toxics

elseif mydir == 3 then

areaa = toxicw

end

 

doAreaCombatHealth(cid, POISONDAMAGE, getThingPositionWithDebug(cid), areaa, -min, -max, 114)

 

elseif spell == "Aqua Tail" then

 

local function rebackSpd(cid, sss)

if not isCreature(cid) then return true end

doChangeSpeed(cid, sss)

setPlayerStorageValue(cid, 446, -1)

end

 

local x = getCreatureSpeed(cid)

doFaceOpposite(cid)

doChangeSpeed(cid, -x)

addEvent(rebackSpd, 400, cid, x)

setPlayerStorageValue(cid, 446, 1)

doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 68)

 

elseif spell == "Fire Fang" then

 

local target = getMasterTarget(cid)

 

doSendMagicEffect(getThingPositionWithDebug(getMasterTarget(cid)), 146)

 

local function doBite(cid, target)

if not isCreature(cid) or not isCreature(target) then return true end

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 15)

end

 

addEvent(doBite, 200, cid, target)

 

elseif spell == "Psy Pulse" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 24)

doAreaCombatHealthAtDistance(cid, PSYCHICDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 136)

 

elseif spell == "Ember" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 3)

doAreaCombatHealthAtDistance(cid, FIREDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 15)

 

elseif spell == "Wing Attack" then

 

local damagearea = {}

local effectpos = getThingPositionWithDebug(cid)

local effect = 255

local a = isCreature(getMasterTarget(cid)) and getCreatureDirectionToTarget(cid, getMasterTarget(cid)) or getCreatureLookDir(cid)

 

if a == 0 then

effect = 128

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y - 1

damagearea = wingdn

elseif a == 1 then

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y + 1

effect = 129

damagearea = wingde

elseif a == 2 then

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y + 1

effect = 131

damagearea = wingds

elseif a == 3 then

effectpos.x = effectpos.x - 1

effectpos.y = effectpos.y + 1

effect = 130

damagearea = wingdw

end

 

doSendMagicEffect(effectpos, effect)

doAreaCombatHealth(cid, FLYINGDAMAGE, getThingPositionWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE)

 

elseif spell == "Poisonous Wing" then

 

local damagearea = {}

local effectpos = getThingPositionWithDebug(cid)

local effect = 255

local a = isCreature(getMasterTarget(cid)) and getCreatureDirectionToTarget(cid, getMasterTarget(cid)) or getCreatureLookDir(cid)

 

if a == 0 then

effect = 128

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y - 1

damagearea = wingdn

elseif a == 1 then

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y + 1

effect = 129

damagearea = wingde

elseif a == 2 then

effectpos.x = effectpos.x + 1

effectpos.y = effectpos.y + 1

effect = 131

damagearea = wingds

elseif a == 3 then

effectpos.x = effectpos.x - 1

effectpos.y = effectpos.y + 1

effect = 130

damagearea = wingdw

end

 

doSendMagicEffect(effectpos, effect)

doAreaCombatHealth(cid, POISONDAMAGE, getThingPositionWithDebug(cid), damagearea, -min, -max, 114)

 

elseif spell == "Mud Bomb" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 38)

 

local function doDamageWithDelay(cid, target)

if not isCreature(cid) or not isCreature(target) then return true end

doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), bomb, -min, -max, 116)

doAreaCombatHealth(cid, null, getThingPositionWithDebug(getMasterTarget(cid)), bomb, 0, 0, 34)

 

if math.random(1, 100) >= 50 then

local rounds = math.random(6, 10)

rounds = rounds + math.floor(getPokemonLevel(cid) / 20)

doAdvancedBlind(target, rounds, getPlayerStorageValue(target, 3890), 34)

end

end

 

addEvent(doDamageWithDelay, getDistDelay, cid, target)

 

elseif spell == "Sonicboom" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 33)

doAreaCombatHealthAtDistance(cid, NORMALDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 1)

 

elseif spell == "Flamethrower" then

 

local flamepos = getThingPositionWithDebug(cid)

local effect = 255

local a = isCreature(getMasterTarget(cid)) and getCreatureDirectionToTarget(cid, getMasterTarget(cid)) or getCreatureLookDir(cid)

 

if a == 0 then

flamepos.x = flamepos.x+1

flamepos.y = flamepos.y-1

effect = 106

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), flamen, -min, -max, 255)

elseif a == 1 then

flamepos.x = flamepos.x+3

flamepos.y = flamepos.y+1

effect = 109

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), flamee, -min, -max, 255)

elseif a == 2 then

flamepos.x = flamepos.x+1

flamepos.y = flamepos.y+3

effect = 107

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), flames, -min, -max, 255)

elseif a == 3 then

flamepos.x = flamepos.x-1

flamepos.y = flamepos.y+1

effect = 108

doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), flamew, -min, -max, 255)

end

 

doSendMagicEffect(flamepos, effect)

 

elseif spell == "Selfdestruct" then

 

setPlayerStorageValue(cid, 33, 1)

 

local function death(params)

if isCreature(params.cid) then

doCreatureAddHealth(params.cid, -getCreatureMaxHealth(cid))

end

end

 

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), destruct1, -min, -max, 5)

addEvent(doAreaCombatHealth, 150, cid, NORMALDAMAGE, getThingPositionWithDebug(cid), destruct2, -(min*0.7), -(max*0.8), 5)

addEvent(doAreaCombatHealth, 250, cid, NORMALDAMAGE, getThingPositionWithDebug(cid), destruct3, -(min*0.4), -(max*0.5), 5)

addEvent(death, 250, {cid = cid})

 

elseif spell == "Drill Peck" then

 

doAreaCombatHealth(cid, FLYDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 110)

 

local hitalvo = getMasterTarget(cid)

 

local function hit(cid, target)

if isCreature(cid) and isCreature(target) then

if getMasterTarget(cid) == target then

doAreaCombatHealth(cid, FLYDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 110)

end

end

end

 

addEvent(hit, 480, cid, hitalvo)

addEvent(hit, 880, cid, hitalvo)

 

elseif spell == "Dizzy Punch" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 26)

doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

local rounds = getPokemonLevel(cid) / 12

rounds = rounds + 2

doAdvancedConfuse(target, rounds, getPlayerStorageValue(target, 3891))

 

elseif spell == "Poison Gas" then

 

local function gas(params)

if not isCreature(params.cid) then return true end

doAreaCombatHealth(params.cid, POISONDAMAGE, getThingPositionWithDebug(cid), bomb2, -min, -max, 114)

end

 

addEvent(gas, 000, {cid = cid, cb = cb})

addEvent(gas, 500, {cid = cid, cb = cb})

addEvent(gas, 1000, {cid = cid, cb = cb})

addEvent(gas, 1500, {cid = cid, cb = cb})

addEvent(gas, 2300, {cid = cid, cb = cb})

addEvent(gas, 2800, {cid = cid, cb = cb})

addEvent(gas, 3300, {cid = cid, cb = cb})

addEvent(gas, 3800, {cid = cid, cb = cb})

addEvent(gas, 4600, {cid = cid, cb = cb})

addEvent(gas, 5100, {cid = cid, cb = cb})

 

elseif spell == "Twister" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 36)

doAreaCombatHealthAtDistance(cid, DRAGONDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 42)

 

elseif spell == "Rock Tomb" then

 

local rock1 = {}

local rock2 = {}

local rock3 = {}

local a = isCreature(getMasterTarget(cid)) and getCreatureDirectionToTarget(cid, getMasterTarget(cid)) or getCreatureLookDir(cid)

 

if a == 0 then

rock1 = {x=getThingPositionWithDebug(cid).x+1, y=getThingPositionWithDebug(cid).y-1, z=getThingPositionWithDebug(cid).z}

rock2 = {x=getThingPositionWithDebug(cid).x+0, y=getThingPositionWithDebug(cid).y-1, z=getThingPositionWithDebug(cid).z}

rock3 = {x=getThingPositionWithDebug(cid).x-1, y=getThingPositionWithDebug(cid).y-1, z=getThingPositionWithDebug(cid).z}

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPositionWithDebug(cid), tombn, -min, -max, 118)

elseif a == 2 then

rock1 = {x=getThingPositionWithDebug(cid).x+1, y=getThingPositionWithDebug(cid).y+1, z=getThingPositionWithDebug(cid).z}

rock2 = {x=getThingPositionWithDebug(cid).x+0, y=getThingPositionWithDebug(cid).y+1, z=getThingPositionWithDebug(cid).z}

rock3 = {x=getThingPositionWithDebug(cid).x-1, y=getThingPositionWithDebug(cid).y+1, z=getThingPositionWithDebug(cid).z}

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPositionWithDebug(cid), tombs, -min, -max, 118)

elseif a == 3 then

rock1 = {x=getThingPositionWithDebug(cid).x-1, y=getThingPositionWithDebug(cid).y+1, z=getThingPositionWithDebug(cid).z}

rock2 = {x=getThingPositionWithDebug(cid).x-1, y=getThingPositionWithDebug(cid).y+0, z=getThingPositionWithDebug(cid).z}

rock3 = {x=getThingPositionWithDebug(cid).x-1, y=getThingPositionWithDebug(cid).y-1, z=getThingPositionWithDebug(cid).z}

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPositionWithDebug(cid), tombw, -min, -max, 118)

elseif a == 1 then

rock1 = {x=getThingPositionWithDebug(cid).x+1, y=getThingPositionWithDebug(cid).y+1, z=getThingPositionWithDebug(cid).z}

rock2 = {x=getThingPositionWithDebug(cid).x+1, y=getThingPositionWithDebug(cid).y+0, z=getThingPositionWithDebug(cid).z}

rock3 = {x=getThingPositionWithDebug(cid).x+1, y=getThingPositionWithDebug(cid).y-1, z=getThingPositionWithDebug(cid).z}

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPositionWithDebug(cid), tombe, -min, -max, 118)

end

 

doSendDistanceShoot(getThingPositionWithDebug(cid), rock1, 11)

doSendDistanceShoot(getThingPositionWithDebug(cid), rock2, 11)

doSendDistanceShoot(getThingPositionWithDebug(cid), rock3, 11)

 

elseif spell == "Discharge" then

 

local function discharge(cid, time)

if not isCreature(cid) then

return true

end

 

if time == 0 then

doSendAnimatedText(getThingPositionWithDebug(cid), "CHARGING", 210)

doSendMagicEffect(getThingPositionWithDebug(cid), 48)

addEvent(discharge, 1000, cid, time + 1)

return true

end

 

if math.random(1, 100) >= 78 then

doCreatureSay(cid, "DISCHARGE!", TALKTYPE_MONSTER)

doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), charge, -(min*(time)), -(max*(time)), 48)

else

if time >= 6 then

doSendAnimatedText(getThingPositionWithDebug(cid), "FAIL", 215)

return true

end

 

doSendAnimatedText(getThingPositionWithDebug(cid), "CHARGING", 210)

doSendMagicEffect(getThingPositionWithDebug(cid), 48)

addEvent(discharge, 1000, cid, time + 1)

return true

end

end

 

discharge(cid, 0)

 

elseif spell == "Mega Prick" then

 

doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(getMasterTarget(cid)), 25)

doAreaCombatHealthAtDistance(cid, BUGDAMAGE, getThingPositionWithDebug(getMasterTarget(cid)), 0, -min, -max, 3)

 

elseif spell == "Gunk Shot" then

 

%0

 

 

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

@shadow2012

No caso do npc vendedora, tenta mudar onde ta

 

scripts/diamonds.lua

Mas parece que ja disseram isso

para

diamonds.lua

Sobre banir pode usar Rule Violations e mudar nome do alvo e colocar as opções lá

 

@Kurobisu

Vai em outro arquivo servidor que tenha ai, no status library procura a função que diz que ta faltando "canAttackOther" e coloca no teu atual que deve parar o bug

 

@Jhonsy

Dizem que tinha um sprite editor q mudava isso so nao consegui baixar e nem utilizar eu coloco sprite encima de sprite

 

@gugaevt

Não é bug, é so ir no configuration.lua e mudar

 

onde ta

useKpdoDlls = true

para

useKpdoDlls = false

 

Ou vice-versa ou algo parecido com isso

 

 

@Pag 412

 

SPOILER PASSOU LONGE DESSA PAGINA

Quando colocarem spoiler eu termino as duv dessa pagina e.e

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

All, queria sabe se fico daorinha minha hunt de meganium e venusaur '-'

 

 

1° parte

2q1i4x2.png

 

2° parte xd

 

2ns8hee.png

 

 

se tiver algo que ta horrivel ou que tenhu que melhora fala por pvt ou aqui msm xd

quem precisar de mapper só da um aviso pvt :D

Link para o comentário
Compartilhar em outros sites

All, queria sabe se fico daorinha minha hunt de meganium e venusaur '-'

 

 

1° parte

2q1i4x2.png

 

2° parte xd

 

2ns8hee.png

 

 

se tiver algo que ta horrivel ou que tenhu que melhora fala por pvt ou aqui msm xd

quem precisar de mapper só da um aviso pvt :D

Tente melhorar a 1° parte, ta mt quadrada o terril

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

alguém sabe me responder por que a minha barra de PK tá ficando assim? Quando eu ponho um pk. da primeira geração aparece ok.. mas se eu ponho um da segunda, fica tudo preto ali na barra.. alguém sabe o que pode ser?

 

2irp0ti.jpg

 

Link para o comentário
Compartilhar em outros sites

alguém sabe me responder por que a minha barra de PK tá ficando assim? Quando eu ponho um pk. da primeira geração aparece ok.. mas se eu ponho um da segunda, fica tudo preto ali na barra.. alguém sabe o que pode ser?

 

2irp0ti.jpg

 

Velho, deve ser porque seu pokebar.lua ou algo do tipo não está cadastrado a portait do Pokémon.

Dá uma procurada aí.

Link para o comentário
Compartilhar em outros sites

Velho, deve ser porque seu pokebar.lua ou algo do tipo não está cadastrado a portait do Pokémon.

Dá uma procurada aí.

 

Aqui num tem pokebar.lua não.. tem só o cdbar.lua, mas mesmo assim num tem nada sobre os portraits ;s

Link para o comentário
Compartilhar em outros sites

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