Faraonekkk
New Member
- Joined
- Feb 15, 2010
- Messages
- 686
- Reaction score
- 4
I got error in console when i end surf.
Its
I have added this function in c++
Also its the script where is error:
Its
(luadocreatureaddhealth) creature not found
I have added this function in c++
Also its the script where is error:
local brd = bordas[item2.itemid]
if brd ~= nil then
if getPlayerStorageValue(cid, 7778) == 3 then
coordenadas = bordas[item2.itemid]
oldPos = getThingPos(item2.uid)
newPos = { x = oldPos.x - coordenadas.x, y = oldPos.y - coordenadas.y, z = oldPos.z }
if (getDistanceBetween(getThingPos(cid), getThingPos(item2.uid)) > 1 ) or (not getClosestFreeTile(cid,oldPos)) then
return doPlayerSendCancel(cid,"You cannot stop surfing here")
end
if getPlayerGroupId(cid) ~= 6 then
setPlayerGroupId(cid, 8)
end
doCreatureSetLookDir(cid, 2)
doChangeSpeed(cid, -(getCreatureSpeed(cid)))
if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then
doChangeSpeed(cid, 200*getPlayerGroupId(cid))
else
doChangeSpeed(cid, getPlayerStorageValue(cid,17500))
end
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 7778, 0)
setPlayerStorageValue(cid, 17001, 0)
local item = getPlayerSlotItem(cid, 8)
--doSummonMonster(cid, getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball."))
local varNome = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
local varApelido = getItemAttribute(item.uid, "apelido")
local varSpecial = getItemAttribute(item.uid, "special")
moveAgua(cid,item2,true)
if(varApelido == nil)then
varApelido = varNome
end
doCreatureSay(cid, "" .. varApelido..", let me get out!", 1)
setCreatureName(cid, varNome, varApelido,varSpecial)
local pk = getCreatureSummons(cid)[1]
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "Exp")
setCreatureMaxHealth(pk, (getPlayerStorageValue(cid, 61209)))
doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61209)))
doCreatureAddHealth(pk, (getPlayerStorageValue(cid, 61210))-(getPlayerStorageValue(cid, 61209)))
return true
end
summonName = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke"):match("This is (.-)'s pokeball.")
if #getCreatureSummons(cid) == 0 then
return doPlayerSendCancel(cid,"You need a Pokemon for this")
end
local function doVoltaSpeed(speedPoke,velocidade)
if getCreatureName(speedPoke) ~= nil then
doChangeSpeed(speedPoke, velocidade)
end
end
if storageAbilidade <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and isInArray(poke, summonName) then
if storageAbilidade <= 0 then
local pokemon = surfs[summonName]
if not isVip(cid) then
doPlayerSendTextMessage(cid, 22, "You need vip to Surf.")
return TRUE
end
if (getDistanceBetween(getThingPos(cid), getThingPos(item2.uid)) > 1 ) then
return doPlayerSendCancel(cid,"You need to get closer for surf")
end
local function surf(params)
if isCreature(params.cid) then
if isCreature(getCreatureSummons(params.cid)[1]) then
if getDistanceBetween(getThingPos(getCreatureSummons(params.cid)[1]), topos) == 1 then
pokeSpeed = getCreatureSummons(params.cid)[1]
posicaoAid = getPosByDir(getCreaturePosition(pokeSpeed), getCreatureLookDirection(pokeSpeed), -1)
chaoAid = getTileThingByPos(posicaoAid)
if chaoAid ~= nil and getPlayerStorageValue(cid, 7800) <= 0 then
doChangeSpeed(pokeSpeed, -getCreatureSpeed(pokeSpeed))
setPlayerStorageValue(cid, 7800, params.dd)
local tmpPokeForPos = getCreatureSummons(params.cid)[1]
local bspd = getCreatureSpeed(tmpPokeForPos)
doChangeSpeed(tmpPokeForPos, -bspd)
doCreatureSetNoMove(tmpPokeForPos,true)
markPosMove(params.cid, getThingPos(tmpPokeForPos))
markOwnerPosMove(params.cid, getThingPos(params.cid))
checarPokeMoveOrder(tmpPokeForPos,params.itemTmp)
setPlayerStorageValue(params.cid, 12, 1)
addEvent(setPlayerStorageValue, 6000, params.cid, 12, 0)
--addEvent(doVoltaSpeed, 6000, pokeSpeed,getCreatureBaseSpeed(pokeSpeed))
addEvent(setPlayerStorageValue,6000,params.cid,7800,0)
end
else
local edire = getDirectionTo(getThingPos(getCreatureSummons(params.cid)[1]), params.topos)
if edire >= 0 and edire <= 7 then
if edire == NORTHWEST then
if math.random(1,100) >= 51 then
edire = NORTH
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = NORTH
else
edire = WEST
end
else
edire = WEST
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = WEST
else
edire = NORTH
end
end
elseif edire == SOUTHWEST then
if math.random(1,100) >= 51 then
edire = SOUTH
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = SOUTH
else
edire = WEST
end
else
edire = WEST
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = WEST
else
edire = SOUTH
end
end
elseif edire == SOUTHEAST then
if math.random(1,100) >= 51 then
edire = SOUTH
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = SOUTH
else
edire = EAST
end
else
edire = EAST
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = EAST
else
edire = SOUTH
end
end
elseif edire == NORTHEAST then
if math.random(1,100) >= 51 then
edire = NORTH
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = NORTH
else
edire = EAST
end
else
edire = EAST
if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), edire), params.ccid, 0, 0) then
edire = EAST
else
edire = NORTH
end
end
end
local dir = edire
if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then
doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1]))
doPushCreature(getCreatureSummons(params.cid)[1], edire, 1, 0)
doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1]))
else
doPushCreature(getCreatureSummons(params.cid)[1], edire, 1, 0)
doChangeSpeed(getCreatureSummons(params.cid)[1], -getCreatureSpeed(getCreatureSummons(params.cid)[1]))
end
end
end
end
end
end
local function speed(params)
if isCreature(params.cid) then
if isCreature(getCreatureSummons(params.cid)[1]) then
if getCreatureSpeed(getCreatureSummons(params.cid)[1]) == 0 then
doChangeSpeed(getCreatureSummons(params.cid)[1], getCreatureBaseSpeed(getCreatureSummons(params.cid)[1]))
doChangeSpeed(params.cid, getCreatureBaseSpeed(params.cid))
end
end
end
end
summonName = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "apelido")
if summonName == nil then
summonName = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke"):match("This is (.-)'s pokeball.")
end
doCreatureSay(cid, ""..summonName..", lets feel that water!", 1)
exhaustion.set(cid, etudao, 4)
if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 6 then
distancc = 1
else
distancc = 0
end
local distancee = distancc
--for i=1,12 do
-- addEvent(surf, 150*i, {cid = cid, dd = item2.uid, topos = topos, itemTmp = item2})
-- addEvent(speed, ((150*12)+100), {cid = cid})
--end
setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1]))
setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1]))
registerCreatureEvent(cid, "Surfing")
setPlayerStorageValue(cid, 17500, getCreatureSpeed(cid))
doChangeSpeed(cid, -250)
doChangeSpeed(cid, pokemon.speed)
exhaustion.set(cid, etudao, 4)
doSetCreatureOutfit(cid, {lookType = pokemon.lookType, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
doRemoveCreature(getCreatureSummons(cid)[1])
setPlayerStorageValue(cid, 7778, 3)
setPlayerStorageValue(cid, 17001, 3)
moveAgua(cid,item2,false)
return true
end
return true
end
end