function onUse(cid, item, fromPosition, itemEx, toPosition) local petName = "[PET] NIVEL MAXIMO" local storageValue = 83712 local playerPets = getCreatureSummons(cid) -- Verifica se o jogador já tem um pet invocado if #playerPets <= 0 then -- Se não houver pet invocado, invoca um novo local newPet = doSummonMonster(cid, petName) if newPet then setPlayerStorageValue(cid, storageValue, 1) end else -- Se houver pet invocado, verifica se é o pet correto e remove-o for _, pet in ipairs(playerPets) do if getCreatureName(pet) == petName then doRemoveCreature(pet) end end end -- Impede que o domador seja afetado pelo ataque em área registerCreatureEvent(cid, "Infriendlyfire") return true end
alem disso, adicione:
<event type="infriendlyfire" name="Infriendlyfire" event="script" value="infriendlyfire.lua"/>
e crie um .lua:
function onInfriendlyfire(cid, attacker, target) if isPlayer(attacker) and isPlayer(target) then return false -- Impede que jogadores causem dano uns aos outros end if isPlayer(attacker) and isSummon(target) then local master = getCreatureMaster(target) if master == attacker then return false -- Impede que o domador cause dano ao seu pet end end if isSummon(attacker) then local master = getCreatureMaster(attacker) if master == target then return false -- Impede que o pet cause dano ao seu domador end end return true end




info
Grupo: Artesão
Registrado: 01/03/20
Posts: 110
Reputação: +1
Gênero: Masculino
Char no Tibia: Samuel on Issobra
-=[TFS]=- 0.3.6 8.60 - PET HIT COM MAGIA NO PLAYER QUE O SUMONO OU SEJA NO DOMADOR ELE ATACA A CRITATURA PLAYER OU MONSTER MAIS MAGIA EM AREA AFETA O DOMADOR
Item que sumona pet
SCRIPT QUE USO ESTA FALTANDO PRA O PET NÃO ATACA COM MAGIA NO DOMADOR OU SEJA QUEM SUMONO O PET
Editado Abril 30 por Muvuka