Ir para conteúdo

Posts Recomendados

Ajuda galera adicionei esse sistema ao meu servidor e ta dando erro na linha 73

 

 

esse e o erro que da quando tento sumonar o pet

 

no !pet

 

aqui ta a script de sumonar o pet!!

 

dofile("./petConfig.lua")

 

 

 

function doPlayerAddSummon(cid, name, pos)

local MyCreature = doSummonCreature(name, pos)

doConvinceCreature(cid, MyCreature)

return MyCreature

end

 

 

local myPet = ""

local myPetUid = 0

 

function onSay(cid, words, param)

 

 

if getPlayerStorageValue(cid, storages.petMag) == -1 then

setPlayerStorageValue(cid, storages.petMag, 0)

end

 

if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then

if getTilePzInfo(getCreaturePosition(cid)) == 3 then

if getPlayerStorageValue(cid, storages.petIsOnline) == 1 or getPlayerStorageValue(cid, storages.petIsOnline) == -1 then

for i = 1, table.maxn(pets) do

if pets.level <= getPlayerLevel(cid) then

 

if getPlayerSex(cid) == 1 then

if getPlayerStorageValue(cid, 24350) >0 then

myPet = "Pet elephant"

break

else

myPet = pets.name

break

end

 

else

if getPlayerStorageValue(cid, 24350) >0 then

myPet = "Pet elephant"

break

else

myPet = petsf.name

break

end

 

end

 

end

end

myPetUid = doPlayerAddSummon(cid, myPet, getCreaturePosition(cid))

setPlayerStorageValue(cid, storages.petUid, myPetUid)

if myPetUid ~= -1 then

if getPlayerStorageValue(cid, storages.petDamage) ~= 0 and getPlayerStorageValue(cid, storages.petDamage) ~= -1 then

if getPlayerStorageValue(cid, storages.petDamage) < getCreatureMaxHealth(getPlayerStorageValue(cid, storages.petUid)) then

doCreatureAddHealth(getPlayerStorageValue(cid, storages.petUid), getPlayerStorageValue(cid, storages.petDamage)*-1)

end

end

doChangeSpeed(myPetUid, getCreatureBaseSpeed(cid) - getCreatureBaseSpeed(myPetUid))

doCreatureSay(myPetUid, 'Hello!', TALKTYPE_ORANGE_1)

addMana({cid = cid})

setPlayerStorageValue(cid, storages.petIsOnline, 2)

else

doPlayerSendCancel(cid, 'Not enought room.')

end

else

doPlayerSendCancel(cid, 'Your pet died! You have to revive it.')

end

else

doPlayerSendCancel(cid, 'Your Pet is isleeping now , hibernation , dont disturb.')

end

else

local daPet = getPlayerStorageValue(cid, storages.petUid)

setPlayerStorageValue(cid, storages.petDamage, getCreatureMaxHealth(daPet) - getCreatureHealth(daPet))

doCreatureSay(daPet, 'Byebye !', TALKTYPE_ORANGE_1)

setPlayerStorageValue(cid, storages.petIsOnline, 1)

doSendMagicEffect(getCreaturePosition(daPet), CONST_ME_POFF)

doRemoveCreature(daPet)

end

return FALSE

end

 

 

 

aqui ta a petconfig.lua

 

 

--// \\--

--( made by FedeVI ) --

--____________ //--

frases = {"Men, im still exhausted!", "Ok, in one momment", "afff, again?!", "meh, one second", "meh, Sharingam"}

lenght = 39 -- maximun lenght the !petsay can have...

manaGainTicks = 3000 --

--how fast the pet gains mana

manaGainAmmount = 10 --//

manaGainPerLevel = 20 -- mana that gains the pet for each level the player gain

magicLevelRate = 0.25 -- how faster the pet will gain mlvl compared to real tibia, 0.5 = 2 times faster, 0.25 = 4 times faster and soo...

base = 2000 --base storage. All storages will depend of this number

base1 = 2100 --base storage.

storages = {

petMag = base,

petUid = base+1,

petExha = base+2,

petDamage = base+3,

petManaSpent = base+4,

petIsOnline = base+5,

petMana = base+6,

petIsHealing = base+7,

petCap = base+8

}

 

petItems = {}

petItems1 = {}

maxItems = 100 --Max items the pet can carry

for i = 1, maxItems do

petItems = base+8+i

petItems1 = base1+8+i

end

--Pets, dependiong on the level male

pets = {{level = 100, name = "pet orc leader"},

{level = 60, name = "pet orc berserker"},

{level = 50, name = "pet valkyrie"},

{level = 40, name = "pet orc spearman"},

{level = 30, name = "pet minotaur"},

{level = 20, name = "pet orc"},

{level = 10, name = "pet cave rat"},

{level = 0, name = "pet Rat"}

}

 

 

--Pets, dependiong on the level female

petsf = {{level = 100, name = "panda"},

{level = 60, name = "bear"},

{level = 50, name = "rabbit"},

{level = 40, name = "dog"},

{level = 30, name = "cat"},

{level = 20, name = "deer"},

{level = 10, name = "parrot"},

{level = 0, name = "butterfly"}

}

--attacks of the pet. !petattack "param

--It's pretty easy how to config, I think it doesn't need an extra explanation.

attacks = {{param = "energy", offensive = 1, needLevel = 1000, self = 0, needMag = 10, manaSpent = 60, exhausted = 1, range = 6, combatType = COMBAT_ENERGYDAMAGE, combatAni = CONST_ME_ENERGYAREA, area = 2,

formula = {maxb = 0.4, maxa = 30, minb = 0.5, mina = 0},

},

{param = "exori", offensive = 1, needLevel = 1000, self = 0, needMag = 5, manaSpent = 145, exhausted = 1, range = 0, combatType = COMBAT_PHYSICALDAMAGE, combatAni = CONST_ME_HITAREA, area = 2,

formula = {maxb = 0.6, maxa = 30, minb = 1.2, mina = 0},

},

{param = "fireball", offensive = 1, needLevel = 500, self = 0, needMag = 15, manaSpent = 100, exhausted = 1, range = 3, combatType = COMBAT_FIREDAMAGE, combatAni = CONST_ME_FIREAREA, area = 6,

formula = {maxb = 0.6, maxa = 30, minb = 1.2, mina = 0}

},

{param = "mini energy", offensive = 1, needLevel = 10, self = 0, needMag = 0, manaSpent = 20, exhausted = 1, range = 1, combatType = COMBAT_ENERGYDAMAGE, combatAni = CONST_ME_ENERGYAREA, area = 1,

formula = {maxb = 0.13, maxa = 0, minb = 0.262, mina = 0}

},

{param = "health", offensive = -1, needLevel = 10, self = 1, needMag = 0, manaSpent = 100, exhausted = 2, range = 0, combatType = COMBAT_HEALING, combatAni = CONST_ME_MAGIC_BLUE, area = 1,

formula = {maxb = 0.4, maxa = 20, minb = 0.7, mina = 0}

}

}

function addMana(a)

local cid = a.cid

local petManaMax = getPlayerLevel(cid)*manaGainPerLevel

if getPlayerStorageValue(cid, storages.petMana) < petManaMax then

if petManaMax - getPlayerStorageValue(cid, storages.petMana) < 10 then

setPlayerStorageValue(cid, storages.petMana, getPlayerStorageValue(cid, storages.petMana) + petManaMax - getPlayerStorageValue(cid, storages.petMana))

else

setPlayerStorageValue(cid, storages.petMana, getPlayerStorageValue(cid, storages.petMana) + 10)

end

addEvent(addMana, manaGainTicks, {cid = cid})

else

setPlayerStorageValue(cid, storages.petIsHealing, 0)

end

end

Link para o comentário
https://xtibia.com/forum/topic/118255-erro-script-pet-line-73/
Compartilhar em outros sites

oia o erro q da no console e essi aki

 

[12/08/2009 23:57:22] Lua Script Error: [TalkAction Interface]

[12/08/2009 23:57:22] data/talkactions/scripts/pet/!pet.lua:onSay

 

[12/08/2009 23:57:22] luaGetCreatureMaxHealth(). Creature not found

 

[12/08/2009 23:57:22] Lua Script Error: [TalkAction Interface]

[12/08/2009 23:57:22] data/talkactions/scripts/pet/!pet.lua:onSay

 

[12/08/2009 23:57:22] luaDoCreatureSay(). Creature not found

 

[12/08/2009 23:57:22] Lua Script Error: [TalkAction Interface]

[12/08/2009 23:57:22] data/talkactions/scripts/pet/!pet.lua:onSay

 

[12/08/2009 23:57:22] luaGetCreaturePosition(). Creature not found

 

[12/08/2009 23:57:22] Lua Script Error: [TalkAction Interface]

[12/08/2009 23:57:22] data/talkactions/scripts/pet/!pet.lua:onSay

 

[12/08/2009 23:57:22] attempt to index a boolean value

[12/08/2009 23:57:22] stack traceback:

[12/08/2009 23:57:22] [C]: in function 'doSendMagicEffect'

[12/08/2009 23:57:22] data/talkactions/scripts/pet/!pet.lua:76: in function <data/talkactions/scripts/pet/!pet.lua:15>

Link para o comentário
https://xtibia.com/forum/topic/118255-erro-script-pet-line-73/#findComment-777597
Compartilhar em outros sites

[17/08/2009 19:02:18] Lua Script Error: [TalkAction Interface]

[17/08/2009 19:02:18] data/talkactions/scripts/sharingam/pet/!pet.lua:onSay

 

[17/08/2009 19:02:18] luaGetCreatureMaxHealth(). Creature not found

 

[17/08/2009 19:02:18] Lua Script Error: [TalkAction Interface]

[17/08/2009 19:02:18] data/talkactions/scripts/sharingam/pet/!pet.lua:onSay

 

[17/08/2009 19:02:18] luaGetCreatureHealth(). Creature not found

 

[17/08/2009 19:02:18] Lua Script Error: [TalkAction Interface]

[17/08/2009 19:02:18] data/talkactions/scripts/sharingam/pet/!pet.lua:onSay

 

[17/08/2009 19:02:18] data/talkactions/scripts/sharingam/pet/!pet.lua:73: attempt to perform arithmetic on a boolean value

[17/08/2009 19:02:18] stack traceback:

[17/08/2009 19:02:18] data/talkactions/scripts/sharingam/pet/!pet.lua:73: in function <data/talkactions/scripts/sharingam/pet/!pet.lua:15>

[17/08/2009 19:02:35] Warlock Gfb has logged in.

 

 

o erro q ta dando e esse ae /\ alguem ajuda?

Link para o comentário
https://xtibia.com/forum/topic/118255-erro-script-pet-line-73/#findComment-780082
Compartilhar em outros sites

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