Help outfits por vocation

kamus9629
em Scripts

kamus9629

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 15/08/11Posts: 291

Boa noite alguem pode me ajudar como eu fasso para certa outfit so funcionar em certa vocation ? no outfits.xml  

como voces ver na foto a vocation sora esta mudando para outfti marcos daimon

image.png.c7663709c58d33a18bf421d4757ecced.png

Hyaki

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 11/01/14Posts: 108Char no Tibia: Rhynd

Você pode usar storage no outfit e setar o mesmo por um creaturescripts.

<outfit id="1" storageId="1415" storageValue="1">
	<list gender="0" lookType="136" name="Citizen"/>
	<list gender="1" lookType="128" name="Citizen"/>
</outfit>
function onLogin(cid)
local r = getCreatureOutfit(cid)
local roupa = {lookHead = r.lookHead, lookBody = r.lookBody, lookLegs = r.lookLegs , lookFeet = r.lookFeet}

	if (getPlayerAccess(cid) <= 2) then
		if isPlayer(cid) then
			
			if getPlayerStorageValue(cid, 1415) == -1 then
				if getPlayerVocation(cid) == 0 then -- Sem vocação
					setPlayerStorageValue(cid,1415 ,1) -- Citzen
					if getPlayerSex(cid) == 0 then -- Se for homem
						doCreatureChangeOutfit(cid,{lookType = 136, roupa}) -- Roupa Masculina
					else
						doCreatureChangeOutfit(cid, {lookType = 128, roupa}) -- Roupa Feminina
					end
				end
			end
			
			if getPlayerStorageValue(cid, 1417) == -1 then
				if getPlayerVocation(cid) == 1 then -- Sorcerer?
					setPlayerStorageValue(cid,1417 ,1) -- Storage da roupa que voce quer, esta no XML/Outfits
					if getPlayerSex(cid) == 0 then -- Se for homem
						doCreatureChangeOutfit(cid,{lookType = 138, roupa}) -- Roupa Masculina
					else
						doCreatureChangeOutfit(cid, {lookType = 130, roupa}) -- Roupa Feminina
					end
				end
			end
			
			
		end
	end
	return true
end