Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getMoveInfo(cid, moveid)
- local name = doCorrectString(getCreatureName(cid))
- if moveid == 1 then
- move = movestable[name].move1
- elseif moveid == 2 then
- move = movestable[name].move2
- elseif moveid == 3 then
- move = movestable[name].move3
- elseif moveid == 4 then
- move = movestable[name].move4
- elseif moveid == 5 then
- move = movestable[name].move5
- elseif moveid == 6 then
- move = movestable[name].move6
- elseif moveid == 7 then
- move = movestable[name].move7
- elseif moveid == 8 then
- move = movestable[name].move8
- elseif moveid == 9 then
- move = movestable[name].move9
- elseif moveid == 10 then
- move = movestable[name].move10
- elseif moveid == 11 then
- move = movestable[name].move11
- elseif moveid == 12 then
- move = movestable[name].move12
- elseif moveid == 13 then
- move = movestable[name].move13
- elseif moveid == 14 then
- move = movestable[name].move14
- end
- return move
- end
- function getPokemonNumberMoves(cid)
- local name = doCorrectString(getCreatureName(cid))
- if not movestable[name].move1 then
- return 0
- elseif not movestable[name].move2 then
- return 1
- elseif not movestable[name].move3 then
- return 2
- elseif not movestable[name].move4 then
- return 3
- elseif not movestable[name].move5 then
- return 4
- elseif not movestable[name].move6 then
- return 5
- elseif not movestable[name].move7 then
- return 6
- elseif not movestable[name].move8 then
- return 7
- elseif not movestable[name].move9 then
- return 8
- elseif not movestable[name].move10 then
- return 9
- elseif not movestable[name].move11 then
- return 10
- elseif not movestable[name].move12 then
- return 11
- elseif not movestable[name].move13 then
- return 12
- elseif not movestable[name].move14 then
- return 13
- else
- return 14
- end
- end
- function setPokemonMoveDelay(cid, move, time)
- if not isCreature(cid) then return true end
- local ball = isSummon(cid) and getPlayerSlotItem(getCreatureMaster(cid), CONST_SLOT_FEET) or nil
- if ball then
- doItemSetAttribute(ball.uid, "move"..move, time)
- end
- setPlayerStorageValue(cid, storages.moves[move], time)
- if time <= 0 then return true end
- addEvent(setPokemonMoveDelay, 1000, cid, move, time - 1)
- end
- function getPokemonMoveDelay(cid, move)
- local storage = storages.moves[move]
- if getPlayerStorageValue(cid, storage) and getPlayerStorageValue(cid, storage) > 0 then
- return true
- else
- return false
- end
- end
- function doClearBallMoveDelay(ball)
- for i = 1, 14 do
- doItemEraseAttribute(ball, "move"..i)
- end
- end
- function getBallMoveDelay(ball, move)
- if getItemAttribute(ball, "move"..move) and getItemAttribute(ball, "move"..move) > 0 then
- return true
- else
- return false
- end
- end
- function setPokemonStatus(cid, status, time, damage, first, attacker)
- if not isCreature(cid) then return true end
- if isSummon(cid) then
- master = getCreatureMaster(cid)
- ball = getPlayerSlotItem(master, CONST_SLOT_FEET)
- else
- master = 0
- ball = false
- end
- local storage = storages.status[status]
- local pos1 = getThingPos(cid)
- local pos2 = getThingPos(cid)
- pos2.y = pos2.y - 1
- if first then
- setPlayerStorageValue(cid, storage, time)
- else
- if getPlayerStorageValue(cid, storage) - 1 == time then
- setPlayerStorageValue(cid, storage, time)
- else
- return true
- end
- end
- if ball ~= false then
- doItemSetAttribute(ball.uid, status, time)
- doItemSetAttribute(ball.uid, status.."Damage", damage)
- end
- if status == "sleep" then
- if time <= 0 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- return true
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- if isNumberPair(time) then
- doSendMagicEffect(pos2, 32)
- end
- if not isPlayer(cid) then
- if getCreatureCondition(cid, CONDITION_OUTFIT) then
- doRemoveCondition(cid, CONDITION_OUTFIT)
- end
- end
- elseif status == "stun" then
- if time <= 0 then
- doRegainSpeed(cid)
- return true
- end
- if isPlayer(cid) then
- if playerSpeed <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- else
- if getCreatureBaseSpeed(cid) <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- end
- elseif status == "string" then
- if time <= 0 then
- doRegainSpeed(cid)
- return true
- end
- doSendMagicEffect(pos1, 150)
- if isPlayer(cid) then
- if playerSpeed <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- else
- if getCreatureBaseSpeed(cid) <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- end
- elseif status == "blind" then
- if time <= 0 then return true end
- doSendMagicEffect(pos1, 34)
- elseif status == "confusion" then
- if time <= 0 then return true end
- if damage == 31 then
- doSendMagicEffect(pos2, damage)
- else
- doSendMagicEffect(pos1, damage)
- end
- doAddCondition(cid, confusioncondition)
- elseif status == "poison" then
- if time <= 0 then return true end
- if getCreatureHealth(cid) - math.floor(damage/2) <= 0 then
- doCreatureAddHealth(cid, -getCreatureHealth(cid) + 1, 8, COMBAT_COLORS[COMBAT_POISONDAMAGE])
- else
- doCreatureAddHealth(cid, -math.floor(damage/2), 8, COMBAT_COLORS[COMBAT_POISONDAMAGE])
- end
- elseif status == "burn" then
- if time <= 0 then return true end
- doCreatureAddHealth(cid, -math.floor(damage/2), 15, COMBAT_COLORS[COMBAT_FIREDAMAGE], attacker)
- elseif status == "leechSeed" then
- if time <= 0 then return true end
- if not isCreature(attacker) then return true end
- if not isNumberPair(time) then
- if getCreatureHealth(cid) - damage <= 0 then
- hit = getCreatureHealth(cid)
- else
- hit = damage
- end
- doSendAnimatedText(getThingPos(attacker), "+"..hit, 35)
- doSendAnimatedText(pos1, "-"..hit, 180)
- doSendMagicEffect(pos1, 45)
- doCreatureAddHealth(attacker, hit)
- doCreatureAddHealth(cid, -hit)
- end
- elseif status == "speedDown" then
- if time <= 0 then
- doRegainSpeed(cid)
- return true
- end
- if isPlayer(cid) then
- if playerSpeed <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- else
- if getCreatureBaseSpeed(cid) <= getCreatureSpeed(cid) then
- doChangeSpeed(cid, -getCreatureSpeed(cid)/2)
- end
- end
- elseif status == "fear" then
- if time <= 0 then
- setCreatureTargetDistance(cid, getCreatureDefaultTargetDistance(cid))
- return true
- end
- if getCreatureTargetDistance(cid) < 6 then
- setCreatureTargetDistance(cid, 6)
- end
- local function doSendEffect(cid)
- if not isCreature(cid) then return true end
- doSendMagicEffect(pos1, 169)
- end
- for i = 0, 1 do
- addEvent(doSendEffect, i * 500, cid)
- end
- elseif status == "involved" then
- if time <= 0 then return true end
- if isNumberPair(time) then
- doSendMagicEffect(pos1, 105)
- doSendMagicEffect(pos1, 170)
- doCreatureAddHealth(cid, -damage, 2, 180)
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, false)
- else
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, true)
- end
- elseif status == "silence" then
- if time <= 0 then return true end
- doSendMagicEffect(pos1, damage)
- elseif status == "rage" then
- if time <= 0 then return true end
- doSendMagicEffect(pos1, 13)
- elseif status == "harden" then
- if time <= 0 then return true end
- doSendMagicEffect(pos1, damage)
- elseif status == "strafe" then
- if time <= 0 then return true end
- if isCreature(getMasterTarget(cid)) then
- doCastMove(cid, "Attack")
- end
- doSendMagicEffect(pos1, 14)
- elseif status == "speedUp" then
- if time <= 0 then
- doRegainSpeed(cid)
- return true
- end
- if isPlayer(cid) then
- if playerSpeed >= getCreatureSpeed(cid) then
- doChangeSpeed(cid, getCreatureSpeed(cid))
- end
- else
- if getCreatureBaseSpeed(cid) >= getCreatureSpeed(cid) then
- doChangeSpeed(cid, getCreatureSpeed(cid))
- end
- end
- end
- if isCreature(master) then
- doOTCSendPokemonHealth(master)
- end
- addEvent(setPokemonStatus, 1000, cid, status, time - 1, damage, false, attacker)
- end
- function doClearPokemonStatus(cid)
- for i = 1, #allStatus do
- setPokemonStatus(cid, allStatus[i], 0, 0, true, 0)
- end
- end
- function getPokemonStatus(cid, status)
- local storage = storages.status[status]
- if getPlayerStorageValue(cid, storage) and getPlayerStorageValue(cid, storage) > 0 then
- return true
- else
- return false
- end
- end
- function doClearBallStatus(ball)
- for i = 1, #allStatus do
- doItemEraseAttribute(ball, allStatus[i])
- end
- end
- function getBallStatus(ball, status)
- if getItemAttribute(ball, status) and getItemAttribute(ball, status) > 0 then
- return true
- else
- return false
- end
- end
- function getMasterTarget(cid)
- if isSummon(cid) then
- return getCreatureTarget(getCreatureMaster(cid))
- else
- return getCreatureTarget(cid)
- end
- end
- function getMasterLevel(cid)
- if isSummon(cid) then
- return getPlayerLevel(getCreatureMaster(cid))
- else
- return getPokemonLevel(getCreatureName(cid))
- end
- end
- function doMissChance(cid, move)
- if move and isInArray(movesnevermiss, move) then return false end
- for i = 1, #missStatus do
- if getPokemonStatus(cid, missStatus[i]) and math.random(1, 2) == 1 then
- doSendAnimatedText(getThingPos(cid), "MISS!", 215)
- return true
- else
- return false
- end
- end
- end
- function getPokemonPowerMove(cid, move)
- if not isCreature(cid) then return true end
- local power = movesinfo[move].power
- return power
- end
- function doSendMoveEffectUp(cid, shoteffect)
- if not isCreature(cid) then return true end
- local fromPos = getThingPos(cid)
- local toPos = {x = fromPos.x - math.random(5, 7), y = fromPos.y - math.random(5, 7), z = fromPos.z}
- doSendDistanceShoot(fromPos, toPos, shoteffect)
- end
- function doSendMoveEffectDown(cid, effect, shoteffect)
- if not isCreature(cid) then return true end
- local myPos = getThingPos(cid)
- local toPos = {x = myPos.x + math.random(-4, 4), y = myPos.y + math.random(-4, 4), z = myPos.z}
- local fromPos = {x = toPos.x - 6, y = toPos.y - 6, z = toPos.z}
- if getThingFromPos(toPos).itemid ~= 0 then
- doSendMagicEffect(toPos, effect)
- if shoteffect then
- doSendDistanceShoot(fromPos, toPos, shoteffect)
- end
- end
- end
- function doFrontalCombatHealth(cid, pos, type, min, max, effect, shoteffect)
- local target = (isCreature(getMasterTarget(cid)) and getMasterTarget(cid) or 0)
- local direction = getCreatureDirectionToTarget(cid, target)
- local function doSendFrontalCombat(cid, turn, randomarea)
- if not isCreature(cid) then return true end
- local randomiclist = {
- [1] = {11, 12, 3, 4, 1, 18, 10, 2, 7, 15},
- [2] = {13, 11, 3, 17, 2, 9, 10, 1, 18, 4},
- [3] = {10, 4, 2, 15, 1, 19, 13, 3, 14, 6},
- [4] = {14, 17, 2, 18, 3, 19, 15, 1, 13, 7},
- [5] = {6, 15, 3, 17, 1, 12, 19, 2, 16, 13}
- }
- local info = {
- [0] = {
- [1] = {x = pos.x, y = pos.y - 1, z = pos.z},
- [2] = {x = pos.x - 1, y = pos.y - 2, z = pos.z},
- [3] = {x = pos.x + 1, y = pos.y - 2, z = pos.z},
- [4] = {x = pos.x, y = pos.y - 3, z = pos.z},
- [5] = {x = pos.x - 2, y = pos.y - 3, z = pos.z},
- [6] = {x = pos.x + 2, y = pos.y - 3, z = pos.z},
- [7] = {x = pos.x - 3, y = pos.y - 4, z = pos.z},
- [8] = {x = pos.x - 1, y = pos.y - 4, z = pos.z},
- [9] = {x = pos.x + 1, y = pos.y - 4, z = pos.z},
- [10] = {x = pos.x + 3, y = pos.y - 4, z = pos.z},
- [11] = {x = pos.x, y = pos.y - 5, z = pos.z},
- [12] = {x = pos.x - 4, y = pos.y - 5, z = pos.z},
- [13] = {x = pos.x - 2, y = pos.y - 5, z = pos.z},
- [14] = {x = pos.x + 2, y = pos.y - 5, z = pos.z},
- [15] = {x = pos.x + 4, y = pos.y - 5, z = pos.z},
- [16] = {x = pos.x - 3, y = pos.y - 6, z = pos.z},
- [17] = {x = pos.x - 1, y = pos.y - 6, z = pos.z},
- [18] = {x = pos.x + 1, y = pos.y - 6, z = pos.z},
- [19] = {x = pos.x + 3, y = pos.y - 6, z = pos.z},
- },
- [1] = {
- [1] = {x = pos.x + 1, y = pos.y, z = pos.z},
- [2] = {x = pos.x + 2, y = pos.y + 1, z = pos.z},
- [3] = {x = pos.x + 2, y = pos.y - 1, z = pos.z},
- [4] = {x = pos.x + 3, y = pos.y, z = pos.z},
- [5] = {x = pos.x + 3, y = pos.y + 2, z = pos.z},
- [6] = {x = pos.x + 3, y = pos.y - 2, z = pos.z},
- [7] = {x = pos.x + 4, y = pos.y + 3, z = pos.z},
- [8] = {x = pos.x + 4, y = pos.y + 1, z = pos.z},
- [9] = {x = pos.x + 4, y = pos.y - 1, z = pos.z},
- [10] = {x = pos.x + 4, y = pos.y - 3, z = pos.z},
- [11] = {x = pos.x + 5, y = pos.y, z = pos.z},
- [12] = {x = pos.x + 5, y = pos.y - 4, z = pos.z},
- [13] = {x = pos.x + 5, y = pos.y - 2, z = pos.z},
- [14] = {x = pos.x + 5, y = pos.y + 2, z = pos.z},
- [15] = {x = pos.x + 5, y = pos.y + 4, z = pos.z},
- [16] = {x = pos.x + 6, y = pos.y - 3, z = pos.z},
- [17] = {x = pos.x + 6, y = pos.y - 1, z = pos.z},
- [18] = {x = pos.x + 6, y = pos.y + 1, z = pos.z},
- [19] = {x = pos.x + 6, y = pos.y + 3, z = pos.z},
- },
- [2] = {
- [1] = {x = pos.x, y = pos.y + 1, z = pos.z},
- [2] = {x = pos.x + 1, y = pos.y + 2, z = pos.z},
- [3] = {x = pos.x - 1, y = pos.y + 2, z = pos.z},
- [4] = {x = pos.x, y = pos.y + 3, z = pos.z},
- [5] = {x = pos.x + 2, y = pos.y + 3, z = pos.z},
- [6] = {x = pos.x - 2, y = pos.y + 3, z = pos.z},
- [7] = {x = pos.x + 3, y = pos.y + 4, z = pos.z},
- [8] = {x = pos.x + 1, y = pos.y + 4, z = pos.z},
- [9] = {x = pos.x - 1, y = pos.y + 4, z = pos.z},
- [10] = {x = pos.x - 3, y = pos.y + 4, z = pos.z},
- [11] = {x = pos.x, y = pos.y + 5, z = pos.z},
- [12] = {x = pos.x - 4, y = pos.y + 5, z = pos.z},
- [13] = {x = pos.x - 2, y = pos.y + 5, z = pos.z},
- [14] = {x = pos.x + 2, y = pos.y + 5, z = pos.z},
- [15] = {x = pos.x + 4, y = pos.y + 5, z = pos.z},
- [16] = {x = pos.x - 3, y = pos.y + 6, z = pos.z},
- [17] = {x = pos.x - 1, y = pos.y + 6, z = pos.z},
- [18] = {x = pos.x + 1, y = pos.y + 6, z = pos.z},
- [19] = {x = pos.x + 3, y = pos.y + 6, z = pos.z},
- },
- [3] = {
- [1] = {x = pos.x - 1, y = pos.y, z = pos.z},
- [2] = {x = pos.x - 2, y = pos.y - 1, z = pos.z},
- [3] = {x = pos.x - 2, y = pos.y + 1, z = pos.z},
- [4] = {x = pos.x - 3, y = pos.y, z = pos.z},
- [5] = {x = pos.x - 3, y = pos.y - 2, z = pos.z},
- [6] = {x = pos.x - 3, y = pos.y + 2, z = pos.z},
- [7] = {x = pos.x - 4, y = pos.y - 3, z = pos.z},
- [8] = {x = pos.x - 4, y = pos.y - 1, z = pos.z},
- [9] = {x = pos.x - 4, y = pos.y + 1, z = pos.z},
- [10] = {x = pos.x - 4, y = pos.y + 3, z = pos.z},
- [11] = {x = pos.x - 5, y = pos.y, z = pos.z},
- [12] = {x = pos.x - 5, y = pos.y - 4, z = pos.z},
- [13] = {x = pos.x - 5, y = pos.y - 2, z = pos.z},
- [14] = {x = pos.x - 5, y = pos.y + 2, z = pos.z},
- [15] = {x = pos.x - 5, y = pos.y + 4, z = pos.z},
- [16] = {x = pos.x - 6, y = pos.y - 3, z = pos.z},
- [17] = {x = pos.x - 6, y = pos.y - 1, z = pos.z},
- [18] = {x = pos.x - 6, y = pos.y + 1, z = pos.z},
- [19] = {x = pos.x - 6, y = pos.y + 3, z = pos.z},
- }
- }
- local area = info[direction][randomiclist[randomarea][turn+1]]
- if getTopCreature(area).uid > 0 and isCreature(getTopCreature(area).uid) then
- doTargetCombatHealth(cid, getTopCreature(area).uid, type, min/2, max/2, 2)
- end
- doSendMagicEffect(area, effect)
- if shoteffect then
- doSendDistanceShoot(getThingPos(cid), area, shoteffect)
- end
- end
- local randomarea = math.random(1, 5)
- for i = 0, 9 do
- addEvent(doSendFrontalCombat, i * 100, cid, i, randomarea)
- end
- local area = {
- [0] = frontalN,
- [1] = frontalE,
- [2] = frontalS,
- [3] = frontalW
- }
- doAreaCombatHealth(cid, type, getThingPos(cid), area[getCreatureDirectionToTarget(cid, target)], min, max, 2)
- end
- function doCastMove(cid, move, target, min, max)
- if not isCreature(cid) or isPlayer(cid) then return true end
- for i = 1, #silenceStatus do
- if getPokemonStatus(cid, silenceStatus[i]) then return true end
- end
- local target = target or isCreature(getMasterTarget(cid)) and getMasterTarget(cid) or 0
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local targetPos = isCreature(target) and getThingPos(target) or nil
- local myDirection = getCreatureDirectionToTarget(cid, target)
- local master = isSummon(cid) and getCreatureMaster(cid) or 0
- local pokeLevel = getMasterLevel(cid)
- if isCreature(master) then
- doAddCondition(master, fightcondition)
- end
- if min and max then
- min = math.abs(min)
- max = math.abs(max)
- else
- min = (getPokemonSpAttack(getCreatureName(cid)) + (getPokemonPowerMove(cid, move) * 5)) * pokeLevel * 0.0175
- max = min + pokeLevel
- if move == "Selfdestruct" then
- min = getCreatureHealth(cid)
- max = getCreatureHealth(cid)
- end
- end
- if getPlayerStorageValue(cid, storages.focus) and getPlayerStorageValue(cid, storages.focus) == 1 and getPokemonPowerMove(cid, move) > 0 then
- min = min * 2
- max = max * 2
- doSendMagicEffect(myPos, 117)
- setPlayerStorageValue(cid, storages.focus, 0)
- end
- if not isInArray({"Attack", "Fury", "Electric Charge", "Melody", "Lifesteal"}, move) and not isSummon(cid) then
- doCreatureSay(cid, string.upper(move).."!", TALKTYPE_MONSTER)
- end
- if doMissChance(cid, move) then return true end
- if move == "Attack" then
- if isWild(cid) then
- local modifier = 1.2 * getMultiplier("normal", target)
- local defPercent = 1 - (getPokemonDefense(getCreatureName(cid))/255)
- hit = math.ceil((getAttackValue(cid) * defPercent) * modifier)
- if getPokemonStatus(cid, "rage") then
- hit = hit * 2
- end
- if getPokemonStatus(target, "harden") then
- hit = math.ceil(hit * 0.75)
- end
- if isCreature(target) and tonumber(getCreatureHealth(target)) - hit <= 0 then
- hit = getCreatureHealth(target)
- end
- elseif isSummon(cid) then
- local modifier = tableFome[getFeedStatus(cid)].hitMultiplier * getMultiplier("normal", target) * getPlayerFightModeOffense(master)
- local defPercent = 1 - (getPokemonDefense(getCreatureName(cid))/255)
- hit = math.ceil((getAttackValue(cid) * defPercent) * modifier)
- if getPokemonStatus(cid, "rage") then
- hit = hit * 2
- end
- if getPokemonStatus(target, "harden") then
- hit = math.ceil(hit * 0.75)
- end
- if isCreature(cid) and tonumber(getCreatureHealth(cid)) - hit <= 0 then
- hit = getCreatureHealth(cid)
- end
- end
- if isInArray({"Butterfree"}, getCreatureName(cid)) then
- doActivePassiveWithDamage(cid, target)
- doTargetCombatHealth(cid, target, COMBAT_GHOSTDAMAGE, hit, hit, 154)
- doSendDistanceShoot(myPos, targetPos, 53)
- elseif isInArray({"Zubat", "Golbat"}, getCreatureName(cid)) then
- doActivePassiveWithDamage(cid, target)
- else
- if getDistanceBetween(myPos, targetPos) <= 1 then
- doActivePassiveWithDamage(cid, target)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, hit, hit, 3)
- end
- end
- elseif move == "Tackle" or move == "Headbutt" or move == "Scratch" or move == "Quick Attack" or move == "Super Fang" then
- local effect = (move == "Tackle" or move == "Quick Attack") and 104 or move == "Headbutt" and 88 or move == "Scratch" and 119 or 151
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, min, max, effect)
- elseif move == "Razor Leaf" then
- local function doSendMove(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local targetPos = isCreature(target) and getThingPos(target) or nil
- doTargetCombatHealth(cid, target, COMBAT_GRASSDAMAGE, min/2, max/2, 105)
- doSendDistanceShoot(myPos, targetPos, 47)
- end
- for i = 0, 1 do
- addEvent(doSendMove, i * 250, cid, target)
- end
- elseif move == "Vine Whip" then
- local function doSendMove(cid, area)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_GRASSDAMAGE, myPos, area, min/2, max/2, 2)
- end
- local info = {
- [0] = {106, vineWhipN, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}},
- [1] = {107, vineWhipE, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}},
- [2] = {108, vineWhipS, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}},
- [3] = {109, vineWhipW, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- for i = 0, 1 do
- addEvent(doSendMove, i * 500, cid, info[myDirection][2])
- end
- elseif move == "Leech Seed" then
- doSendDistanceShoot(myPos, targetPos, 48)
- doTargetCombatHealth(cid, target, STATUS_LEECHSEED, pokeLevel, pokeLevel, 2)
- elseif move == "Solar Beam" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local pos = getThingPos(cid)
- local info = {
- [0] = {110, solarBeamN, {x = pos.x + 1, y = pos.y - 1, z = pos.z}},
- [1] = {111, solarBeamE, {x = pos.x + 6, y = pos.y + 1, z = pos.z}},
- [2] = {112, solarBeamS, {x = pos.x + 1, y = pos.y + 6, z = pos.z}},
- [3] = {113, solarBeamW, {x = pos.x - 1, y = pos.y + 1, z = pos.z}}
- }
- doSendMagicEffect(info[getCreatureDirectionToTarget(cid, target)][3], info[getCreatureDirectionToTarget(cid, target)][1])
- doAreaCombatHealth(cid, COMBAT_GRASSDAMAGE, pos, info[getCreatureDirectionToTarget(cid, target)][2], min, max, 2)
- end
- doSendMagicEffect(myPos, 117)
- addEvent(doSendMove, 500, cid)
- elseif move == "Sleep Powder" then
- doAreaCombatHealth(cid, STATUS_SLEEP, myPos, circle2x2, 5, 5, 114)
- elseif move == "Stun Spore" then
- doAreaCombatHealth(cid, STATUS_STUN, myPos, circle2x2, 10, 10, 115)
- elseif move == "Poison Powder" then
- doAreaCombatHealth(cid, STATUS_POISON20, myPos, circle2x2, pokeLevel, pokeLevel, 116)
- elseif move == "Bullet Seed" then
- doFrontalCombatHealth(cid, myPos, COMBAT_GRASSDAMAGE, min, max, 45, 48)
- elseif move == "Giga Drain" then
- doTargetCombatHealth(cid, target, ABSORB_GRASS, min, max, 118)
- doSendMagicEffect(myPos, 117)
- doSendDistanceShoot(myPos, targetPos, 49)
- elseif move == "Leaf Storm" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = getThingPos(cid)
- local pos = {x = myPos.x + math.random(-4, 4), y = myPos.y + math.random(-4, 4), z = myPos.z}
- if getTopCreature(pos).uid > 0 and isCreature(getTopCreature(pos).uid) then
- doTargetCombatHealth(cid, getTopCreature(pos).uid, COMBAT_GRASSDAMAGE, min/2, max/2, 2)
- end
- if getThingFromPos(pos).itemid ~= 0 then
- doSendDistanceShoot(myPos, pos, 47)
- doSendMagicEffect(pos, 105)
- end
- end
- for i = 0, 9 do
- addEvent(doSendMove, i * 100, cid)
- end
- doAreaCombatHealth(cid, COMBAT_GRASSDAMAGE, myPos, square4x4, min, max, 2)
- elseif move == "Ember" then
- doSendDistanceShoot(myPos, targetPos, 3)
- doTargetCombatHealth(cid, target, COMBAT_FIREDAMAGE, min, max, 2)
- elseif move == "Flamethrower" then
- local info = {
- [0] = {120, throwerN, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}},
- [1] = {121, throwerE, {x = myPos.x + 3, y = myPos.y + 1, z = myPos.z}},
- [2] = {122, throwerS, {x = myPos.x + 1, y = myPos.y + 3, z = myPos.z}},
- [3] = {123, throwerW, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, myPos, info[myDirection][2], min, max, 2)
- doAreaCombatHealth(cid, STATUS_BURN10, myPos, info[myDirection][2], pokeLevel, pokeLevel, 2)
- elseif move == "Fireball" then
- doSendDistanceShoot(myPos, targetPos, 3)
- doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, targetPos, circle2x2, min, max, 6)
- doTargetCombatHealth(cid, target, COMBAT_FIREDAMAGE, min, max, 6)
- doAreaCombatHealth(cid, STATUS_BURN5, targetPos, circle2x2, pokeLevel, pokeLevel, 2)
- doTargetCombatHealth(cid, target, STATUS_BURN5, pokeLevel, pokeLevel, 2)
- elseif move == "Fire Fang" then
- doSendMagicEffect(targetPos, 36)
- doSendDistanceShoot(myPos, targetPos, 3)
- doTargetCombatHealth(cid, target, COMBAT_FIREDAMAGE, min, max, 124)
- doTargetCombatHealth(cid, target, STATUS_BURN10, pokeLevel, pokeLevel, 2)
- elseif move == "Fire Blast" then
- local function doSendMove(cid, area, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, area, line1x1, min, max, 36)
- doAreaCombatHealth(cid, STATUS_BURN5, area, line1x1, pokeLevel, pokeLevel, 2)
- doSendMagicEffect(area, effect)
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {125, {x = myPos.x, y = myPos.y - (i+1), z = myPos.z}},
- [1] = {126, {x = myPos.x + (i+1), y = myPos.y, z = myPos.z}},
- [2] = {127, {x = myPos.x, y = myPos.y + (i+1), z = myPos.z}},
- [3] = {128, {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], info[myDirection][1], i+1)
- end
- elseif move == "Rage" then
- setPokemonStatus(cid, "rage", 20, 0, true, 0)
- elseif move == "Flame Burst" then
- doFrontalCombatHealth(cid, myPos, COMBAT_FIREDAMAGE, min, max, 6, 3)
- elseif move == "Wing Attack" then
- local info = {
- [0] = {129, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}, {x = myPos.x, y = myPos.y - 1, z = myPos.z}},
- [1] = {130, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}, {x = myPos.x + 1, y = myPos.y, z = myPos.z}},
- [2] = {131, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}, {x = myPos.x, y = myPos.y + 1, z = myPos.z}},
- [3] = {132, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}, {x = myPos.x - 1, y = myPos.y, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][2], info[myDirection][1])
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, info[myDirection][3], line1x1, min, max, 2)
- elseif move == "Air Slash" then
- local info = {
- [1] = {133, 129, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}},
- [2] = {134, 130, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}},
- [3] = {135, 131, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}},
- [4] = {136, 132, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}}
- }
- for i = 1, 4 do
- doSendMagicEffect(info[i][3], info[i][1])
- addEvent(doSendMagicEffect, 500, info[i][3], info[i][2])
- end
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, myPos, circle2x2, min/2, max/2, 2)
- addEvent(doAreaCombatHealth, 500, cid, COMBAT_FLYINGDAMAGE, myPos, circle2x2, min/2, max/2, 2)
- elseif move == "Magma Storm" then
- local function doSendMove(cid, area, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, myPos, area, min, max, effect)
- if turn >= 5 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 4 do
- local areas = {square1x1, magmaStorm1, magmaStorm2, magmaStorm3, magmaStorm4}
- local effects = {6, 5, 36, 36, 6}
- addEvent(doSendMove, i * 500, cid, areas[i+1], effects[i+1], i+1)
- end
- elseif move == "Scary Face" then
- doSendMagicEffect({x = myPos.x + 1, y = myPos.y + 1, z = myPos.z}, 137)
- doAreaCombatHealth(cid, STATUS_STUN, myPos, circle4x4, 10, 10, 2)
- elseif move == "Bubbles" then
- doSendDistanceShoot(myPos, targetPos, 50)
- doTargetCombatHealth(cid, target, COMBAT_WATERDAMAGE, min, max, 138)
- elseif move == "Water Gun" then
- local info = {
- [0] = {139, missile6N, {x = myPos.x, y = myPos.y - 1, z = myPos.z}},
- [1] = {140, missile6E, {x = myPos.x + 6, y = myPos.y, z = myPos.z}},
- [2] = {141, missile6S, {x = myPos.x, y = myPos.y + 6, z = myPos.z}},
- [3] = {142, missile6W, {x = myPos.x - 1, y = myPos.y, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- doAreaCombatHealth(cid, COMBAT_WATERDAMAGE, myPos, info[myDirection][2], min, max, 2)
- elseif move == "Waterball" then
- doSendDistanceShoot(myPos, targetPos, 50)
- doAreaCombatHealth(cid, COMBAT_WATERDAMAGE, targetPos, circle2x2, min, max, 138)
- doTargetCombatHealth(cid, target, COMBAT_WATERDAMAGE, min, max, 138)
- elseif move == "Aqua Tail" then
- doSendDistanceShoot(myPos, targetPos, 50)
- doTargetCombatHealth(cid, target, COMBAT_WATERDAMAGE, min, max, 138)
- elseif move == "Hydro Cannon" then
- local function doSendMove(cid, area, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_WATERDAMAGE, area, line1x1, min, max, 138)
- doSendMagicEffect(area, effect)
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {143, {x = myPos.x, y = myPos.y - (i+1), z = myPos.z}},
- [1] = {144, {x = myPos.x + (i+1), y = myPos.y, z = myPos.z}},
- [2] = {145, {x = myPos.x, y = myPos.y + (i+1), z = myPos.z}},
- [3] = {146, {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], info[myDirection][1], i+1)
- end
- elseif move == "Harden" then
- setPokemonStatus(cid, "harden", 10, 147, true, 0)
- elseif move == "Brine" then
- doFrontalCombatHealth(cid, myPos, COMBAT_WATERDAMAGE, min, max, 138, 50)
- elseif move == "Water Pulse" then
- doAreaCombatHealth(cid, COMBAT_WATERDAMAGE, myPos, circle3x3, min, max, 148)
- elseif move == "Skull Bash" then
- local function doSendMove(cid, area, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, area, line1x1, min, max, 2)
- doAreaCombatHealth(cid, STATUS_STUN, area, line1x1, 8, 8, 2)
- if not isNumberPair(turn) then
- doSendMagicEffect(area, 149)
- end
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {x = myPos.x, y = myPos.y - (i+1), z = myPos.z},
- [1] = {x = myPos.x + (i+1), y = myPos.y, z = myPos.z},
- [2] = {x = myPos.x, y = myPos.y + (i+1), z = myPos.z},
- [3] = {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection], i+1)
- end
- elseif move == "Hydropump" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = getThingPos(cid)
- local pos = {x = myPos.x + math.random(-4, 4), y = myPos.y + math.random(-4, 4), z = myPos.z}
- if getTopCreature(pos).uid > 0 and isCreature(getTopCreature(pos).uid) then
- doTargetCombatHealth(cid, getTopCreature(pos).uid, COMBAT_WATERDAMAGE, min/2, max/2, 2)
- end
- if getThingFromPos(pos).itemid ~= 0 then
- doSendDistanceShoot(myPos, pos, 50)
- doSendMagicEffect(pos, 53)
- end
- end
- for i = 0, 9 do
- addEvent(doSendMove, i * 100, cid)
- end
- doAreaCombatHealth(cid, COMBAT_WATERDAMAGE, myPos, square4x4, min, max, 2)
- elseif move == "String Shot" then
- doSendDistanceShoot(myPos, targetPos, 51)
- doTargetCombatHealth(cid, target, STATUS_STRING, 5, 5, 2)
- elseif move == "Bug Bite" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_BUGDAMAGE, min, max, 8)
- elseif move == "Super Sonic" then
- doSendDistanceShoot(myPos, targetPos, 52)
- doTargetCombatHealth(cid, target, STATUS_CONFUSION10, 31, 31, 2)
- elseif move == "Silver Wind" then
- doSendDistanceShoot(myPos, targetPos, 51)
- doAreaCombatHealth(cid, COMBAT_BUGDAMAGE, targetPos, cross1x1, min, max, 152)
- doSendMagicEffect(targetPos, 153)
- elseif move == "Whirlwind" then
- local function doSendMove(cid, area, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, myPos, area, min/2, max/2, 159)
- if turn >= 4 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- local info = {
- [0] = {whirlwindN1, whirlwindN2, whirlwindN3, whirlwindN4},
- [1] = {whirlwindE1, whirlwindE2, whirlwindE3, whirlwindE4},
- [2] = {whirlwindS1, whirlwindS2, whirlwindS3, whirlwindS4},
- [3] = {whirlwindW1, whirlwindW2, whirlwindW3, whirlwindW4}
- }
- for i = 0, 3 do
- addEvent(doSendMove, i * 250, cid, info[myDirection][i+1], i)
- end
- for i = 1, 4 do
- addEvent(doSendMove, i * 250, cid, info[myDirection][i], i)
- end
- elseif move == "Confusion" then
- doAreaCombatHealth(cid, COMBAT_PSYCHICDAMAGE, myPos, circle3x3, min, max, 154)
- elseif move == "Psybeam" then
- for i = 1, 6 do
- local info = {
- [0] = {155, {x = myPos.x, y = myPos.y - i, z = myPos.z}},
- [1] = {156, {x = myPos.x + i, y = myPos.y, z = myPos.z}},
- [2] = {157, {x = myPos.x, y = myPos.y + i, z = myPos.z}},
- [3] = {158, {x = myPos.x - i, y = myPos.y, z = myPos.z}}
- }
- doAreaCombatHealth(cid, COMBAT_PSYCHICDAMAGE, info[myDirection][2], nil, min, max, info[myDirection][1])
- end
- elseif move == "Air Cutter" then
- local function doSendMove(cid, area, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, area, line1x1, min, max, 2)
- doSendMagicEffect(area, effect)
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {129, {x = myPos.x + 1, y = myPos.y - (i+1), z = myPos.z}},
- [1] = {130, {x = myPos.x + (i+2), y = myPos.y + 1, z = myPos.z}},
- [2] = {131, {x = myPos.x + 1, y = myPos.y + (i+2), z = myPos.z}},
- [3] = {132, {x = myPos.x - (i+1), y = myPos.y + 1, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], info[myDirection][1], i+1)
- end
- elseif move == "Safeguard" then
- doClearPokemonStatus(cid)
- doSendMagicEffect(myPos, 1)
- elseif move == "Horn Attack" then
- local function doSendMove(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local targetPos = isCreature(target) and getThingPos(target) or nil
- doSendDistanceShoot(myPos, targetPos, 54)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, min/5, max/5, 3)
- end
- for i = 0, 4 do
- addEvent(doSendMove, i * 150, cid, target)
- end
- elseif move == "Poison Sting" then
- doSendDistanceShoot(myPos, targetPos, 54)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min, max, 8)
- elseif move == "Poison Jab" then
- doSendDistanceShoot(myPos, targetPos, 54)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min, max, 160)
- doTargetCombatHealth(cid, target, STATUS_POISON10, pokeLevel, pokeLevel, 2)
- elseif move == "Fury Cutter" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local myDirection = getCreatureDirectionToTarget(cid, target)
- local info = {
- [0] = {129, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}, {x = myPos.x, y = myPos.y - 1, z = myPos.z}},
- [1] = {130, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}, {x = myPos.x + 1, y = myPos.y, z = myPos.z}},
- [2] = {131, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}, {x = myPos.x, y = myPos.y + 1, z = myPos.z}},
- [3] = {132, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}, {x = myPos.x - 1, y = myPos.y, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][2], info[myDirection][1])
- doAreaCombatHealth(cid, COMBAT_BUGDAMAGE, info[myDirection][3], line1x1, min/2, max/2, 2)
- end
- for i = 0, 1 do
- addEvent(doSendMove, i * 500, cid)
- end
- elseif move == "Pin Missile" then
- doFrontalCombatHealth(cid, myPos, COMBAT_BUGDAMAGE, min, max, 16, 55)
- elseif move == "Toxic Spikes" then
- local function doSendMove(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local targetPos = isCreature(target) and getThingPos(target) or nil
- doSendDistanceShoot(myPos, targetPos, 54)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, min/5, max/5, 161)
- end
- for i = 0, 4 do
- addEvent(doSendMove, i * 150, cid, target)
- end
- elseif move == "Strafe" then
- setPokemonStatus(cid, "strafe", 20, 0, true, 0)
- elseif move == "Sand Attack" then
- for i = 1, 3 do
- local info = {
- [0] = {162, {x = myPos.x, y = myPos.y - i, z = myPos.z}, {x = myPos.x, y = myPos.y - 1, z = myPos.z}},
- [1] = {163, {x = myPos.x + i, y = myPos.y, z = myPos.z}, {x = myPos.x + 3, y = myPos.y, z = myPos.z}},
- [2] = {164, {x = myPos.x, y = myPos.y + i, z = myPos.z}, {x = myPos.x, y = myPos.y + 3, z = myPos.z}},
- [3] = {165, {x = myPos.x - i, y = myPos.y, z = myPos.z}, {x = myPos.x - 1, y = myPos.y, z = myPos.z}}
- }
- doAreaCombatHealth(cid, STATUS_BLIND, info[myDirection][2], nil, 5, 5, 2)
- if i == 1 then
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- end
- end
- elseif move == "Gust" then
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local info = {
- [0] = {x = myPos.x, y = myPos.y - turn, z = myPos.z},
- [1] = {x = myPos.x + turn, y = myPos.y, z = myPos.z},
- [2] = {x = myPos.x, y = myPos.y + turn, z = myPos.z},
- [3] = {x = myPos.x - turn, y = myPos.y, z = myPos.z}
- }
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, info[myDirection], nil, min, max, 2)
- if not isNumberPair(turn) then
- doSendMagicEffect(info[myDirection], 159)
- end
- end
- for i = 0, 4 do
- addEvent(doSendMove, i * 150, cid, i+1)
- end
- elseif move == "Drill Peck" then
- for i = 0, 2 do
- addEvent(doTargetCombatHealth, i * 100, cid, target, COMBAT_FLYINGDAMAGE, min/3, max/3, 2)
- end
- doSendMagicEffect(targetPos, 166)
- elseif move == "Aeroblast" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = getThingPos(cid)
- local pos = {x = myPos.x + math.random(-4, 4), y = myPos.y + math.random(-4, 4), z = myPos.z}
- if getTopCreature(pos).uid > 0 and isCreature(getTopCreature(pos).uid) then
- doTargetCombatHealth(cid, getTopCreature(pos).uid, COMBAT_FLYINGDAMAGE, min/2, max/2, 2)
- end
- if getThingFromPos(pos).itemid ~= 0 then
- doSendDistanceShoot(myPos, pos, 56)
- doSendMagicEffect(pos, 159)
- end
- end
- for i = 0, 9 do
- addEvent(doSendMove, i * 100, cid)
- end
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, myPos, square4x4, min, max, 2)
- elseif move == "Hurricane" then
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendMove, 500, cid, turn + 1)
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, getThingPos(cid), square1x1, (min/20), (max/20), 159)
- if turn == 20 or getPokemonStatus(cid, "sleep") then
- doRemoveCondition(cid, CONDITION_OUTFIT)
- stopEvent(event)
- end
- end
- setPokemonStatus(cid, "speedUp", 20, 0, true, 0)
- doSetCreatureOutfit(cid, {lookType = 250}, -1)
- doSendMove(cid)
- elseif move == "Agility" then
- setPokemonStatus(cid, "strafe", 20, 0, true, 0)
- setPokemonStatus(cid, "speedUp", 10, 0, true, 0)
- elseif move == "Roost" then
- local healMin = (getCreatureMaxHealth(cid) * 40) / 100
- local healMax = healMin + pokeLevel
- local heal = math.random(healMin, healMax)
- if getCreatureHealth(cid) + heal > getCreatureMaxHealth(cid) then
- heal = getCreatureMaxHealth(cid) - getCreatureHealth(cid)
- end
- if heal > 0 then
- doSendAnimatedText(myPos, "+"..heal, 35)
- doCreatureAddHealth(cid, heal)
- end
- doSendMagicEffect(myPos, 167)
- if isSummon(cid) then
- doOTCSendPokemonHealth(master)
- end
- elseif move == "Bite" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_DARKDAMAGE, min, max, 168)
- elseif move == "Pursuit" then
- local function doSendMove(cid, target, turn)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = getThingPos(cid)
- local targetPos = getThingPos(target)
- local randomPos = getClosestFreeTile(cid, targetPos)
- if turn == 1 then
- doSendDistanceShoot(myPos, targetPos, 57)
- doSendMagicEffect(myPos, 95)
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- setCreatureVisibility(cid, true)
- elseif turn == 2 then
- doSendDistanceShoot(randomPos, targetPos, 57)
- doSendMagicEffect(randomPos, 95)
- doTargetCombatHealth(cid, target, COMBAT_DARKDAMAGE, min, max, 2)
- elseif turn == 3 then
- doSendDistanceShoot(targetPos, myPos, 57)
- doSendMagicEffect(myPos, 95)
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- setCreatureVisibility(cid, false)
- end
- end
- for i = 0, 2 do
- addEvent(doSendMove, i * 500, cid, target, i+1)
- end
- elseif move == "Peck" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_FLYINGDAMAGE, min, max, 104)
- elseif move == "Aerial Ace" then
- local function doSendMoveDamage(cid)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, COMBAT_FLYINGDAMAGE, myPos, square4x4, min, max, 2)
- end
- for i = 0, 19 do
- addEvent(doSendMoveEffectDown, i * 50, cid, math.random(133, 136))
- end
- addEvent(doSendMoveDamage, 1000, cid)
- elseif move == "Poison Fang" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min, max, 151)
- doTargetCombatHealth(cid, target, STATUS_POISON5, pokeLevel, pokeLevel, 2)
- elseif move == "Gunk Shot" then
- local function doSendMove(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local myPos = isCreature(cid) and getThingPos(cid) or nil
- local targetPos = isCreature(target) and getThingPos(target) or nil
- doSendDistanceShoot(myPos, targetPos, 55)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min/5, max/5, 8)
- end
- for i = 0, 4 do
- addEvent(doSendMove, i * 150, cid, target)
- end
- elseif move == "Acid" then
- doSendDistanceShoot(myPos, targetPos, 14)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min, max, 20)
- elseif move == "Fear" then
- doAreaCombatHealth(cid, STATUS_FEAR, myPos, circle4x4, 6, 6, 2)
- elseif move == "Wrap" then
- doSendDistanceShoot(myPos, targetPos, 14)
- setPokemonStatus(target, "involved", 8, math.random(min, max), true, 0)
- elseif move == "Iron Tail" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_STEELDAMAGE, min, max, 171)
- elseif move == "Mega Kick" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_FIGHTINGDAMAGE, min, max, 172)
- elseif move == "Thunder Shock" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_ELECTRICDAMAGE, min, max, 48)
- elseif move == "Thunder Bolt" then
- local function doSendMoveDown(cid, target, toPos)
- if not isCreature(target) or not isCreature(cid) then return true end
- doSendDistanceShoot(toPos, getThingPos(target), 58)
- doTargetCombatHealth(cid, target, COMBAT_ELECTRICDAMAGE, min/2, max/2, 48)
- end
- local function doSendMoveUp(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- local myPos = getThingPos(cid)
- local targetPos = getThingPos(target)
- local toPos = targetPos
- toPos.x = toPos.x - 6
- toPos.y = toPos.y - 6
- doSendDistanceShoot(myPos, toPos, 58)
- addEvent(doSendMoveDown, 350, cid, target, toPos)
- end
- for i = 0, 1 do
- addEvent(doSendMoveUp, i * 200, cid, target)
- end
- elseif move == "Thunder Wave" then
- local info = {
- [0] = wave5N,
- [1] = wave5E,
- [2] = wave5S,
- [3] = wave5W
- }
- doAreaCombatHealth(cid, STATUS_STUN, myPos, info[myDirection], 10, 10, 2)
- doAreaCombatHealth(cid, COMBAT_ELECTRICDAMAGE, myPos, info[myDirection], min, max, 48)
- elseif move == "Thunder Punch" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_ELECTRICDAMAGE, min, max, 173)
- elseif move == "Thunder" then
- local effectPos = {x = myPos.x + 1, y = myPos.y, z = myPos.z}
- doSendMagicEffect(effectPos, 194)
- doAreaCombatHealth(cid, STATUS_STUN, myPos, thunder, 10, 10, 2)
- doAreaCombatHealth(cid, COMBAT_ELECTRICDAMAGE, myPos, thunder, min, max, 48)
- elseif move == "Electric Storm" then
- local function doSendMoveDown(cid)
- if not isCreature(cid) then return true end
- for i = 0, 39 do
- addEvent(doSendMoveEffectDown, i * 50, cid, 48, 58)
- end
- end
- local function doSendMoveDamage(cid)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_STUN, myPos, square4x4, 10, 10, 2)
- doAreaCombatHealth(cid, COMBAT_ELECTRICDAMAGE, myPos, square4x4, min, max, 2)
- end
- for i = 0, 19 do
- addEvent(doSendMoveEffectUp, i * 50, cid, 58)
- end
- addEvent(doSendMoveDown, 500, cid)
- addEvent(doSendMoveDamage, 1500, cid)
- elseif move == "Body Slam" then
- local damage = math.random(min, max)
- local counter = (damage*10/100)
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, damage, damage, 88)
- doCreatureAddHealth(cid, -math.floor(counter), 2, 200, target)
- elseif move == "Mud Shot" then
- doSendDistanceShoot(myPos, targetPos, 59)
- doTargetCombatHealth(cid, target, COMBAT_GROUNDDAMAGE, min, max, 175)
- doTargetCombatHealth(cid, target, STATUS_BLIND, 6, 6, 2)
- elseif move == "Rollout" then
- local outfit = {
- ["Sandshrew"] = 251,
- ["Sandslash"] = 252,
- }
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendMove, 500, cid, turn + 1)
- doAreaCombatHealth(cid, COMBAT_ROCKDAMAGE, getThingPos(cid), square1x1, (min/20), (max/20), 2)
- if turn == 20 or getPokemonStatus(cid, "sleep") then
- doRemoveCondition(cid, CONDITION_OUTFIT)
- stopEvent(event)
- end
- end
- setPokemonStatus(cid, "speedUp", 20, 0, true, 0)
- doSetCreatureOutfit(cid, {lookType = outfit[getCreatureName(cid)]}, -1)
- doSendMove(cid)
- elseif move == "Bulldoze" then
- local function doSendMove(cid, area, effectarea, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_GROUNDDAMAGE, area, line1x1, min, max, 176)
- doSendMagicEffect(effectarea, effect)
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {177, {x = myPos.x, y = myPos.y - (i+1), z = myPos.z}, {x = myPos.x + 1, y = myPos.y - i, z = myPos.z}},
- [1] = {178, {x = myPos.x + (i+1), y = myPos.y, z = myPos.z}, {x = myPos.x + (i+2), y = myPos.y + 1, z = myPos.z}},
- [2] = {179, {x = myPos.x, y = myPos.y + (i+1), z = myPos.z}, {x = myPos.x + 1, y = myPos.y + (i+2), z = myPos.z}},
- [3] = {180, {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}, {x = myPos.x - i, y = myPos.y + 1, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], info[myDirection][3], info[myDirection][1], i+1)
- end
- elseif move == "Earth Power" then
- local effectPos = {x = myPos.x + 1, y = myPos.y + 1, z = myPos.z}
- doAreaCombatHealth(cid, COMBAT_GROUNDDAMAGE, myPos, square1x1, min, max, 2)
- doSendMagicEffect(effectPos, 181)
- elseif move == "Earthquake" then
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendMove, 500, cid, turn + 1)
- doAreaCombatHealth(cid, COMBAT_GROUNDDAMAGE, getThingPos(cid), circle2x2, (min/20), (max/20), 88)
- if turn == 20 or getPokemonStatus(cid, "sleep") then
- stopEvent(event)
- end
- end
- doSendMove(cid)
- elseif move == "Defense Curl" then
- setPokemonStatus(cid, "harden", 10, 182, true, 0)
- elseif move == "Dig" then
- local function doReturn(cid)
- if not isCreature(cid) then return true end
- setCreatureVisibility(cid, false)
- doClearPokemonStatus(cid)
- doAreaCombatHealth(cid, COMBAT_GROUNDDAMAGE, getThingPos(cid), circle2x2, min, max, 184)
- doAreaCombatHealth(cid, STATUS_SLOW, getThingPos(cid), circle2x2, 10, 10, 2)
- end
- local function doReturnEffect(cid)
- if not isCreature(cid) then return true end
- doSendMagicEffect(getThingPos(cid), 183)
- end
- setCreatureVisibility(cid, true)
- setPokemonStatus(cid, "speedUp", 3, 0, true, 0)
- setPokemonStatus(cid, "silence", 3, 2, true, 0)
- doSendMagicEffect(myPos, 183)
- addEvent(doReturn, 3000, cid)
- addEvent(doReturnEffect, 2750, cid)
- elseif move == "Cross Poison" then
- doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, myPos, crossPoison, min, max, 160)
- doAreaCombatHealth(cid, STATUS_POISON10, myPos, crossPoison, pokeLevel, pokeLevel, 2)
- elseif move == "Sand Tomb" then
- doFrontalCombatHealth(cid, myPos, COMBAT_GROUNDDAMAGE, min, max, 185, 56)
- doFrontalCombatHealth(cid, myPos, STATUS_BLIND, 5, 5, 2)
- elseif move == "Sludge Wave" then
- local function doSendMove(cid, area, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, area, line1x1, min, max, 161)
- doAreaCombatHealth(cid, STATUS_BLIND, area, line1x1, 5, 5, 2)
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {125, {x = myPos.x, y = myPos.y - (i+1), z = myPos.z}},
- [1] = {126, {x = myPos.x + (i+1), y = myPos.y, z = myPos.z}},
- [2] = {127, {x = myPos.x, y = myPos.y + (i+1), z = myPos.z}},
- [3] = {128, {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], i+1)
- end
- elseif move == "Doubleslap" then
- for i = 0, 1 do
- addEvent(doTargetCombatHealth, i * 100, cid, target, COMBAT_NORMALDAMAGE, min/2, max/2, 2)
- end
- doSendMagicEffect(targetPos, 187)
- elseif move == "Sing" then
- doAreaCombatHealth(cid, STATUS_SLEEP, myPos, circle3x3, 10, 10, 22)
- elseif move == "Multi-Slap" then
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, myPos, square1x1, min/2, max/2, 187)
- addEvent(doAreaCombatHealth, 100, cid, COMBAT_NORMALDAMAGE, myPos, square1x1, min/2, max/2, 2)
- elseif move == "Great Love" then
- local function doSendMoveDamage(cid)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_CONFUSION10, myPos, square4x4, 188, 188, 2)
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, myPos, square4x4, min, max, 2)
- end
- for i = 0, 19 do
- addEvent(doSendMoveEffectDown, i * 50, cid, 188)
- end
- addEvent(doSendMoveDamage, 1000, cid)
- elseif move == "Healarea" then
- local healMin = (getCreatureMaxHealth(cid) * 75) / 100
- local healMax = healMin + pokeLevel
- local heal = math.random(healMin, healMax)
- if getCreatureHealth(cid) + heal > getCreatureMaxHealth(cid) then
- heal = getCreatureMaxHealth(cid) - getCreatureHealth(cid)
- end
- if heal > 0 then
- doSendAnimatedText(myPos, "+"..heal, 35)
- doCreatureAddHealth(cid, heal)
- end
- doSendMagicEffect(myPos, 12)
- if isSummon(cid) then
- doOTCSendPokemonHealth(master)
- end
- doAreaCombatHealth(cid, COMBAT_HEAL, myPos, circle3x3, healMin, healMax, 12)
- elseif move == "Metronome" then
- local effectPos = {x = myPos.x, y = myPos.y - 1, z = myPos.z}
- local randomMoves = {"Leaf Storm", "Magma Storm", "Hydropump", "Electric Storm"}
- local move = randomMoves[math.random(#randomMoves)]
- doSendMagicEffect(effectPos, 189)
- addEvent(doCastMove, 500, cid, move)
- elseif move == "Dazzling Gleam" then
- doSendDistanceShoot(myPos, targetPos, 60)
- doTargetCombatHealth(cid, target, COMBAT_FAIRYDAMAGE, min, max, 190)
- elseif move == "Moonblast" then
- local function doSendMoveDamage(cid)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_SILENCE, myPos, square4x4, 2, 2, 2)
- doAreaCombatHealth(cid, COMBAT_ELECTRICDAMAGE, myPos, square4x4, min, max, 2)
- end
- addEvent(doSendMoveDamage, 1000, cid)
- elseif move == "Flame Circle" then
- local area1 = {WF11, WF12, WF13, WF14, WF15, WF16, WF17, WF18}
- local area2 = {WF21, WF22, WF23, WF24, WF25, WF26, WF27, WF28, WF29, WF210, WF211, WF212, WF213, WF214, WF215, WF216}
- local area3 = {WF31, WF32, WF33, WF34, WF35, WF36, WF37, WF38, WF39, WF310, WF311, WF312, WF313, WF314, WF315, WF316, WF317, WF318, WF319, WF320, WF321, WF322, WF323, WF324}
- for i = 0, 7 do
- addEvent(doAreaCombatHealth, i * 300, cid, COMBAT_FIREDAMAGE, myPos, area1[i+1], min, max, 6)
- end
- for i = 0, 15 do
- addEvent(doAreaCombatHealth, i * 160, cid, COMBAT_FIREDAMAGE, myPos, area2[i+1], min, max, 6)
- end
- for i = 0, 23 do
- addEvent(doAreaCombatHealth, i * 110, cid, COMBAT_FIREDAMAGE, myPos, area3[i+1], min, max, 6)
- end
- elseif move == "Flame Wheel" then
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendMove, 500, cid, turn + 1)
- doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, getThingPos(cid), square1x1, (min/20), (max/20), 2)
- if turn == 20 or getPokemonStatus(cid, "sleep") then
- doRemoveCondition(cid, CONDITION_OUTFIT)
- stopEvent(event)
- end
- end
- setPokemonStatus(cid, "speedUp", 20, 0, true, 0)
- doSetCreatureOutfit(cid, {lookType = 253}, -1)
- doSendMove(cid)
- elseif move == "Confuse Ray" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_GHOSTDAMAGE, min, max, 2)
- doTargetCombatHealth(cid, target, STATUS_CONFUSION10, 191, 191, 2)
- elseif move == "Hyper Voice" then
- local info = {
- [0] = wave5N,
- [1] = wave5E,
- [2] = wave5S,
- [3] = wave5W
- }
- doAreaCombatHealth(cid, STATUS_STUN, myPos, info[myDirection], 10, 10, 2)
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, myPos, info[myDirection], min, max, 22)
- elseif move == "Echoed Voice" then
- local function doSendMove(cid, area1, area2, effect, turn)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, area1, line1x1, 0, 0, 209)
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, area1, line1x1, min, max, 39)
- if turn ~= 1 then
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, area2, line1x3, 0, 0, 209)
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, area2, line1x3, min, max, 39)
- end
- if turn >= 6 then
- doRegainSpeed(cid)
- doCreatureSetNoMove(cid, false)
- end
- end
- doChangeSpeed(cid, -getCreatureSpeed(cid))
- doCreatureSetNoMove(cid, true)
- for i = 0, 5 do
- local info = {
- [0] = {125, {x = myPos.x, y = myPos.y - (i+1), z = myPos.z}, {x = myPos.x, y = myPos.y - i, z = myPos.z}},
- [1] = {126, {x = myPos.x + (i+1), y = myPos.y, z = myPos.z}, {x = myPos.x + i, y = myPos.y, z = myPos.z}},
- [2] = {127, {x = myPos.x, y = myPos.y + (i+1), z = myPos.z}, {x = myPos.x, y = myPos.y + i, z = myPos.z}},
- [3] = {128, {x = myPos.x - (i+1), y = myPos.y, z = myPos.z}, {x = myPos.x - i, y = myPos.y, z = myPos.z}}
- }
- addEvent(doSendMove, i * 300, cid, info[myDirection][2], info[myDirection][3], info[myDirection][1], i+1)
- end
- elseif move == "Softboiled" then
- local healMin = (getCreatureMaxHealth(cid) * 95) / 100
- local healMax = healMin + pokeLevel
- local heal = math.random(healMin, healMax)
- if getCreatureHealth(cid) + heal > getCreatureMaxHealth(cid) then
- heal = getCreatureMaxHealth(cid) - getCreatureHealth(cid)
- end
- if heal > 0 then
- doSendAnimatedText(myPos, "+"..heal, 35)
- doCreatureAddHealth(cid, heal)
- end
- doSendMagicEffect(myPos, 117)
- if isSummon(cid) then
- doOTCSendPokemonHealth(master)
- end
- elseif move == "Charm" then
- setPokemonStatus(cid, "harden", 15, 192, true, 0)
- elseif move == "Rock n'Roll" then
- local function doSendMove(cid, area)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_CONFUSION10, myPos, area, 193, 193, 2)
- doAreaCombatHealth(cid, COMBAT_NORMALDAMAGE, myPos, area, min/2, max/2, 1)
- end
- local areas = {square1x1, circleHollow2x2, circleHollow3x3, circleHollow4x4, circleHollow5x5, circleHollow4x4, circleHollow3x3, circleHollow2x2, square1x1}
- for i = 1, #areas do
- addEvent(doSendMove, (i-1) * 350, cid, areas[i])
- end
- elseif move == "Absorb" then
- local hit = (min + max) / 2
- doSendMagicEffect(myPos, 117)
- doTargetCombatHealth(cid, target, ABSORB_GRASS, hit, hit, 2)
- elseif move == "Toxic" then
- local function doSendMove(cid, area)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_POISON20, myPos, area, pokeLevel, pokeLevel, 2)
- doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, myPos, area, min, max, 161)
- end
- local areas = {square1x1, circleHollow2x2}
- for i = 1, #areas do
- addEvent(doSendMove, (i-1) * 350, cid, areas[i])
- end
- elseif move == "Poison Bomb" then
- doSendDistanceShoot(myPos, targetPos, 14)
- doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, targetPos, square1x1, min, max, 20)
- doTargetCombatHealth(cid, target, COMBAT_POISONDAMAGE, min, max, 20)
- doAreaCombatHealth(cid, STATUS_POISON10, targetPos, square1x1, pokeLevel, pokeLevel, 2)
- doTargetCombatHealth(cid, target, STATUS_POISON10, pokeLevel, pokeLevel, 2)
- elseif move == "Poison Gas" then
- local function doSendMove(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendMove, 500, cid, turn + 1)
- doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, getThingPos(cid), circle2x2, (min/20), (max/20), 161)
- doAreaCombatHealth(cid, STATUS_POISON20, getThingPos(cid), circle2x2, pokeLevel, pokeLevel, 2)
- doAreaCombatHealth(cid, STATUS_BLIND, getThingPos(cid), circle2x2, 3, 3, 2)
- if turn == 20 or getPokemonStatus(cid, "sleep") then
- stopEvent(event)
- end
- end
- doSendMove(cid)
- elseif move == "Petal Dance" then
- doFrontalCombatHealth(cid, myPos, COMBAT_GRASSDAMAGE, min, max, 105, 61)
- elseif move == "Slash" then
- doSendDistanceShoot(myPos, targetPos, 40)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, min, max, 195)
- elseif move == "Leech Life" then
- local hit = (min + max) / 2
- doSendMagicEffect(myPos, 117)
- doTargetCombatHealth(cid, target, ABSORB_BUG, hit, hit, 2)
- elseif move == "X-Scissor" then
- local info = {
- [0] = {133, xScissorN, {x = myPos.x + 1, y = myPos.y, z = myPos.z}},
- [1] = {134, xScissorE, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}},
- [2] = {135, xScissorS, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}},
- [3] = {136, xScissorW, {x = myPos.x, y = myPos.y + 1, z = myPos.z}}
- }
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- doAreaCombatHealth(cid, COMBAT_BUGDAMAGE, myPos, info[myDirection][2], min/2, max/2, 2)
- elseif move == "Psychic" then
- doAreaCombatHealth(cid, COMBAT_PSYCHICDAMAGE, myPos, circle3x3, min, max, 196)
- elseif move == "Signal Beam" then
- local function doSendMove(cid, area)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local pos = getThingPos(cid)
- doAreaCombatHealth(cid, COMBAT_BUGDAMAGE, pos, area, min, max, 2)
- end
- local info = {
- [0] = {197, solarBeamN, {x = pos.x + 1, y = pos.y - 1, z = pos.z}},
- [1] = {198, solarBeamE, {x = pos.x + 6, y = pos.y + 1, z = pos.z}},
- [2] = {199, solarBeamS, {x = pos.x + 1, y = pos.y + 6, z = pos.z}},
- [3] = {200, solarBeamW, {x = pos.x - 1, y = pos.y + 1, z = pos.z}}
- }
- doSendMagicEffect(info[myDirection][3], info[myDirection][1])
- addEvent(doSendMove, 2000, cid, info[myDirection][2])
- elseif move == "Bug Buzz" then
- local info = {
- [0] = wave5BN,
- [1] = wave5BE,
- [2] = wave5BS,
- [3] = wave5BW
- }
- doAreaCombatHealth(cid, STATUS_STUN, myPos, info[myDirection], 10, 10, 2)
- doAreaCombatHealth(cid, COMBAT_BUGDAMAGE, myPos, info[myDirection], min, max, 201)
- elseif move == "Mud Slap" then
- doSendDistanceShoot(myPos, targetPos, 59)
- doTargetCombatHealth(cid, target, COMBAT_GROUNDDAMAGE, min, max, 175)
- doTargetCombatHealth(cid, target, STATUS_BLIND, 10, 10, 2)
- doTargetCombatHealth(cid, target, STATUS_SLOW, 10, 10, 2)
- elseif move == "Night Slash" then
- local function doSendMove(cid)
- if not isCreature(cid) then return true end
- if getPokemonStatus(cid, "sleep") then return true end
- local info = {
- [1] = {202, {x = myPos.x + 1, y = myPos.y - 1, z = myPos.z}},
- [2] = {203, {x = myPos.x + 2, y = myPos.y + 1, z = myPos.z}},
- [3] = {204, {x = myPos.x + 1, y = myPos.y + 2, z = myPos.z}},
- [4] = {205, {x = myPos.x - 1, y = myPos.y + 1, z = myPos.z}}
- }
- for i = 1, 4 do
- doSendMagicEffect(info[i][2], info[i][1])
- end
- doAreaCombatHealth(cid, COMBAT_DARKDAMAGE, myPos, square1x1, min/2, max/2, 206)
- end
- for i = 0, 1 do
- addEvent(doSendMove, i * 500, cid)
- end
- elseif move == "Pay Day" then
- local function doSendMoveDown(cid, target, toPos)
- if not isCreature(target) or not isCreature(cid) then return true end
- doSendDistanceShoot(toPos, getThingPos(target), 62)
- doTargetCombatHealth(cid, target, COMBAT_NORMALDAMAGE, min/2, max/2, 207)
- end
- local function doSendMoveUp(cid, target)
- if not isCreature(cid) or not isCreature(target) then return true end
- local myPos = getThingPos(cid)
- local targetPos = getThingPos(target)
- local toPos = targetPos
- toPos.x = toPos.x - 6
- toPos.y = toPos.y - 6
- doSendDistanceShoot(myPos, toPos, 62)
- addEvent(doSendMoveDown, 350, cid, target, toPos)
- end
- for i = 0, 1 do
- addEvent(doSendMoveUp, i * 200, cid, target)
- end
- elseif move == "Torment" then
- local function doSendMove(cid, area)
- if not isCreature(cid) then return true end
- doAreaCombatHealth(cid, STATUS_SILENCE, myPos, area, 191, 191, 208)
- end
- local areas = {circleHollow5x5, circleHollow4x4, circleHollow3x3, circleHollow2x2, square1x1}
- for i = 1, #areas do
- addEvent(doSendMove, (i-1) * 350, cid, areas[i])
- end
- setPlayerStorageValue(cid, storages.focus, 1)
- elseif move == "Invisible" then
- local function doChangeVisibility(cid)
- if not isCreature(cid) then return true end
- setCreatureVisibility(cid, false)
- end
- doSendMagicEffect(myPos, 154)
- setCreatureVisibility(cid, true)
- addEvent(doChangeVisibility, 8000, cid)
- -------------------------------------------------------------------------- • PASSIVES • --------------------------------------------------------------------------
- elseif move == "Fury" then
- setPokemonStatus(cid, "rage", 20, 0, true, 0)
- elseif move == "Electric Charge" then
- local function doSendEffect(cid, turn)
- if not isCreature(cid) then return true end
- local turn = turn or 1
- local event = addEvent(doSendEffect, 1000, cid, turn + 1)
- if turn == 1 then
- setPlayerStorageValue(cid, storages.focus, 1)
- end
- if getPlayerStorageValue(cid, storages.focus) and getPlayerStorageValue(cid, storages.focus) == 1 then
- doSendMagicEffect(getThingPos(cid), 174)
- else
- stopEvent(event)
- end
- end
- if not getPlayerStorageValue(cid, storages.focus) or getPlayerStorageValue(cid, storages.focus) < 1 then
- doSendEffect(cid)
- end
- elseif move == "Melody" then
- doAreaCombatHealth(cid, STATUS_SLEEP, myPos, circle3x3, 5, 5, 22)
- elseif move == "Lifesteal" then
- doSendMagicEffect(myPos, 117)
- doTargetCombatHealth(cid, target, ABSORB_POISON, max/3, max/3, 2)
- elseif move == "Spores Reaction" then
- local randomMoves = {"Sleep Powder", "Stun Spore", "Poison Powder"}
- local move = randomMoves[math.random(#randomMoves)]
- doCastMove(cid, move)
- elseif move == "Mega Drain" then
- local hit = (min + max) / 2
- doSendMagicEffect(myPos, 117)
- doTargetCombatHealth(cid, target, ABSORB_NORMAL, hit, hit, 2)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement