Ir para conteúdo

Featured Replies

Postado

Olá, tô com um bug numa script de action que é daqui do fórum é essa aqui, é um pergaminho que pega um corpo no chão com o id do corpo e transforma em outro pergaminho modificado que invoca um monstro ao usar o pergaminho, deu tudo certo tirando o fato do monstro não ter aparecido... segue o erro: 

0002421.thumb.png.92d08049c2bd02a65f7ff102689ce0c8.png

Vou deixar aqui meu script como eu coloquei:

 

Vai.lua:

local mtrs = {
 
                ["[Edo Tensei] Madara"] = {hp = 50000, maxhp = 50000, corpse = 2835, chance = 100},
}
local vocs = {149, 150, 151}
local corpos = {2835}
 
function onUse(cid, item, frompos, item2, topos)
if(not(isInArray(vocs, getPlayerVocation(cid)))) then
return doPlayerSendTextMessage(cid, 26, "You cannot use this object.")
end
if(not(isInArray(corpos, item2.itemid))) then
doPlayerPopupFYI(cid, "Para usar o Edo Tensei você deve usar o pergaminho em algum corpo de um jogador.")
return true
end
                for pet_name, v in pairs(mtrs) do
                                if item2.itemid == v.corpse then
                                        if math.random(0,100) <= v.chance then
doSendMagicEffect(topos, 2)
                                                doPlayerSendTextMessage(cid, 27, "".. pet_name .. " foi selado nesse pergaminho.")
                                                doRemoveItem(item2.uid, 1)
                                                doRemoveItem(item.uid, 1)
                                                local itemcatch = doPlayerAddItem(cid, 9992, 1)
                                                doItemSetAttribute(itemcatch, "namepet", pet_name)
                                                doItemSetAttribute(itemcatch, "description", "Neste pergaminho foi selado um ".. pet_name ..".")
                                                doItemSetAttribute(itemcatch, "lifepet", v.hp)
                                                doItemSetAttribute(itemcatch, "maxlifepet", v.maxhp)
                                        else
                                                doPlayerSendTextMessage(cid, 27, "Falhou.")
                                        end
                                end
                end
                return true
end

Pega.lua:

local config = {
percent = 15, --- porcentagem do chakra que perde
}
 
function onUse(cid, item, frompos, item2, topos)
    local health = tonumber(getItemAttribute(item.uid, "lifepet"))
    local mhp = tonumber(getItemAttribute(item.uid, "maxlifepet"))
local lifedraw = math.ceil(getCreatureMaxHealth(cid) * (config.percent)/100)
local vocs = {149, 150, 151}
local msg0 = [[ Você ssó pode ter 0 summon(s), A seguinte tabela mostra os
leveis e o respectivo número de summons que um player terá
ao estar nele
 
Level <~> [summons]
 
~->50[1]
~->150[2]
~->200[2]
~->350[3]
~->450[4]
]]
 
local msg1 = [[ Você ssó pode ter 1 summon(s), A seguinte tabela mostra os
leveis e o respectivo número de summons que um player terá
ao estar nele
 
Level <~> [summons]
 
~->50[1]
~->150[2]
~->200[2]
~->350[3]
~->450[4]
]]
 
local msg2 = [[ Você ssó pode ter 2 summon(s), A seguinte tabela mostra os
leveis e o respectivo número de summons que um player terá
ao estar nele
 
Level <~> [summons]
 
~->50[1]
~->150[2]
~->200[2]
~->350[3]
~->450[4]
]]
 
local msg3 = [[ Você ssó pode ter 3 summon(s), A seguinte tabela mostra os
leveis e o respectivo número de summons que um player terá
ao estar nele
 
Level <~> [summons]
 
~->50[1]
~->150[2]
~->200[2]
~->350[3]
~->450[4]
]]
 
local msg4 = [[ Você ssó pode ter 4 summon(s), A seguinte tabela mostra os
leveis e o respectivo número de summons que um player terá
ao estar nele
 
Level <~> [summons]
 
~->50[1]
~->150[2]
~->200[2]
~->350[3]
~->450[4]
]]
 
if(not(isInArray(vocs, getPlayerVocation(cid)))) then
return doPlayerSendTextMessage(cid, 26, "You cannot use this object.")
end
 
if health <= 0 then
return doPlayerSendCancel(cid, "Esse pet esta morto.")
end
 
 
if #getCreatureSummons(cid) == 0 and getPlayerLevel(cid) <= 49 then
doPlayerPopupFYI(cid, msg0)
    return true
end
 
if #getCreatureSummons(cid) == 1 and getPlayerLevel(cid) <= 149 then
doPlayerPopupFYI(cid, msg1)
    return true
end
 
if #getCreatureSummons(cid) == 1 and getPlayerLevel(cid) <= 199 then
doPlayerPopupFYI(cid, msg1)
    return true
end
 
if #getCreatureSummons(cid) == 2 and getPlayerLevel(cid) <= 349 then
doPlayerPopupFYI(cid, msg2)
    return true
end
 
if #getCreatureSummons(cid) == 3 and getPlayerLevel(cid) <= 449 then
doPlayerPopupFYI(cid, msg3)
    return true
end
 
if #getCreatureSummons(cid) == 4 and getPlayerLevel(cid) >= 450 then
doPlayerPopupFYI(cid, msg4)
    return true
end
 
    local pet_name = getItemAttribute(item.uid, "namepet")
 
if item.itemid == 9992 then
if not getTilePzInfo(getPlayerPosition(cid)) then
if #getCreatureSummons(cid) < 1 and getPlayerLevel(cid) > 49 or #getCreatureSummons(cid) < 2 and getPlayerLevel(cid) > 149 or #getCreatureSummons(cid) < 2 and getPlayerLevel(cid) > 199 or #getCreatureSummons(cid) < 3 and getPlayerLevel(cid) > 349 or #getCreatureSummons(cid) < 4 and getPlayerLevel(cid) > 449 then
if isCreature(cid) then
if getCreatureMaxHealth(cid) then
 
local summon = doSummonCreature(pet_name, topos)
doRemoveItem(item.uid, 1)
                doConvinceCreature(cid, summon)
                setCreatureMaxHealth(summon, mhp)
                doCreatureAddHealth(summon, mhp)
                doCreatureAddHealth(summon, health - mhp)
doCreatureAddHealth(cid, -5000)
doCreatureAddMana(cid, -5103)
                doSendMagicEffect(getCreaturePosition(summon), 296)
                doCreatureSay(cid, "EDO TENSEI!", 19)
end
else
doPlayerSendCancel(cid,'Você não pode invocar uma criatura de uma zona protegida.')
end
    end
end
end
    return true
end

    <action itemid="12695" event="script" value="vai.lua"/>
    <action itemid="9992" event="script" value="pega.lua"/>

 

monstro== madara.xml:

<?xml version="1.0" encoding="UTF-8"?>
<monster name="[Edo Tensei] Madara" nameDescription="[Edo Tensei] Madara" race="blood" experience="000" speed="250" manacost="0">
	<health now="792" max="792"/>
	<look type="192" head="0" body="94" legs="79" feet="79" corpse="0"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="90" defense="20"/>
	<flags>
		<flag summonable="1"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="1"/>
		<flag pushable="0"/>
		<flag canpushitems="1"/>
		<flag canpushcreatures="1"/>
		<flag targetdistance="1"/>
		<flag staticattack="65"/>
		<flag runonhealth="0"/>
	</flags>
	<attacks>
		<attack name="melee" interval="3000" min="-30" max="-30"/>

	</attacks>
	<defenses armor="80" defense="80">
		<defense name="healing" interval="4000" chance="40" min="300" max="300">
			<attribute key="areaEffect" value="blueshimmer"/>
	</defense>
		<defense name="speed" interval="4000" chance="40" speedchange="450" duration="8000">
			<attribute key="areaEffect" value="redshimmer"/>
		</defense>
	</defenses>
	<elements>
		<element physicalPercent="20"/>
		<element icePercent="10"/>
		<element holyPercent="-15"/>
		<element deathPercent="35"/>
	</elements>
	<immunities>
		<immunity poison="1"/>
		<immunity lifedrain="1"/>
		<immunity outfit="1"/>
		<immunity drunk="1"/>
		<immunity invisible="1"/>
	</immunities>
<script>

</monster>

 

Editado por adolfbig (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo