Ir para conteúdo

Pet System Adapted By Mesenga + Perguntas E Respostas


Mesenga

Posts Recomendados

Bom...fiz esse tópico pro povo não ficar perguntando a mesma coisa sobre o PET SYSTEM

 

-Criando-

 

Bem pessoal, esse PET SYSTEM foi feito por FedeVI da OTFANS e eu adaptei muitas coisas para poder pegar

 

Vá na pasta Talkaction, abra o Talkaction.xml e adicione isso:

 

 

<talkaction words="!petinfo" script="pets/!petinfo.lua"/>
<talkaction words="!petsay" script="pets/!petsay.lua"/>
<talkaction words="!petcarry" script="pets/!petcarry.lua"/>
<talkaction words="!pet" script="pets/!pet.lua"/>
<talkaction words="!petattack" script="pets/!petattack.lua"/>
<talkaction words="!petgetitem" script="pets/!petgetitem.lua"/>

 

Crie um arquivo chamado petconfig.lua na mesma pasta do config.lua e coloque isso:

 

--//						 \\--
--(	made by FedeVI  and Adapted by Mesenga)  --
--____________ //-- 
petSystemExhaustion = 0 --in secods, 0 = no exhausted.  
frases = {"Men, im still exhausted!", "Ok, in one momment", "afff, again?!", "meh, one second"}
lenght = 39 -- maximun lenght the !petsay can have...
manaGainTicks = 3000 --	
				   --how fast the pet gains mana
manaGainAmmount = 20 --//
manaGainPerLevel = 30 -- mana that gains the pet for each level the player gain
magicLevelRate = 10 -- how faster the pet will gain mlvl compared to real tibia,,
base = 2000 --base storage. All storages will depend of this number
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,
		petSystemExhaustion = base+9
		}

petItems = {}
maxItems = 10 --Max items the pet can carry
--lol V
x = 0 y = function() x = x + 1 end table.foreach(storages, y)
for i = 1, maxItems do
petItems[i] = base+x+i
end
--Pets, dependiong on the level
pets = 
{
   {vocations = {4, 5}, pets =
	{{level = 350, name = "Juggernaut"}, {level = 255, name = "Dark Torturer"}, {level = 190, name = "Hellfire Fighter"}, {level = 120, name = "Hydra"}, {level = 80, name = "Quara Hydromancer"}, {level = 50, name = "Cyclops Smith"}, {level = 40, name = "Demon Skeleton"}, {level = 30, name = "Barbarian Skullhunter"}, {level = 20, name = "Monk"}, {level = 10, name = "Bear"}, {level = 0, name = "Wolf"}}
	},
	{vocations = {1, 6}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Demon"}, {level = 180, name = "Betrayed Wraith"}, {level = 120, name = "Diabolic Imp"}, {level = 80, name = "Braindeath"}, {level = 50, name = "Ice Golem"}, {level = 40, name = "Acolyte Of The Cult"}, {level = 30, name = "Barbarian Headsplitter"}, {level = 20, name = "Dark Monk"}, {level = 10, name = "Polar Bear"}, {level = 0, name = "Cave Rat"}}
	},
	{vocations = {2, 7}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Hand of Cursed Fate"}, {level = 175, name = "Phantasm"}, {level = 120, name = "Frost Dragon"}, {level = 80, name = "Massive Water Elemental"}, {level = 50, name = "Water Elemental"}, {level = 40, name = "Dwarf Geomancer"}, {level = 30, name = "Barbarian Brutetamer"}, {level = 20, name = "Assassin"}, {level = 10, name = "Lion"}, {level = 0, name = "Rat"}}
	},
	{vocations = {3, 8}, pets =
	{{level = 350, name = "Orshabaal"}, {level = 260, name = "Plaguesmith"}, {level = 185, name = "Destroyer"}, {level = 120, name = "Dragon Lord"}, {level = 80, name = "Quara Hydromancer Scout"}, {level = 50, name = "Orc Leader"}, {level = 40, name = "Elf Arcanist"}, {level = 30, name = "Barbarian Bloodwalker"}, {level = 20, name = "Hunter"}, {level = 10, name = "Panda"}, {level = 0, name = "Bat"}}
	}
}
--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",  theFunction = false, offensive = 1, needLevel = 20, self = 0, needMag = 10, manaSpent = 120, 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", theFunction = false, offensive = 1, needLevel = 40, self = 0, needMag = 5, manaSpent = 200, 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", theFunction = false, offensive = 1,  needLevel = 50, 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", theFunction = false, offensive = 1,  needLevel = 0, self = 0, needMag = 0, manaSpent = 80, 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", theFunction = false, offensive = -1,  needLevel = 10, self = 1, needMag = 0, manaSpent = 150, 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}
			 },
			 {param = "ultimate explosion", theFunction = false, offensive = 1,  needLevel = 150, self = 0, needMag = 20, manaSpent = 600, exhausted = 2, range = 0, combatType = COMBAT_PARAM_DISTANCEEFFECT, combatAni = CONST_ANI_FIRE, area = 8, 
				formula = {maxb = 1.0, maxa = 50, minb = 1.7, mina = 0}
			 },
			 {param = "paralize", needLevel = 1, needMag = 0, manaSpent = 300, exhausted = 2,
			 theFunction = function (parameters)
				daPet = getPlayerStorageValue(parameters.cid, storages.petUid)
				if getCreatureTarget(daPet) ~= 0 then
					doAddCondition(getCreatureTarget(parameters.cid), 4)
				end
			 end
			},
			{param = "speed", needLevel = 10, needMag = 4, manaSpent = 60, exhausted = 2,
			 theFunction = function (parameters)				
				doAddCondition(getPlayerStorageValue(parameters.cid, storages.petUid), 11)
			end
			},
			 {param = "double fire", needLevel = 1, needMag = 0, manaSpent = 220, exhausted = 2,
			 theFunction = function (parameters)


				local myAttack = formulaAttack(getPlayerLevel(parameters.cid),  getPlayerStorageValue(parameters.cid, storages.petMag), 0.7, 0, 1.0, 0)
				function doAreaCombatHealthEx(params)
					local randoms = {[1] = math.random(-2, 2),
									 [2] = math.random(-2, 2)				
									}

					local attackCreature = getPlayerStorageValue(parameters.cid, storages.petUid)
					if getCreatureTarget(getPlayerStorageValue(parameters.cid, storages.petUid)) ~= 0 then
						attackCreature = getCreatureTarget(getPlayerStorageValue(parameters.cid, storages.petUid))
					end				
					local posa = getCreaturePosition(attackCreature)
					doAreaCombatHealth(getPlayerStorageValue(parameters.cid, storages.petUid), COMBAT_FIREDAMAGE, {x = posa.x + randoms[1], y = posa.y + randoms[2], z = posa.z},  1, -params.myAttack.minD, -params.myAttack.maxD, CONST_ME_FIREAREA)
					doSendDistanceShoot(getCreaturePosition(getPlayerStorageValue(parameters.cid, storages.petUid)), {x = posa.x + randoms[1], y = posa.y + randoms[2], z = posa.z}, CONST_ANI_FIRE)

				end
				doAreaCombatHealthEx({cid = parameters.cid, target = getCreaturePosition(attackCreature), myAttack = myAttack})
				for i = 1, 7 do
					addEvent(doAreaCombatHealthEx, 200*i, {cid = parameters.cid, target = getCreaturePosition(attackCreature), myAttack = myAttack})
				end
			end
			}
		}
function setExhausted(cid)
setPlayerStorageValue(cid, storages.petSystemExhaustion, os.clock()+1)
end
function formulaAttack(magicLevel, level, maxb, maxa, minb, mina)
return {minD = (level * 2 + magicLevel * 3) * (1 + mina) + minb,
		maxD = (level * 2 + magicLevel * 3) * (1 + maxb) + maxa
	   }
end

function isExhausted(cid)
if isPlayer(cid) == 1 then	
	local CRONOMETRO = getPlayerStorageValue(cid, storages.petSystemExhaustion)
	local CRONOMETRO2 = os.clock()
	local TIEMPO = os.difftime(CRONOMETRO2, CRONOMETRO)
	if petSystemExhaustion - TIEMPO > petSystemExhaustion or CRONOMETRO == -1 then
		setPlayerStorageValue(cid, storages.petSystemExhaustion, CRONOMETRO2+1)
		return 0
	end
	if petSystemExhaustion - TIEMPO <= 0 then
		return 0
	end
end
return 1
end

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

 

Na pasta data\talkactions\scripts crie uma pasta chamada "pets" e dentro crie os seguintes arquivos:

 

!petinfo.lua

 

dofile("./petConfig.lua")
function onSay(cid, words, param)
if isExhausted(cid) == 1 then
	return 0
end
local request = 0
local daPet = getPlayerStorageValue(cid, storages.petUid)
if isCreature(daPet) == 1 then
	param = string.lower(param)
	if param == "lv" then
		request = getPlayerStorageValue(cid, storages.petLevel)
			elseif param == "ml" then
		request = getPlayerStorageValue(cid, storages.petMag)
	elseif param == "mana" then		
		request = getPlayerStorageValue(cid, storages.petMana)
	elseif param == "health" then
		request = getCreatureHealth(daPet)
	end
	if request ~= 0 then
		doPlayerSendTextMessage(cid, 19, 'Pet' .. param .. ': ' .. request .. '.')
	end
else
	doPlayerSendCancel(cid, 'You haven\'t call your <span class="highlight">pet</span>!')
end
return setExhausted(cid)
end

 

!petcarry.lua

 
dofile("./petConfig.lua")
function onSay(cid, words, param)

if isExhausted(cid) == 1 then
	return 0
end
local mySto = 0
local daPet = getPlayerStorageValue(cid, storages.petUid)
if isCreature(daPet) == 1 then
	local pos = getCreaturePosition(daPet)
	local a = 1
	while a < 10 do
		if getItemWeight(getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = a}).itemid, 1) ~= 0  then
			break
		end
		a = a + 1
	end
	local carryingItem = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = a})
	if getItemWeight(carryingItem.itemid, 1) ~= 0 then
		if isContainer(carryingItem.uid) == 0 then
			for b = 1, #petItems do
				if getPlayerStorageValue(cid, petItems[b]) == 0 or getPlayerStorageValue(cid, petItems[b]) == -1 then
					mySto = b
					break
				end
			end
			local count = 1
			if mySto ~= 0 then
				local theID = carryingItem.itemid
				if isItemStackable(theID) == 1 then
					count = carryingItem.type
					doRemoveItem(carryingItem.uid, carryingItem.type)
				else
					doRemoveItem(carryingItem.uid, 1)
				end
				setPlayerStorageValue(cid, petItems[mySto], theID*100+count)
				if count == 1 then
					doCreatureSay(daPet, 'Hmm, a ' .. getItemName(theID) .. ', I\'ll save it on my bag number ' .. mySto .. '!', TALKTYPE_ORANGE_1)
				else
					doCreatureSay(daPet, 'Hmm, ' .. count .. ' ' .. getItemName(theID) .. 's, I\'ll save them on my bag number ' .. mySto .. '!', TALKTYPE_ORANGE_1)
				end
			else
				doCreatureSay(daPet, 'I have no space!', TALKTYPE_ORANGE_1)
			end
		else
			doCreatureSay(daPet, 'I can\'t take containers!', TALKTYPE_ORANGE_1)
		end
	else
		doCreatureSay(daPet, 'I can\'t see any item!', TALKTYPE_ORANGE_1)
	end
else
	doPlayerSendCancel(cid, 'You haven\'t call your <span class="highlight">pet</span>!')
end
return setExhausted(cid)
end

 

!pet.lua

 
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 isExhausted(cid) == 1 then
	return 0
end
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)) == 0 then
		if getPlayerStorageValue(cid, storages.petIsOnline) == 1 or getPlayerStorageValue(cid, storages.petIsOnline) == -1 then
			for i = 1, #pets do
				if isInArray(pets[i].vocations, getPlayerVocation(cid)) == 1 then
					for k = 1, #pets[i].pets do							
						if pets[i].pets[k].level <= getPlayerLevel(cid) then
							myPet = pets[i].pets[k].name
							break
						end
					end
				break
				end
			end
			myPetUid = doPlayerAddSummon(cid, myPet, getCreaturePosition(cid))
			if myPetUid ~= -1 then
				setPlayerStorageValue(cid, storages.petUid, myPetUid)
				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 <span class="highlight">pet</span> died! You have to revive it.')
		end
	else
		doPlayerSendCancel(cid, 'You cannot summon your <span class="highlight">pet</span> in PZ.')
	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 setExhausted(cid)
end

 

!petattack.lua

dofile("./petConfig.lua")	 
function onSay(cid, words, param)

if isExhausted(cid) == 1 then
	return 0
end

local lookDirs = {[0] = {x = 0, y = -1},
				  [1] = {x = 1, y = 0},
				  [2] = {x = 0, y = 1},
				  [3] = {x = -1, y = 0}
				 }

local myAttack = 0 
local CRONOMETRO = 0
local CRONOMETRO2 = 0
local TIEMPO = 0

function formulaAttack(magicLevel, level, maxb, maxa, minb, mina)
return {minD = (level * 2 + magicLevel * 3) * (1 + mina) + minb,
		maxD = (level * 2 + magicLevel * 3) * (1 + maxb) + maxa
	   }
end
function getPetMlvl(manaSpent)
	local i = 0
	while manaSpent >= (1600 * (1.2^i))*magicLevelRate do
		i = i + 1
	end
	return i
end

local daPet = getPlayerStorageValue(cid, storages.petUid)
if isCreature(daPet) == 1 then 
	if param ~= nil then

		param = string.lower(param)
		local petPos = getCreaturePosition(daPet)
		local lookDir = getPlayerLookDir(cid) -- getPlayerLookDir(daPet plz ! ! !)
		local damage = {}
		CRONOMETRO = getPlayerStorageValue(cid, storages.petExha)
		CRONOMETRO2 = os.clock()
		TIEMPO = os.difftime(CRONOMETRO2, CRONOMETRO)

		for i = 1, #attacks do
			if param == attacks[i].param then
				myAttack = i
				break
			end
		end

		if myAttack ~= 0 then
			if attacks[myAttack].exhausted - TIEMPO > attacks[myAttack].exhausted or CRONOMETRO == -1 then
				setPlayerStorageValue(cid, storages.petExha, CRONOMETRO2+1)
			end
			if getPlayerStorageValue(cid, storages.petMana) >= attacks[myAttack].manaSpent then
				if attacks[myAttack].needLevel <= getPlayerLevel(cid) then
					if attacks[myAttack].needMag <= getPlayerStorageValue(cid, storages.petMag) then
						if attacks[myAttack].exhausted - TIEMPO <= 0 then
							if attacks[myAttack].theFunction == false then
								damage = formulaAttack(getPlayerStorageValue(cid, storages.petMag), getPlayerLevel(cid),  attacks[myAttack].formula.maxb, attacks[myAttack].formula.maxa, attacks[myAttack].formula.minb, attacks[myAttack].formula.mina)
								doAreaCombatHealth(daPet*((attacks[myAttack].self - 1)*-1), attacks[myAttack].combatType, {x = petPos.x + attacks[myAttack].range*lookDirs[lookDir].x, y = petPos.y + attacks[myAttack].range*lookDirs[lookDir].y, z = petPos.z}, attacks[myAttack].area, math.floor(damage.minD*-1*attacks[myAttack].offensive), math.floor(damage.maxD*-1*attacks[myAttack].offensive), attacks[myAttack].combatAni)
							else
								attacks[myAttack].theFunction({cid = cid, words = words, param = param})
							end
							doCreatureSay(daPet, '' .. param .. '!', TALKTYPE_ORANGE_1)
							if getPlayerStorageValue(cid, storages.petIsHealing) == 0 or getPlayerStorageValue(cid, storages.petIsHealing) == -1 then
								addEvent(addMana, manaGainTicks, {cid = cid})
								setPlayerStorageValue(cid, storages.petIsHealing, 1)
							end
							setPlayerStorageValue(cid, storages.petExha, CRONOMETRO2+1)
							setPlayerStorageValue(cid, storages.petManaSpent, getPlayerStorageValue(cid, storages.petManaSpent) + attacks[myAttack].manaSpent)
							setPlayerStorageValue(cid, storages.petMana, getPlayerStorageValue(cid, storages.petMana) - attacks[myAttack].manaSpent)
							if getPetMlvl(getPlayerStorageValue(cid, storages.petManaSpent)) > getPlayerStorageValue(cid, storages.petMag) then
								setPlayerStorageValue(cid,  storages.petMag, getPetMlvl(getPlayerStorageValue(cid, storages.petManaSpent)))
								doCreatureSay(daPet, 'You advanced to magic level ' .. getPlayerStorageValue(cid, storages.petMag) .. '!', TALKTYPE_ORANGE_1)
							end
						else
							doCreatureSay(daPet, '' .. frases[math.random(1, #frases)] .. '!', TALKTYPE_ORANGE_1)
						end
					else
						doCreatureSay(daPet, 'My magic level is too low!', TALKTYPE_ORANGE_1)
					end
				else
					doCreatureSay(daPet, 'AAh Im out of mana!', TALKTYPE_ORANGE_1)
				end
			else
				doCreatureSay(daPet, 'Woups! I can\'t use that spell yet', TALKTYPE_ORANGE_1)
			end				
		else
			----------------special attacks ?----------------------
		end
	else
		doPlayerSendCancel(cid, 'You must spesific a spell.')
	end
else
	doPlayerSendCancel(cid, 'You haven\'t call your <span class="highlight">pet</span>!.')
end
return setExhausted(cid)
end

 

!petgetitem.lua

dofile("./petConfig.lua")
function onSay(cid, words, param)
if isExhausted(cid) == 1 then
	return 0
end
local daPet = getPlayerStorageValue(cid, storages.petUid)
if isCreature(daPet) == 1 then
	if param ~= "" then
		param = tonumber(param)
		if type(param) == "number" then
			if param <= maxItems then
				if getPlayerStorageValue(cid, petItems[param]) ~= 0 and getPlayerStorageValue(cid, petItems[param]) ~= -1 then
					local that = getPlayerStorageValue(cid, petItems[param])
					local item = math.floor(that/100)
					local count = that-item*100
					doPlayerAddItem(cid, item, count)
					if count == 1 then

if count > 1 then
doCreatureSay(daPet, 'Here are your ' .. count .. ' ' .. getItemName(item) .. 's', TALKTYPE_ORANGE_1)
else
doCreatureSay(daPet, 'Here is your ' .. getItemName(item) .. '', TALKTYPE_ORANGE_1)
end

					else
						doCreatureSay(daPet, 'Here are your ' .. count .. ' ' .. getItemName(item) .. 's', TALKTYPE_ORANGE_1)
					end
					setPlayerStorageValue(cid, petItems[param], 0)
				end
			end
		end
	end
end
return setExhausted(cid)
end

 

Abaixo Script para o npc que revive o pet adaptado por mim para TFS:

 

Na pasta NPC crie um arquivo chamado Pet.xml

 

<npc name="Pet" script="data/npc/scripts/pet.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="231" head="79" body="118" legs="115" feet="114" corpse="2212"/>
<parameters>

</parameters>
</npc>

 

Na pasta NPC\Scripts crie um arquivo chamado pet.lua

 

local focus = 0
local talk_start = 0
local talk_state = 0
local costPerLevel = 300

dofile("./petConfig.lua")



function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
if focus == cid then
	 selfSay('How rude!.')
	 focus = 0
	 talk_start = 0
end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  msg = string.lower(msg)
if getDistanceToCreature(cid) < 4 then
	  if (msgcontains(msg, 'hi') and (focus == 0)) then
		  selfSay('Hello! I can take you to the train!')
			focus = cid
			talk_start = os.clock()

	  elseif msgcontains(msg, 'hi') and (focus ~= cid) then
		  selfSay('Sorry! I talk to you in a minute.')
	end

	if msgcontains(msg, 'revive') and focus == cid then
		if  isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 then
			if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
				selfSay('YOUR PET DIED?!, YOU\'R A BAD OWNER, THIS WILL COST YOU ' .. getPlayerLevel(cid)*costPerLevel .. ' GOLD COINS!, AGREE?!')
				talk_state = 1
			else
				selfSay('Your pet is alive.')
			end
		else
			selfSay('Your pet is standing next to you.')
		end
	talk_start = os.clock()
	end
	if msgcontains(msg, 'yes') and focus == cid and talk_state == 1 then
		if doPlayerRemoveMoney(cid, getPlayerLevel(cid)*costPerLevel) == 1 then
			setPlayerStorageValue(cid, storages.petIsOnline, 1)
			selfSay('You can now summon again your pet.')
		else
			selfSay('You don\'t have enought money.')
		end
	talk_state = 0
	talk_start = os.clock()
	end				

	if msgcontains(msg, 'bye') then
		selfSay('Good bye!')
		focus = 0
		talk_start = 0
		talk_state = 0
	end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()

doNpcSetCreatureFocus(focus)
  if (os.clock() - talk_start) > 30 then
	  if focus > 0 then
		  selfSay('Next Please...')
	  end
		  focus = 0
					talk_state = 0
  end
if focus ~= 0 then
	if getDistanceToCreature(focus) > 5 then
					talk_state = 0
		selfSay('Good bye then.')
					talk_state =  0
		focus = 0
	end
end
end

 

-Vamos adicionar um sisteminha para o PET logar e morrer-

 

Para seu pet logar, abra a pasta do TFS, vá em data/creaturescripts e procure o arquivo "creaturescripts.xml"

 

abra o arquivo e coloque uma linha com

 

<event type="login" name="PlayerLogin" script="login.lua"/>

 

Ainda na pasta, abra dentro dela a pasta Scripts, adicione um script com nome "login.lua"

Nele coloque:

function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end

 

DOWNLOAD PASTA CRIATURESCRIPTS JÁ CONFIGURADA

 

 

-Adicionando PETS novos-

 

Vá na pasta do server e abra o petconfig.lua

 

onde tem:

 

	{
   {vocations = {4, 5}, pets =
	{{level = 350, name = "Juggernaut"}, {level = 255, name = "Dark Torturer"}, {level = 190, name = "Hellfire Fighter"}, {level = 120, name = "Hydra"}, {level = 80, name = "Quara Hydromancer"}, {level = 50, name = "Cyclops Smith"}, {level = 40, name = "Demon Skeleton"}, {level = 30, name = "Barbarian Skullhunter"}, {level = 20, name = "Monk"}, {level = 10, name = "Bear"}, {level = 0, name = "Wolf"}}
	},
	{vocations = {1, 6}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Demon"}, {level = 180, name = "Betrayed Wraith"}, {level = 120, name = "Diabolic Imp"}, {level = 80, name = "Braindeath"}, {level = 50, name = "Ice Golem"}, {level = 40, name = "Acolyte Of The Cult"}, {level = 30, name = "Barbarian Headsplitter"}, {level = 20, name = "Dark Monk"}, {level = 10, name = "Polar Bear"}, {level = 0, name = "Cave Rat"}}
	},
	{vocations = {2, 7}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Hand of Cursed Fate"}, {level = 175, name = "Phantasm"}, {level = 120, name = "Frost Dragon"}, {level = 80, name = "Massive Water Elemental"}, {level = 50, name = "Water Elemental"}, {level = 40, name = "Dwarf Geomancer"}, {level = 30, name = "Barbarian Brutetamer"}, {level = 20, name = "Assassin"}, {level = 10, name = "Lion"}, {level = 0, name = "Rat"}}
	},
	{vocations = {3, 8}, pets =
	{{level = 350, name = "Orshabaal"}, {level = 260, name = "Plaguesmith"}, {level = 185, name = "Destroyer"}, {level = 120, name = "Dragon Lord"}, {level = 80, name = "Quara Hydromancer Scout"}, {level = 50, name = "Orc Leader"}, {level = 40, name = "Elf Arcanist"}, {level = 30, name = "Barbarian Bloodwalker"}, {level = 20, name = "Hunter"}, {level = 10, name = "Panda"}, {level = 0, name = "Bat"}}
	}
}

 

coloque um novo monstro, ex: Undead dragon para Knight

 

{{level = 250, name = "Undead Draon"},

 

Agora vá na pasta MONSTERS e abra o Undead Dragon.xml

 

procure essa linha:

 

	  <flag convinceable="0"/>

 

mude pra:

 

<flag convinceable="1"/>

 

pronto, só isso, mais nada.

 

=)

 

 

-Terminando-

 

 

-Meu Pet system não funciona, os comandos !petattack ", !petinfo ",etc.

 

Bem...o pet system só pega na versão de otserver TFS (The Forgotten Server) ou

qualquer ot que ot tiver a pasta "CREATURESCRIPTS"

 

-Porque meu mostro DEMON ou qualquer outro me ataca?

 

Vá na pasta data/monsters, em seguida procure o monstro que deseja que seja pet, ex: Demon.xml

 

abra como bloco de notas e procure a linha:

 

<flag convinceable="0"/>

 

Troque o "0" por "1", ficando assim:

 

<flag convinceable="1"/>

Editado por Mesenga
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • Respostas 79
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Tenho o Mapa Yurots e o pet funfo porem igual a um summon, se voce puder dizer como eu arrumo para os comandos !petinfo,etc. funcionarem eu agradeço :icon1:

Link para o comentário
Compartilhar em outros sites

Tipo vei vi num ot

q o cara fez

q lvl 50 fazia um pet 'dragon hatling'

lvl 100 o pet evoluia pra 'frost dragon hatling'

e depois lvl 200 virava 'dragon lord halting..

nesse ai n tem dessas paradas axo q ficaria rox..

O gm tava tentando fazer com spider, "spider~ crystal spider~ tarantula'

:)

Link para o comentário
Compartilhar em outros sites

@Kyrius

 

cara, isso eh muito facil, só você ir no PETCONFIG.LUA e procura esta parte:

 

	{
   {vocations = {4, 8}, pets =
	{{level = 350, name = "Juggernaut"}, {level = 255, name = "Dark Torturer"}, {level = 190, name = "Hellfire Fighter"}, {level = 120, name = "Hydra"}, {level = 80, name = "Quara Hydromancer"}, {level = 50, name = "Cyclops Smith"}, {level = 40, name = "Demon Skeleton"}, {level = 30, name = "Barbarian Skullhunter"}, {level = 20, name = "Monk"}, {level = 10, name = "Bear"}, {level = 0, name = "Wolf"}}
	},
	{vocations = {1, 5}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Demon"}, {level = 180, name = "Betrayed Wraith"}, {level = 120, name = "Diabolic Imp"}, {level = 80, name = "Braindeath"}, {level = 50, name = "Ice Golem"}, {level = 40, name = "Acolyte Of The Cult"}, {level = 30, name = "Barbarian Headsplitter"}, {level = 20, name = "Dark Monk"}, {level = 10, name = "Polar Bear"}, {level = 0, name = "Cave Rat"}}
	},
	{vocations = {2, 6}, pets =
	{{level = 350, name = "Ferumbras"}, {level = 260, name = "Hand of Cursed Fate"}, {level = 175, name = "Phantasm"}, {level = 120, name = "Frost Dragon"}, {level = 80, name = "Massive Water Elemental"}, {level = 50, name = "Water Elemental"}, {level = 40, name = "Dwarf Geomancer"}, {level = 30, name = "Barbarian Brutetamer"}, {level = 20, name = "Assassin"}, {level = 10, name = "Lion"}, {level = 0, name = "Rat"}}
	},
	{vocations = {3, 7}, pets =
	{{level = 350, name = "Orshabaal"}, {level = 260, name = "Plaguesmith"}, {level = 185, name = "Destroyer"}, {level = 120, name = "Dragon Lord"}, {level = 80, name = "Quara Hydromancer Scout"}, {level = 50, name = "Orc Leader"}, {level = 40, name = "Elf Arcanist"}, {level = 30, name = "Barbarian Bloodwalker"}, {level = 20, name = "Hunter"}, {level = 10, name = "Panda"}, {level = 0, name = "Bat"}}
	}
}

 

1º Vocations 4 (knight) e 8 (EK)

2º Sorc e master sorc

3º Druid e ED

4º Paladin e Royal Pally

 

ai eh só você troca os nomes e os leveis para as criaturas que você desejar

Link para o comentário
Compartilhar em outros sites

vc faz a talkaction

!petspell "energy ai ele da um energy

tava qrendo dize abolir essa parada, ai qdo vc ataka o pet da atk automaticamente

he :)

Link para o comentário
Compartilhar em outros sites


×
×
  • Criar Novo...