StyloMaldoso 330 Postado Julho 12, 2012 Share Postado Julho 12, 2012 (editado) digodigo2 Na boa, para de flood mais acho que esse system é foda de fazer porque, 1° igual o slicer disse é + de 350 efect que tem que adiciona no cliente e 2° Eu acho que não é facil fazer , eu acho que é uma tabela bem chatinha de fazer kk na boa, eu acho aquele lek que fez ele não quer posta, se ele não posto até hoje, não irá postar mais e para de flood aproveitando.. Alguem ae que abaxo o server do slicer, que não tem aquele erro do move1 pode colokar o link para dowload sem o erro? vlws ;D Olha eu vi umas pessoa pergutando por private, como que adiciona os "%" a mais da vocaçao no clan eu acho que é no pokemon Moves se não for fala na onde é porque não sei direto vo posta meu pokemon Moves e voces achão ae --[[ *** functions *** •doMoveInAreaWithMiss(cid, area, effect, cd, atkName, paralize, element, min, max) •Da uma atk com efeito que deixa os alvos com efeito de 'MISS'... •doMoveInArea(cid, rounds, effect, area, min, max, element, atkName) •Da um atk 'nomal' e tb atks que deixam os alvos com efeito de 'Confuso'... •doMoveInAreaMulti(cid, effDistance, effMagic, areaEff, areaDano, element, min, max) •Da um atk estilo 'Multi-Kick, Bullet Seed' e afins... --]] const_distance_delay = 56 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) if isSummon(cid) then return getCreatureTarget(getCreatureMaster(cid)) else return getCreatureTarget(cid) end end function doAreaCombatWithDelay(cid, target, pos, area, type, effect, a, b) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 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 isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isCreature(cid) and isCreature(target) then delay = getDistanceBetween(getThingPosWithDebug(cid), getThingPosWithDebug(target)) * const_distance_delay addEvent(doAreaCombatWithDelay, delay, cid, target, getThingPosWithDebug(target), 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 local target = 0 local getDistDelay = 0 if isCreature(getMasterTarget(cid)) then target = getMasterTarget(cid) getDistDelay = getDistanceBetween(getThingPositionWithDebug(cid), getThingPositionWithDebug(target)) * const_distance_delay end 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(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) 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) * 0.95 + getSpecialAttack(cid) * 0.45 ---original, 1.4 / 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 --- BURN SKIN ----------------------------- if getPlayerStorageValue(cid, 974848) >= 1 then min = min*2 max = max*2 end --- FOCUS ---------------------------------- if getPlayerStorageValue(cid, 253) >= 0 and movesinfo[spell] and movesinfo[spell].f ~= 0 then min = min * 2 max = max * 2 setPlayerStorageValue(cid, 253, -1) end --- Shredder Team ------------------------------- if getPlayerStorageValue(cid, 637500) >= 1 then min = 0 max = 0 end ------------------Miss System-------------------------- local cd = getPlayerStorageValue(cid, 32659) local cd2 = getPlayerStorageValue(cid, 3891) if cd > 0 or cd2 > 0 then if math.random(1, 100) > 30 then doSendAnimatedText(getThingPos(cid), "MISS", 215) return false end end ---------------GHOST DAMAGE----------------------- ghostDmg = GHOSTDAMAGE if getPlayerStorageValue(cid, 999457) >= 1 then ghostDmg = NORMALDAMAGE addEvent(setPlayerStorageValue, 50, cid, 999457, -1) end ---------------SelfDestruction----------------- canDoSelf = true ----------------REFLECT------------------------- local uid = checkAreaUid(getCreaturePosition(cid), BigArea2, 1, 1) for _,pid in pairs(uid) do if isCreature(pid) then if getPlayerStorageValue(cid, 21099) >= 1 then if getPlayerStorageValue(pid, 21101) >= 1 then target = pid setPlayerStorageValue(cid, 21099, 0) setPlayerStorageValue(pid, 21101, 0) end elseif getPlayerStorageValue(pid, 21099) >= 1 and pid ~= cid then if not isInArray({"Reflect", "Team Slice", "Magic Coat", "Shredder Team"}, spell) then addEvent(docastspell, 100, pid, spell) doSendMagicEffect(getThingPos(pid), 135) doSendAnimatedText(getThingPos(pid), "REFLECT", COLOR_GRASS) setPlayerStorageValue(cid, 21101, 1) canDoSelf = false min = 0 max = 0 end end end end -------------------------------------------------- element = movesinfo[spell].t if isSummon(cid) then if getPlayerVocation(getCreatureMaster(cid)) == 7 and element == "water" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 4 and element == "electric" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 5 and element == "fire" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 6 and element == "flying" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 6 and element == "dragon" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 7 and element == "ice" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 8 and element == "grass" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 8 and element == "bug" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 9 and element == "ghost" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 9 and element == "poison" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 10 and element == "rock" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 10 and element == "earth" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 11 and element == "fighting" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 11 and element == "normal" then min = min + (min * 0.30) max = max + (max * 0.30) elseif getPlayerVocation(getCreatureMaster(cid)) == 12 and element == "psychic" then min = min + (min * 0.30) max = max + (max * 0.30) end end if spell == "Reflect" or spell == "Magic Coat" then if spell == "Magic Coat" then eff = 11 else eff = 135 end doSendMagicEffect(getThingPositionWithDebug(cid), eff) setPlayerStorageValue(cid, 21099, 75) local function doEndReflect(cid) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 21099) <= 0 then --doSendAnimatedText(getThingPos(cid), "BREAK", COLOR_BURN) doSendMagicEffect(getThingPositionWithDebug(cid), eff) return true end setPlayerStorageValue(cid, 21099, getPlayerStorageValue(cid, 21099) - 1) addEvent(doEndReflect, 200, cid) end addEvent(doEndReflect, 200, cid) elseif spell == "Quick Attack" then doSendMagicEffect(getThingPositionWithDebug(cid), 211) local x = getClosestFreeTile(cid, getThingPositionWithDebug(target)) doTeleportThing(cid, x, false) doFaceCreature(cid, getThingPositionWithDebug(target)) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 3) elseif spell == "Razor Leaf" then local function throw(cid, target) if not isCreature(cid) or not isCreature(target) then return false end if isSleeping(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 8) doAreaCombatHealthAtDistance(cid, GRASSDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 245) end addEvent(throw, 0, cid, target) addEvent(throw, 350, cid, target) 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, 245) elseif spell == "Headbutt" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 118) elseif spell == "Leech Seed" then local leecher = cid local leeched = target 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(target) if newlife >= 1 then doSendMagicEffect(getThingPositionWithDebug(cid), 14) doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPositionWithDebug(cid), "+"..newlife.."", 32) end end end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 1) for rounds = 1, 5 do addEvent(drain, 2000 * rounds, leecher, leeched) end elseif spell == "Solar Beam" then local function useSolarBeam(cid) if not isCreature(cid) then return true end if isSleeping(cid) then return true end local effect1 = 255 local effect2 = 255 local effect3 = 255 local effect4 = 255 local effect5 = 255 local area = {} local pos1 = getThingPositionWithDebug(cid) local pos2 = getThingPositionWithDebug(cid) local pos3 = getThingPositionWithDebug(cid) local pos4 = getThingPositionWithDebug(cid) local pos5 = getThingPositionWithDebug(cid) if getCreatureLookDir(cid) == 1 then effect1 = 4 effect2 = 10 effect3 = 10 effect4 = 10 effect5 = 26 pos1.x = pos1.x + 2 pos1.y = pos1.y + 1 pos2.x = pos2.x + 3 pos2.y = pos2.y + 1 pos3.x = pos3.x + 4 pos3.y = pos3.y + 1 pos4.x = pos4.x + 5 pos4.y = pos4.y + 1 pos5.x = pos5.x + 6 pos5.y = pos5.y + 1 area = solare elseif getCreatureLookDir(cid) == 0 then effect1 = 36 effect2 = 37 effect3 = 37 effect4 = 38 pos1.x = pos1.x + 1 pos1.y = pos1.y - 1 pos2.x = pos2.x + 1 pos2.y = pos2.y - 3 pos3.x = pos3.x + 1 pos3.y = pos3.y - 4 pos4.x = pos4.x + 1 pos4.y = pos4.y - 5 area = solarn elseif getCreatureLookDir(cid) == 2 then effect1 = 46 effect2 = 50 effect3 = 50 effect4 = 59 pos1.x = pos1.x + 1 pos1.y = pos1.y + 2 pos2.x = pos2.x + 1 pos2.y = pos2.y + 3 pos3.x = pos3.x + 1 pos3.y = pos3.y + 4 pos4.x = pos4.x + 1 pos4.y = pos4.y + 5 area = solars elseif getCreatureLookDir(cid) == 3 then effect1 = 115 effect2 = 162 effect3 = 162 effect4 = 162 effect5 = 163 pos1.x = pos1.x - 1 pos1.y = pos1.y + 1 pos2.x = pos2.x - 3 pos2.y = pos2.y + 1 pos3.x = pos3.x - 4 pos3.y = pos3.y + 1 pos4.x = pos4.x - 5 pos4.y = pos4.y + 1 pos5.x = pos5.x - 6 pos5.y = pos5.y + 1 area = solarw end if effect1 ~= 255 then doSendMagicEffect(pos1, effect1) end if effect2 ~= 255 then doSendMagicEffect(pos2, effect2) end if effect3 ~= 255 then doSendMagicEffect(pos3, effect3) end if effect4 ~= 255 then doSendMagicEffect(pos4, effect4) end if effect5 ~= 255 then doSendMagicEffect(pos5, effect5) end doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255) doRegainSpeed(cid) end local function ChargingBeam(cid) if not isCreature(cid) then return true end if isSleeping(cid) then return true end local tab = {} for x = -2, 2 do for y = -2, 2 do local pos = getThingPositionWithDebug(cid) pos.x = pos.x + x pos.y = pos.y + y if pos.x ~= getThingPositionWithDebug(cid).x and pos.y ~= getThingPositionWithDebug(cid).y then table.insert(tab, pos) end end end doSendDistanceShoot(tab[math.random(#tab)], getThingPositionWithDebug(cid), 37) end doChangeSpeed(cid, -getCreatureSpeed(cid)) for r = 1, 270 do addEvent(ChargingBeam, r*9, cid) end addEvent(useSolarBeam, 2800, cid) elseif spell == "Sleep Powder" then local calc = math.floor(getPokemonLevel(cid) / 20) local v1 = 6 local v2 = v1 + calc doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPositionWithDebug(cid), powders, -v1, -v2, 27) elseif spell == "Stun Spore" then doMoveInAreaWithMiss(cid, confusion, 85, 9, spell, 1, GRASSDAMAGE, 0, 0) elseif spell == "Poison Powder" then local v1 = (10 + getPokemonLevel(cid)) * 2 setPlayerStorageValue(cid, 919231, v1) local v3 = getPokemonLevel(cid) / 10 + 5 doAreaCombatHealth(cid, POISON_POWDERDAMAGE, getThingPositionWithDebug(cid), powders, -v3, -v3, 84) elseif spell == "Bullet Seed" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 1, 45, bullet, bulletDano, GRASSDAMAGE, min, max) elseif spell == "Body Slam" then doBodyPush(cid, target, true) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 3) elseif spell == "Leaf Storm" or tonumber(spell) == 73 then doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(cid), grassarea, -min, -max, 255) local pos = getThingPositionWithDebug(cid) local function doSendLeafStorm(cid, pos) if not isCreature(cid) then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 8) end for a = 1, 250 do local lugar = {x = pos.x + math.random(-9, 9), y = pos.y + math.random(-8, 8), z = pos.z} addEvent(doSendLeafStorm, a * 2, cid, lugar) end elseif spell == "Leaf Dream" or tonumber(spell) == 73 then doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(cid), grassarea, -min, -max, 239) local pos = getThingPositionWithDebug(cid) local function doSendLeafStorm(cid, pos) if not isCreature(cid) then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 8) end for a = 1, 239 do local lugar = {x = pos.x + math.random(-9, 9), y = pos.y + math.random(-8, 8), z = pos.z} addEvent(doSendLeafStorm, a * 2, cid, lugar) end elseif spell == "Scratch" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 142) elseif spell == "Ember" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 3) doAreaCombatHealthAtDistance(cid, FIREDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 15) elseif spell == "Flamethrower" then local flamepos = getThingPos(cid) local effect = 255 local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if a == 0 then flamepos.x = flamepos.x+1 flamepos.y = flamepos.y-1 effect = 106 elseif a == 1 then flamepos.x = flamepos.x+3 flamepos.y = flamepos.y+1 effect = 109 elseif a == 2 then flamepos.x = flamepos.x+1 flamepos.y = flamepos.y+3 effect = 107 elseif a == 3 then flamepos.x = flamepos.x-1 flamepos.y = flamepos.y+1 effect = 108 end doMoveInArea(cid, 0, 2, flamek, min, max, FIREDAMAGE) doSendMagicEffect(flamepos, effect) elseif spell == "Fireball" then doSendDistanceShoot(getThingPos(cid), getThingPositionWithDebug(target), 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, target) elseif spell == "Fire Fang" then doSendMagicEffect(getThingPositionWithDebug(target), 138) local function doBite(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 15) end addEvent(doBite, 200, cid, target) elseif spell == "Fire Blast" then local posicao = getThingPositionWithDebug(cid) local function fireBlast(cid, area1, area2, effect, area3) if not isCreature(cid) then return true end if not isSightClear(posicao, area1, false) then return true end if isSleeping(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, null, area1, 0, -min, -max, effect) if area2.x ~= getThingPositionWithDebug(cid).x or area2.y ~= getThingPositionWithDebug(cid).y then doAreaCombatHealth(cid, null, area2, area3, -min, -max, 35) end doAreaCombatHealth(cid, FIREDAMAGE, area1, area3, -min, -max, 35) end local m = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if m == 0 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y - (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y - a, z = posicao.z}, 60, whirl3) end elseif m == 2 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y + (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y + a, z = posicao.z}, 62, whirl3) end elseif m == 1 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x + a + 1, y = posicao.y, z = posicao.z}, {x = posicao.x + a, y = posicao.y, z = posicao.z}, 61, whirl3) end elseif m == 3 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x - (a + 1), y = posicao.y, z = posicao.z}, {x = posicao.x - a, y = posicao.y, z = posicao.z}, 63, whirl3) end end elseif spell == "Rage" then doBuffSyst(cid, 15, 13, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Raging Blast" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 3, 6, bullet, bulletDano, FIREDAMAGE, min, max) elseif spell == "Monster Blast" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 237, 237, bullet, bulletDano, FIREDAMAGE, min, max) elseif spell == "Dragon Claw" then doAreaCombatHealth(cid, DRAGONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 141) elseif spell == "Wing Attack" then local effectpos = getThingPositionWithDebug(cid) local effect = 255 local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if a == 0 then effect = 128 effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y - 1 elseif a == 1 then effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 1 effect = 129 elseif a == 2 then effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 1 effect = 131 elseif a == 3 then effectpos.x = effectpos.x - 1 effectpos.y = effectpos.y + 1 effect = 130 end doSendMagicEffect(effectpos, effect) doMoveInArea(cid, 0, 2, wingatk, min, max, FLYINGDAMAGE) elseif spell == "Magma Storm" then local eff = {35, 35, 6} local area = {flames2, flames3, flames4} doMoveInArea(cid, 0, 6, flames1, min, max, FIREDAMAGE) addEvent(doMoveInArea, 2*450, cid, 0, 2, flames0, min, max, FIREDAMAGE) for i = 1, 3 do addEvent(doMoveInArea, i*450, cid, 0, eff, area, min, max, FIREDAMAGE) end elseif spell == "Big Explosion" then local eff = {241, 241, 241} local area = {flames2, flames3, flames4} doMoveInArea(cid, 0, 6, flames1, min, max, FIREDAMAGE) addEvent(doMoveInArea, 2*450, cid, 0, 2, flames0, min, max, FIREDAMAGE) for i = 1, 3 do addEvent(doMoveInArea, i*450, cid, 0, eff, area, min, max, FIREDAMAGE) end elseif spell == "Bubbles" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 2) doAreaCombatHealthAtDistance(cid, WATERDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 25) elseif spell == "Clamp" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 2) doAreaCombatHealthAtDistance(cid, WATERDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 53) 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 == "Waterball" then doSendDistanceShoot(getThingPos(cid), getThingPositionWithDebug(target), 2) local function damage(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(target), waba, -min, -max, 68) end addEvent(damage, 100, cid, target) 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(target), 0, -min, -max, 68) elseif spell == "Hydro Cannon" then local posicao = getThingPositionWithDebug(cid) local function HydroCannon(cid, area1, area2, effect, area3) if not isCreature(cid) then return true end if not isSightClear(posicao, area1, false) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doAreaCombatHealth(cid, null, area1, 0, -min, -max, effect) if area2.x ~= getThingPositionWithDebug(cid).x or area2.y ~= getThingPositionWithDebug(cid).y then doAreaCombatHealth(cid, null, area2, area3, -min, -max, 68) end doAreaCombatHealth(cid, WATERDAMAGE, area1, area3, -min, -max, 68) end local m = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if m == 0 then for a = 0, 5 do addEvent(HydroCannon, 300 * a, cid, {x = posicao.x, y = posicao.y - (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y - a, z = posicao.z}, 64, whirl3) end elseif m == 2 then for a = 0, 5 do addEvent(HydroCannon, 300 * a, cid, {x = posicao.x, y = posicao.y + (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y + a, z = posicao.z}, 66, whirl3) end elseif m == 1 then for a = 0, 5 do addEvent(HydroCannon, 300 * a, cid, {x = posicao.x + a + 1, y = posicao.y, z = posicao.z}, {x = posicao.x + a, y = posicao.y, z = posicao.z}, 65, whirl3) end elseif m == 3 then for a = 0, 5 do addEvent(HydroCannon, 300 * a, cid, {x = posicao.x - (a + 1), y = posicao.y, z = posicao.z}, {x = posicao.x - a, y = posicao.y, z = posicao.z}, 67, whirl3) end end elseif spell == "Harden" or spell == "Calm Mind" then if spell == "Harden" then eff = 144 else eff = 133 end doBuffSyst(cid, 15, eff, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Bubble Blast" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 2, 68, bullet, bulletDano, WATERDAMAGE, min, max) elseif spell == "Skull Bash" then doMoveInArea(cid, 0, 118, reto5, min, max, NORMALDAMAGE, spell) elseif spell == "Hydropump" then local pos = getThingPositionWithDebug(cid) local function doSendBubble(cid, pos) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 2) doSendMagicEffect(pos, 53) end for b = 1, 3 do for a = 1, 20 do local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z} addEvent(doSendBubble, a * 75, cid, lugar) end end doAreaCombatHealth(cid, WATERDAMAGE, pos, waterarea, -min, -max, 255) elseif spell == "Tsunami" then local pos = getThingPositionWithDebug(cid) local function doSendBubble(cid, pos) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 2) doSendMagicEffect(pos, 246) end for b = 1, 3 do for a = 1, 20 do local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z} addEvent(doSendBubble, a * 75, cid, lugar) end end doAreaCombatHealth(cid, WATERDAMAGE, pos, waterarea, -min, -max, 255) elseif spell == "String Shot" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 23) if canAttackOther(cid, target) == "Can" then addEvent(doMissSyst, 100, target, 6, 137, getPlayerStorageValue(target, 32659), 1) end elseif spell == "Bug Bite" then doSendMagicEffect(getThingPositionWithDebug(target), 244) local function doBite(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, BUGDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 8) end addEvent(doBite, 200, cid, target) elseif spell == "Super Sonic" then local rounds = math.random(4, 7) rounds = rounds + math.floor(getPokemonLevel(cid) / 35) doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 32) doAdvancedConfuse(target, rounds, getPlayerStorageValue(target, 3891), cid) elseif spell == "Whirlwind" then addEvent(doMoveInArea, 0, cid, 0, 42, SL1, min, max, FLYINGDAMAGE, spell) addEvent(doMoveInArea, 300, cid, 0, 42, SL2, min, max, FLYINGDAMAGE, spell) addEvent(doMoveInArea, 600, cid, 0, 42, SL3, min, max, FLYINGDAMAGE, spell) addEvent(doMoveInArea, 900, cid, 0, 42, SL4, min, max, FLYINGDAMAGE, spell) elseif spell == "Psybeam" then local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) local t = { [0] = 57, [1] = 234, [2] = 58, [3] = 209, } doMoveInArea(cid, 0, t[a], reto4, min, max, PSYCHICDAMAGE, spell) elseif spell == "Sand Attack" then local function doMoveInDirection(cid, mydir) if mydir == 0 then --norte return 120 elseif mydir == 2 then --sul return 122 elseif mydir == 1 then --leste return 121 elseif mydir == 3 then --oeste return 119 end end --(cid, area, eff, cd, nameAtk, cond, element, min, max) doMoveInAreaWithMiss(cid, reto5, doMoveInDirection(cid, mydir), 9, spell, 1, null, 0, 0) elseif spell == "Confusion" or spell == "Night Shade" then local rounds = math.random(4, 7) --rever area... rounds = rounds + math.floor(getPokemonLevel(cid) / 35) if spell == "Confusion" then dano = PSYCHICDAMAGE else dano = ghostDmg end doMoveInArea(cid, rounds, 136, selfArea1, min, max, dano) elseif spell == "Horn Attack" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 15) addEvent(doAreaCombatWithDelay, getDistDelay, cid, target, getThingPositionWithDebug(target), 0, NORMALDAMAGE, 3, -min, -max) elseif spell == "Poison Sting" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 15) doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 8) elseif spell == "Fury Cutter" then local effectpos = getThingPositionWithDebug(cid) local effect = 255 local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if a == 0 then effect = 128 effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y - 1 elseif a == 1 then effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 1 effect = 129 elseif a == 2 then effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 1 effect = 131 elseif a == 3 then effectpos.x = effectpos.x - 1 effectpos.y = effectpos.y + 1 effect = 130 end local function doFury(cid, effect) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doSendMagicEffect(effectpos, effect) doMoveInArea(cid, 0, 2, wingatk, min, max, BUGDAMAGE) end addEvent(doFury, 0, cid, effect) addEvent(doFury, 350, cid, effect) elseif spell == "Pin Missile" then doMoveInAreaMulti(cid, 13, 7, bullet, bulletDano, BUGDAMAGE, min, max) elseif spell == "Strafe" or spell == "Agility" then doBuffSyst(cid, 15, 14, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Gust" then doMoveInArea(cid, 0, 42, reto5, min, max, FLYINGDAMAGE, spell) elseif spell == "Drill Peck" then doAreaCombatHealth(cid, FLYINGDAMAGE, getThingPos(target), 0, -min, -max, 148) elseif spell == "Tornado" then local pos = getThingPositionWithDebug(cid) local function doSendTornado(cid, pos) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 22) doSendMagicEffect(pos, 42) end for b = 1, 3 do for a = 1, 20 do local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z} addEvent(doSendTornado, a * 75, cid, lugar) end end doAreaCombatHealth(cid, FLYINGDAMAGE, pos, waterarea, -min, -max, 255) elseif spell == "Bite" or tonumber(spell) == 5 then doAreaCombatHealth(cid, DARKDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 146) elseif spell == "Super Fang" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 244) elseif spell == "Poison Fang" then doSendMagicEffect(getThingPositionWithDebug(target), 244) local function doBite(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 114) end addEvent(doBite, 200, cid, target) elseif spell == "Sting Gun" then local function doGun(cid, target) if not isCreature(cid) or not isCreature(target) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doSendDistanceShoot(getThingPos(cid), getThingPositionWithDebug(target), 13) doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 8) end addEvent(doGun, 0, cid, target) addEvent(doGun, 100, cid, target) addEvent(doGun, 200, cid, target) elseif spell == "Acid" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 14) doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 20) elseif spell == "Fear" or spell == "Roar" then local rounds = 5 local uid = checkAreaUid(getCreaturePosition(cid), confusion, 1, 1) for _,pid in pairs(uid) do if isSummon(cid) and (isMonster(pid) or isSummon(pid)) and pid ~= cid then if isSummon(pid) and canAttackOther(cid, pid) == "Can" then addEvent(doAdvancedFear, 300, pid, rounds, getPlayerStorageValue(pid, 3894), cid, spell) elseif isMonster(pid) then addEvent(doAdvancedFear, 300, pid, rounds, getPlayerStorageValue(pid, 3894), cid, spell) end elseif isMonster(cid) and (isSummon(pid) or isPlayer(pid)) and pid ~= cid then if isPlayer(pid) and #getCreatureSummons(pid) <= 0 then addEvent(doAdvancedFear, 300, pid, rounds, getPlayerStorageValue(pid, 3894), cid, spell) elseif isSummon(pid) then addEvent(doAdvancedFear, 300, pid, rounds, getPlayerStorageValue(pid, 3894), cid, spell) end end end elseif spell == "Iron 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, STEELDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 160) elseif spell == "Thunder Shock" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 40) doAreaCombatHealthAtDistance(cid, ELECTRICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 48) elseif spell == "Thunder Bolt" then local function doThunderHit(cid, target) if not isCreature(target) or not isCreature(cid) then return true end if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 48) end local function doThunderFall(cid, frompos, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local ry = math.abs(frompos.y - pos.y) doSendDistanceShoot(frompos, getThingPositionWithDebug(target), 41) addEvent(doThunderHit, ry * 11, cid, target) end local function doThunderUp(cid, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local mps = getThingPositionWithDebug(cid) local xrg = math.floor((pos.x - mps.x) / 2) local topos = mps topos.x = topos.x + xrg local rd = 7 topos.y = topos.y - rd doSendDistanceShoot(getThingPositionWithDebug(cid), topos, 41) addEvent(doThunderFall, rd * 49, cid, topos, target) end local alvo = target for thnds = 1, 2 do addEvent(doThunderUp, thnds * 155, cid, alvo) end elseif spell == "Thunder Wave" then --(cid, area, eff, cd, nameAtk, cond, element, min, max) doMoveInAreaWithMiss(cid, tw1, 48, 9, spell, 1, ELECTRICDAMAGE, min, max) elseif spell == "Thunder" then --(cid, area, eff, cd, nameAtk, cond, element, min, max) doMoveInAreaWithMiss(cid, thunderr, 48, 9, spell, 1, ELECTRICDAMAGE, min, max) elseif spell == "Mega Kick" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 113) elseif spell == "Thunder Punch" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doSendMagicEffect(getThingPositionWithDebug(target), 112) local function doPunch(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 48) end addEvent(doPunch, 200, cid, target) elseif spell == "Electric Storm" then local master = isSummon(cid) and getCreatureMaster(cid) or cid for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, ELECTRICDAMAGE, 41, 48) end addEvent(doMoveInAreaWithMiss, 500, cid, BigArea2, 48, 9, spell, 1, ELECTRICDAMAGE, min, max) elseif spell == "Mud Shot" or spell == "Mud Slap" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 6) doTargetCombatHealth(cid, target, GROUNDDAMAGE, -min, -max, 34) if canDoMiss(target, spell) then doMissSyst(target, 9, 34, getPlayerStorageValue(target, 32659), 1) end elseif spell == "Rollout" then local outfits = { ["Voltorb"] = {lookType = 638}, ["Electrode"] = {lookType = 637}, ["Sandshrew"] = {lookType = 635}, ["Sandslash"] = {lookType = 636}, ["Phanpy"] = {lookType = 1005}, ["Dolphan"] = {lookType = 1007}, ["Miltank"] = {lookType = 1006}, ["Golem"] = {lookType = 639}, ["Shiny Electrode"] = {lookType = 1387}, ["Shiny Sandshrew"] = {lookType = 1390}, ["Shiny Sandslash"] = {lookType = 1389}, ["Shiny Golem"] = {lookType = 1403}, ["Shiny Voltorb"] = {lookType = 1388} } if outfits[getCreatureName(cid)] then doSetCreatureOutfit(cid, outfits[getCreatureName(cid)], 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, ROCKDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255) end for r = 1, 11 do --8 addEvent(roll, 750 * r, cid, outfit) end elseif spell == "Shockwave" then local posicao = getThingPositionWithDebug(cid) local function doShockWave(cid, pos, varx, vary, effect) if isCreature(cid) and isSightClear(posicao, pos, false) then if getPlayerStorageValue(cid, 3894) >= 1 then return true end if isSleeping(cid) then return true end doAreaCombatHealth(cid, GROUNDDAMAGE, pos, whirl3, -min, -max, 255) doSendMagicEffect({x = pos.x + varx, y = pos.y + vary, z = pos.z}, effect) end end local effect = 255 local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if a == 0 then effect = 126 for sw = 0, 5 do addEvent(doShockWave, 325 * sw, cid, {x = posicao.x, y = posicao.y - (sw + 1), z = posicao.z}, 1, 1, effect) end elseif a == 2 then effect = 125 for sw = 0, 5 do addEvent(doShockWave, 325 * sw, cid, {x = posicao.x, y = posicao.y + (sw + 1), z = posicao.z}, 1, 1, effect) end elseif a == 1 then effect = 124 for sw = 0, 5 do addEvent(doShockWave, 325 * sw, cid, {x = posicao.x + (sw + 1), y = posicao.y, z = posicao.z}, 1, 1, effect) end elseif a == 3 then effect = 123 for sw = 0, 5 do addEvent(doShockWave, 325 * sw, cid, {x = posicao.x - (sw + 1), y = posicao.y, z = posicao.z}, 1, 1, effect) end end elseif spell == "Earthshock" then doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255) local sps = getThingPositionWithDebug(cid) sps.x = sps.x+1 sps.y = sps.y+1 doSendMagicEffect(sps, 127) elseif spell == "Earthquake" then local function doQuake(cid) if not isCreature(cid) then return false end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doMoveInArea(cid, 0, 118, confusion, min, max, GROUNDDAMAGE, spell) end addEvent(doQuake, 000, cid) addEvent(doQuake, 500, cid) -- +500 addEvent(doQuake, 1000, cid) -- +500 addEvent(doQuake, 1500, cid) -- +500 addEvent(doQuake, 2300, cid) -- +800 addEvent(doQuake, 2800, cid) -- +500 addEvent(doQuake, 3300, cid) -- +500 addEvent(doQuake, 3800, cid) -- +500 addEvent(doQuake, 4600, cid) -- +800 addEvent(doQuake, 5100, cid) -- +500 addEvent(doQuake, 5600, cid) -- +500 addEvent(doQuake, 6100, cid) -- +500 addEvent(doQuake, 6900, cid) -- +800 addEvent(doQuake, 7400, cid) -- +500 addEvent(doQuake, 7900, cid) -- +500 addEvent(doQuake, 8400, cid) -- +500 addEvent(doQuake, 9200, cid) -- +800 addEvent(doQuake, 1000, cid) -- +800 elseif spell == "Stomp" then doMoveInAreaWithMiss(cid, stomp, 34, 9, spell, 1, GROUNDDAMAGE, min, max) elseif spell == "Toxic Sparkes" then local function doToxic(cid, target) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPos(cid), getThingPositionWithDebug(target), 15) doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 114) end addEvent(doToxic, 0, cid, target) addEvent(doToxic, 300, cid, target) --addEvent(doToxic, 400, cid, target) elseif spell == "Horn Drill" then local function doHorn(cid, target) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPos(cid), getThingPositionWithDebug(target), 25) doAreaCombatHealthAtDistance(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 0) end addEvent(doHorn, 0, cid, target) addEvent(doHorn, 300, cid, target) elseif spell == "Doubleslap" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPos(target), 0, -min, -max, 148) elseif spell == "Lovely Kiss" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 16) doSendMagicEffect(getThingPos(target), 147) if canAttackOther(cid, target) == "Can" then doMissSyst(target, 9, 147, getPlayerStorageValue(target, 32659), 1) end elseif spell == "Sing" then doAreaCombatHealth(cid, SLEEP_POWDERDAMAGE, getThingPositionWithDebug(cid), powders, -6, -10, 33) elseif spell == "Multislap" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPos(cid), splash, -min, -max, 3) elseif spell == "Metronome" then local spells = {"Shadow Storm", "Electric Storm", "Magma Storm", "Blizzard", "Leaf Storm", "Hydropump", "Falling Rocks"} local random = math.random(1, #spells) local randommove = spells[random] local pos = getThingPos(cid) pos.y = pos.y - 1 doSendMagicEffect(pos, 161) local function doMetronome(cid, spell) if not isCreature(cid) then return true end docastspell(cid, spell) doCreatureSay(cid, ""..string.upper(spell).."!", TALKTYPE_MONSTER) end addEvent(doMetronome, 100, cid, randommove) elseif spell == "Focus" then doSendAnimatedText(getThingPos(cid), "FOCUS", 144) setPlayerStorageValue(cid, 253, 1) elseif spell == "Flame Wheel" then local function sendFireEff(cid, dir) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, FIREDAMAGE, getPosByDir(getThingPositionWithDebug(cid), dir), 0, -min, -max, 15) end local function doWheel(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, 9 do addEvent(sendFireEff, a * 140, cid, t[a]) end end doWheel(cid, false, cid) elseif spell == "Hyper Voice" then doMoveInAreaWithMiss(cid, tw1, 22, 9, spell, 0, NORMALDAMAGE, min, max) elseif spell == "Restore" or spell == "Selfheal" then local min = (getCreatureMaxHealth(cid) * 75) / 100 local max = (getCreatureMaxHealth(cid) * 85) / 100 local function doHealArea(cid, min, max) local amount = math.random(min, max) if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid)) end if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then doCreatureAddHealth(cid, amount) doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65) end end doSendMagicEffect(getThingPositionWithDebug(cid), 132) doHealArea(cid, min, max) elseif spell == "Healarea" then local min = (getCreatureMaxHealth(cid) * 50) / 100 local max = (getCreatureMaxHealth(cid) * 60) / 100 local function doHealArea(cid, min, max) local amount = math.random(min, max) if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid)) end if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then doCreatureAddHealth(cid, amount) doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65) end end local pos = getPosfromArea(cid, heal) local n = 0 while n < #pos do n = n+1 thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253} local pid = getThingFromPosWithProtect(cid, thing) doSendMagicEffect(pos[n], 12) doHealArea(cid, min, max) if isCreature(pid) then if isSummon(cid) and (isSummon(pid) or isPlayer(pid)) then if canAttackOther(cid, pid) == "Cant" then doHealArea(pid, min, max) end elseif isSummon(cid) and isMonster(pid) then elseif isMonster(cid) and isMonster(pid) then doHealArea(pid, min, max) end end end elseif spell == "Toxic" then doMoveInArea(cid, 0, 114, reto5, min, max, POISONDAMAGE, spell) elseif spell == "Absorb" then local life = getCreatureHealth(target) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 14) local newlife = life - getCreatureHealth(target) doSendMagicEffect(getThingPositionWithDebug(cid), 14) if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPositionWithDebug(cid), "+"..newlife.."", 32) end elseif spell == "Poison Bomb" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 14) doAreaCombatHealthAtDistance(cid, POISONDAMAGE, getThingPositionWithDebug(target), bombWee2, -min, -max, 20) elseif spell == "Poison Gas" then local function gas(cid) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end --doAreaCombatHealth(cid, POISONDAMAGE, getThingPositionWithDebug(cid), bombWee3, -min, -max, 114) doMoveInAreaWithMiss(cid, confusion, 114, 13, spell, 0, POISONDAMAGE, min, max) end addEvent(gas, 000, cid) addEvent(gas, 500, cid) -- +500 addEvent(gas, 1000, cid) -- +500 addEvent(gas, 1500, cid) -- +500 addEvent(gas, 2300, cid) -- +800 addEvent(gas, 2800, cid) -- +500 addEvent(gas, 3300, cid) -- +500 addEvent(gas, 3800, cid) -- +500 addEvent(gas, 4600, cid) -- +800 addEvent(gas, 5100, cid) -- +500 addEvent(gas, 5600, cid) -- +500 addEvent(gas, 6100, cid) -- +500 addEvent(gas, 6900, cid) -- +800 addEvent(gas, 7400, cid) -- +500 addEvent(gas, 7900, cid) -- +500 addEvent(gas, 8400, cid) -- +500 addEvent(gas, 9200, cid) -- +800 addEvent(gas, 1000, cid) -- +800 elseif spell == "Petal Dance" then doMoveInAreaMulti(cid, 21, 245, bullet, bulletDano, GRASSDAMAGE, min, max) elseif spell == "Slash" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 159) elseif spell == "X-Scissor" then local a = getThingPos(cid) local X = { {{x = a.x+1, y = a.y, z = a.z}, 16}, --norte {{x = a.x+2, y = a.y+1, z = a.z}, 221}, --leste {{x = a.x+1, y = a.y+2, z = a.z}, 223}, --sul {{x = a.x, y = a.y+1, z = a.z}, 243}, --oeste } local pos = X[mydir+1] for b = 1, 3 do addEvent(doSendMagicEffect, b * 70, pos[1], pos[2]) end doMoveInArea(cid, 0, 2, xScissor, min, max, BUGDAMAGE, spell) elseif spell == "Psychic" then --rever area... doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPositionWithDebug(cid), selfArea2, -min, -max, 133) elseif spell == "Pay Day" then local function doThunderHit(cid, target) if not isCreature(target) or not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 28) end local function doThunderFall(cid, frompos, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local ry = math.abs(frompos.y - pos.y) doSendDistanceShoot(frompos, getThingPositionWithDebug(target), 39) addEvent(doThunderHit, ry * 11, cid, target) end local function doThunderUp(cid, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local mps = getThingPositionWithDebug(cid) local xrg = math.floor((pos.x - mps.x) / 2) local topos = mps topos.x = topos.x + xrg local rd = 7 topos.y = topos.y - rd doSendDistanceShoot(getThingPositionWithDebug(cid), topos, 39) addEvent(doThunderFall, rd * 49, cid, topos, target) end local alvo = target for thnds = 1, 2 do addEvent(doThunderUp, thnds * 155, cid, alvo) end elseif spell == "Psywave" then --(cid, rounds, eff, area, min, max, element, spell) doMoveInArea(cid, 0, 133, tw1, min, max, PSYCHICDAMAGE, spell) elseif spell == "Triple Kick" or spell == "Triple Kick Lee" then doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPos(target), 0, -min, -max, 110) elseif spell == "Karate Chop" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPos(target), 0, -min, -max, 113) elseif spell == "Ground Chop" then doMoveInArea(cid, 0, 111, reto5, min, max, FIGHTINGDAMAGE, spell) elseif spell == "Mega Punch" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPos(target), 0, -min, -max, 112) elseif spell == "Tri Flames" then doMoveInArea(cid, 0, 6, triflames, min, max, FIREDAMAGE) elseif spell == "War Dog" then doBuffSyst(cid, 15, 28, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Hypnosis" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 24) doAreaCombatHealthAtDistance(cid, SLEEP_POWDERDAMAGE, getThingPositionWithDebug(target), 0, -5, -9, 255) elseif spell == "Dizzy Punch" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 26) doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 112) local rounds = getPokemonLevel(cid) / 12 rounds = rounds + 2 doAdvancedConfuse(target, rounds, getPlayerStorageValue(target, 3891)) elseif spell == "Ice Punch" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 28) doSendMagicEffect(getThingPositionWithDebug(target), 112) local function doPunch(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 43) end addEvent(doPunch, 200, cid, target) elseif spell == "Ice Beam" then local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) doMoveInAreaWithMiss(cid, reto5, 43, 9, spell, 1, ICEDAMAGE, 0, 0) if a == 0 then doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg1n, -min, -max, 99) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg2n, -min, -max, 105) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg3n, -min, -max, 103) elseif a == 2 then doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg1s, -min, -max, 98) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg2s, -min, -max, 105) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg3s, -min, -max, 102) elseif a == 1 then doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg1e, -min, -max, 96) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg2e, -min, -max, 104) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg3e, -min, -max, 100) elseif a == 3 then doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg1w, -min, -max, 97) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg2w, -min, -max, 104) doAreaCombatHealth(cid, ICEDAMAGE, getThingPositionWithDebug(cid), wg3w, -min, -max, 101) end elseif spell == "Psy Pulse" or spell == "Cyber Pulse" then local function doPulse(cid, eff) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 3) doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPositionWithDebug(cid), 0, -min, -max, eff) end if spell == "Cyber Pulse" then eff = 11 else eff = 133 end addEvent(doPulse, 0, cid, eff) addEvent(doPulse, 250, cid, eff) elseif spell == "Psyusion" then local rounds = math.random(4, 7) rounds = rounds + math.floor(getPokemonLevel(cid) / 35) local eff = {136, 133, 136, 133} local area = {psy1, psy2, psy3, psy4} --doMoveInArea(cid, rounds, eff, area, min, max, element, spell) doMoveInArea(cid, rounds, 136, psy1, min, max, PSYCHICDAMAGE, spell) addEvent(doMoveInArea, 3*400, cid, rounds, 137, psy5, min, max, PSYCHICDAMAGE, spell) for i = 1, 3 do addEvent(doMoveInArea, i*400, cid, rounds, eff[i+1], area[i+1], min, max, PSYCHICDAMAGE, spell) end elseif spell == "Triple Punch" then doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPos(target), 0, -min, -max, 110) elseif spell == "Fist Machine" then local mpos = getThingPositionWithDebug(cid) local b = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) local effect = 0 local xvar = 0 local yvar = 0 if b == SOUTH then effect = 218 yvar = 2 elseif b == NORTH then effect = 217 elseif b == WEST then effect = 216 elseif b == EAST then effect = 215 xvar = 2 end mpos.x = mpos.x + xvar mpos.y = mpos.y + yvar doSendMagicEffect(mpos, effect) doMoveInArea(cid, 0, 0, machine, min, max, FIGHTINGDAMAGE) elseif spell == "Destroyer Hand" then doMoveInAreaMulti(cid, 26, 0, bullet, bulletDano, FIGHTINGDAMAGE, min, max) elseif spell == "Rock Throw" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 11) doAreaCombatHealthAtDistance(cid, ROCKDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 44) elseif spell == "Rock Slide" then local function doRockHurt(cid, target) if not isCreature(target) or not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 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 = target for rocks = 0, 4 do addEvent(doFallRock, rocks * 65, cid, alvo) end elseif spell == "Falling Rocks" then local master = isSummon(cid) and getCreatureMaster(cid) or cid for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, ROCKDAMAGE, 11, 44) end addEvent(doAreaCombatHealth, 500, cid, ROCKDAMAGE, getThingPos(cid), waterarea, -min, -max, 255) elseif spell == "Selfdestruct" then local function death(cid) if isCreature(cid) then if pokes[getCreatureName(cid)].type == "psychic" or pokes[getCreatureName(cid)].type2 == "psychic" then return true end doCreatureAddHealth(cid, -getCreatureMaxHealth(cid)) end end doMoveInArea(cid, 0, 5, selfArea1, 0, 0, null, spell) local life = getCreatureHealth(cid) local uid = checkAreaUid(getCreaturePosition(cid), selfArea1, 1, 1) for _,pid in pairs(uid) do if isCreature(pid) then if (getCreatureHealth(pid)-life) <= 0 then dano = getCreatureHealth(pid) else dano = life end if isSummon(cid) and (isMonster(pid) or isSummon(pid)) and canDoSelf and pid ~= cid then if isSummon(pid) and canAttackOther(cid, pid) == "Can" then doSendAnimatedText(getThingPos(pid), "-"..dano.."", COLOR_NORMAL) doCreatureAddHealth(pid, -dano) elseif isMonster(pid) then doSendAnimatedText(getThingPos(pid), "-"..dano.."", COLOR_NORMAL) doCreatureAddHealth(pid, -dano) end elseif isMonster(cid) and isSummon(pid) and canDoSelf and pid ~= cid then doSendAnimatedText(getThingPos(pid), "-"..dano.."", COLOR_NORMAL) --144 doCreatureAddHealth(pid, -dano) elseif isPlayer(pid) and #getCreatureSummons(pid) <= 0 and canDoSelf and canAttackOther(cid, pid) then doSendAnimatedText(getThingPos(pid), "-"..dano.."", COLOR_NORMAL) doCreatureAddHealth(pid, -dano) end end end addEvent(death, 300, cid) elseif spell == "Crusher Stomp" then local pL = getThingPos(cid) pL.x = pL.x+5 pL.y = pL.y+1 ----------------- local pO = getThingPos(cid) pO.x = pO.x-3 pO.y = pO.y+1 ------------------ local pN = getThingPos(cid) pN.x = pN.x+1 pN.y = pN.y+5 ----------------- local pS = getThingPos(cid) pS.x = pS.x+1 pS.y = pS.y-3 local po = {pL, pO, pN, pS} local po2 = { {x = pL.x, y = pL.y-1, z = pL.z}, {x = pO.x, y = pO.y-1, z = pO.z}, {x = pN.x-1, y = pN.y, z = pN.z}, {x = pS.x-1, y = pS.y, z = pS.z}, } for i = 1, 4 do doSendMagicEffect(po, 127) doAreaCombatHealth(cid, GROUNDDAMAGE, po2, crusher, -min, -max, 255) end doMoveInAreaWithMiss(cid, stomp, 34, 9, spell, 1, GROUNDDAMAGE, min, max) elseif spell == "Water Pulse" then doMoveInArea(cid, 0, 68, reto5, min, max, WATERDAMAGE, spell) elseif spell == "Sonicboom" then local function doBoom(cid) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 33) doAreaCombatHealthAtDistance(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 3) end addEvent(doBoom, 0, cid) addEvent(doBoom, 250, cid) elseif spell == "Stickmerang" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 34) doAreaCombatHealthAtDistance(cid, FLYINGDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 212) elseif spell == "Stickslash" then local function sendStickEff(cid, dir) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, FLYINGDAMAGE, getPosByDir(getThingPositionWithDebug(cid), dir), 0, -min, -max, 212) end local function doStick(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, 9 do addEvent(sendStickEff, a * 140, cid, t[a]) end end doStick(cid, false, cid) elseif spell == "Stick Throw" then local a = getCreatureSpeed(cid) doChangeSpeed(cid, -a) doMoveInArea(cid, 0, 212, reto4, min, max, FLYINGDAMAGE, spell) local function nois(cid, s) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doChangeSpeed(cid, s) end addEvent(nois, 2000, cid, a) elseif spell == "Pluck" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doAreaCombatHealthAtDistance(cid, FLYINGDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 111) elseif spell == "Tri-attack" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPos(target), 0, -min, -max, 110) elseif spell == "Ice Shards" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 28) doAreaCombatHealthAtDistance(cid, ICEDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 43) elseif spell == "Icy Wind" then doMoveInAreaWithMiss(cid, tw1, 43, 9, spell, 1, ICEDAMAGE, min, max) elseif spell == "Aurora Beam" then local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) local t = { [0] = 57, [1] = 234, [2] = 58, [3] = 209, } doMoveInAreaWithMiss(cid, reto4, t[a], 9, spell, 1, ICEDAMAGE, min, max) elseif spell == "Rest" then doBuffSyst(cid, 6, 0, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Sludge" then local function doSludgeHit(cid, target) if not isCreature(target) or not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, POISONDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 116) end local function doSludgeFall(cid, frompos, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local ry = math.abs(frompos.y - pos.y) doSendDistanceShoot(frompos, getThingPositionWithDebug(target), 6) addEvent(doSludgeHit, ry * 11, cid, target) end local function doSludgeUp(cid, target) if not isCreature(target) or not isCreature(cid) then return true end local pos = getThingPositionWithDebug(target) local mps = getThingPositionWithDebug(cid) local xrg = math.floor((pos.x - mps.x) / 2) local topos = mps topos.x = topos.x + xrg local rd = 7 topos.y = topos.y - rd doSendDistanceShoot(getThingPositionWithDebug(cid), topos, 6) addEvent(doSludgeFall, rd * 49, cid, topos, target) end local alvo = target for thnds = 1, 2 do addEvent(doSludgeUp, thnds * 155, cid, alvo) end doMissSyst(alvo, 9, 34, getPlayerStorageValue(alvo, 32659), 0) elseif spell == "Mud Bomb" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 6) addEvent(doAreaCombatHealth, 200, cid, GROUNDDAMAGE, getThingPos(target), bombWee2, -min, -max, 116) --------miss syst-------------- local uid = checkAreaUid(getThingPos(target), bombWee1, 1, 1) for _,pid in pairs(uid) do if isCreature(pid) then if isSummon(cid) and (isMonster(pid) or isSummon(pid) or isPlayer(pid)) and pid ~= cid then if (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and canAttackOther(cid, pid) == "Can" then doMissSyst(pid, 9, 34, getPlayerStorageValue(pid, 32659), 0) elseif isMonster(pid) then doMissSyst(pid, 9, 34, getPlayerStorageValue(pid, 32659), 0) end elseif isMonster(cid) and (isSummon(pid) or isPlayer(pid)) and pid ~= cid then if isPlayer(pid) and #getCreatureSummons(pid) <= 0 then doMissSyst(pid, 9, 34, getPlayerStorageValue(pid, 32659), 0) elseif isSummon(pid) then doMissSyst(pid, 9, 34, getPlayerStorageValue(pid, 32659), 0) end end end end elseif spell == "Mortal Gas" then local pos = getThingPositionWithDebug(cid) local function doSendAcid(cid, pos) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), pos, 14) doSendMagicEffect(pos, 114) end for b = 1, 3 do for a = 1, 20 do local lugar = {x = pos.x + math.random(-4, 4), y = pos.y + math.random(-3, 3), z = pos.z} addEvent(doSendAcid, a * 75, cid, lugar) end end doAreaCombatHealth(cid, POISONDAMAGE, pos, waterarea, -min, -max, 255) elseif spell == "Mega Horn" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 25, 44, bullet, bulletDano, ROCKDAMAGE, min, max) elseif spell == "Egg Bomb" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 12) doAreaCombatHealthAtDistance(cid, NORMALDAMAGE, getThingPositionWithDebug(target), crusher, -min, -max, 5) elseif spell == "Super Vines" then doCreatureSetLookDir(cid, 2) local a = getCreatureSpeed(cid) doChangeSpeed(cid, -a) local effect = 0 local pos = getThingPositionWithDebug(cid) pos.x = pos.x + 1 pos.y = pos.y + 1 if getCreatureOutfit(cid).lookType == 369 then effect = 213 else effect = 229 end doSendMagicEffect(pos, effect) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255) local function nois(cid, s) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doChangeSpeed(cid, s) end addEvent(nois, 200, cid, a) elseif spell == "Epicenter" then doMoveInArea(cid, 0, 127, epicenter, min, max, GROUNDDAMAGE, spell) elseif spell == "Bubblebeam" then local function sendBubbles(cid) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 2) doAreaCombatHealthAtDistance(cid, WATERDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 25) end sendBubbles(cid) addEvent(sendBubbles, 100, cid) elseif spell == "Swift" then local function sendSwift(cid) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 32) doAreaCombatHealthAtDistance(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 3) end sendSwift(cid) addEvent(sendSwift, 200, cid) elseif spell == "Spark" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 32) doAreaCombatHealthAtDistance(cid, ELECTRICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 43) elseif spell == "Mimic Wall" then local p = getThingPos(cid) local dirr = getCreatureLookDir(cid) if dirr == 0 or dirr == 2 then item = 11439 else item = 11440 end local wall = { [0] = {{x = p.x, y = p.y-1, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}}, [2] = {{x = p.x, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}}, [1] = {{x = p.x+1, y = p.y, z = p.z}, {x = p.x+1, y = p.y+1, z = p.z}, {x = p.x+1, y = p.y-1, z = p.z}}, [3] = {{x = p.x-1, y = p.y, z = p.z}, {x = p.x-1, y = p.y+1, z = p.z}, {x = p.x-1, y = p.y-1, z = p.z}}, } function removeAllActionIDs(cid, pos, onlyOne) if onlyOne then local thing1 = {x=pos.x,y=pos.y,z=pos.z,stackpos=0} local tile1 = getTileThingWithProtect(cid, thing1).uid doSetItemActionId(tile1, 0) end n = 0 for i = 1, #pos do n = n + 1 thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=0} local tile = getTileThingWithProtect(cid, thing).uid doSetItemActionId(tile, 0) end end for i = 1, 3 do if wall[dirr] then local t = wall[dirr] if canWalkOnPos(t, false, false, true, true, true) and hasTile(cid, t) then doCreateItem(item, 1, t) -- local Tile = getTileThingWithProtect(cid, {x=t.x,y=t.y,z=t.z,stackpos=0}) doSetItemActionId(Tile.uid, 88072) addEvent(removeAllActionIDs, 15000, cid, t, true) -- addEvent(doRemoveItemFromPos, 15000, t, item, 1) end end end local pos = getPosfromArea(cid, wall_1) local pos2 = getPosfromArea(cid, wall_2) if hasTile(cid, {x=p.x,y=p.y,z=p.z,stackpos=0}) then tile0 = getTileThingWithProtect(cid, {x=p.x,y=p.y,z=p.z,stackpos=0}).uid end doSetItemActionId(tile0, 88070) addEvent(removeAllActionIDs, 15000, cid, p, true) n = 0 while n < #pos do if not isCreature(cid) then return true end n = n+1 local tile1 = getTileThingWithProtect(cid, {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=0}).uid --- local tile2 = getTileThingWithProtect(cid, {x=pos2[n].x,y=pos2[n].y,z=pos2[n].z,stackpos=0}).uid doSetItemActionId(tile1, 88071) doSetItemActionId(tile2, 88070) end addEvent(removeAllActionIDs, 15000, cid, pos) addEvent(removeAllActionIDs, 15000, cid, pos2) elseif spell == "Shredder Team" then local team = { ["Scyther"] = "Scyther", ["Shiny Scyther"] = "Shiny Scyther", ["Scizor"] = "Scizor", } local function setStorage(cid, storage) if isCreature(cid) then if getPlayerStorageValue(cid, storage) >= 1 then setPlayerStorageValue(cid, storage, 0) end end end local function RemoveTeam(cid) if isCreature(cid) then doSendMagicEffect(getThingPos(cid), 211) doRemoveCreature(cid) end end if getPlayerStorageValue(cid, 637500) >= 1 then return true end local master = getCreatureMaster(cid) local item = getPlayerSlotItem(master, 8) local life, maxLife = getCreatureHealth(cid), getCreatureMaxHealth(cid) local name = getItemAttribute(item.uid, "poke") local pos = getThingPos(cid) local time = 30 local pokelife = (getCreatureHealth(cid) / getCreatureMaxHealth(cid)) doItemSetAttribute(item.uid, "hp", pokelife) doDisapear(cid) addEvent(doAppear, math.random(0, 5), cid) if team[name] then for b = 2, 3 do doSummonMonster(master, team[name]) end pk1 = getCreatureSummons(master)[1] pk2 = getCreatureSummons(master)[2] pk3 = getCreatureSummons(master)[3] for a = 1, 3 do local pk = {[1] = pk1, [2] = pk2, [3] = pk3} doTeleportThing(pk[a], getClosestFreeTile(pk[a], pos), false) adjustStatus(pk[a], item.uid, true, true, true) doSendMagicEffect(getThingPos(pk[a]), 211) end setPlayerStorageValue(pk2, 637500, 1) setPlayerStorageValue(pk3, 637500, 1) setPlayerStorageValue(master, 637501, 1) if getPlayerStorageValue(master, 89784) >= 1 then for times = 1, getPlayerStorageValue(master, 89784) do addEvent(sendMoveEffect, times*1500, pk2, 14) addEvent(sendMoveEffect, times*1500, pk3, 14) end end addEvent(setStorage, time * 1000, master, 637501) addEvent(RemoveTeam, time * 1000, pk2) addEvent(RemoveTeam, time * 1000, pk3) end elseif spell == "Team Slice" then local master = getCreatureMaster(cid) if #getCreatureSummons(master) < 2 or not isCreature(target) then return true end local summons = getCreatureSummons(master) local posis = {[1] = pos1, [2] = pos2, [3] = pos3} local a = getCreatureSpeed(cid) if getCreatureOutfit(cid).lookType == 366 then eff = 27 elseif getCreatureOutfit(cid).lookType == 1317 then eff = 29 end local function nois(cid, s) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doChangeSpeed(cid, s) end if #getCreatureSummons(master) >= 2 and isCreature(target) then if isCreature(cid) then addEvent(doTargetCombatHealth, 500, cid, target, BUGDAMAGE, -min, -max, 255) for i = 1, #summons do posis = getThingPos(summons) doDisapear(summons) doChangeSpeed(summons, -a) addEvent(doSendMagicEffect, 300, posis, 211) addEvent(doSendDistanceShoot, 350, posis, getThingPos(target), eff) addEvent(doSendDistanceShoot, 450, getThingPos(target), posis, eff) addEvent(doSendDistanceShoot, 600, posis, getThingPos(target), eff) addEvent(doSendDistanceShoot, 650, getThingPos(target), posis, eff) addEvent(nois, 670, summons, a) addEvent(doAppear, 670, summons) end end end elseif spell == "Blizzard" then local master = getCreatureMaster(cid) or 0 for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, ICEDAMAGE, 28, 52) end addEvent(doMoveInAreaWithMiss, 500, cid, BigArea2, 43, 9, spell, 1, ICEDAMAGE, min, max) elseif spell == "Great Love" then local master = getCreatureMaster(cid) or 0 for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, NORMALDAMAGE, 0, 147) end addEvent(doMoveInAreaWithMiss, 500, cid, BigArea2, 147, 9, spell, 1, NORMALDAMAGE, min, max) elseif spell == "Fire Punch" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 39) doSendMagicEffect(getThingPositionWithDebug(target), 112) local function doPunch(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 35) end addEvent(doPunch, 200, cid, target) elseif spell == "Guillotine" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 146) elseif spell == "Hyper Beam" then local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if a == 0 then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg1n, -min, -max, 152) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg2n, -min, -max, 158) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg3n, -min, -max, 156) elseif a == 2 then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg1s, -min, -max, 151) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg2s, -min, -max, 158) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg3s, -min, -max, 155) elseif a == 1 then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg1e, -min, -max, 149) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg2e, -min, -max, 157) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg3e, -min, -max, 153) elseif a == 3 then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg1w, -min, -max, 150) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg2w, -min, -max, 157) doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(cid), wg3w, -min, -max, 154) end elseif spell == "Thrash" then --cid, effDist, effDano, areaEff, areaDano, element, min, max doMoveInAreaMulti(cid, 10, 111, bullet, bulletDano, NORMALDAMAGE, min, max) elseif spell == "Splash" or tonumber(spell) == 7 then doAreaCombatHealth(cid, WATERDAMAGE, getThingPositionWithDebug(cid), splash, -min, -max, 255) doSendMagicEffect(getThingPositionWithDebug(cid), 53) elseif spell == "Dragon Breath" then doMoveInArea(cid, 0, 143, db1, min, max, DRAGONDAMAGE, spell) elseif spell == "Muddy Water" then doMoveInAreaWithMiss(cid, muddy, 116, 9, spell, 0, WATERDAMAGE, min, max) elseif spell == "Venom Motion" then doMoveInAreaWithMiss(cid, muddy, 114, 9, spell, 0, POISONDAMAGE, min, max) elseif spell == "Thunder Fang" then doSendMagicEffect(getThingPositionWithDebug(target), 146) local function doBite(cid, target) if not isCreature(cid) or not isCreature(target) then return true end doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 48) end addEvent(doBite, 200, cid, target) elseif spell == "Zap Cannon" or spell == "Charge Beam" then local a = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if spell == "Zap Cannon" then doMoveInArea(cid, 0, 207, duplo5, 0, 0, ELECTRICDAMAGE, spell) end if a == 0 then doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg1n, -min, -max, 94) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg2n, -min, -max, 93) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg3n, -min, -max, 95) elseif a == 2 then doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg1s, -min, -max, 91) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg2s, -min, -max, 93) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg3s, -min, -max, 92) elseif a == 1 then doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg1e, -min, -max, 86) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg2e, -min, -max, 88) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg3e, -min, -max, 87) elseif a == 3 then doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg1w, -min, -max, 89) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg2w, -min, -max, 88) doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPositionWithDebug(cid), wg3w, -min, -max, 90) end elseif spell == "Sacred Fire" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 3) doAreaCombatHealthAtDistance(cid, FIREDAMAGE, getThingPositionWithDebug(target), sacred, -min, -max, 143) elseif spell == "Blaze Kick" then doMoveInArea(cid, 0, 6, blaze, min, max, FIREDAMAGE, spell) addEvent(doMoveInArea, 200, cid, 0, 6, kick, min, max, FIREDAMAGE, spell) elseif spell == "Cross Chop" then doMoveInArea(cid, 0, 118, blaze, min, max, FIGHTINGDAMAGE, spell) addEvent(doMoveInArea, 200, cid, 0, 118, kick, min, max, FIGHTINGDAMAGE, spell) elseif spell == "Overheat" then doMoveInArea(cid, 0, 5, reto5, min, max, FIREDAMAGE, spell) elseif spell == "Ancient Power" then local posicao = getThingPositionWithDebug(cid) local function fireBlast(cid, area1, area2, effect, area3) if not isCreature(cid) then return true end if not isSightClear(posicao, area1, false) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, null, area1, 0, -min, -max, effect) if area2.x ~= getThingPositionWithDebug(cid).x or area2.y ~= getThingPositionWithDebug(cid).y then doAreaCombatHealth(cid, null, area2, area3, -min, -max, 137) end doAreaCombatHealth(cid, ROCKDAMAGE, area1, area3, -min, -max, 137) end local m = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if m == 0 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y - (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y - a, z = posicao.z}, 18, whirl3) end elseif m == 2 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y + (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y + a, z = posicao.z}, 18, whirl3) end elseif m == 1 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x + a + 1, y = posicao.y, z = posicao.z}, {x = posicao.x + a, y = posicao.y, z = posicao.z}, 18, whirl3) end elseif m == 3 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x - (a + 1), y = posicao.y, z = posicao.z}, {x = posicao.x - a, y = posicao.y, z = posicao.z}, 18, whirl3) end end elseif spell == "Dark Portal" then local posicao = getThingPositionWithDebug(cid) local function fireBlast(cid, area1, area2, effect, area3) if not isCreature(cid) then return true end if not isSightClear(posicao, area1, false) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, null, area1, 0, -min, -max, effect) if area2.x ~= getThingPositionWithDebug(cid).x or area2.y ~= getThingPositionWithDebug(cid).y then doAreaCombatHealth(cid, null, area2, area3, -min, -max, 137) end doAreaCombatHealth(cid, GHOSTDAMAGE, area1, area3, -min, -max, 137) end local m = isCreature(target) and getCreatureDirectionToTarget(cid, target) or getCreatureLookDir(cid) if m == 0 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y - (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y - a, z = posicao.z}, 506, whirl3) end elseif m == 2 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x, y = posicao.y + (a + 1), z = posicao.z}, {x = posicao.x, y = posicao.y + a, z = posicao.z}, 506, whirl3) end elseif m == 1 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x + a + 1, y = posicao.y, z = posicao.z}, {x = posicao.x + a, y = posicao.y, z = posicao.z}, 506, whirl3) end elseif m == 3 then for a = 0, 5 do addEvent(fireBlast, 300 * a, cid, {x = posicao.x - (a + 1), y = posicao.y, z = posicao.z}, {x = posicao.x - a, y = posicao.y, z = posicao.z}, 506, whirl3) end end elseif spell == "Twister" then doMoveInAreaMulti(cid, 28, 41, bullet, bulletDano, DRAGONDAMAGE, min, max) elseif spell == "Multi-Kick" then doMoveInAreaMulti(cid, 39, 113, multi, multiDano, FIGHTINGDAMAGE, min, max) elseif spell == "Multi-Punch" then doMoveInAreaMulti(cid, 39, 112, multi, multiDano, FIGHTINGDAMAGE, min, max) elseif spell == "Squisky Licking" then addEvent(doMoveInAreaWithMiss, 0, cid, SL1, 145, 9, spell, 1, NORMALDAMAGE, min, max) addEvent(doMoveInAreaWithMiss, 200, cid, SL2, 145, 9, spell, 1, NORMALDAMAGE, min, max) addEvent(doMoveInAreaWithMiss, 400, cid, SL3, 145, 9, spell, 1, NORMALDAMAGE, min, max) addEvent(doMoveInAreaWithMiss, 600, cid, SL4, 145, 9, spell, 1, NORMALDAMAGE, min, max) elseif spell == "Lick" then doMoveDano(cid, getCreatureTarget(cid), "Lick", NORMALDAMAGE, 0, 0, 0, 9, 2, 1) doSendMagicEffect(getThingPos(getCreatureTarget(cid)), 145) elseif spell == "Bonemerang" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 7) doAreaCombatHealthAtDistance(cid, GROUNDDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 227) addEvent(doSendDistanceShoot, 200, getThingPositionWithDebug(target), getThingPositionWithDebug(cid), 7) elseif spell == "Bone Club" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 7) doAreaCombatHealthAtDistance(cid, GROUNDDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 118) elseif spell == "Bone Slash" then local function sendStickEff(cid, dir) if not isCreature(cid) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, GROUNDDAMAGE, getPosByDir(getThingPositionWithDebug(cid), dir), 0, -min, -max, 227) end local function doStick(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, 9 do addEvent(sendStickEff, a * 140, cid, t[a]) end end doStick(cid, false, cid) elseif spell == "Furious Legs" or spell == "Ultimate Champion" then doBuffSyst(cid, 15, 13, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Sludge Rain" then local master = getCreatureMaster(cid) or 0 for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, POISONDAMAGE, 6, 116) end addEvent(doMoveInAreaWithMiss, 500, cid, BigArea2, 34, 9, spell, 0, POISONDAMAGE, min, max) elseif spell == "Shadow Ball" then doSendDistanceShoot(getThingPositionWithDebug(cid), getThingPositionWithDebug(target), 18) local function doDamageWithDelay(cid, target) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, ghostDmg, getThingPositionWithDebug(target), 0, -min, -max, 255) local pos = getThingPositionWithDebug(target) pos.x = pos.x + 1 doSendMagicEffect(pos, 140) end addEvent(doDamageWithDelay, getDistDelay, cid, target) elseif spell == "Shadow Punch" then local pos = getThingPositionWithDebug(target) doSendMagicEffect(pos, 112) local function doPunch(cid, target) if not isCreature(cid) or not isCreature(target) then return true end if isSleeping(cid) then return false end if getPlayerStorageValue(cid, 3894) >= 1 then return true end doAreaCombatHealth(cid, ghostDmg, getThingPositionWithDebug(target), 0, -min, -max, 255) local pos = getThingPositionWithDebug(target) pos.x = pos.x + 1 doSendMagicEffect(pos, 140) end addEvent(doPunch, 300, cid, target) elseif spell == "Shadow Storm" then local master = isSummon(cid) and getCreatureMaster(cid) or cid for rocks = 1, 62 do addEvent(fall, rocks*35, cid, master, ghostDmg, 18, 140) end --muda pra 2 addEvent(doMoveInArea, 500, cid, 0, 2, BigArea2, min, max, ghostDmg, spell) elseif spell == "Invisible" then doDisapear(cid) addEvent(doAppear, 3000, cid) doSendMagicEffect(getThingPositionWithDebug(cid), 134) elseif spell == "Nightmare" then if not isSleeping(target) then doSendMagicEffect(getThingPositionWithDebug(target), 3) doSendAnimatedText(getThingPositionWithDebug(target), "FAIL", 155) return true end doAreaCombatHealth(cid, ghostDmg, getThingPositionWithDebug(target), 0, -min, -max, 138) elseif spell == "Dream Eater" then if not isSleeping(target) then doSendMagicEffect(getThingPositionWithDebug(target), 3) doSendAnimatedText(getThingPositionWithDebug(target), "FAIL", 155) return true end local a = getCreatureHealth(target) doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 138) local b = getCreatureHealth(target) local c = a - b local amount = math.ceil(c / 2) local function doHealArea(cid, min, max) local amount = math.random(min, max) if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then amount = -(getCreatureHealth(cid)-getCreatureMaxHealth(cid)) end if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then doCreatureAddHealth(cid, amount) doSendAnimatedText(getThingPos(cid), "+"..amount.."", 155) end end doSendMagicEffect(getThingPositionWithDebug(cid), 132) doHealArea(cid, amount, amount) elseif spell == "Dark Eye" then doSendMagicEffect(getThingPos(cid), 47) setPlayerStorageValue(cid, 999457, 1) elseif spell == "Elemental Hands" then if getCreatureOutfit(cid).lookType == 1301 then print("Error occurred with move 'Elemental Hands', outfit of hitmonchan is wrong") doPlayerSendTextMessage(getCreatureMaster(cid), MESSAGE_STATUS_CONSOLE_BLUE, "A error are ocurred... A msg is sent to gamemasters!") return true end --proteçao pra n usar o move com o shiny hitmonchan com outfit diferente da do elite monchan do PO... local e = getCreatureMaster(cid) local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke") local hands = getItemAttribute(getPlayerSlotItem(e, 8).uid, "hands") if hands == 4 then doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hands", 0) doSendMagicEffect(getThingPositionWithDebug(cid), hitmonchans[name][0].eff) doSetCreatureOutfit(cid, {lookType = hitmonchans[name][0].out}, -1) else doItemSetAttribute(getPlayerSlotItem(e, 8).uid, "hands", hands+1) doSendMagicEffect(getThingPositionWithDebug(cid), hitmonchans[name][hands+1].eff) doSetCreatureOutfit(cid, {lookType = hitmonchans[name][hands+1].out}, -1) end elseif spell == "Crabhammer" then doAreaCombatHealth(cid, NORMALDAMAGE, getThingPositionWithDebug(target), 0, -min, -max, 225) elseif spell == "Ancient Fury" then doBuffSyst(cid, 15, 0, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Burn Skin" then doBuffSyst(cid, 15, 0, getPlayerStorageValue(cid, 36847), spell, true) elseif spell == "Divine Punishment" then local roardirections = { --skill n terminada ;p mas da uma base ae pra galera o/ [NORTH] = {SOUTH}, [sOUTH] = {NORTH}, [WEST] = {EAST}, [EAST] = {WEST}} local function divineBack(cid) if not isCreature(cid) then return true end local uid = checkAreaUid(getCreaturePosition(cid), check, 1, 1) for _,pid in pairs(uid) do dirrr = getCreatureDirectionToTarget(pid, cid) delay = getNextStepDelay(pid, 0) if isSummon(cid) and (isMonster(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can")) and pid ~= cid then setPlayerStorageValue(pid, 654878, 1) doChangeSpeed(pid, -getCreatureSpeed(pid)) doChangeSpeed(pid, 100) doPushCreature(pid, roardirections[dirrr][1], 1, 0) doChangeSpeed(pid, -getCreatureSpeed(pid)) addEvent(setPlayerStorageValue, 6450, pid, 654878, -1) addEvent(doRegainSpeed, 6450, pid) elseif isMonster(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then setPlayerStorageValue(pid, 654878, 1) doChangeSpeed(pid, -getCreatureSpeed(pid)) doChangeSpeed(pid, 100) doPushCreature(pid, roardirections[dirrr][1], 1, 0) doChangeSpeed(pid, -getCreatureSpeed(pid)) addEvent(doRegainSpeed, 6450, pid) addEvent(setPlayerStorageValue, 6450, pid, 654878, -1) end end end local function doDivine(cid, min, max, spell, rounds, area) if not isCreature(cid) then return true end for i = 1, 9 do addEvent(doMoveInArea, i*500, cid, rounds, 137, area, min, max, PSYCHICDAMAGE, spell) end end local rounds = math.random(9, 12) local area = {punish1, punish2, punish3, punish1, punish2, punish3, punish1, punish2, punish3} local posi = getThingPos(cid) posi.x = posi.x+1 posi.y = posi.y+1 doDisapear(cid) doChangeSpeed(cid, -getCreatureSpeed(cid)) doSendMagicEffect(posi, 247) addEvent(doAppear, 6450, cid) addEvent(doRegainSpeed, 6450, cid) local uid = checkAreaUid(getCreaturePosition(cid), check, 1, 1) for _,pid in pairs(uid) do if isSummon(cid) and (isMonster(pid) or (isSummon(pid) and canAttackOther(cid, pid) == "Can") or (isPlayer(pid) and canAttackOther(cid, pid) == "Can")) and pid ~= cid then doChangeSpeed(pid, -getCreatureSpeed(pid)) elseif isMonster(cid) and (isSummon(pid) or (isPlayer(pid) and #getCreatureSummons(pid) <= 0)) and pid ~= cid then doChangeSpeed(pid, -getCreatureSpeed(pid)) end end addEvent(divineBack, 2100, cid) addEvent(doDivine, 2200, cid, min, max, spell, rounds, area) end return true end Se voces acharem e for, Não fui eu que fiz isso, não quero rep +. os do bonus "%" merito todos para o ZerefShirou por ter me ajudado quando eu precisei de ajuda ^^ Editado Julho 12, 2012 por StyloMaldoso Link para o comentário Compartilhar em outros sites More sharing options...
zerefshirou 112 Postado Julho 12, 2012 Share Postado Julho 12, 2012 @digodigo2 Então é hoje que você vai continuar esperando kkk @Kurobisu Não é no arquivo da magia, deve ser configuration.lua ou spells.xml ou .xml do pokemon, good luck E sobre o evolution, tem certeza que é esse que ta no serve? pelo que vi só tem 469 linhas, quanto o erro é na 595, posta o level system.lua então deve ser la @StyloMaldoso Olhando pra desse jeito, lembra do meu dash normal, era bem maior que isso ai ahsahusausa e no login? Nem se fala ahsuahsua Link para o comentário Compartilhar em outros sites More sharing options...
BrunooMaciell 83 Postado Julho 12, 2012 Share Postado Julho 12, 2012 @ALL Alguem pode pasar o systema de addons por itens se possivel ^^ ?? Rep+ Link para o comentário Compartilhar em outros sites More sharing options...
zesy 6 Postado Julho 12, 2012 Share Postado Julho 12, 2012 (editado) @TOPICO Haha... tou de volta... Infelizamente meu PC queimo a fonte e demoro pra arruma... Mas o bom é que já arrumou e vou colocar o Meu Serv on dinovo... Estou com os seguintes erros: • Quando o Player faz logout com o poke fora e depois ele faz login, o poke volta a vida inteira. Por Enquanto só esses que eu me lembro. Eu vou editando quando eu lembrar mais... Então... Sobre os Icones da Ball, só fazendo mais 300 itens +/- , e como @Slicer disse nao tem sprites pros shiny, então dá um trabalho do carambra, além de ter q reforma o cath.lua(lib) e o cath.lua(actions) pra poder dar certo.... seria complicado. Pra muda o ip do client usa o HexEditor, só nao sei onde tem pra Download. Sobre o sistema de Addons, acho q tá na assinatura do @RicardoSohnn(nao ta não )... ele tem um defeito, quando o poke evolui, ele fica com o outfit do addon, eu seja, se vc coloca addon num charmander, e ele evolui pra charmeleon, ele fica com outfir do charmander com addon... Editado Julho 12, 2012 por ZeSy Link para o comentário Compartilhar em outros sites More sharing options...
shadow2012 6 Postado Julho 12, 2012 Share Postado Julho 12, 2012 (editado) alguem sabe pq fica dano erro nesse npc de diamond. <?xml version="1.0" encoding="UTF-8"?> <npc name="Vendedora" script="scripts/diamond.lua" walkinterval="3000" floorchange="0" access="5" > <health now="150" max="150"/> <look type="517" head="0" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Bem-vindo a loja do diamond, aqui voce pode comprar sua Premium , mudar de sexo e comprar bencao.Para ver as ofertas diga 'offer' "/> <parameter key="message_farewell" value="Ate a proxima, Beijoss!"/> </parameters> </npc> local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid -- Conversa Jogador/NPC if(msgcontains(msg, 'offer') or msgcontains(msg, 'offer')) then selfSay('Para Premium diga ( premium ) Para bencao diga ( bencao ) Para trocar de sexo diga ( trocar sexo ) Para trocar de cidade natal diga ( cidade natal ).', cid) elseif(msgcontains(msg, 'premium') or msgcontains(msg, 'Premium')) then selfSay('dialogo da premium - diga sim para comprar-', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'bencao') or msgcontains(msg, 'Bencao')) then selfSay('Com bencao reduz sua penalidade quando morto ( perde menos XP skills etc..) ela custa apenas 3 Diamond.Deseja ter a Bencao??', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'trocar sexo') or msgcontains(msg, 'trocar sexo')) then selfSay('Para trocar de sexo sao nescessarios 5 Diamonds. Deseja mudar seu sexo??', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'cidade natal') or msgcontains(msg, 'cidade natal')) then selfSay('deseja trocar de cidade natal? custa apenasDiamond. Deseja trocar Cidade Natal??', cid) talkState[talkUser] = 4 -- Confirmação da Compra elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, 2145, 10) == true) then selfSay('Parabens, Premium de 30 dias!', cid) doPlayerAddPremiumDays(cid, 31) talkState[talkUser] = 0 else selfSay('Voce nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 2) then if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then selfSay('Voce ja esta usando bencao!', cid) else if(doPlayerRemoveItem(cid, 2145, 3) == true) then selfSay('Thanks!', cid) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Voce nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then if(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then doPlayerSetSex(cid, PLAYERSEX_MALE) else doPlayerSetSex(cid, PLAYERSEX_FEMALE) end talkState[talkUser] = 0 else selfSay('Você nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'sendas') and talkState[talkUser] == 4) then if(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) doPlayerSetTown(cid, 2) talkState[talkUser] = 0 else selfSay('Você nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'falador') and talkState[talkUser] == 4) then if(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) doPlayerSetTown(cid, 1) talkState[talkUser] = 0 else selfSay('Você não tem Dimond suficientes.', cid) talkState[talkUser] = 0 end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) aki o erro: [12/07/2012 14:55:40] [Error - LuaScriptInterface::loadFile] cannot open scripts/diamond.lua: No such file or directory [12/07/2012 14:55:40] [Warning - NpcScript::NpcScript] Cannot load script: scripts/diamond.lua [12/07/2012 14:55:40] cannot open scripts/diamond.lua: No such file or directory Editado Julho 12, 2012 por shadow2012 Link para o comentário Compartilhar em outros sites More sharing options...
Kurobisu 73 Postado Julho 12, 2012 Share Postado Julho 12, 2012 (editado) Mais erros vem a me aparecer Aqui: 1º Erro: [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: [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> Issu tudo começou a aparecer depois de que eu instalei o Patch do Nibelins, Só que daí retirei outros bugs com ele. Outro erro é quando o Pokémon Atacka o outro ele invez de perder HP não Hita nada! Me ajuda ai porfavor! #Edit: Meu Exp.lua aqui: local combats = { [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC}, [GRASSDAMAGE] = {cor = COLOR_GRASS}, [POISONEDDAMAGE] = {cor = COLOR_GRASS}, [MORTALGASDAMAGE] = {cor = COLOR_POISON}, [FIREDAMAGE] = {cor = COLOR_FIRE2}, [bURNEDDAMAGE] = {cor = COLOR_BURN}, [WATERDAMAGE] = {cor = COLOR_WATER}, [iCEDAMAGE] = {cor = COLOR_ICE}, [NORMALDAMAGE] = {cor = COLOR_NORMAL}, [GUILLOTINEDAMAGE] = {cor = COLOR_NORMAL}, [FLYDAMAGE] = {cor = COLOR_FLYING}, [GHOSTDAMAGE] = {cor = COLOR_GHOST}, [NIGHTMAREDAMAGE] = {cor = COLOR_GHOST}, [GROUNDDAMAGE] = {cor = COLOR_GROUND}, [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC}, [THUNDERWAVEDAMAGE] = {cor = COLOR_ELECTRIC}, [ROCKDAMAGE] = {cor = COLOR_ROCK}, [bUGDAMAGE] = {cor = COLOR_BUG}, [FIGHTDAMAGE] = {cor = COLOR_FIGHTING}, [sEISMICTOSSDAMAGE] = {cor = COLOR_FIGHTING}, [DRAGONDAMAGE] = {cor = COLOR_DRAGON}, [POISONDAMAGE] = {cor = COLOR_POISON}, [DARKDAMAGE] = {cor = COLOR_DARK}, [sTEELDAMAGE] = {cor = COLOR_STEEL}, } local function doHeal(cid, amount) doCreatureAddHealth(cid, amount) doSendMagicEffect(getThingPos(cid), 12) doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65) end 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 getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true 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) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end doSleep(cid, value, true) return false end -------------------------------------------------- if combat == HEALINGDAMAGE then local healing = math.abs(value) if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then doHeal(cid, healing) return false end if isSummon(cid) and isSummon(attacker) then if getPlayerStorageValue(getCreatureMaster(cid), 990) >= 1 then return false end if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then doHeal(cid, healing) return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then doHeal(cid, healing) return false end end 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 not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end local master = attacker if isSummon(attacker) then master = getCreatureMaster(attacker) 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 --muda isso end -------------------------------------------------- if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then 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, 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 not isSummon(cid) and isSummon(attacker) then return false end if isSummon(cid) and isSummon(attacker) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) 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 multiplier = 1 local miss = (getSpeed(cid) - getSpeed(attacker)) * 0.26 local poketype1 = pokes[getCreatureName(cid)].type local poketype2 = pokes[getCreatureName(cid)].type2 if getCreatureCondition(cid, CONDITION_INVISIBLE) then return false end if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then if isInArray(effectiveness[damageCombat].super, poketype1) then multiplier = multiplier * 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 doSendMagicEffect(getThingPos(cid), 3) return false end if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then if not isInArray({"Clefable", "Wigglytuff"}, getCreatureName(attacker)) then return false end end if miss > 0 and math.random(1, 100) <= miss and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then doSendMagicEffect(getThingPos(cid), 211) doSendAnimatedText(getThingPos(cid), "MISS", 215) return false end end -------------------------------------------------- local valor = value if multiplier > 2 then multiplier = 2 elseif multiplier == 0.25 then multiplier = 0.5 end -------------------------------------------------- local function resetMiss(cid) if not isCreature(cid) then return true end setPlayerStorageValue(cid, 88726, -1) end if getPlayerStorageValue(cid, 88726) ~= 1 and miss > 0 and math.random(1, 100) <= miss and damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignoremiss, combat) and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then doSendMagicEffect(getThingPos(cid), 211) doSendAnimatedText(getThingPos(cid), "MISS", 215) doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(cid)), false) doSendMagicEffect(getThingPos(cid), 211) doFaceCreature(cid, getThingPos(attacker)) setPlayerStorageValue(cid, 88726, 1) addEvent(resetMiss, 2200, cid) return false end if not isSummon(attacker) and not isSummon(cid) then return false end if isSummon(cid) and isSummon(attacker) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end --party system if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end if isSleeping(attacker) then return false end local randomRange = math.random(83, 117) / 100 local block = 0 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 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 valor = valor * multiplier valor = valor * randomRange if isSummon(attacker) then valor = valor * getHappinessRate(attacker) else valor = valor * summonReduction end valor = math.floor(valor) if combat == NIGHTMAREDAMAGE then local div = 8 if isSummon(attacker) and not isSummon(cid) then div = 4 end valor = math.floor(getCreatureMaxHealth(cid)/div) elseif combat == GUILLOTINEDAMAGE then if isGhostPokemon(cid) then doSendMagicEffect(getThingPos(cid), 3) return false end local gDmg = 0.5 if isSummon(attacker) and not isSummon(cid) then gDmg = 0.7 end valor = getCreatureMaxHealth(cid) * gDmg elseif combat == SEISMICTOSSDAMAGE then valor = getPokemonLevel(attacker) * 10 elseif 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 combat == PSYCHOSHIFTDAMAGE and isCreature(cid) then if not isPlayer(cid) then local pos = getThingPos(cid) pos.x = pos.x + math.random(-4,4) pos.y = pos.y + math.random(-4,4) for a = 1, 6 do if not canWalkOnPos(pos, true, true, true, true, false) or not isSightClear(getThingPos(cid), pos, false) then pos = getThingPos(cid) pos.x = pos.x + math.random(-4,4) pos.y = pos.y + math.random(-4,4) end end if not canWalkOnPos(pos, true, true, true, true, false) then pos = getClosestFreeTile(cid, getThingPos(cid)) end if not canWalkOnPos(pos, true, true, true, true, false) then pos = getThingPos(cid) end doTeleportThing(cid, pos, false) end doSendMagicEffect(getThingPos(cid), math.random(12, 14)) end if combat == THUNDERWAVEDAMAGE then doCreatureAddCondition(cid, thunderwavecondition) end if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) end end --- REFLECT -------------------------------- if not isPlayer(cid) and getPlayerStorageValue(cid, 34) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then doSendMagicEffect(getThingPos(cid), 135) doSendAnimatedText(getThingPos(cid), "REFLECT", COLOR_GRASS) setPlayerStorageValue(cid, 34, -1) return false end -------------------------------------------- if hasMimicWall(cid) then doSendMagicEffect(getThingPos(cid), 135) local dmgText = ""..valor.."" local a = getPlayerStorageValue(cid, 878) setPlayerStorageValue(cid, 878, a - valor) local k = getPlayerStorageValue(cid, 878) if k <= 0 then local b = getTileItemById(getThingPos(cid), 11440) if b.uid > 1 then doRemoveItem(b.uid, 1) end local c = getTileItemById(getThingPos(cid), 11439) if c.uid > 1 then doRemoveItem(c.uid, 1) end dmgText = ""..a.."" doSendMagicEffect(getThingPos(cid), 3) end doSendAnimatedText(getThingPos(cid), dmgText, 215) return false 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(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.08) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 11) doSendMagicEffect(getThingPos(cid), 178) 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 = 128, direita = 129, esquerda = 130, baixo = 131}, --Scizor [1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther [952] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop [909] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco [910] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress } --acima do efeito 255 n aparece -pelo menos aki- entao fica esse por enquanto... ;x --efeito vermelho => {cima = 261, direita = 263, esquerda = 264, baixo = 262} if isSummon(cid) then if OutFit[getCreatureOutfit(cid).lookType] 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 outfitt = OutFit[getCreatureOutfit(cid).lookType] local function doWingAttack(cid, a, damage, min, max) local damagearea = {} local effectpos = getThingPosWithDebug(cid) local effect = 255 if a == 0 then effect = outfitt.cima effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y - 1 damagearea = wingdn elseif a == 1 then effect = outfitt.direita effectpos.x = effectpos.x + 2 effectpos.y = effectpos.y + 1 damagearea = wingde elseif a == 2 then effect = outfitt.baixo effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 2 damagearea = wingds elseif a == 3 then effect = outfitt.esquerda effectpos.x = effectpos.x - 1 effectpos.y = effectpos.y + 1 damagearea = wingdw end doSendMagicEffect(effectpos, effect) if damage then local look = getCreatureOutfit(cid).lookType if look == 366 or look == 1317 then --scyther e shiny scyther doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) elseif look == 952 then --hitmontop doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) else --resto doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) end end end local dire = getCreatureLookDir(cid) local cpos = getThingPosWithDebug(cid) local min = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... setPlayerStorageValue(cid, 32623, 1) --proteçao doSetCreatureOutfit(cid, {lookType = OutFit[getCreatureOutfit(cid).lookType].out}, -1) local function doDance(cid, dir, damage, min, max) if not isCreature(cid) then return true end doCreatureSetLookDir(cid, dir) doWingAttack(cid, dir, damage, min, max) end for times = 0, 2 do for directions = 0, 3 do addEvent(doDance, times * 300, cid, directions, true, min, max) end end local function doChangeO(cid, dir, pos) if not isCreature(cid) then return true end setPlayerStorageValue(cid, 32623, 0) --proteçao doRemoveCondition(cid, CONDITION_OUTFIT) if getThingPosWithDebug(cid).x == pos.x and getThingPosWithDebug(cid).y == pos.y then doCreatureSetLookDir(cid, dir) end end addEvent(doChangeO, 2 * 300 + 10, cid, dire, cpos) end end end -------------------------------------------Lava Counter / Electricity------------------------------------- local Fire_Thunder = {"Magmar", "Shiny Magmar", "Electabuzz", "Shiny Electabuzz"} --["Nome"] = {effeito, damage} local eff = { ["Magmar"] = {15, FIREDAMAGE}, ["Shiny Magmar"] = {15, FIREDAMAGE}, ["Electabuzz"] = {207, ELECTRICDAMAGE}, ["Shiny Electabuzz"] = {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)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... 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 setPlayerStorageValue(cid, 32623, 0) --proteçao end setPlayerStorageValue(cid, 32623, 1) --proteçao doSpinFire(cid, false, cid) end end end ---------------------------------------------Demon Kicker---------------------------------- --[outfit] = outfit chutando, local hitmonlees = { [371] = 652, --hitmonlee [1300] = 652, --shiny hitmonlee [877] = 878, --elite hitmonlee PxG } --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(getCreatureTarget(getCreatureMaster(cid))) then if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- if isSleeping(cid) then return true end 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 doRemoveCondition(cid, CONDITION_OUTFIT) end local min = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... setPlayerStorageValue(cid, 32623, 1) --proteçao doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookType]}, -1) 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(getCreatureTarget(getCreatureMaster(cid))) then if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- if isSleeping(cid) then return true end 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 = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... 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 setPlayerStorageValue(cid, 32623, 1) --proteçao doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPosWithDebug(cid), confusion, -min, -max, 136) end end for i = 1, 7 do addEvent(damage, i*500, cid) end setPlayerStorageValue(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), eshock, -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--------------------------------------------------- arr = { {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 2, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1} } local charge = {"Pikachu", "Shiny Pikachu", "Raichu", "Shiny Raichu"} if isSummon(cid) then local e = getCreatureMaster(cid) local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke") local target = 0 if isInArray(charge, name) then if getPlayerStorageValue(cid, 253) >= 0 then return true end local uid = checkAreaUid(getCreaturePosition(cid), arr, 1, 1) for _,pid in pairs(uid) do if isCreature(pid) then if getCreatureTarget(pid) == cid then target = target+1 end end end if target == 0 then return true end if target == (1 or 2) then chance = 15 --15% elseif target == (3 or 4) then chance = 20 --20% elseif target == (5 or 6) then chance = 30 --30% end if math.random(1, 100) <= chance then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- setPlayerStorageValue(cid, 253, 1) 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 4 = 4% Acho, Mais Fica A Sua Escolha if getPlayerStorageValue(cid, 32623) == 1 then return false end local function effect(params) if isCreature(params.cid) then doSendMagicEffect(getThingPos(params.cid), 12) end end setPlayerStorageValue(cid, 32623, 1) local function doReduceOffenseDefense(cid, qnt) if not isCreature(cid) then return true end local a = getDefense(cid) local A = getOffense(cid) if getCreatureName(cid) ~= "Persian" then setPlayerStorageValue(cid, 1002, a - qnt) end setPlayerStorageValue(cid, 1001, A - qnt) end local function doDoubleOffenseDefense(cid) if not isCreature(cid) then return true end local a = getDefense(cid) local A = getOffense(cid) if getCreatureName(cid) ~= "Persian" then setPlayerStorageValue(cid, 1002, a * 2) end setPlayerStorageValue(cid, 1001, A * 1.5) local b = getDefense(cid) local c = b - a local B = getOffense(cid) local C = B - A if getCreatureName(cid) ~= "Persian" then addEvent(doReduceOffenseDefense, 15 * 1500 + 40, cid, c) end addEvent(doReduceOffenseDefense, 15 * 1500 + 40, cid, C) end setPlayerStorageValue(cid, 32623, 0) doDoubleOffenseDefense(cid) for times = 0, 15 do addEvent(effect, 1500 * times + 40, {cid = cid}) end setPlayerStorageValue(cid, 32623, 1) 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 isCreature(pid) 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 --------------------------------------- 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 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 consegui concertar ja o problema do atack que não hitava, mais agora me surgiu outro problema nem sei se é o mesmo mais apareceu. Problema: [12/07/2012 15:30:40] [Error - CreatureScript Interface] [12/07/2012 15:30:40] data/creaturescripts/scripts/exp.lua:onStatsChange [12/07/2012 15:30:40] Description: [12/07/2012 15:30:40] data/lib/status library.lua:262: attempt to call global 'canAttackOther' (a nil value) [12/07/2012 15:30:40] stack traceback: [12/07/2012 15:30:40] data/lib/status library.lua:262: in function 'doAdvancedBurn' [12/07/2012 15:30:40] data/creaturescripts/scripts/exp.lua:529: in function <data/creaturescripts/scripts/exp.lua:128> [12/07/2012 15:30:49] [Error - CreatureScript Interface] [12/07/2012 15:30:49] data/creaturescripts/scripts/exp.lua:onStatsChange [12/07/2012 15:30:49] Description: [12/07/2012 15:30:49] data/lib/status library.lua:262: attempt to call global 'canAttackOther' (a nil value) [12/07/2012 15:30:49] stack traceback: [12/07/2012 15:30:50] data/lib/status library.lua:262: in function 'doAdvancedBurn' [12/07/2012 15:30:50] data/creaturescripts/scripts/exp.lua:529: in function <data/creaturescripts/scripts/exp.lua:128> 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}, [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 function doHeal(cid, amount) doCreatureAddHealth(cid, amount) doSendMagicEffect(getThingPos(cid), 12) doSendAnimatedText(getThingPos(cid), "+"..amount.."", 65) end 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 getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction if isCreature(attacker) then return false end return true 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) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end doSleep(cid, value, true) return false end -------------------------------------------------- if combat == HEALINGDAMAGE then local healing = math.abs(value) if not isSummon(cid) and not isSummon(attacker) and not isPlayer(attacker) then doHeal(cid, healing) return false end if isSummon(cid) and isSummon(attacker) then if getPlayerStorageValue(getCreatureMaster(cid), 990) >= 1 then return false end if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then doHeal(cid, healing) return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then doHeal(cid, healing) return false end end 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 not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end local master = attacker if isSummon(attacker) then master = getCreatureMaster(attacker) 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 --muda isso end -------------------------------------------------- if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then 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, 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 not isSummon(cid) and isSummon(attacker) then return false end if isSummon(cid) and isSummon(attacker) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) 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 multiplier = 1 local miss = (getSpeed(cid) - getSpeed(attacker)) * 0.26 local poketype1 = pokes[getCreatureName(cid)].type local poketype2 = pokes[getCreatureName(cid)].type2 if getCreatureCondition(cid, CONDITION_INVISIBLE) then return false end if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then if isInArray(effectiveness[damageCombat].super, poketype1) then multiplier = multiplier * 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 doSendMagicEffect(getThingPos(cid), 3) return false end if getCreatureCondition(attacker, CONDITION_INVISIBLE) and not isGhostPokemon(attacker) then if not isInArray({"Clefable", "Wigglytuff"}, getCreatureName(attacker)) then return false end end if miss > 0 and math.random(1, 100) <= miss and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then doSendMagicEffect(getThingPos(cid), 211) doSendAnimatedText(getThingPos(cid), "MISS", 215) return false end end -------------------------------------------------- local valor = value if multiplier > 2 then multiplier = 2 elseif multiplier == 0.25 then multiplier = 0.5 end -------------------------------------------------- local function resetMiss(cid) if not isCreature(cid) then return true end setPlayerStorageValue(cid, 88726, -1) end if getPlayerStorageValue(cid, 88726) ~= 1 and miss > 0 and math.random(1, 100) <= miss and damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignoremiss, combat) and not isSleeping(cid) and not getCreatureCondition(cid, CONDITION_PARALYZE) then doSendMagicEffect(getThingPos(cid), 211) doSendAnimatedText(getThingPos(cid), "MISS", 215) doTeleportThing(cid, getClosestFreeTile(cid, getThingPos(cid)), false) doSendMagicEffect(getThingPos(cid), 211) doFaceCreature(cid, getThingPos(attacker)) setPlayerStorageValue(cid, 88726, 1) addEvent(resetMiss, 2200, cid) return false end if not isSummon(attacker) and not isSummon(cid) then return false end if isSummon(cid) and isSummon(attacker) then if not isInParty(getCreatureMaster(cid)) or not isInParty(getCreatureMaster(attacker)) then return false end --party system if not getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then return false end end if isSleeping(attacker) then return false end local randomRange = math.random(83, 117) / 100 local block = 0 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 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 valor = valor * multiplier valor = valor * randomRange if isSummon(attacker) then valor = valor * getHappinessRate(attacker) else valor = valor * summonReduction end valor = math.floor(valor) if combat == NIGHTMAREDAMAGE then local div = 8 if isSummon(attacker) and not isSummon(cid) then div = 4 end valor = math.floor(getCreatureMaxHealth(cid)/div) elseif combat == GUILLOTINEDAMAGE then if isGhostPokemon(cid) then doSendMagicEffect(getThingPos(cid), 3) return false end local gDmg = 0.5 if isSummon(attacker) and not isSummon(cid) then gDmg = 0.7 end valor = getCreatureMaxHealth(cid) * gDmg elseif combat == SEISMICTOSSDAMAGE then valor = getPokemonLevel(attacker) * 10 elseif 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 combat == PSYCHOSHIFTDAMAGE and isCreature(cid) then if not isPlayer(cid) then local pos = getThingPos(cid) pos.x = pos.x + math.random(-4,4) pos.y = pos.y + math.random(-4,4) for a = 1, 6 do if not canWalkOnPos(pos, true, true, true, true, false) or not isSightClear(getThingPos(cid), pos, false) then pos = getThingPos(cid) pos.x = pos.x + math.random(-4,4) pos.y = pos.y + math.random(-4,4) end end if not canWalkOnPos(pos, true, true, true, true, false) then pos = getClosestFreeTile(cid, getThingPos(cid)) end if not canWalkOnPos(pos, true, true, true, true, false) then pos = getThingPos(cid) end doTeleportThing(cid, pos, false) end doSendMagicEffect(getThingPos(cid), math.random(12, 14)) end if combat == THUNDERWAVEDAMAGE then doCreatureAddCondition(cid, thunderwavecondition) end if valor >= getCreatureHealth(cid) then if isInArray(cannotKill, combat) and isPlayer(cid) then valor = getCreatureHealth(cid) - 1 else valor = getCreatureHealth(cid) end end --- REFLECT -------------------------------- if not isPlayer(cid) and getPlayerStorageValue(cid, 34) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then doSendMagicEffect(getThingPos(cid), 135) doSendAnimatedText(getThingPos(cid), "REFLECT", COLOR_GRASS) setPlayerStorageValue(cid, 34, -1) return false end -------------------------------------------- if hasMimicWall(cid) then doSendMagicEffect(getThingPos(cid), 135) local dmgText = ""..valor.."" local a = getPlayerStorageValue(cid, 878) setPlayerStorageValue(cid, 878, a - valor) local k = getPlayerStorageValue(cid, 878) if k <= 0 then local b = getTileItemById(getThingPos(cid), 11440) if b.uid > 1 then doRemoveItem(b.uid, 1) end local c = getTileItemById(getThingPos(cid), 11439) if c.uid > 1 then doRemoveItem(c.uid, 1) end dmgText = ""..a.."" doSendMagicEffect(getThingPos(cid), 3) end doSendAnimatedText(getThingPos(cid), dmgText, 215) return false 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(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.08) and not exhaustion.get(getCreatureMaster(cid), 88726) then exhaustion.set(getCreatureMaster(cid), 88726, 11) doSendMagicEffect(getThingPos(cid), 178) 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 = 128, direita = 129, esquerda = 130, baixo = 131}, --Scizor [1317] = {out = 849, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Shiny Scyther [952] = {out = 1193, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Hitmontop [909] = {out = 1194, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --pineco [910] = {out = 1192, cima = 128, direita = 129, esquerda = 130, baixo = 131}, --Forretress } --acima do efeito 255 n aparece -pelo menos aki- entao fica esse por enquanto... ;x --efeito vermelho => {cima = 261, direita = 263, esquerda = 264, baixo = 262} if isSummon(cid) then if OutFit[getCreatureOutfit(cid).lookType] 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 outfitt = OutFit[getCreatureOutfit(cid).lookType] local function doWingAttack(cid, a, damage, min, max) local damagearea = {} local effectpos = getThingPosWithDebug(cid) local effect = 255 if a == 0 then effect = outfitt.cima effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y - 1 damagearea = wingdn elseif a == 1 then effect = outfitt.direita effectpos.x = effectpos.x + 2 effectpos.y = effectpos.y + 1 damagearea = wingde elseif a == 2 then effect = outfitt.baixo effectpos.x = effectpos.x + 1 effectpos.y = effectpos.y + 2 damagearea = wingds elseif a == 3 then effect = outfitt.esquerda effectpos.x = effectpos.x - 1 effectpos.y = effectpos.y + 1 damagearea = wingdw end doSendMagicEffect(effectpos, effect) if damage then local look = getCreatureOutfit(cid).lookType if look == 366 or look == 1317 then --scyther e shiny scyther doAreaCombatHealth(cid, BUGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) elseif look == 952 then --hitmontop doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) else --resto doAreaCombatHealth(cid, STEELDAMAGE, getThingPosWithDebug(cid), damagearea, -min, -max, CONST_ME_NONE) end end end local dire = getCreatureLookDir(cid) local cpos = getThingPosWithDebug(cid) local min = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... setPlayerStorageValue(cid, 32623, 1) --proteçao doSetCreatureOutfit(cid, {lookType = OutFit[getCreatureOutfit(cid).lookType].out}, -1) local function doDance(cid, dir, damage, min, max) if not isCreature(cid) then return true end doCreatureSetLookDir(cid, dir) doWingAttack(cid, dir, damage, min, max) end for times = 0, 2 do for directions = 0, 3 do addEvent(doDance, times * 300, cid, directions, true, min, max) end end local function doChangeO(cid, dir, pos) if not isCreature(cid) then return true end setPlayerStorageValue(cid, 32623, 0) --proteçao doRemoveCondition(cid, CONDITION_OUTFIT) if getThingPosWithDebug(cid).x == pos.x and getThingPosWithDebug(cid).y == pos.y then doCreatureSetLookDir(cid, dir) end end addEvent(doChangeO, 2 * 300 + 10, cid, dire, cpos) end end end -------------------------------------------Lava Counter / Electricity------------------------------------- local Fire_Thunder = {"Magmar", "Shiny Magmar", "Electabuzz", "Shiny Electabuzz"} --["Nome"] = {effeito, damage} local eff = { ["Magmar"] = {15, FIREDAMAGE}, ["Shiny Magmar"] = {15, FIREDAMAGE}, ["Electabuzz"] = {207, ELECTRICDAMAGE}, ["Shiny Electabuzz"] = {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)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... 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 setPlayerStorageValue(cid, 32623, 0) --proteçao end setPlayerStorageValue(cid, 32623, 1) --proteçao doSpinFire(cid, false, cid) end end end ---------------------------------------------Demon Kicker---------------------------------- --[outfit] = outfit chutando, local hitmonlees = { [371] = 652, --hitmonlee [1300] = 652, --shiny hitmonlee [877] = 878, --elite hitmonlee PxG } --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(getCreatureTarget(getCreatureMaster(cid))) then if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- if isSleeping(cid) then return true end 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 doRemoveCondition(cid, CONDITION_OUTFIT) end local min = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... setPlayerStorageValue(cid, 32623, 1) --proteçao doSetCreatureOutfit(cid, {lookType = hitmonlees[getCreatureOutfit(cid).lookType]}, -1) 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(getCreatureTarget(getCreatureMaster(cid))) then if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- if isSleeping(cid) then return true end 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 = getPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano... local max = getPokemonLevel(cid)*20 --nao sei como funciona o sistema de dano... 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 setPlayerStorageValue(cid, 32623, 1) --proteçao doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPosWithDebug(cid), confusion, -min, -max, 136) end end for i = 1, 7 do addEvent(damage, i*500, cid) end setPlayerStorageValue(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), eshock, -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--------------------------------------------------- arr = { {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 2, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1} } local charge = {"Pikachu", "Shiny Pikachu", "Raichu", "Shiny Raichu"} if isSummon(cid) then local e = getCreatureMaster(cid) local name = getItemAttribute(getPlayerSlotItem(e, 8).uid, "poke") local target = 0 if isInArray(charge, name) then if getPlayerStorageValue(cid, 253) >= 0 then return true end local uid = checkAreaUid(getCreaturePosition(cid), arr, 1, 1) for _,pid in pairs(uid) do if isCreature(pid) then if getCreatureTarget(pid) == cid then target = target+1 end end end if target == 0 then return true end if target == (1 or 2) then chance = 15 --15% elseif target == (3 or 4) then chance = 20 --20% elseif target == (5 or 6) then chance = 30 --30% end if math.random(1, 100) <= chance then -- Porcentagem de chance pro poke usar a passiva... 10 = 10% +/- setPlayerStorageValue(cid, 253, 1) 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 4 = 4% Acho, Mais Fica A Sua Escolha if getPlayerStorageValue(cid, 32623) == 1 then return false end local function effect(params) if isCreature(params.cid) then doSendMagicEffect(getThingPos(params.cid), 12) end end setPlayerStorageValue(cid, 32623, 1) local function doReduceOffenseDefense(cid, qnt) if not isCreature(cid) then return true end local a = getDefense(cid) local A = getOffense(cid) if getCreatureName(cid) ~= "Persian" then setPlayerStorageValue(cid, 1002, a - qnt) end setPlayerStorageValue(cid, 1001, A - qnt) end local function doDoubleOffenseDefense(cid) if not isCreature(cid) then return true end local a = getDefense(cid) local A = getOffense(cid) if getCreatureName(cid) ~= "Persian" then setPlayerStorageValue(cid, 1002, a * 2) end setPlayerStorageValue(cid, 1001, A * 1.5) local b = getDefense(cid) local c = b - a local B = getOffense(cid) local C = B - A if getCreatureName(cid) ~= "Persian" then addEvent(doReduceOffenseDefense, 15 * 1500 + 40, cid, c) end addEvent(doReduceOffenseDefense, 15 * 1500 + 40, cid, C) end setPlayerStorageValue(cid, 32623, 0) doDoubleOffenseDefense(cid) for times = 0, 15 do addEvent(effect, 1500 * times + 40, {cid = cid}) end setPlayerStorageValue(cid, 32623, 1) 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 isCreature(pid) 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 --------------------------------------- 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 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 Ajuda ae porfavorzão! Editado Julho 12, 2012 por Kurobisu Link para o comentário Compartilhar em outros sites More sharing options...
Eternaus 0 Postado Julho 12, 2012 Share Postado Julho 12, 2012 como eu coloco pokemon na dentro da chest pra ficar tipo um kit inicial o player abre o baú pega o pokemon ?? Link para o comentário Compartilhar em outros sites More sharing options...
Taiger 286 Postado Julho 12, 2012 Share Postado Julho 12, 2012 To com um erro, os alguns pokes nao hitam nada dos players. Alguem pode me ajudar? Link para o comentário Compartilhar em outros sites More sharing options...
AWeskers 14 Postado Julho 12, 2012 Share Postado Julho 12, 2012 Galéra to com um problema aqui na spr, pareçe que a capacidade maxima déla é 65535, só que presiso de mais espaço que isso. Alguem sabe como almenta a capacidade maxima déla ? se souber posta ae ou manda MSG. Vlws ae. Link para o comentário Compartilhar em outros sites More sharing options...
StyloMaldoso 330 Postado Julho 12, 2012 Share Postado Julho 12, 2012 Jhonsy kk é foda esse poblema acho que só excluindo sprint veias huasdhsdh para adiciona + ;/ Link para o comentário Compartilhar em outros sites More sharing options...
AWeskers 14 Postado Julho 12, 2012 Share Postado Julho 12, 2012 @shadow2012: não tenho certeza mais verifica se o nome do script do NPC ta como "diamond". ja que o NPC em xml ta carregando o diamond.lua qualquer erro no nome póde causar em não carregar o arquivo.lua @StyloMaldoso ja exclui um monte de sprites sem uso mais nao passa de 65535 a capacidade maxima, talvez presise alterar a programação do arquivo, coisa que não sou programador. Link para o comentário Compartilhar em outros sites More sharing options...
shadow2012 6 Postado Julho 12, 2012 Share Postado Julho 12, 2012 (editado) @shadow2012: não tenho certeza mais verifica se o nome do script do NPC ta como "diamond". ja que o NPC em xml ta carregando o diamond.lua qualquer erro no nome póde causar em não carregar o arquivo.lua @StyloMaldoso ja exclui um monte de sprites sem uso mais nao passa de 65535 a capacidade maxima, talvez presise alterar a programação do arquivo, coisa que não sou programador. vlw cara tinha um nome scripts junto com o nome npc ta ai seu rep. amanha eu coloco pq ja atingiu o maximo de rep q ja dei hj Outra duvida qual e o comando de banir player? Editado Julho 12, 2012 por shadow2012 Link para o comentário Compartilhar em outros sites More sharing options...
Kurobisu 73 Postado Julho 12, 2012 Share Postado Julho 12, 2012 To com um erro, os alguns pokes nao hitam nada dos players. Alguem pode me ajudar? Não deu para intender sua duvida, seria o pokémon ao atackar o player ou o Pokémon atackando o Pokémon ou vice versa? Explica direito isto aí. @shadow2012: não tenho certeza mais verifica se o nome do script do NPC ta como "diamond". ja que o NPC em xml ta carregando o diamond.lua qualquer erro no nome póde causar em não carregar o arquivo.lua @StyloMaldoso ja exclui um monte de sprites sem uso mais nao passa de 65535 a capacidade maxima, talvez presise alterar a programação do arquivo, coisa que não sou programador. vlw cara tinha um nome scripts junto com o nome npc ta ai seu rep. amanha eu coloco pq ja atingiu o maximo de rep q ja dei hj Outra duvida qual e o comando de banir player? /ban Ou então faça o seguinte, diga: /commands Daí abrirá uma janela dentro do game com uma lista completa dos comandos, pra entender é só olhar que ja da pra ter uma base... @shadow2012: não tenho certeza mais verifica se o nome do script do NPC ta como "diamond". ja que o NPC em xml ta carregando o diamond.lua qualquer erro no nome póde causar em não carregar o arquivo.lua @StyloMaldoso ja exclui um monte de sprites sem uso mais nao passa de 65535 a capacidade maxima, talvez presise alterar a programação do arquivo, coisa que não sou programador. Jhonsy, seria mais o caso pois o limite realmente não tem como ser aumentado a capacidade maxima de Sprites é essa. A não ser que você faça com que fique 2 Tibia.spr dentro da pasta de seu Client, aí ja surgiria mais uma forma de capacidade... como eu coloco pokemon na dentro da chest pra ficar tipo um kit inicial o player abre o baú pega o pokemon ?? Cara acho que ta meio difíciu responder a está pergunta, eu ando tentando por via Script's caso queira tentar aí posso até lhe ensinar mais fique claro que mesmo comigo não deu certo só que pelo visto daria certo se fosse em outro tipo de OT. Caso queira tentar no seu pra ver a sorte só falar aí que posto um Tutorial. Também gostaria que alguém fora eu ajuda-se nesta dúvida nem eu consigo por para o player pegar o Pokémon Ínicial. Link para o comentário Compartilhar em outros sites More sharing options...
AWeskers 14 Postado Julho 13, 2012 Share Postado Julho 13, 2012 (editado) @Kurobiso: Vlws ae, me deu uma idéia msm ^^, acho que consigo colocar 2 sprs, compilando as duas formando uma unica spr com o dobro de capacidaed, sei um jeito de fazer isso, Vlws ae ^^ @shadow2012: Esquenta com REP não, nen presisa dar, não ligo pra isso. Editado Julho 13, 2012 por Jhonsy Link para o comentário Compartilhar em outros sites More sharing options...
gugaevt 1 Postado Julho 13, 2012 Share Postado Julho 13, 2012 Alguem Pode Me Ajuda Quando Tira o Pokemon Aparece essa mensagem ali aqueles negocio 12/0,0,0,0,0,0 o outro 12/0-0-0-0-0 Me Ajudem Por favor!! Rep ++ Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados