Ir para conteúdo
  • Cadastre-se

Derivado Um erro no mosnter "pokemon"


Posts Recomendados

Olá boa noite ou dia.  Tenho alguns pokes com um defeito. Eles não recebem dano dos ataques em áreas até serem targetig-zados existe isso kkk . Bom dps que aponta o targeting, ele recebe o dano, mas para de receber ao chegar em 1 de life e n morre. Independente de eu atacar ou não, só o fato de o pokemon nativo estar me targetando ele dá o ERRO ABAIXO: (vale ressaltar que eu o invoquei no /m ja q n tem no mapa ) Agradeço se me ajudarem :439b7e504f558bbb4e25f740432f9be3:;D

 

 

 

Spoiler

ERRO sdfsedrg.thumb.PNG.6c72e52a1b2e5300c98a45c21d97f397.PNG

 

 

Script de um poke com erro 

 

Spoiler

 


<?xml version="1.0" encoding="UTF-8"?>
<monster name="Lucario" nameDescription="a Kirlia " race="ghost" experience="1100" speed="217" manacost="0">
    <health now="130" max="130"/>
    <look type="1797" head="65" body="90" legs="95" feet="113" corpse="14772"/>
    <targetchange interval="2000" chance="0"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="1"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="1"/>
        <flag convinceable="1"/>
        <flag pushable="1"/>
        <flag canpushitems="0"/>
        <flag canpushcreatures="0"/>
        <flag targetdistance="1"/>
        <flag staticattack="97"/>
        <flag runonhealth="0"/>
       
    </flags>
    <attacks>
	 <attack name="melee" interval="2000" chance="100" range="1" min="-50" max="-100"/>
    </attacks>
    <defenses armor="0" defense="0"/>
    <voices interval="5000" chance="10">
        <voice sentence="Lucario!"/>
    </voices>
    <loot>
    </loot>
    <script>
        <event name="Spawn"/>
    </script>
</monster>

 

 

Script do local apontado 

 

Spoiler

 


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 v1.6
local cannotkill = {BURNEDDAMAGE, POISONEDDAMAGE}

function onStatsChange(cid, attacker, type, combat, value)
if isWatchingTv(cid) then return false end -- TV Block
--------------------- healarea ---------------------
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
	if isWild(cid) and isWild(attacker) then -- monstros se curarem
	return true 
	end
return true
end
--------------------- healarea ---------------------
if isSleeping(attacker) then return false end
if isPlayer(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then return false end
if getPlayerStorageValue(cid, 9658783) == 1 then return false end
if combat == FLYSYSTEMDAMAGE then return false end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV
if (isPlayer(cid) and #getCreatureSummons(cid) >= 1 and not getTileInfo(getThingPos(getCreatureSummons(cid)[1])).protection) or isPlayer(attacker) then return false end -- seguranca do player nao atacar
if isGod(cid)  then return false end -- god nao morrer o.O
if isWild(cid) and isWild(attacker) then return false end -- monstro nao atacar monstro, mas deixar pokemons do shared team baterem
if getTileInfo(getThingPos(cid)).protection then return false end
-- duel system e outros
if isSummon(cid) and isSummon(attacker) then
	local p1, p2 = getCreatureMaster(cid), getCreatureMaster(attacker)
	if not CanAttackerInDuel(p1, p2) then
	   return false
	end
end
if isSummon(attacker) and isPlayer(cid) then
	return false -- quandotiver pvp colocar storage do pvp aqui
end

if not (isCreature(attacker)) then return true end
local raceCombat = typeTable[getElementByCombat(combat)] 
local spellNameFromAttacker = getPlayerStorageValue(attacker, 21102)

	-- player morte e ataques
	if isPlayer(cid) and (#getCreatureSummons(cid) <= 0 or #getCreatureSummons(cid) >= 1 and getTileInfo(getThingPos(getCreatureSummons(cid)[1])).protection) then
	
		local color = 180
		if (combat == 128 or combat == 1) and spellNameFromAttacker == -1  then
			value = -(getOffense(attacker) * 100)
		else
			if not typeTable[getMoveType(getCreatureName(attacker), spellNameFromAttacker)] then
				color = 180
			else
			    color = typeTable[getMoveType(getCreatureName(attacker), spellNameFromAttacker)].color or 180
			end
		end


		if value >= getCreatureHealth(cid) then
			value = getCreatureHealth(cid)
		end
		
		value = math.ceil(value)
	
	   if (value*-1) >= getCreatureHealth(cid) then
		  doKillPlayer(cid, attacker, (value*-1))
		  return false
	   end
	   doSendAnimatedText(getThingPosWithDebug(cid), (value * -1), color) 
	   doCreatureAddHealth(cid, value)
	   setPlayerStorageValue(attacker, 21102, -1) -- reseta a spellName do pokemon atacante
	   return false
	end
	-- player morte e ataques


if not isPlayer(cid) then
-- valores do atacante


	if isPokePassive(cid) and isSummon(attacker) then
	   doSetPokemonAgressiveToPlayer(cid, getCreatureMaster(attacker))
	end
	
	local myName = doCorrectString(getCreatureName(cid))
	if isInArray(specialabilities["evasion"], myName) and isSummon(cid) then 
	   local target = cid
	   if getCreatureTarget(getCreatureMaster(cid)) == attacker then 
		   if math.random(1, 100) <= passivesChances["Evasion"][myName] then                                                                                      
			  if isCreature(attacker) then  --alterado v1.6 
				 doSendMagicEffect(getThingPosWithDebug(target), 211)
				 doSendAnimatedText(getThingPosWithDebug(target), "TOO BAD", 215)                                 
				 doTeleportThing(target, getClosestFreeTile(target, getThingPosWithDebug(attacker)), false)
				 doSendMagicEffect(getThingPosWithDebug(target), 211)
				 doFaceCreature(target, getThingPosWithDebug(attacker)) 
				 return false    
			  end
			end   
		end
	end

	---- cor do dano
	
		--[[if (combat == 128 or combat == 1) and spellNameFromAttacker == -1  then
			
		else
			raceCombat = typeTable[getMoveType(getCreatureName(attacker), spellNameFromAttacker)]
		end]] -- alterado
		
		raceCombat = typeTable[getPokemonType(attacker).type1]
	
	---- cor do dano
	local critical, criticalValue = false, 0
	local returnDamage = false

	------------- Helds 
	if isSummon(cid) then
		local heldx = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "xHeldItem")
		if heldx then
		local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
		
			  if heldName == "X-Block" and isSummon(cid) then 	     -- bloquear alguns ataques
				local chance = heldBlockChance[tonumber(heldTier)]
				if (math.random(1, 100) <= chance) then
					doSendAnimatedText(getThingPos(cid), "BLOCKED", 215)
				end
			  end
			  
			  if heldName == "X-Return" and isSummon(cid) then 	     -- bloquear alguns ataques
				local chance = heldReturn[tonumber(heldTier)]
				if (math.random(1, 100) <= chance) then
					returnDamage = true
					returnDamageValue = heldReturn[tonumber(heldTier)]
				end
			  end
			  
		end
	end
	
	if isSummon(attacker) then
		local heldx = getItemAttribute(getPlayerSlotItem(getCreatureMaster(attacker), 8).uid, "xHeldItem")
		if heldx then
		local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
		
			  if heldName == "X-Critical" then -- dar critico nos ataques
				local chance = heldCriticalChance[tonumber(heldTier)]
				if (math.random(1, 100) <= chance) then
					critical = true
					criticalValue = math.random(50, 100)
				end
			  end
			  
		end
	end
	------------- Helds 
	
	if isReflect(attacker) then
		local valueReflected = getPlayerStorageValue(attacker, 21105)
		if valueReflected > 0 then
		   removeReflect(attacker)
		   value = valueReflected
		   doCreatureAddHealth(cid, -math.floor(value))
		   doSendAnimatedText(getThingPos(cid), (value == 0 and "" or value), COLOR_GRASS)
		   if isSummon(cid) then doSendLifePokeToOTC(getCreatureMaster(cid)) end
		    if value >= getCreatureHealth(cid) then
				if isSummon(cid) then
					if isInDuel(getCreatureMaster(cid)) then
					   doRemoveCountPokemon(getCreatureMaster(cid))
					end
				end
			doKillWildPoke(attacker, cid)
			return false
			end
		   return false
		end
	end
	
	------------------------------------POTIONS-------------------------------------------
		if isSummon(cid) then
		   if getPlayerStorageValue(cid, 173) >= 1 then
			 setPlayerStorageValue(cid, 173, -1)  --alterado v1.6
			 doSendAnimatedText(getThingPos(cid), "LOST HEAL", 144)
		   end
		end
		
	local boost_def, boost_attk = (0.7 * getPokemonBoost(cid)) / 100, (0.5 * getPokemonBoost(attacker)) / 100
	
	if(combat == 128 or combat == 1) and spellNameFromAttacker == -1 then -- ataque basico
	   doSendMagicEffect(getThingPos(cid), 3)
	   value = getEffectvineCombat(cid, attacker, value)
		if value == 0 then 
		   return false
		else
		   value = value * getOffense(attacker) -- buff ataque system 
		   local name = doCorrectString(getCreatureName(attacker))
		   if pokes[name] and pokes[name].level <= 5 and value ~= 0 then 
			  value = -math.random(pokes[name].offense, pokes[name].offense+5)
		   end
		end
	else -- magia
	   value = getEffectvineSpell(attacker, spellNameFromAttacker, value, cid) -- checagem de efetividades de magia
	   if value == 0 then 
		   return false
		else
		   value = value * (1 + getSpecialAttack(attacker) / 100)
		end
	end	
	
		if spellNameFromAttacker ~= -1 and value == 0 then value = -doForceDanoSpeel(attacker, spellNameFromAttacker) end
		if value == 0 then value = -getEffectvineCombat(cid, attacker, getOffense(attacker)) end -- rever isto.. colocar dano base do xml
	
		value = value - (value * (getDefense(cid) / 100)) -- buff deff system, defendendo por %
		
		-------- boost system
		value = (value) + (boost_def * (value * -1))
		value = (value - getMasterLevel(attacker)) - (boost_attk * (value * -1))
		-------- boost system
		
		value = math.ceil(value * -1)
		if value >= getCreatureHealth(cid) then value = getCreatureHealth(cid) end
		
		if value < 0 then 
		   value = value * -1
		end
		
	
		-------- xp por dano
		if isSummon(attacker) and not isSummon(cid) then
			addPlayerDano(cid, getCreatureMaster(attacker), value)
		end
		-------- xp por dano
		
		if critical then -- X-Critical system
		    value = value * 2 + criticalValue	
		    doSendAnimatedText(getThingPos(cid), (value == 0 and "" or value) .. "K", COLOR_BURN)
		else
			doSendAnimatedText(getThingPos(cid), (value == 0 and "" or value), raceCombat.color)
		end
		
		if returnDamage then
			local valueToReturn = math.ceil(value * (returnDamageValue / 100))
			if valueToReturn > getCreatureHealth(attacker) then 
				valueToReturn = getCreatureHealth(attacker) -1
			end
			
			if valueToReturn > 1 then
				value = value - valueToReturn
				doSendAnimatedText(getThingPos(attacker), (valueToReturn == 0 and "" or valueToReturn), 31)
				doSendMagicEffect(getThingPos(attacker), 3)
				doCreatureAddHealth(attacker, -valueToReturn)
			end
		end
		
		local spellName = getPlayerStorageValue(attacker, 21102)
		setPlayerStorageValue(attacker, 21102, -1) -- reseta a spellName do pokemon atacante
		
		if(isReflect(cid))then -- reflect system igual GBA
		   if spellName ~= -1 then 
			   if not isInArray({"Team Claw", "Team Slice"}, spellName) then
				  doSendMagicEffect(getThingPosWithDebug(cid), 135)
				  doSendAnimatedText(getThingPosWithDebug(cid), "REFLECT", COLOR_GRASS)
				  addEvent(docastspell, 100, cid, spellName)
				  if getCreatureName(cid) == "Wobbuffet" then
					 doRemoveCondition(cid, CONDITION_OUTFIT)    
				  end
				  setPlayerStorageValue(cid, 21099, -1)                    --alterado v1.6
				  setPlayerStorageValue(cid, 21100, 1)
				  setPlayerStorageValue(cid, 21101, attacker)
				  setPlayerStorageValue(cid, 21103, getTableMove(attacker, spellName).f)
				  setPlayerStorageValue(cid, 21104, getCreatureOutfit(attacker).lookType)
				  setPlayerStorageValue(cid, 21105, value)
				  if spellName == "Rollout" then
					 doRolloutReflected(cid, doCorrectString(getCreatureName(attacker)))
				  end
				  return false
			   end
			end
        end 
		
		if getCreatureName(cid) == "Kangaskhan" and math.random(1, 100) < 25 and isMega(cid) then
		   docastspell(cid, "Groundshock", 0, 0)
		end
			
	if value >= getCreatureHealth(cid) then
		if isSummon(cid) then
			if isInArray({"Aggron", "Sudowoodo", "Mega Aggron"}, getCreatureName(cid)) then
			   doCreatureAddHealth(cid, -(getCreatureHealth(cid)-1))
			   docastspell(cid, "Sturdy", 0, 0)
			   if isSummon(cid) then doSendLifePokeToOTC(getCreatureMaster(cid)) end
			   return false
			end
		end
		doKillWildPoke(attacker, cid)
		return false
	end
	    --------------Passiva Lifesteal Clobat------------
		  if isInArray({"crobat", "shiny crobat"}, getCreatureName(attacker):lower())and (combat == 128 or combat == 1) and spellNameFromAttacker == -1 then                    
		    doCreatureAddHealth(attacker, math.floor(value))
		    doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(value), 30)
	      end
	    --------------------------------------------
	doCreatureAddHealth(cid, -value)
	doCastPassive(cid)
	
	if not isSummon(cid) and not isMega(cid) then -- virar mega
	   checkChenceToMega(cid)
	end
	
	if isSummon(cid) then
		-- otclient life
		doSendLifePokeToOTC(getCreatureMaster(cid))
		-- otclient life
	end
end	

	return false
end

function getMasterLevel(cid)
	if isSummon(cid) then
	   return getPlayerLevel(getCreatureMaster(cid))
	end
	return 0
end

 

 

Editado por ruanvioto (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo