Ir para conteúdo
  • 0

Erros no console


AlphaLove

Pergunta

Boa tarde a todos,

hoje venho aqui pedir a ajuda de vocês para resolver alguns erros que ocorrem no console do servidor "Pda By Slicer V2.9 (com level system)" os erros que ocorriam quando ligava eu já removi mas tem alguns que aparecem depois que ele já está ligado.

Não vou enrolar muito, então os erros que encontrei até agora são esses:

 

 

[02/05/2013 15:21:24] [Error - TalkAction Interface]
[02/05/2013 15:21:24] data/talkactions/scripts/teleportfloor.lua:onSay
[02/05/2013 15:21:24] Description:
[02/05/2013 15:21:24] data/talkactions/scripts/teleportfloor.lua:30: attempt to call global 'gerarEmVolta' (a nil value)
[02/05/2013 15:21:24] stack traceback:
[02/05/2013 15:21:24]  data/talkactions/scripts/teleportfloor.lua:30: in function <data talkactions="" scripts="" teleportfloor.lua:1="">

 

SCRIPT:[teleportfloor.lua]

 

function onSay(cid, words, param, channel)
local n = 1
if(param ~= '' and tonumber(param)) then
 n = math.max(0, tonumber(param))
end
local tmp, pos = getCreaturePosition(cid), getCreaturePosition(cid)
if(words:sub(2, 2) == "u") then
 pos.z = pos.z - n
else
 pos.z = pos.z + n
end
if pos.z == 7 then
elseif pos.z <= 6 then
doAreaCombatHealth(0,0,pos,0,0,0,255)
doCreateItem(460,1,pos)
end

pos = getClosestFreeTile(cid, pos, false, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
 return true
end
if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then
 doSendMagicEffect(tmp, CONST_ME_POFF)
 doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
gerarEmVolta(getThingPos(cid))
return true
end

 

 

[02/05/2013 15:22:28] [Error - MoveEvents Interface]
[02/05/2013 15:22:28] data/movements/scripts/fly.lua:onStepIn
[02/05/2013 15:22:28] Description:
[02/05/2013 15:22:28] (luaDoRemoveItem) Item not found

 

SCRIPT:[Fly.lua]

 

local del = {'460', '1022', '1023', '1024'}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)position.stackpos = 0
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TVif getPlayerStorageValue(cid, 17000) <= 0 then
 doTeleportThing(cid, fromPosition, false)
 doRemoveItem(getTileThingByPos(position).uid, 1)
 doPlayerSendCancel(cid, "You can't fly.")
return true
end
doAreaCombatHealth(cid, FLYSYSTEMDAMAGE, getThingPos(cid), splash, 0, 0, 255)local pos = getThingPos(cid)
if pos.z == 7 then return true end
pos.z = pos.z + 1
for i = 0, 255 do
	pos.stackpos = i
	local tile = getTileThingByPos(pos)
	if tile.itemid ~= 0 and not isCreature(tile.uid) then
		if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then
			doTransformItem(item.uid, 11677)
		end
	end
endreturn true
end
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
local effect = 2if toPosition.z == fromPosition.z and getCreatureOutfit(cid).lookType ~= 316 and getCreatureOutfit(cid).lookType ~= 648 then
 doSendMagicEffect(fromPosition, effect)
end
local oldtpos = fromPosition
oldtpos.stackpos = STACKPOS_GROUND
if getTileThingByPos(oldtpos).itemid >= 1 then
doRemoveItem(getTileThingByPos(oldtpos).uid, 1)
end
return true
end  

 

 

[02/05/2013 15:43:14] [Error - TalkAction Interface]
[02/05/2013 15:43:14] data/talkactions/scripts/move1.lua:onSay
[02/05/2013 15:43:14] Description:
[02/05/2013 15:43:14] data/lib/pokemon moves.lua:127: attempt to perform arithmetic on a string value
[02/05/2013 15:43:14] stack traceback:
[02/05/2013 15:43:14]  data/lib/pokemon moves.lua:127: in function 'docastspell'
[02/05/2013 15:43:14]  data/talkactions/scripts/move1.lua:168: in function <data talkactions="" scripts="" move1.lua:20="">

 

SCRIPT:[move1.lua]

 

local msgs = {"use ", ""}
function doAlertReady(cid, id, movename, n, cd)
if not isCreature(cid) then return true end
local myball = getPlayerSlotItem(cid, 8)
if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") is ready!")
return true
end
local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
if not p or #p <= 0 then return true end
for a = 1, #p do
 if getItemAttribute(p[a], cd) == "cd:"..id.."" then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")
 return true
 end
end
end
function onSay(cid, words, param, channel)

if param ~= "" then return true end
if string.len(words) > 3 then return true end
if #getCreatureSummons(cid) == 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")
return 0
end
		 --alterado v2.5
local mypoke = getCreatureSummons(cid)[1]
if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end
if getCreatureName(mypoke) == "Evolution" then return true end
local name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)
local it = string.sub(words, 2, 3)
local move = movestable[name].move1
if getPlayerStorageValue(mypoke, 212123) >= 1 then
  cdzin = "cm_move"..it..""
else
  cdzin = "move"..it..""	   --alterado v2.5
end
if it == "2" then
 move = movestable[name].move2
elseif it == "3" then
 move = movestable[name].move3
elseif it == "4" then
 move = movestable[name].move4
elseif it == "5" then
 move = movestable[name].move5
elseif it == "6" then
 move = movestable[name].move6
elseif it == "7" then
 move = movestable[name].move7
elseif it == "8" then
 move = movestable[name].move8
elseif it == "9" then
 move = movestable[name].move9
elseif it == "10" then
 move = movestable[name].move10
elseif it == "11" then
 move = movestable[name].move11
elseif it == "12" then
 move = movestable[name].move12
elseif it == "13" then
 move = movestable[name].move13
end
if not move then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
return true
end
--if false and getLevel(mypoke) < move.level then
if getLevel(mypoke) < move.level then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't have enough level to use this move.")
return 0
end
if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")
return 0
end
if getTileInfo(getThingPos(mypoke)).protection then
 doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")
return 0
end

if getPlayerStorageValue(mypoke, 3894) >= 1 then
return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3
end

if (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then	   --alterado v2.5
 doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")
return 0
end
																 --alterado v2.7 \/\/\/
if isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) then
  local target = getCreatureTarget(cid)																					  
  if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then
  if isCreature(getMasterTarget(target)) then																	
	 doSendMagicEffect(getThingPos(target), 211)
	 doSendAnimatedText(getThingPos(target), "TOO BAD", 215)							  
	 doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false)
	 doSendMagicEffect(getThingPos(target), 211)
	 doFaceCreature(target, getThingPos(mypoke))	
	 return true	
  end
  end
end

if move.target == 1 then
if not isCreature(getCreatureTarget(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")
return 0
end
if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
return 0
end
if getCreatureHealth(getCreatureTarget(cid)) <= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")
return 0
end
if not isCreature(getCreatureSummons(cid)[1]) then
return true
end
if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")
return 0
end
if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
return 0
end
end
local newid = 0
	if isSleeping(mypoke) or isSilence(mypoke) then  --alterado v2.5
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
  return 0
 else
  newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
 end

doCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..move.name.."!", TALKTYPE_SAY)

local summons = getCreatureSummons(cid) --alterado v2.6
addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)

for i = 2, #summons do
   if isCreature(summons[i]) and getPlayerStorageValue(cid, 637501) >= 1 then
	  docastspell(summons[i], move.name)		--alterado v2.6
   end
end
docastspell(mypoke, move.name)
doCreatureAddCondition(cid, playerexhaust)
if useKpdoDlls then
 doUpdateCooldowns(cid)
end
return 0
end

 

 

[02/05/2013 15:43:22] [Error - CreatureScript Interface]
[02/05/2013 15:43:22] data/creaturescripts/scripts/exp.lua:onStatsChange
[02/05/2013 15:43:22] Description:
[02/05/2013 15:43:22] data/creaturescripts/scripts/exp.lua:435: attempt to perform arithmetic on a string value
[02/05/2013 15:43:22] stack traceback:
[02/05/2013 15:43:22]  data/creaturescripts/scripts/exp.lua:435: in function <data creaturescripts="" scripts="" exp.lua:122="">

 

SCRIPT:[exp.lua]

 

local combats = {						 --alterado v2.6 \/
[PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC},
[GRASSDAMAGE] = {cor = COLOR_GRASS},
[POISONEDDAMAGE] = {cor = COLOR_GRASS},
[FIREDAMAGE] = {cor = COLOR_FIRE2},						
[bURNEDDAMAGE] = {cor = COLOR_BURN},
[WATERDAMAGE] = {cor = COLOR_WATER},
[iCEDAMAGE] = {cor = COLOR_ICE},
[NORMALDAMAGE] = {cor = COLOR_NORMAL},
[FLYDAMAGE] = {cor = COLOR_FLYING},		  
[GHOSTDAMAGE] = {cor = COLOR_GHOST},
[GROUNDDAMAGE] = {cor = COLOR_GROUND},
[ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC},
[ROCKDAMAGE] = {cor = COLOR_ROCK},
[bUGDAMAGE] = {cor = COLOR_BUG},
[FIGHTDAMAGE] = {cor = COLOR_FIGHTING},
[DRAGONDAMAGE] = {cor = COLOR_DRAGON},
[POISONDAMAGE] = {cor = COLOR_POISON},
[DARKDAMAGE] = {cor = COLOR_DARK},			  
[sTEELDAMAGE] = {cor = COLOR_STEEL},
[MIRACLEDAMAGE] = {cor = COLOR_PSYCHIC},
[DARK_EYEDAMAGE] = {cor = COLOR_GHOST},
[sEED_BOMBDAMAGE] = {cor = COLOR_GRASS},
[sACREDDAMAGE] = {cor = COLOR_FIRE2},
[MUDBOMBDAMAGE] = {cor = COLOR_GROUND}, --alterado v2.9
}
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 = {GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE}
local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE}
local ignored = {POISONEDDAMAGE, BURNEDDAMAGE}				--alterado v2.6
local cannotkill = {BURNEDDAMAGE, POISONEDDAMAGE}
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 not isCreature(attacker) then  --alterado v2.5 cid == attacker
if not isInArray(fixdamages, combat) and combats[combat] then
 doSendAnimatedText(getThingPos(cid), value, combats[combat].cor)
end
return true
end
--------------------------------------------------
--alterado v2.6  retirado os combats sleep_powder e poison_powder daki!
--------------------------------------------------
if isMonster(cid) then
local valor = value
  if not pokes[getCreatureName(cid)] and damageCombat == COMBAT_PHYSICALDAMAGE then
  valor = getOffense(attacker) * playerDamageReduction
  doCreatureAddHealth(cid, -math.abs(valor), 3, races[7].cor)					   --alterado v2.6 dano nos npcs
  return false
  elseif not pokes[getCreatureName(cid)] and damageCombat ~= COMBAT_PHYSICALDAMAGE then
  doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor)
  return false
  end
end
--------------------------------------------------
if isPlayer(attacker) then
local valor = value
if valor > getCreatureHealth(cid) then
 valor = getCreatureHealth(cid)
end
if combat == COMBAT_PHYSICALDAMAGE then
return false
end
if combat == PHYSICALDAMAGE then
doSendMagicEffect(getThingPos(cid), 3)
doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor)
end
if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then
doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor)
end
if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then
 doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".")
end
return true
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then
return false																		  
end
--------------------------------------------------
if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then
if isSummon(attacker) or isPlayer(attacker) then
  if canAttackOther(cid, attacker) == "Cant" then return false end
end
local valor = 0
 if combat == COMBAT_PHYSICALDAMAGE then
  valor = getOffense(attacker)
 else
  valor = getSpecialAttack(attacker)
 end
valor = valor * playerDamageReduction
valor = valor * math.random(83, 117) / 100
if valor >= getCreatureHealth(cid) then
 valor = getCreatureHealth(cid)
end
valor = math.floor(valor)
if valor >= getCreatureHealth(cid) then
   if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
	  setPlayerStorageValue(cid, 6598754, -1)
	  setPlayerStorageValue(cid, 6598755, -1)
	  doRemoveCondition(cid, CONDITION_OUTFIT)			 --alterado v2.7
	  doTeleportThing(cid, posBackPVP, false)
	  doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
	  return false
   end
   if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then
	  doRemoveCondition(cid, CONDITION_OUTFIT)
	  setPlayerStorageValue(cid, 17000, 0)
	  setPlayerStorageValue(cid, 17001, 0)
	  setPlayerStorageValue(cid, 63215, -1)
	  doChangeSpeed(cid, PlayerSpeed)
	  local item = getPlayerSlotItem(cid, 8)
	  local btype = getPokeballType(item.itemid)
	  if #getCreatureSummons(cid) <= 0 then
	 if isInArray(pokeballs[btype].all, item.itemid) then
	  doTransformItem(item.uid, pokeballs[btype].off)
	  doItemSetAttribute(item.uid, "hp", 0)
		 end
	  end
  end
  if getPlayerStorageValue(cid, 22545) == 1 then
	 if getGlobalStorageValue(22550) == 1 then
		doPlayerSendTextMessage(cid, 20, "You are the last survivor of the golden arena! Take your reward!")
		doPlayerAddItem(cid, 2152, getPlayerStorageValue(cid, 22551)*2)
		setPlayerStorageValue(cid, 22545, -1)
		doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
		setPlayerRecordWaves(cid)	
		endGoldenArena()
		return false		  
	 else
		 setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
		 setPlayerStorageValue(cid, 22545, -1)
		 doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)  
		 doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
		 setPlayerRecordWaves(cid)	
		 return false
	 end
  end

  local corpse = doCreateItem(3058, 1, getThingPos(cid))
  doDecayItem(corpse)
  doItemSetAttribute(corpse, "pName", getCreatureName(cid))		  --alterado v2.7 coloca corpse quando o player morre!
  doItemSetAttribute(corpse, "attacker", getCreatureName(attacker))
  doItemSetAttribute(corpse, "article", getPlayerSex(cid) == 0 and "She" or "He")

  if getPlayerStorageValue(cid, 98796) >= 1 then
	setPlayerStorageValue(cid, 98796, -1)
	setPlayerStorageValue(cid, 98797, -1)					  --alterado v2.8
	doTeleportThing(cid, SafariOut, false)
	doSendMagicEffect(getThingPos(cid), 21)
	doPlayerSendTextMessage(cid, 27, "You die in the saffari...")
	return false
  end
  if getPlayerStorageValue(cid, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) <= 10 then
	  setPlayerStorageValue(cid, Agatha.stoIni, -1)
	  setPlayerStorageValue(cid, Agatha.stoRec, -1)
	  setPlayerStorageValue(cid, Agatha.stoPer, -1)
	  setPlayerStorageValue(cid, Agatha.stoEni, -1)		--alterado v2.9  agatha quest
	  setPlayerStorageValue(cid, Agatha.stoRes, -1)
  end
  end
doCreatureAddHealth(cid, -valor, 3, 180)
if not isPlayer(cid) and valor > 0 then
addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".")
end
return false
end
--------------------------------------------------
if type == STATSCHANGE_HEALTHGAIN then
if cid == attacker then
return true
end
if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then
return false
end
return true
end
--------------------------------------------------
if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then
if isPlayer(cid) then
return false
end
if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then
if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then
return false
end
end
--------------------------------------------------
if ehMonstro(cid) and ehMonstro(attacker) and not isSummon(cid) and not isSummon(attacker) then
return false										  --alterado v2.9 /\
end
---------------------------------------------------
--------------------REFLECT-----------------------
if getPlayerStorageValue(cid, 21099) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then
  if not isInArray({"Team Claw", "Team Slice"}, getPlayerStorageValue(attacker, 21102)) then
  doSendMagicEffect(getThingPosWithDebug(cid), 135)
  doSendAnimatedText(getThingPosWithDebug(cid), "REFLECT", COLOR_GRASS)
  addEvent(docastspell, 100, cid, getPlayerStorageValue(attacker, 21102))
  if getCreatureName(cid) == "Wobbuffet" then
	 doRemoveCondition(cid, CONDITION_OUTFIT)  
  end
  setPlayerStorageValue(cid, 21099, -1)					--alterado v2.6
  setPlayerStorageValue(cid, 21100, 1)
  setPlayerStorageValue(cid, 21101, attacker)
  setPlayerStorageValue(cid, 21103, getTableMove(attacker, getPlayerStorageValue(attacker, 21102)).f)
  setPlayerStorageValue(cid, 21104, getCreatureOutfit(attacker).lookType)
  return false
  end
end
-------------------------------------------------
local multiplier = 1  
  if isCreature(cid) then
  poketype1 = pokes[getCreatureName(cid)].type		--alterado v2.6
  poketype2 = pokes[getCreatureName(cid)].type2
  end
  if not poketype1 or not poketype2 then return false end  --alterado v2.6
if getCreatureCondition(cid, CONDITION_INVISIBLE) then
return false
end
if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
if isInArray(effectiveness[damageCombat].super, poketype1) then
 multiplier = multiplier + 0.5
end
if isInArray(effectiveness[damageCombat].super, poketype2) then
 multiplier = multiplier + 0.5
end
if isInArray(effectiveness[damageCombat].weak, poketype1) then
 multiplier = multiplier - 0.25		  --alterado v2.3  efetividade q nem na pxg...
end
if isInArray(effectiveness[damageCombat].weak, poketype2) then
 multiplier = multiplier - 0.25
end
if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
 if isInArray(specialabilities["foresight"], getCreatureName(attacker)) then   --alterado v2.5
	   multiplier = 0.5		   --alterado v2.6	
	end
end
elseif combat == COMBAT_PHYSICALDAMAGE then
if isGhostPokemon(cid) then	 --alterado v2.3

   if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then  --alterado v2.5
	  doSendMagicEffect(getThingPos(cid), 3)	
   return false
   end
end

 local cd = getPlayerStorageValue(attacker, conds["Miss"])
	local cd2 = getPlayerStorageValue(attacker, conds["Confusion"])	  --alterado v2.5
	local cd3 = getPlayerStorageValue(attacker, conds["Stun"])		  
	if cd >= 0 or cd2 >= 0 or cd3 >= 0 then
	   if math.random(1, 100) > 50 then  --50% chance de da miss no atk fisico
	doSendMagicEffect(getThingPos(cid), 211)
	doSendAnimatedText(getThingPos(attacker), "MISS", 215)
	return false
	   end
	end
end
--------------------------------------------------
local valor = value
if multiplier == 1.5 and poketype2 == "no type" then
	multiplier = 2										 --alterado v2.6
elseif multiplier == 1.5 and poketype2 ~= "no type" then
 multiplier = 1.75	  
elseif multiplier == 1.25 then	--edited effetivines = pxg
 multiplier = 1  
end
--------------------------------------------------
if isSummon(cid) and isSummon(attacker) then
	if getCreatureMaster(cid) == getCreatureMaster(attacker) then
	   return false
	end
 if canAttackOther(cid, attacker) == "Cant" then
	   return false
	end
end
local randomRange = math.random(83, 117) / 100
local block = 1
if not isPlayer(cid) then

if combat == COMBAT_PHYSICALDAMAGE then
 --[[local value = getOffense(attacker) > 1000 and 3 or 2
   block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--'
 valor = (getOffense(attacker)/value) * block

 if valor <= 0 then
   valor = math.random(5, 10) --alterado v1.9
   end]]

   block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid)))
  if getPokemonGender(attacker) == SEX_MALE then
  block = block + 0.2
  end
  if getPokemonGender(cid) == SEX_FEMALE then
  block = block - 0.2
  end
   valor = getOffense(attacker) * block

   if getOffenseInRage(attacker) >= 1500 then   --alterado v2.8
	  valor = valor * 0.3
   end

	if isInArray(specialabilities["counter"], getCreatureName(cid)) then
   if math.random(1, 100) <= 10 then
	  doCreatureAddHealth(attacker, -valor, 3, 180)	--alterado v2.5
	  valor = 0
	  doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215)
	  end
	end
else
 block = 1 - (getDefense(cid) / (getSpecialAttack(attacker) + getDefense(cid)))
	valor = valor * block * generalSpecialAttackReduction
  if isSummon(cid) then
valor = valor * summonSpecialDamageReduction - getPokemonLevel(cid) / 2
  end
end
end
valor = valor * multiplier
valor = valor * randomRange
if isSummon(attacker) then
 valor = valor * getHappinessRate(attacker)
else
 valor = valor * summonReduction
end
valor = math.floor(valor)

if combat == BURNEDDAMAGE then
 valor = value * getResistance(cid, FIREDAMAGE)
elseif combat == POISONEDDAMAGE then
 valor = value * getResistance(cid, POISONDAMAGE)
end
if math.random(1, 100) == 4 and not isInArray(ignorecritical, combat) then
 doSendAnimatedText(getThingPos(attacker), "CRITICAL", 215)
 valor = valor * 2
end
-------------------------Edited CLAN SYSTEM-----------------------------------
if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then
   valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk")
elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then	--alterado v2.3
   valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2))
end
-----------------------------------------------------------------------

---------------------- Edited Proteção --------------------------------
if valor <= 10 then
   valor = math.random(15, 25)
end
-----------------------------------------------------------------------
---------------------- FEAR / ROAR ------------------------------------
if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then		 --alterado v2.5!!
return true
end
---------------------------------------------------------------------------
if damageCombat ~= COMBAT_PHYSICALDAMAGE and not isInArray(ignored, damageCombat) then
  if isInArray(effectiveness[damageCombat].non, poketype1) or isInArray(effectiveness[damageCombat].non, poketype2) then
  if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) and getPlayerStorageValue(attacker, 999457) <= 0 then
	 valor = valor * 0					  --alterado v2.5
  end
  end
end
if damageCombat == GROUNDDAMAGE then
  if isInArray(specialabilities["levitate"], getCreatureName(cid)) then
  valor = 0					  --alterado v2.5
  end
end
-----------------------------------------------------------------------------
local p = getThingPos(cid)					 --poke na pos backup
if p.x == 1 and p.y == 1 and p.z == 10 then
return false									 --alterado v2.2
end
if getPlayerStorageValue(cid, 9658783) == 1 then
return false	  --alterado v2.4 -- skill camuflage/future sight/acid armor e afins
end
-----------------------------------------------------------------------------
--------------- FIGHT MODE -----------------------
if useOTClient then
if isSummon(cid) then								  --alterado v2.7 soh funciona com o OTClient q eu disponibilizei...
  local master = getCreatureMaster(cid)
  if getPlayerStorageValue(master, 248759) == 1 then
  valor = valor * 1.1
  elseif getPlayerStorageValue(master, 248759) == 3 then
  valor = valor * 0.9
  end
end
if isSummon(attacker) then
  local master = getCreatureMaster(attacker)
  if getPlayerStorageValue(master, 248759) == 1 then
  valor = valor * 1.1
  elseif getPlayerStorageValue(master, 248759) == 3 then
  valor = valor * 0.9
  end
end
end  
-----------------------------------------------------------------------------

if valor >= getCreatureHealth(cid) then
 if isInArray(cannotKill, combat) and isPlayer(cid) then
  valor = getCreatureHealth(cid) - 1
 else
  valor = getCreatureHealth(cid)
 end
end
valor = math.floor(valor)  --alterado v2.5

------------------ SKILLs Q CURAM O ATTACKER ---------------------------------
local function doHeal(cid, amount)
if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then
  amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid))
end
if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then		   --alterado v2.6
  doCreatureAddHealth(cid, amount)
  doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65)
end
end

if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then
  if getPlayerStorageValue(attacker, 95487) >= 1 then
  doHeal(attacker, valor)
  setPlayerStorageValue(attacker, 95487, -1)				  --alterado v2.6
  end
elseif damageCombat == SEED_BOMBDAMAGE then
  doHeal(attacker, valor)
end
--------------------------------------------
----------SACRED FIRE-----------------------
if combat == SACREDDAMAGE and not ehNPC(cid) then	--alterado v2.6
  local ret = {}
  ret.id = cid
  ret.cd = 9
  ret.check = getPlayerStorageValue(cid, conds["Silence"])
  ret.eff = 39
  ret.cond = "Silence"
  doCondition2(ret)
elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then
  local ret = {}										--alterado v2.8
  ret.id = cid
  ret.cd = 9
  ret.eff = 34
  ret.check = getPlayerStorageValue(cid, conds["Miss"])
  ret.spell = "Mud Bomb"	   --alterado v2.9
  ret.cond = "Miss"

  doCondition2(ret)
end
--------------Passiva Lifesteal Clobat------------
if combat == COMBAT_PHYSICALDAMAGE then
  if getCreatureName(attacker) == "Crobat" then					--alterado v2.4
  doCreatureAddHealth(attacker, math.floor(valor))
  doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30)
  end
end
--------------------------------------------
  valor = math.abs(valor)	--alterado v2.9

if isSummon(attacker) and not isSummon(cid) and not isPlayer(cid) then
  local expstring = cid.."expEx"
  if getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring) == null then
  doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, expstring, 0)
 end
 local exp = valor / getCreatureMaxHealth(cid)
 local ball = getPlayerSlotItem(getCreatureMaster(attacker), 8).uid
 doItemSetAttribute(ball, expstring, getItemAttribute(ball, expstring) + exp)
  if getItemAttribute(ball, expstring) > 1 then
doItemSetAttribute(ball, expstring, 1)
  end
end
if isSummon(attacker) then
 if combat == COMBAT_PHYSICALDAMAGE then
  doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255)
  addEvent(doDoubleHit, 1000, attacker, cid, valor, races)	  --alterado v2.6	agility
	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)
  addEvent(doDoubleHit, 1000, attacker, cid, valor, races)   --alterado v2.6   agility
	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
if damageCombat == FIREDAMAGE and not isBurning(cid) then
local ret = {}
ret.id = cid
ret.cd = math.random(5, 12)							 --alterado v2.5
ret.check = getPlayerStorageValue(cid, conds["Burn"])
ret.damage = isSummon(attacker) and getMasterLevel(attacker)+getPokemonBoost(attacker) or getPokemonLevel(attacker)
ret.cond = "Burn"

doCondition2(ret)
elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then
   local ret = {}
ret.id = cid
ret.cd = math.random(6, 15)							  --alterado v2.5
ret.check = getPlayerStorageValue(cid, conds["Poison"])
local lvl = isSummon(attacker) and getMasterLevel(attacker) or getPokemonLevel(attacker)
   ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2)
ret.cond = "Poison"

doCondition2(ret)
end
------------------------------------POTIONS-------------------------------------------
if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then
  if getPlayerStorageValue(cid, 173) >= 1 then
  if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then
	 setPlayerStorageValue(cid, 173, -1)  --alterado v2.6
	 doSendAnimatedText(getThingPos(cid), "Lost Heal", 144)
  end
  end
end
----------------------------------------PASSIVAS------------------------------------- --alterado v2.7 \/
-------------------------------------------Counter Helix------------------------------------
if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then
  docastspell(cid, "Counter Helix")
end
-------------------------------------------Lava Counter/Electricity----------------------------
if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then
  docastspell(cid, "Lava-Electricity")
end
---------------------------------------Stunning Confusion-----------------------------------------
if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then
  docastspell(cid, "Stunning Confusion")
end
-----------------------------------------Groundshock-----------------------------------
if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then
  docastspell(cid, "Groundshock")
end
--------------------------------------Electric Charge---------------------------------------------
if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then
  docastspell(cid, "Electric Charge", 0, 0)
end
-------------------------------------Melody------------------------------------
if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then
  docastspell(cid, "Melody")
end
------------------------------------- Dragon Fury / Fury ---------------------------------------
if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then
  docastspell(cid, "Dragon Fury", 0, 0)
end
------------------------------------- Mega Drain ---------------------------------------
if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then
  docastspell(cid, "Mega Drain")
end
------------------------------------- Spores Reaction ---------------------------------------
if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then
  docastspell(cid, "Spores Reaction")
end
------------------------------------ Amnesia ----------------------------------------  
if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then
  docastspell(cid, "Amnesia", 0, 0)
end
----------------------------------- Zen Mind -----------------------------------------
if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then
  docastspell(cid, "Zen Mind", 0, 0)
end
---------------------------------- Mirror Coat ---------------------------------------
if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then  
  docastspell(cid, "Mirror Coat", 0, 0)
end
--------------------------------- Illusion -----------------------------------------
return false
end

 

 

[02/05/2013 15:52:58] [Error - Action Interface]
[02/05/2013 15:52:58] In a timer event called from:
[02/05/2013 15:52:58] data/actions/scripts/catch.lua:onUse
[02/05/2013 15:52:58] Description:
[02/05/2013 15:52:58] data/lib/catch system.lua:94: attempt to perform arithmetic on a nil value
[02/05/2013 15:52:58] stack traceback:
[02/05/2013 15:52:58]  data/lib/catch system.lua:94: in function <data lib="" catch="" system.lua:67="">

 

SCRIPT:[catch.lua]

 


local ballcatch = {					--id normal, id da ball shiy
[2394] = {cr = 3, on = 24, off = 23, ball = {11826, 11737}, send = 47, typeee = "normal"},  --alterado v2.9  \/
[2391] = {cr = 6, on = 198, off = 197, ball = {11832, 11740}, send = 48, typeee = "great"},
[2393] = {cr = 10, on = 202, off = 201, ball = {11835, 11743}, send = 46, typeee = "super"},
[2392] = {cr = 15, on = 200, off = 199, ball = {11829, 11746}, send = 49, typeee = "ultra"},
[12617] = {cr = 3, on = 204, off = 203, ball = {10975, 12621}, send = 35, typeee = "saffari"},
}

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

local item2 = getTopCorpse(topos)
if item2 == null then
return true
end

if getItemAttribute(item2.uid, "catching") == 1 then
  return true
end

if getItemAttribute(item2.uid, "golden") and getItemAttribute(item2.uid, "golden") == 1 then
  return doPlayerSendCancel(cid, "You can't try to catch a pokemon in the Golden Arena!")   --alterado v2.6
end

local name = string.lower(getItemNameById(item2.itemid))  --alterado v2.9 \/
  name = string.gsub(name, "fainted ", "")
  name = string.gsub(name, "defeated ", "")
  name = doCorrectPokemonName(name)
local x = pokecatches[name]


local storage = newpokedex[doCorrectPokemonName(name)].stoCatch			--alterado v2.9 \/
if getPlayerStorageValue(cid, storage) == -1 or not string.find(getPlayerStorageValue(cid, storage), ";") then  
  setPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0;")			  
end	

if not x then return true end

local owner = getItemAttribute(item2.uid, "corpseowner")

if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner then  --alterado v2.5
  doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")
  return true
end

local newidd = isShinyName(name) and ballcatch[item.itemid].ball[2] or ballcatch[item.itemid].ball[1] --alterado v2.9	  
local typeee = ballcatch[item.itemid].typeee

local catchinfo = {}
catchinfo.rate = ballcatch[item.itemid].cr
catchinfo.catch = ballcatch[item.itemid].on
catchinfo.fail = ballcatch[item.itemid].off
catchinfo.newid = newidd					  
catchinfo.name = doCorrectPokemonName(name)
catchinfo.topos = topos
catchinfo.chance = x.chance

doSendDistanceShoot(getThingPos(cid), topos, ballcatch[item.itemid].send)
doRemoveItem(item.uid, 1)

local d = getDistanceBetween(getThingPos(cid), topos)

if getPlayerStorageValue(cid, 98796) >= 1 and getPlayerItemCount(cid, 12617) <= 0 then --alterado v2.9
  setPlayerStorageValue(cid, 98796, -1)
  setPlayerStorageValue(cid, 98797, -1)											  
  doTeleportThing(cid, SafariOut, false)
  doSendMagicEffect(getThingPos(cid), 21)
  doPlayerSendTextMessage(cid, 27, "You spend all your 'saffari balls', good luck in the next time...")
end

addEvent(doSendPokeBall, d * 70 + 100 - (d * 14) , cid, catchinfo, false, false, typeee)
addEvent(doSendMagicEffect, (d * 70 + 100 - (d * 14)) - 100, topos, 3)
return true
end

 

 

[02/05/2013 15:53:06] [Error - CreatureScript Interface]
[02/05/2013 15:53:06] data/creaturescripts/scripts/look.lua:onLook
[02/05/2013 15:53:06] Description:
[02/05/2013 15:53:06] data/creaturescripts/scripts/look.lua:55: attempt to concatenate a nil value
[02/05/2013 15:53:06] stack traceback:
[02/05/2013 15:53:06]  data/creaturescripts/scripts/look.lua:55: in function <data creaturescripts="" scripts="" look.lua:12="">

 

SCRIPT:[look.lua]

 

 


local NPCBattle = {
["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},		 --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}

function onLook(cid, thing, position, lookDistance)

local str = {}

if not isCreature(thing.uid) then
  local iname = getItemInfo(thing.itemid)
  if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then

  unLock(thing.uid)
  local lock = getItemAttribute(thing.uid, "lock")		
  local pokename = getItemAttribute(thing.uid, "poke")

  table.insert(str, "You see "..iname.article.." "..iname.name..".")
  if getItemAttribute(thing.uid, "unique") then			  
	 table.insert(str, " It's an unique item.")  
  end
  table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n")  
  if lock and lock > 0 then
	 table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")  
  end
  local boost = getItemAttribute(thing.uid, "boost") or 0
  if boost > 0 then
	 table.insert(str, "Boost level: +"..boost..".\n")
  end
  if getItemAttribute(thing.uid, "nick") then
	 table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
  end
  if getItemAttribute(thing.uid, "gender") == SEX_MALE then
	 table.insert(str, "It is male.")
  elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
	 table.insert(str, "It is female.")	  
  else
	 table.insert(str, "It is genderless.")
  end
 table.insert(str, "\n--- Status ---")	
  table.insert(str, "\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
  table.insert(str, "Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
  table.insert(str, "Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false

  elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

  table.insert(str, "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")	
  if isContainer(thing.uid) then
	 table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
  end
  table.insert(str, "\n")

  if getItemAttribute(thing.uid, "gender") == SEX_MALE then
	 table.insert(str, "It is male.")
  elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
	 table.insert(str, "It is female.")
  else
	 table.insert(str, "It is genderless.")
  end
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false

  elseif isContainer(thing.uid) then	 --containers

  if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
	 table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
	 table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
	 table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
  else  
	 table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
  end
  if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
	 table.insert(str, "\nItemID: ["..thing.itemid.."]")	
	 local pos = getThingPos(thing.uid)
	 table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
  end
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false

  elseif getItemAttribute(thing.uid, "unique") then	--alterado v2.8 \/
  local p = getThingPos(thing.uid)

  table.insert(str, "You see ")
  if thing.type > 1 then
	 table.insert(str, thing.type.." "..iname.plural..".")
  else
	 table.insert(str, iname.article.." "..iname.name..".")
  end
  table.insert(str, " It's an unique item.\n"..iname.description)

  if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
	 table.insert(str, "\nItemID: ["..thing.itemid.."]")
	 table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
  end

  sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false

  else
  return true
  end
end

local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then	--npcs duel
  table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then	--npcs de TV
  table.insert(str, getPlayerStorageValue(thing.uid, 697548))								  
  local pos = getThingPos(thing.uid)
  if youAre[getPlayerGroupId(cid)] then
  table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
  end
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then	
  table.insert(str, "You see "..getCreatureName(thing.uid)..".")
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false
end

if isPlayer(thing.uid) then	 --player
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  
return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end

if not isSummon(thing.uid) then
  table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n")
  if getPokemonGender(thing.uid)  == SEX_MALE then
  table.insert(str, "It is male.")
  elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
  table.insert(str, "It is female.")
  else
  table.insert(str, "It is genderless.")
  end
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  return false

elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
  local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
  local boostshow = " + "..boostlevel.."]"
  if showBoostSeparated then
  boostshow = "] [+"..boostlevel.."]"
  end
  local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
  if getCreatureMaster(thing.uid) == cid then
  local myball = getPlayerSlotItem(cid, 8).uid
  local nexp = getItemAttribute(myball, "nextlevelexp")
  table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
  table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
  table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
  if getItemAttribute(myball, "level") <= 99 then
	 table.insert(str, "\nExperience needed to level up: "..nexp..".")
  end
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
  end
  return false
end
return true
end

 

 

[02/05/2013 17:02:03] [Error - MoveEvents Interface]
[02/05/2013 17:02:03] data/movements/scripts/PVP/Trade_Back.lua:onStepIn
[02/05/2013 17:02:03] Description:
[02/05/2013 17:02:03] data/lib/011-string.lua:29: attempt to index local 'str' (a number value)
[02/05/2013 17:02:03] stack traceback:
[02/05/2013 17:02:03]  data/lib/011-string.lua:29: in function 'explode'
[02/05/2013 17:02:03]  data/movements/scripts/PVP/Trade_Back.lua:13: in function <data movements="" scripts="" pvp="" trade_back.lua:3="">

 

SCRIPT:[Trade_Back.lua]

 


local tileClans = {33800, 33801, 33802, 33803, 33804, 33805, 33806, 33807, 33808}
		   --   psy	ore	win	nat	sea   gard   male	rai   volc
function onStepIn(cid, item, pos)
if isSummon(cid) then
return false
end
--
local storage = 171877
if isInArray(tileClans, item.actionid) then
  storage = 171878
end
--
local b = string.explode(getPlayerStorageValue(cid, storage), "/")
local t = string.explode(b[1], ";")   --alterado v2.8
--
if #getCreatureSummons(cid) >= 1 then
  for i = 1, #getCreatureSummons(cid) do
   doTeleportThing(getCreatureSummons(cid)[i], {x=tonumber(t[1]) - 1, y=tonumber(t[2]), z=tonumber(t[3])}, false)
  end
end
doTeleportThing(cid, {x=tonumber(t[1]), y=tonumber(t[2]), z=tonumber(t[3])}, false)
setPlayerStorageValue(cid, storage, -1)
return true
end

 

 

 

 

O pior deles acho que é esse, não sei se é o mapa ou o que acontece.. mas ele da um clean que demora demais, nesse tempo não pode se mexer no server e depois toma dc, ninguém pode logar e nem nada.

 

[02/05/2013 17:24:22] > CLEAN: Removed 0 items from 2979922 tiles in 1327.7 seconds.

 

Queria saber se tem como diminuir o tempo desse clean..?!?

 

 

 

Quem puder me ajudar eu agradeço e claro, ganha rep+ por cada erro que me ajudar a arrumar =)

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

12 respostass a esta questão

Posts Recomendados

  • 0

Troque seu script de move por:

 

 

 

 

function getTime(s)

local n = math.floor(s / 600)

s = s - (600 * n)

return n, s

end

 

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers)

local creaturesList = {}

for x = -radiusx, radiusx do

for y = -radiusy, radiusy do

if not (x == 0 and y == 0) then

creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE})

if (creature.type == 1 and showPlayers == 1) or (creature.type == 2 and showMonsters == 1) then

table.insert(creaturesList, creature.uid)

end

end

end

end

return creaturesList

end

 

-- CONDITIONS

 

function Confused(inconfuse, rounds)

if rounds == 0 then return false end

if not inconfuse then return false end

local c = {[1] = {x = 1, y = 0}, [2] = {x = 0, y = 1}, [3] = {x = -1, y = 0}, [4] = {x = 0, y = -1}}

local p = getCreaturePosition(inconfuse)

doSendMagicEffect(p, 31)

local s = math.random(4)

doTeleportThing(inconfuse, {x = p.x + c.x, y = p.y + c.y, z = p.z})

return addEvent(Confused, 400, inconfuse, rounds-1)

end

 

local paralize = createConditionObject(CONDITION_PARALYZE)

setConditionParam(paralize, CONDITION_PARAM_TICKS, 5*1000)

setConditionFormula(paralize, -0.7, 0, -0.8, 0)

function Paralize(inparalize)

doSendAnimatedText(getCreaturePosition(inparalize), "PAZ", 210)

doAddCondition(inparalize , paralize)

return true

end

 

local sleep = createConditionObject(CONDITION_PARALYZE)

setConditionParam(sleep, CONDITION_PARAM_TICKS, 5*1000)

setConditionFormula(sleep, -1.7, 0, -1.8, 0)

function Sleep(insleep)

doAddCondition(insleep , sleep)

p = getCreaturePosition(insleep)

doSendAnimatedText(p, "SLEEP", 154)

for i = 1, 5 do

if i == 1 then

doSendMagicEffect(p, 32)

else

addEvent(doSendMagicEffect, i * 1000, p, 32)

end

end

return true

end

 

function Poison(inpoison, ef, rounds)

if rounds == 0 then return false end

if not inpoison then return false end

local p = getCreaturePosition(inpoison)

doAreaCombatHealth(pet, COMBAT_EARTHDAMAGE, p, 0, -5, -10, ef)

return addEvent(Poison, 800, inpoison, ef, rounds-1)

end

 

-- END CONDITIONS

 

function getPosToStorm(posdecay)

b = {x = posdecay.x-20, y = posdecay.y-20, z = posdecay.z}

return b

end

 

local area1 = createCombatArea{

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

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

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

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

{0, 1, 1, 1, 0}

}

 

local area2 = createCombatArea{

{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 area3 = createCombatArea{

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

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

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

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

{0, 0, 1, 0, 0}

}

 

 

local areadirecion1 = {

[2] = createCombatArea{

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

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

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

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

{0, 0, 2, 0, 0}

},

 

[3] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

},

 

[0] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

},

 

[1] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

}

}

 

local areadirecion2 = {

[2] = createCombatArea{

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

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

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

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

{0, 0, 2, 0, 0}

},

 

[3] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

},

 

[0] = createCombatArea{

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

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

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

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

{0, 0, 1, 0, 0}

},

 

[1] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

}

}

 

local areadirecion3 = {

[2] = createCombatArea{

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

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

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

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

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

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

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

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

{0, 0, 2, 0, 0}

},

 

[3] = createCombatArea{

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

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

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

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

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

},

 

[0] = createCombatArea{

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

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

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

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

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

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

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

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

{0, 0, 1, 0, 0}

},

 

[1] = createCombatArea{

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

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

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

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

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

}

}

 

local areadirecion4 = {

[2] = createCombatArea{

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

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

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

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

{0, 0, 2, 0, 0}

},

 

[3] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

},

 

[0] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

},

 

[1] = createCombatArea{

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

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

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

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

{0, 0, 0, 0, 0}

}

}

 

local d = {

["Bulbasaur"] = {

["m1"] = {atk = "Quick Attack", minlvl = 20, st = 2000, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Razor Leaf", minlvl = 20, st = 2001, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m3"] = {atk = "Vine Whip", minlvl = 20, st = 2002, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m4"] = {atk = "Headbutt", minlvl = 20, st = 2003, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m5"] = {atk = "Leech Seed", minlvl = 20, st = 2004, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m6"] = {atk = "Solar Beam", minlvl = 20, st = 2005, cd = 3, min = 200, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m7"] = {atk = "Stun Spore", minlvl = 20, st = 2006, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m8"] = {atk = "Poison Powder", minlvl = 20, st = 2007, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2008, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

},

["Ivysaur"] = {

["m1"] = {atk = "Quick Attack", minlvl = 40, st = 2009, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Razor Leaf", minlvl = 40, st = 2010, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m3"] = {atk = "Vine Whip", minlvl = 40, st = 2011, cd = 3, min = 300, max = 440, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m4"] = {atk = "Headbutt", minlvl = 40, st = 2012, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m5"] = {atk = "Leech Seed", minlvl = 40, st = 2013, cd = 3, min =300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m6"] = {atk = "Solar Beam", minlvl = 40, st = 2014, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m7"] = {atk = "Stun Spore", minlvl = 40, st = 2015, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m8"] = {atk = "Poison Powder", minlvl = 40, st = 2016, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2017, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

},

["Venusaur"] = {

["m1"] = {atk = "Quick Attack", minlvl = 80, st = 2018, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Razor Leaf", minlvl = 80, st = 2019, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m3"] = {atk = "Vine Whip", minlvl = 80, st = 2020, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m4"] = {atk = "Headbutt", minlvl = 80, st = 2021, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m5"] = {atk = "Leech Seed", minlvl = 80, st = 2022, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false},

["m6"] = {atk = "Solar Beam", minlvl = 80, st = 2023, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m7"] = {atk = "Stun Spore", minlvl = 80, st = 2024, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m8"] = {atk = "Poison Powder", minlvl = 80, st = 2025, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2026, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m10"] = {atk = "Leaf Storm", minlvl = 80, st = 2027, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

},

["Charmander"] = {

["m1"] = {atk = "Scratch", minlvl = 20, st = 2028, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Ember", minlvl = 20, st = 2029, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m3"] = {atk = "Flamethrower", minlvl = 20, st = 2030, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m4"] = {atk = "Fire Ball", minlvl = 20, st = 2031, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false},

["m5"] = {atk = "Fire Blast", minlvl = 20, st = 2032, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m6"] = {atk = "Rage", minlvl = 20, st = 2033, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m7"] = {atk = "Fire Fang", minlvl = 20, st = 2034, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false},

},

["Charmeleon"] = {

["m1"] = {atk = "Scratch", minlvl = 40, st = 2035, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Ember", minlvl = 40, st = 2036, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m3"] = {atk = "Flamethrower", minlvl = 40, st = 2037, cd = 3, min = 400, max = 500, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m4"] = {atk = "Fire Ball", minlvl = 40, st = 2038, cd = 3, min = 300, max =400, damage = COMBAT_FIREDAMAGE, target = true, pz = false},

["m5"] = {atk = "Fire Blast", minlvl = 40, st = 2039, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m6"] = {atk = "Rage", minlvl = 40, st = 2040, cd = 3, min = 100, max = 300, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m7"] = {atk = "Fire Fang", minlvl = 40, st = 2041, cd = 3, min = 400, max = 800, damage = COMBAT_FIREDAMAGE, target = true, pz = false},

},

["Charizard"] = {

["m1"] = {atk = "Dragon Claw", minlvl = 80, st = 2042, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Ember", minlvl = 80, st = 2043, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m3"] = {atk = "Flamethrower", minlvl = 80, st = 2044, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m4"] = {atk = "Fire Ball", minlvl = 80, st = 2045, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = true, pz = false},

["m5"] = {atk = "Fire Blast", minlvl = 80, st = 2046, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m6"] = {atk = "Rage", minlvl = 80, st = 2047, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m7"] = {atk = "Magma Storm", minlvl = 80, st = 2048, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false},

["m8"] = {atk = "Wing Attack", minlvl = 80, st = 2049, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false},

},

["Squirtle"] = {

["m1"] = {atk = "Headbutt", minlvl = 20, st = 2050, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Bubbles", minlvl = 20, st = 2051, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m3"] = {atk = "Water Gun", minlvl = 20, st = 2052, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m4"] = {atk = "Waterball", minlvl = 20, st = 2053, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m5"] = {atk = "Aqua Tail", minlvl = 20, st = 2054, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m6"] = {atk = "Hydro Cannon", minlvl = 20, st = 2055, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m7"] = {atk = "Harden", minlvl = 20, st = 2056, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true},

["m8"] = {atk = "Surf", minlvl = 20, st = 2057, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

},

["Wartortle"] = {

["m1"] = {atk = "Headbutt", minlvl = 40, st = 2058, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Bubbles", minlvl = 40, st = 2059, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m3"] = {atk = "Water Gun", minlvl = 40, st = 2060, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m4"] = {atk = "Waterball", minlvl = 40, st = 2061, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2062, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2063, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m7"] = {atk = "Harden", minlvl = 40, st = 2064, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true},

["m8"] = {atk = "Surf", minlvl = 40, st = 2065, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

},

["Blastoise"] = {

["m1"] = {atk = "Headbutt", minlvl = 40, st = 2066, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Bubbles", minlvl = 40, st = 2067, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m3"] = {atk = "Water Gun", minlvl = 40, st = 2068, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m4"] = {atk = "Waterball", minlvl = 40, st = 2069, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false},

["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2070, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2071, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m7"] = {atk = "Harden", minlvl = 40, st = 2072, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true},

["m8"] = {atk = "Surf", minlvl = 40, st = 2073, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

["m9"] = {atk = "Hydropump", minlvl = 40, st = 2074, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false},

},

["Caterpie"] = {

["m1"] = {atk = "Headbutt", minlvl = 1, st = 2075, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "String Shot", minlvl = 1, st = 2076, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m3"] = {atk = "Bug Bite", minlvl = 1, st = 2077, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

},

["Metapod"] = {

["m1"] = {atk = "Headbutt", minlvl = 10, st = 2078, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "String Shot", minlvl = 10, st = 2079, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m3"] = {atk = "Bug Bite", minlvl = 10, st = 2080, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m4"] = {atk = "Harden", minlvl = 10, st = 2081, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true},

},

["Butterfree"] = {

["m1"] = {atk = "Headbutt", minlvl = 30, st = 2082, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "Whirlwind", minlvl = 30, st = 2083, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false},

["m3"] = {atk = "Super Sonic", minlvl = 30, st = 2084, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m4"] = {atk = "Stun Spore", minlvl = 30, st = 2085, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m5"] = {atk = "Poison Powder", minlvl = 30, st = 2086, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m6"] = {atk = "Sleep Powder", minlvl = 30, st = 2087, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false},

["m7"] = {atk = "Psybeam", minlvl = 30, st = 2088, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false},

["m8"] = {atk = "Confusion", minlvl = 30, st = 2089, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false},

},

["Weedle"] = {

["m1"] = {atk = "Horn Attack", minlvl = 1, st = 2090, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "String Shot", minlvl = 1, st = 2091, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m3"] = {atk = "Poison Sting", minlvl = 1, st = 2092, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

},

["Kakuna"] = {

["m1"] = {atk = "Bug Bite", minlvl = 10, st = 2093, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "String Shot", minlvl = 10, st = 2094, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2095, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m4"] = {atk = "Harden", minlvl = 10, st = 2096, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = true},

},

["Beedrill"] = {

["m1"] = {atk = "Fury Cutter", minlvl = 10, st = 2097, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m2"] = {atk = "String Shot", minlvl = 10, st = 2098, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2099, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m4"] = {atk = "Pin Missile", minlvl = 10, st = 2100, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m5"] = {atk = "Rage", minlvl = 10, st = 2101, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

["m6"] = {atk = "Strafe", minlvl = 10, st = 2102, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false},

},

 

}

 

function onSay(cid, words, param)

 

if #getCreatureSummons(cid) == 0 then

return doPlayerSendCancel(cid, "You do not have any pokemon.")

end

 

local poke = d[getCreatureName(getCreatureSummons(cid)[1])][words]

if not poke then

return true

end

local storage = poke.st

local exst = 16265

local cdexst = 0.5

local cd = math.ceil(poke.cd/2)

local pet = getCreatureSummons(cid)[1]

local target = getCreatureTarget(cid)

local look = getCreatureLookDir(pet)

local position = getThingPos(pet)

 

if getTilePzInfo(getCreaturePosition(pet)) and poke.pz == false then

return doPlayerSendCancel(cid, "Not Attack in protection zone.")

end

 

if getPlayerLevel(cid) < poke.minlvl then

return doPlayerSendTextMessage(cid, 19, "Your need level "..poke.minlvl.." to use " ..poke.atk..".")

end

 

if os.time()-getPlayerStorageValue(cid, storage) <= cd then

minutes,seconds = getTime(cd-(os.time()-getPlayerStorageValue(cid, storage)))

return doPlayerSendTextMessage(cid, 27, "Wait "..seconds.." seconds to use "..poke.atk..".")

end

 

if target == 0 and poke.target then

return doPlayerSendTextMessage(cid, 19, "This Pokemon Attack need any target.")

end

 

if os.time()-getPlayerStorageValue(cid, exst) <= cdexst then

minutes,seconds = getTime(cdexst-(os.time()-getPlayerStorageValue(cid, exst)))

return doPlayerSendCancel(cid, "Poke exhausted")

end

 

local critico = math.random(100) < 10 and 2 or 1

 

--ATTACKS

 

if poke.atk == "Quick Attack" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 148)

 

elseif poke.atk == "Razor Leaf" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 4)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 79)

 

elseif poke.atk == "Vine Whip" then

local effects = {

[0] = 80,

[1] = 83,

[2] = 81,

[3] = 82

}

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look])

 

elseif poke.atk == "Headbutt" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111)

 

elseif poke.atk == "Leech Seed" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 6)

doSendAnimatedText(getCreaturePosition(target), "POISON", 66)

addEvent(Poison, 500, target, 45, 5)

 

elseif poke.atk == "Solar Beam" then

local a = {

[0] = {x = 0, y = -1, effect={[1]=94,[2]=93,[3]=93,[4]=95}},

[1] = {x = 1, y = 0, effect={[1]=86,[2]=88,[3]=88,[4]=87}},

[2] = {x = 0, y = 1, effect={[1]=91,[2]=93,[3]=93,[4]=92}},

[3] = {x = -1, y = 0, effect={[1]=89,[2]=88,[3]=88,[4]=90}}

}

for i = 1,4 do

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59)

 

elseif poke.atk == "Stun Spore" then

local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0)

for _,pid in pairs(d) do

Paralize(pid)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 85)

 

elseif poke.atk == "Poison Powder" then

local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0)

for _,pid in pairs(d) do

doSendAnimatedText(getCreaturePosition(pid), "POISON", 66)

Poison(pid, 8, 5)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 84)

 

elseif poke.atk == "Sleep Powder" then

local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0)

for _,pid in pairs(d) do

Sleep(pid)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 27)

 

elseif poke.atk == "Leaf Storm" then

local d = getCreaturesInRange(getThingPos(pet), 3, 3, 1, 0)

for _,pid in pairs(d) do

for i = 1, 4 do

if i == 1 then

addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79)

doSendDistanceShoot(getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4)

else

addEvent(doAreaCombatHealth, i*800 ,pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79)

addEvent(doSendDistanceShoot, i*600, getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4)

end

end

end

 

elseif poke.atk == "Scratch" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142)

 

elseif poke.atk == "Ember" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 15)

 

elseif poke.atk == "Flamethrower" then

local effects = {

[0] = 55,

[1] = 58,

[2] = 56,

[3] = 57

}

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look])

 

elseif poke.atk == "Fire Ball" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 3)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 5)

 

elseif poke.atk == "Fire Blast" then

local a = {

[0] = {x = 0, y = -1, effect= 60},

[1] = {x = 1, y = 0, effect= 61},

[2] = {x = 0, y = 1, effect= 62},

[3] = {x = -1, y = 0, effect= 63}

}

for i = 1,8 do

if i == 1 then

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15)

else

addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15)

end

end

 

elseif poke.atk == "Rage" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

for i = 1,4 do

if i == 1 then

doSendMagicEffect(position, 168)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142)

else

addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142)

end

end

 

elseif poke.atk == "Fire Fang" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146)

addEvent(doAreaCombatHealth, 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15)

addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15)

 

elseif poke.atk == "Dragon Claw" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 141)

 

elseif poke.atk == "Magma Storm" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 36)

addEvent(doAreaCombatHealth, 800, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 6)

 

elseif poke.atk == "Wing Attack" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 115)

addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 42)

 

elseif poke.atk == "Bubbles" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 2)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68)

 

elseif poke.atk == "Water Gun" then

local a = {

[0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=76}},

[1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=71}},

[2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=78}},

[3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=73}}

}

for i = 1,4 do

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59)

 

elseif poke.atk == "Waterball" then

for i = 1,5 do

if i == 1 then

addEvent(doAreaCombatHealth, 200 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68)

doSendDistanceShoot(getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2)

else

addEvent(doAreaCombatHealth, i*700 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68)

addEvent(doSendDistanceShoot, i*500, getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2)

end

end

 

elseif poke.atk == "Aqua Tail" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 160)

 

elseif poke.atk == "Hydro Cannon" then

local a = {

[0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}},

[1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}},

[2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}},

[3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}}

}

for i = 1,8 do

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 59)

 

elseif poke.atk == "Harden" then

function Harden(cid, rounds)

if rounds == 0 then return false end

if #getCreatureSummons(cid) == 0 then return false end

doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 144)

return addEvent(Harden, 1000, cid, rounds-1)

end

addEvent(Harden, 500, cid, 40)

 

elseif poke.atk == "Surf" then

local a = {

[0] = {x = 0, y = -1, effect= 66},

[1] = {x = 1, y = 0, effect= 67},

[2] = {x = 0, y = 1, effect= 64},

[3] = {x = -1, y = 0, effect= 65}

}

for i = 1,8 do

if i == 1 then

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68)

else

addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68)

end

end

 

elseif poke.atk == "Hydropump" then

local a = {

[0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}},

[1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}},

[2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}},

[3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}}

}

for i = 1,8 do

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68)

addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 33)

 

elseif poke.atk == "String Shot" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 23)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137)

Paralize(target)

 

elseif poke.atk == "Bug Bite" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146)

 

elseif poke.atk == "Whirlwind" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion4[look], -poke.min, -poke.max * critico, 42)

 

elseif poke.atk == "Super Sonic" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

for i = 1, 3 do

if i == 1 then

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 24)

else

addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 24)

end

end

addEvent(doSendAnimatedText, 500, getCreaturePosition(target), "CONF", 210)

addEvent(Confused, 500, target, 15)

 

elseif poke.atk == "Psybeam" then

local a = {

[0] = {x = 0, y = -1, effect={[1]=108,[2]=109,[3]=109,[4]=108}},

[1] = {x = 1, y = 0, effect={[1]=106,[2]=107,[3]=107,[4]=106}},

[2] = {x = 0, y = 1, effect={[1]=109,[2]=108,[3]=108,[4]=109}},

[3] = {x = -1, y = 0, effect={[1]=107,[2]=106,[3]=106,[4]=107}}

}

for i = 1,4 do

doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect)

end

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59)

 

elseif poke.atk == "Confusion" then

doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area3, -poke.min, -poke.max * critico, 136)

 

elseif poke.atk == "Horn Attack" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111)

 

elseif poke.atk == "Poison Sting" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 15)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 9)

 

elseif poke.atk == "Fury Cutter" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110)

addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110)

 

elseif poke.atk == "Pin Missile" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then

return doPlayerSendCancel(cid, "Target is far away.")

end

for i = 1, 3 do

if i == 1 then

doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 13)

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137)

else

addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 13)

addEvent(doAreaCombatHealth, i * 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137)

end

end

 

elseif poke.atk == "Strafe" then

if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then

return doPlayerSendCancel(cid, "Target is far away.")

end

local dd = {142, 111, 110, 148}

for i = 1,6 do

af = math.random(4)

if i == 1 then

doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af])

else

addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af])

end

end

 

 

end

 

-- END ATTACKS

 

doPlayerSay(cid, getCreatureName(pet)..", use "..poke.atk..".", 1)

setPlayerStorageValue(cid, storage, os.time()+cd)

setPlayerStorageValue(cid, exst, os.time()+cdexst)

local atknotcritic = {"Harden", "Poison Powder", "Sleep Powder", "Super Sonic", "Stun Spore"}

if critico == 2 and not isInArray(atknotcritic, poke.atk) then

doSendAnimatedText(getCreaturePosition(cid), "CRITICAL", 144)

end

 

return true

end

 

 

 

Troque também a linha do seu move do talkactions por:

 

 

<talkaction words="m1;m2;m3;m4;m5;m6;m7;m8;m9;m10;m11;m12" hide="yes" event="script" value="moves.lua"/>

 

 

 

 

Verifique se o seu script está com o nome de moves.lua, caso contrário troque o nome em value="moves.lua"/>

 

Teste este primeiramente;

Link para o comentário
Compartilhar em outros sites

  • 0

Ficou meio grande o script né não ? Mas enfim.. testei aqui e não funcionou Mais nenhum move s;

e começou a dar esse erro toda hora no console :

 

[04/05/2013 18:37:01] [Error - TalkAction Interface]
[04/05/2013 18:37:01] data/talkactions/scripts/move1.lua:onSay
[04/05/2013 18:37:01] Description:
[04/05/2013 18:37:01] data/talkactions/scripts/move1.lua:388: attempt to index field '?' (a nil value)
[04/05/2013 18:37:01] stack traceback:
[04/05/2013 18:37:01]  data/talkactions/scripts/move1.lua:388: in function <data/talkactions/scripts/move1.lua:382>

Link para o comentário
Compartilhar em outros sites

  • 0

O último de todos, vá em data/globalevents/ e poste aqui o globalevents.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
<globalevent name="save" interval="1800" event="script" value="save.lua"/>
<globalevent name="clean" interval="7200" event="script" value="clean.lua"/>

<globalevent name="serverstart" type="start" event="script" value="start.lua"/>
<globalevent name="playersrecord" type="record" event="script" value="record.lua"/>
<globalevent name="GoldenArena1" time="2:50" event="script" value="Golden Arena.lua"/>
<globalevent name="GoldenArena2" time="7:50" event="script" value="Golden Arena.lua"/>
<globalevent name="GoldenArena3" time="11:50" event="script" value="Golden Arena.lua"/>
<globalevent name="GoldenArena4" time="12:40" event="script" value="Golden Arena.lua"/>
<globalevent name="GoldenArena5" time="21:50" event="script" value="Golden Arena.lua"/>
<!-- <globalevent name="timer_example" time="21:35" event="script" value="my_script.lua"/> -->
</globalevents>

 

 

Mudo esse interval ?

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

  • 0

Menos, se não me engano são milesegundos. Ali são 2 horas. Vá dividindo *-*

7200 = 2 horas

3600 = 1 hora

1800 = meia hora

900 = 15 min

 

E assim vai

Link para o comentário
Compartilhar em outros sites

  • 0

Exato.

Mas o que eu me refiro no tempo do clean, é que quando ele da clean, o servidor fica parado, sem ninguem se mecher até tomar dc e sem ninguem poder entrar.

 

Exemplo:To lá jogando de boa aí da clean, o servidor trava por um longo periodo de tempo no clean e depois de tantos mil segundos da o aviso que o clean terminou e pode-se jogar normal. Mas nesse tempo acontece o que eu disse acima.

Link para o comentário
Compartilhar em outros sites

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