Ir para conteúdo

Featured Replies

Postado

ae clan, to com os seguintes erros no tfs com o pokedeath:

 


[26/02/2018 20:33:41] [Error - CreatureScript Interface]
[26/02/2018 20:33:41] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[26/02/2018 20:33:41] Description:
[26/02/2018 20:33:41] (luaDoAddContainerItem) Container not found

 

e esse aqui no statschange:

 

[26/02/2018 20:48:31] [Error - CreatureScript Interface]
[26/02/2018 20:48:31] In a timer event called from:
[26/02/2018 20:48:31] data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
[26/02/2018 20:48:31] Description:
[26/02/2018 20:48:31] (luaDoAddCondition) Creature not found

 

 

 

pokedeath.lua:

 

Spoiler

function matou(cid, target)
if isSummon(target) and isPlayer(getCreatureMaster(target)) then
 
	doPlayerSendCancel(getCreatureMaster(target), '12//,hide') --alterado v1.7
	doUpdateMoves(getCreatureMaster(target))
	doKillPlayerPokemon(target)
	doRemoveCreature(target)
	doSendPlayerExtendedOpcode(cid, opcodes.OPCODE_POKEMON_HEALTH, "0|0")
	
elseif isWild(target) then

if getPlayerStorageValue(target, 637500) >= 1 then -- sherdder team
	doRemoveCreature(target)
	return true
end


local nameDeath = doCorrectString(getCreatureName(target))
local pos = getThingPos(target)
local corpseID = getPokemonCorpse(nameDeath)
local corpse = doCreateItem(corpseID, 1, pos) 

	if isSummon(cid) then
		checkDirias(cid, nameDeath)
    end	   
	  doItemSetAttribute(corpse, "pokeName", "fainted " .. nameDeath:lower())
      doDecayItem(corpse)
	  local name = getCreatureName(getCreatureMaster(cid))
	  doCorpseAddLoot(getCreatureName(target), corpse, getCreatureMaster(cid), target)
      doRemoveCreature(target)
	 
end 

return false
end

local stoneEffect = {
	  ["fire stone"] = 405,
	  ["water stone"] = 406,
	  ["leaf stone"] = 407,
	  ["heart stone"] = 408,
	  ["thunder stone"] = 272,
	  ["venom stone"] = 273,
	  ["enigma stone"] = 274,
	  ["rock stone"] = 275,
	  ["earth stone"] = 276,
	  ["ice stone"] = 277,
	  ["darkness stone"] = 278,
	  ["punch stone"] = 279,
	  ["coccon stone"] = 280,
	  ["metal stone"] = 281,
	  ["ancient stone"] = 282,
	  ["crystal stone"] = 283,
	  ["dragon scale"] = 284,
	  ["mighty token"] = 378,
}

function doCorpseAddLoot(name, item, cid, target) -- essa func jรก vai ajudar em um held, luck.
if cid == target then 
doItemSetAttribute(item, "corpseowner", "asçdlkasçldkaçslkdçaskdçaslkdçlsakdçkaslç")
return true 
end -- selfdestruct
local lootList = getMonsterLootList(name)
local isStoneDroped = false
name = doCorrectString(name)
local pokeName = name
local str, vir = "Loot from " .. name .. ": ", 0
local megaID, megaName = "", ""
local lootListNow = {}
	if isMega(target) then
		  if name == "Charizard" then
			 megaID = getPlayerStorageValue(target, storages.isMegaID)
		  end
		megaName = "Mega " .. name .. (megaID ~= "" and " " .. megaID or "")
	    str = "Loot from " .. megaName .. ": "
	    pokeName = megaName
	    local t = {id = megasConf[megaName].itemToDrop, count = 1, chance = 0.1}
	     table.insert(lootList, t)
	end
    local countVirg = 0
	for i, _ in pairs(lootList) do
	    countVirg = countVirg + 1
	    local id, count, chance = lootList[i].id, lootList[i].count, lootList[i].chance * 1
		local tienelucky =0
		local MaxChanceLucky=0
		---- X-Lucky
		local heldx = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "xHeldItem")
			if heldx then
			local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
				  if heldName == "X-Lucky" then -- dar mais loot
					tienelucky=1
					 MaxChanceLucky =  heldLucky[tonumber(heldTier)]
				  end
			end
		---- X-Lucky
		

		local percent, lootCount = math.random(0.1, 100.9), math.random(1, count)
		
		if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then
		 if  getPlayerStorageValue(cid, 123456) == 1 then
		percent = math.random(0.1, 10000.9)
		else
		 percent = math.random(0.1, 9000.9)
		 end
	end
		if (percent <= chance) then
			if isStone(id) then
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     posCorpse.x = posCorpse.x +1
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			if  id == 15644 then ----mighty token
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			posCorpse.x = posCorpse.x +1
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			
			if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then  -----mega stone
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				posCorpse.x = posCorpse.x +2
			   posCorpse.y = posCorpse.y +2  
			   doSendMagicEffect(posCorpse, 391)
				doBroadcastMessage(""..getCreatureName(cid).." dropped a "..getItemNameById(id).."!!")
			posCorpse.x = posCorpse.x -1
			   posCorpse.y = posCorpse.y -1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
		     doAddContainerItem(item, id, lootCount)
			 table.insert(lootListNow, getItemNameById(id) .. " (" .. lootCount .. ")")
			 else -- ENTRA EL LUCKY AQUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
			 if tienelucky == 1 then
			 percent = math.random(0.1, MaxChanceLucky)
			 if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then
		 if  getPlayerStorageValue(cid, 123456) == 1 then
		percent = math.random(0.1, 100000.9)
		else
		 percent = math.random(0.1, 90000.9)
		 end
	end
		if (percent <= chance) then
			if isStone(id) then
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     posCorpse.x = posCorpse.x +1
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			if  id == 15644 then ----mighty token
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			posCorpse.x = posCorpse.x +1
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			
			if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then  -----mega stone
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				posCorpse.x = posCorpse.x +2
			   posCorpse.y = posCorpse.y +2  
			   doSendMagicEffect(posCorpse, 391)
				doBroadcastMessage(""..getCreatureName(cid).." dropped a: "..getItemNameById(id).."!!")
			posCorpse.x = posCorpse.x -1
			   posCorpse.y = posCorpse.y -1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
		     doAddContainerItem(item, id, lootCount)
			 table.insert(lootListNow, getItemNameById(id) .. " (" .. lootCount .. "): Lucky bonus")
			 end
			 -- SAÑE EL LUCKY AQUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		end
	end
	end
	for i = 1, #lootListNow do
		str = str .. lootListNow[i] .. (tonumber(i) == tonumber(#lootListNow) and "." or ", ")
	end
	if getExpByMoreDano(target) == true then
		return true
	end
	local players = string.explode(getExpByMoreDano(target), "|")
	local xp, newXP = getPokemonExperienceD(name), xp
	local maiorPercent = 0
	local playerWinner = ""
			if players ~= nil then
				for i = 1, #players do
				local name = string.explode(players[i], "/")[1]
				local percent = tonumber(string.explode(players[i], "/")[2])
					  if percent > maiorPercent then
					     playerWinner = name
						 maiorPercent = percent
					  end
					  if #players == 1 then -- caso so um player matou o bixo
					     percent = 100
					  end
					  local heldExp = 1
					  local player = getPlayerByName(name)
							local heldx = getItemAttribute(getPlayerSlotItem(player, 8).uid, "xHeldItem")
							if heldx then
							local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
								  if heldName == "X-Experience" then -- dar mais experiencia
									 heldExp = heldExperience[tonumber(heldTier)]
								  end
							end
					  playerAddExp(player,  math.ceil(percent * xp / 100) * heldExp)
				end
			end
		  local pWinnerLoot = getPlayerByName(playerWinner)	
		  if isCreature(pWinnerLoot) then
		     doItemSetAttribute(item, "corpseowner", playerWinner)
			 local loot =  str .. (str == "Loot from ".. name .. ": " and "Nothing." or "")
		     doPlayerSendTextMessage(pWinnerLoot, MESSAGE_INFO_DESCR, loot)
			 doSendMsgInParty(cid, loot)
			 if isStoneDroped then
			    doSendMagicEffect(getThingPos(pWinnerLoot), 173, pWinnerLoot)
				--- adicionar efeito em cima do loot
			 end
		  end
end


function playerAddExp(cid, exp)
local vip = 0.25
local color = 215
local tets = ""

if  getPlayerStorageValue(cid, 123457) == 1 then
vip = 0.30
color = 89
tets = " (Event)"
end

if  getPlayerStorageValue(cid, 123456) == 1 then
vip = 0.50
color = 210
tets = " (vip)"
end


if not isCreature(cid) then return true end
exp = exp * vip;
	if isInPartyAndSharedExperience(cid) then
		local partyPlayers = getPartyMembers(getPlayerParty(cid))
		local partyExp = math.ceil(exp / #partyPlayers)
			  for i = 1, #partyPlayers do
				 if isPlayer(partyPlayers[i]) then
				 	if getPlayerLevel(cid) <= 50 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 180))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 180) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 51 and getPlayerLevel(partyPlayers[i]) <= 100 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 120))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 120) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 101 and getPlayerLevel(partyPlayers[i]) <= 160 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 80))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 80) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 151 and getPlayerLevel(partyPlayers[i]) <= 200 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 50))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 50) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 201 and getPlayerLevel(partyPlayers[i]) <= 250 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 30))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 30) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 251 and getPlayerLevel(partyPlayers[i]) <= 300 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 15))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 15) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 301 and getPlayerLevel(partyPlayers[i]) <= 309 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 3))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 3) .. tets, color)
elseif getPlayerLevel(partyPlayers[i]) >= 310 and getPlayerLevel(partyPlayers[i]) <= 349 then
	doPlayerAddExp(partyPlayers[i], ( partyExp * 1))
	doSendAnimatedText(getThingPos(partyPlayers[i]), ( partyExp * 1) .. tets, color)
 end
 
local poke = getCreatureSummons(partyPlayers[i])[1] 


	

 
				 end
			  end
		return true
	end

	
 if getPlayerLevel(cid) <= 50 then
  doPlayerAddExp(cid, math.floor(500 * exp))
  doSendAnimatedText(getThingPos(cid), exp * 500, 215)
 elseif getPlayerLevel(cid) >= 51 and getPlayerLevel(cid) <= 75 then
  doPlayerAddExp(cid, math.floor(250 * exp))
  doSendAnimatedText(getThingPos(cid), exp * 250, 215)
 elseif getPlayerLevel(cid) >= 76 and getPlayerLevel(cid) <= 100 then
  doPlayerAddExp(cid, math.floor(125 * exp))
  doSendAnimatedText(getThingPos(cid), exp * 125, 215)
 elseif getPlayerLevel(cid) >= 101 and getPlayerLevel(cid) <= 150 then
  doPlayerAddExp(cid, math.floor(100 * exp))
  doSendAnimatedText(getThingPos(cid), exp * 100, 215)
 elseif getPlayerLevel(cid) >= 151 and getPlayerLevel(cid) <= 200 then
  doPlayerAddExp(cid, math.floor(50 * exp))
  doSendAnimatedText(getThingPos(cid), exp * 50, 215)
 elseif getPlayerLevel(cid) >= 201 and getPlayerLevel(cid) <= 250 then
  doPlayerAddExp(cid, math.floor(25 *exp))
     doSendAnimatedText(getThingPos(cid), exp * 25, 215)
 elseif getPlayerLevel(cid) >= 251 and getPlayerLevel(cid) <= 300 then
  doPlayerAddExp(cid, math.floor(5 *exp))
     doSendAnimatedText(getThingPos(cid), exp * 5, 215)
 elseif getPlayerLevel(cid) >= 301 then
  doPlayerAddExp(cid, math.floor(1 *exp))
     doSendAnimatedText(getThingPos(cid), exp * 1, 215)
    end 
    end 



function doSendMsgInParty(cid, loot)
	if isInPartyAndSharedExperience(cid) then
		local partyPlayers = getPartyMembers(getPlayerParty(cid))
			  for i = 1, #partyPlayers do
				 if isPlayer(partyPlayers[i]) then
					doSendMsgToPartyChannel(partyPlayers[i], loot)
				 end
			  end
		return true
	end
end

function checkDirias(cid, nameDeath)

	    local master = getCreatureMaster(cid)
		local getNpcTaskName = getPlayerStorageValue(master, storages.miniQuests.storNpcTaskName)
		local pokeTask1 = getPlayerStorageValue(master, storages.miniQuests.storPokeNameTask1)
		local pokeCountTask1 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask1))
		
	   if pokeTask1 ~= -1 and pokeTask1 == nameDeath then
		  setPlayerStorageValue(master, storages.miniQuests.storPokeCountTask1, pokeCountTask1 -1) 
		  local getCountNow = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask1))
		  if getCountNow >= 1 then
		     doSendMsg(master, getNpcTaskName .. ": Left " .. getCountNow .. " " .. nameDeath .. (getCountNow > 1 and "s" or "") .. ".")
		  else
		     doSendMsg(master, getNpcTaskName .. ": You completed my task.")
		  end
	   end
	   
	    local getNpcTaskName2 = getPlayerStorageValue(master, storages.miniQuests.storNpcTaskName2)
		local pokeTask2 = getPlayerStorageValue(master, storages.miniQuests.storPokeNameTask2)
		local pokeCountTask2 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask2))
		
	   if pokeTask2 ~= -1 and pokeTask2 == nameDeath then
		  setPlayerStorageValue(master, storages.miniQuests.storPokeCountTask2, pokeCountTask2 -1) 
		  local getCountNow2 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask2))
		  if getCountNow2 >= 1 then
		     doSendMsg(master, getNpcTaskName2 .. ": Left " .. getCountNow2 .. " " .. nameDeath .. (getCountNow2 > 1 and "s" or "") .. ".")
		  else
		     doSendMsg(master, getNpcTaskName2 .. ":  You completed my task.")
		  end
	   end
	   
	   local getNpcTaskName3 = getPlayerStorageValue(master, storages.miniQuests.storNpcTaskName3)
	   local pokeTask3 = getPlayerStorageValue(master, storages.miniQuests.storPokeNameTask3)
	   local pokeCountTask3 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask3))
		
	   if pokeTask3 ~= -1 and pokeTask3 == nameDeath then
		  setPlayerStorageValue(master, storages.miniQuests.storPokeCountTask3, pokeCountTask3 -1) 
		  local getCountNow3 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask3))
		  if getCountNow3 >= 1 then
		     doSendMsg(master, getNpcTaskName3 .. ": Left " .. getCountNow3 .. " " .. nameDeath .. (getCountNow3 > 1 and "s" or "") .. ".")
		  else
		     doSendMsg(master, getNpcTaskName3 .. ": You completed my task.")
		  end
	   end
	   
	   local getNpcTaskName4 = getPlayerStorageValue(master, storages.miniQuests.storNpcTaskName4)
	   local pokeTask4 = getPlayerStorageValue(master, storages.miniQuests.storPokeNameTask4)
	   local pokeCountTask4 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask4))
		
	   if pokeTask4 ~= -1 and pokeTask4 == nameDeath then
		  setPlayerStorageValue(master, storages.miniQuests.storPokeCountTask4, pokeCountTask4 -1) 
		  local getCountNow4 = tonumber(getPlayerStorageValue(master, storages.miniQuests.storPokeCountTask4))
		  if getCountNow4 >= 1 then
		     doSendMsg(master, getNpcTaskName4 .. ": Left " .. getCountNow4 .. " " .. nameDeath .. (getCountNow4 > 1 and "s" or "") .. ".")
		  else
		     doSendMsg(master, getNpcTaskName4 .. ": You completed my task.")
		  end
	   end
end

 

 

statschange.lua:

 

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 getPlayerStorageValue(cid, 9658783) == 1 then return false end
if getPlayerStorageValue(cid, 898999) == 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 CanAttackerInFree(p1, p2) then
	
	else
	if not CanAttackerInDuel(p1, p2) then
	   return false
	end
 end
end


if isSummon(attacker) and isPlayer(cid) and getPlayerStorageValue(getCreatureMaster(attacker), 321321)  <= 0 then
	return false -- quandotiver pvp colocar storage do pvp aqui
end

if not (isCreature(attacker)) then return true end

local spellNameFromAttacker = getPlayerStorageValue(attacker, 21112)
local nombredelpoke = getCreatureName(attacker)

if isMega(attacker) then
	nombredelpoke= "Mega "..getCreatureName(attacker)..""
	if getMegaID(cid) == "X" then
		nombredelpoke = nombredelpoke.." X"
	end
	if getMegaID(cid) == "Y" then
		nombredelpoke = nombredelpoke.." Y"
	end
end

local raceCombat = typeTable[getMoveType(nombredelpoke, spellNameFromAttacker)] 

	-- 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
	-- local asdasd = typeTable[getMoveType(getCreatureName(attacker), spellNameFromAttacker)] 
	-- raceCombat = typeTable[getMoveType(getCreatureName(attacker), spellNameFromAttacker)] 
	
		if raceCombat then
			
		else
			asdasd = typeTable[getPokemonType(attacker).type1]
			raceCombat = asdasd
		end
		
	
	---- 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)
					value = 0
				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(cid) then
		
		if not getCreatureMaster(cid) then return false end
		
		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-Elemental" then -- do elemental
				local chance = heldElemental[tonumber(heldTier)]
				if (math.random(1, 100) <= chance) then
					local elemento = getPokemonType(cid).type1
					doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "xelemental", elemento)
					docastspell(cid, "X Elemental")
				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))
		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 ) - (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) < 20 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

 

 

  • 5 years later...
Postado

Desculpa reviver, não sei se tem problema. 

luaDoAddContainerItem é só você ir no Object Builder e ir no corpse do pokemon que tá dando isso. Marque a opção "Recipiente" EN: "Container". Faça isso em todos os pokemons que estão com esse problema.

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