Ir para conteúdo

[HELP] Erro exp.lua Pokemon [HELP]


Flaah

Posts Recomendados

Galera meu script exp.lua do Pokemon Dash da esse erro, quando clico no monster inimigo e não hita o monster:

[16/02/2014 00:32:41] [Error - CreatureScript Interface]
[16/02/2014 00:32:41] data/creaturescripts/scripts/exp.lua:onStatsChange
[16/02/2014 00:32:41] Description:
[16/02/2014 00:32:41] data/creaturescripts/scripts/exp.lua:233: attempt to call global 'isSummon' (a nil value)
[16/02/2014 00:32:41] stack traceback:
[16/02/2014 00:32:41] data/creaturescripts/scripts/exp.lua:233: in function <data/creaturescripts/scripts/exp.lua:19>

 

 

Script:

 

local expcond = createConditionObject(CONDITION_INFIGHT)
setConditionParam(expcond, CONDITION_PARAM_TICKS, 4500)

local efeitos = {
[COMBAT_PHYSICALDAMAGE] = 3,
[COMBAT_RAIODAMAGE] = 3,
[COMBAT_DROWNDAMAGE] = 3,
[COMBAT_FIREDAMAGE] = 3,
[COMBAT_GRAMADAMAGE] = 3,
[COMBAT_ICEDAMAGE] = 3,
[COMBAT_VOARDAMAGE] = 3,
[COMBAT_POISONDAMAGE] = 3,
[COMBAT_HOLYDAMAGE] = 3,
[COMBAT_DEATHDAMAGE] = 3,
[COMBAT_EARTHDAMAGE] = 3,
[COMBAT_ENERGYDAMAGE] = 3,
}

function onStatsChange(cid, attacker, enps, combatee, value)
if combatee == COMBAT_ENERGYDAMAGE then
cor = COLOR_MAGICA
elseif combatee == COMBAT_GRAMADAMAGE then
cor = COLOR_GRAMA
elseif combatee == COMBAT_FIREDAMAGE then
cor = COLOR_FOGO
elseif combatee == COMBAT_DROWNDAMAGE then
cor = COLOR_AGUA
elseif combatee == COMBAT_ICEDAMAGE then
cor = COLOR_GELO
elseif combatee == COMBAT_HOLYDAMAGE then
cor = COLOR_NORMAL
elseif combatee == COMBAT_VOARDAMAGE then
cor = COLOR_VOAR
elseif combatee == COMBAT_DEATHDAMAGE then
cor = COLOR_FANTASMA
elseif combatee == COMBAT_EARTHDAMAGE then
cor = COLOR_TERRA
elseif combatee == COMBAT_RAIODAMAGE then
cor = COLOR_RAIO
elseif combatee == COMBAT_POISONDAMAGE then
cor = COLOR_VENENO
elseif getCreatureName(cid) == "Kakuna" or getCreatureName(cid) == "Metapod" then
cor = COLOR_VENENO
elseif getCreatureName(cid) == "Golem" or getCreatureName(cid) == "Graveler" or getCreatureName(cid) == "Geodude" then
cor = COLOR_TERRA
else
cor = NONE
end
local cores = cor
if getPlayerStorageValue(cid, 33) >= 1 then -- funcionamento do self destruction
if isCreature(attacker) then
return false
end
return true
end
if getPlayerStorageValue(cid, 34) >= 1 then -- REFLECT
if combatee ~= COMBAT_PHYSICALDAMAGE then
if isCreature(attacker) then
doSendMagicEffect(getThingPos(cid), 135)
doSendMagicEffect(getThingPos(attacker), 3)
doSendAnimatedText(getThingPos(cid), "REFLECT", 215)
doCreatureAddHealth(attacker, -value, 3, 191) -- 3 = efeito do reflect
setPlayerStorageValue(cid, 34, 0)
return false
end
end
end
if getPlayerStorageValue(cid, 35) >= 1 then -- MAGIAS DE MISS, STRING SHOT, MUD SHOT ETC
if combatee ~= COMBAT_PHYSICALDAMAGE then
if isCreature(attacker) then
doSendAnimatedText(getThingPos(cid), "MISS", 215)
setPlayerStorageValue(cid, 35, 0)
return false
end
end
end
if not isCreature(attacker) then
return true
end
if isPlayer(attacker) then
return true
end
if enps == STATSCHANGE_HEALTHGAIN then
return true
end
if enps == STATSCHANGE_HEALTHLOSS then
if getCreatureHealth(cid) <= value then
if isPlayer(cid) then
if #getCreatureSummons(cid) == 0 then
doCreatureAddHealth(cid, -getCreatureHealth(cid), 3, 180) -- 3 é o efeito que aparece no player quando ele é atacado e vai morrer
return false
end
return false
end
if isPlayer(getCreatureMaster(attacker)) then
doTargetCombatHealth(getCreatureMaster(attacker), cid, combatee, -(getCreatureHealth(cid)), -(getCreatureHealth(cid)), efeitos[combatee])
if isInArray({COMBAT_EARTHDAMAGE, COMBAT_RAIODAMAGE, COMBAT_VOARDAMAGE, COMBAT_POISONDAMAGE}, combatee) then
doSendAnimatedText(getThingPos(cid), value, cores)
end
return false
end
return true
end
if isPlayer(cid) then
if #getCreatureSummons(cid) >= 1 then
return false
end
doCreatureAddHealth(cid, -value, 3, 180) -- 3 é o efeito que aparece no player quando é atacado
return false
end

if isPlayer(getCreatureMaster(cid)) then
doAddCondition(getCreatureMaster(cid), expcond)
end


if combatee == COMBAT_RAIODAMAGE then
if isInArray(electric2, getCreatureName(cid)) then
x = 2
elseif isInArray(electric1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(electric0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_DROWNDAMAGE then
if isInArray(water2, getCreatureName(cid)) then
x = 2
elseif isInArray(water1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(water0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_GRAMADAMAGE then
if isInArray(grass2, getCreatureName(cid)) then
x = 2
elseif isInArray(grass1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(grass0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_VOARDAMAGE then
if isInArray(flying2, getCreatureName(cid)) then
x = 2
elseif isInArray(flying1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(flying0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_FIREDAMAGE then
if isInArray(fire2, getCreatureName(cid)) then
x = 2
elseif isInArray(fire1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(fire0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_EARTHDAMAGE then
if isInArray(ground2, getCreatureName(cid)) then
x = 2
elseif isInArray(ground1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(ground0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_DEATHDAMAGE then
if isInArray(ghost2, getCreatureName(cid)) then
x = 2
elseif isInArray(ghost1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(ghost0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_HOLYDAMAGE then
if isInArray(normal2, getCreatureName(cid)) then
x = 2
elseif isInArray(normal1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(normal0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_POISONDAMAGE then
if isInArray(poison2, getCreatureName(cid)) then
x = 2
elseif isInArray(poison1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(poison0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_ENERGYDAMAGE then
if isInArray(psychic2, getCreatureName(cid)) then
x = 2
elseif isInArray(psychic1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(psychic0, getCreatureName(cid)) then
x = 0
else
x = 1
end
elseif combatee == COMBAT_ICEDAMAGE then
if isInArray(ice2, getCreatureName(cid)) then
x = 2
elseif isInArray(ice1, getCreatureName(cid)) then
x = 0.5
elseif isInArray(ice0, getCreatureName(cid)) then
x = 0
else
x = 1
end
else
x = 1
end

local xx = x

if not isSummon(attacker) then
if not isPlayer(cid) and not isPlayer(getCreatureMaster(cid)) then
return false
end
if isSummon(cid) and getCreatureHealth(cid) <= (getCreatureMaxHealth(cid)*0.15) and not exhaustion.get(getCreatureMaster(cid), 88726) then
exhaustion.set(getCreatureMaster(cid), 88726, 6)
doSendMagicEffect(getThingPos(cid), 178)
end
if getPlayerStorageValue(cid, 4) >= 1 then
local damage = value
doCreatureAddHealth(cid, -((math.ceil(damage/2))*xx), 2, cores) -- 2 é o efeito que aparece no pokemon quando tem harden e é atacado
else
local damage = value
if cor == NONE then
return true
end
doCreatureAddHealth(cid, -((math.ceil(damage/1))*xx), efeitos[combatee], cores)
return false
end
return false
end
if isSummon(attacker) then
if isSummon(cid) then
if isInParty(getCreatureMaster(cid)) and isInParty(getCreatureMaster(attacker)) and getPlayerParty(getCreatureMaster(cid)) == getPlayerParty(getCreatureMaster(attacker)) then
else
return false
end
end
local combatx = combatee
local valor = value
if getPlayerStorageValue(cid, 4) >= 1 then
doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -((valor / 2)*x), -(((valor / 2)+10)*x), 255)
else
doTargetCombatHealth(getCreatureMaster(attacker), cid, combatx, -((valor)*x), -((valor+10)*x), 255)
end
if isInArray({COMBAT_EARTHDAMAGE, COMBAT_RAIODAMAGE, COMBAT_VOARDAMAGE, COMBAT_POISONDAMAGE}, combatee) then
doSendAnimatedText(getThingPos(cid), value*xx, cores)
end
end
end
end

 

 

Bom é isso, D:

VELENDO ++REP PELA AJUDA

Link para o comentário
Compartilhar em outros sites

qual servidor vc usou como base?

esse erro pode ser dado por ñ achar a function ou por n existir o objeto... ele n reconhece o monstro...

 

e outra duvida eh em todos os pokemons ou só em alguns?

Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...
×
×
  • Criar Novo...