Ir para conteúdo

[npc,move,talk]que Muda Outfit


Volksz

Posts Recomendados

EU já pedi uma vez e ja me deram uma action que mudava outfit, mas infelizmente nao funcionou.

 

Entao venho pedir NPC ou Moveevents ou Talkaction que muda a outfit atual do player, permanentemente.

 

Vlew.

 

E Tambem um Phoda, desse video

http://www.youtube.com/watch?v=s1-DUWq_0Uc

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

Entendo o seu desespero em relação á ser respondido, porém cometer double post não ajudará.

O double post neste fórum é considerado flood, no qual acarretará em um alerta.

Se você não compreendeu a explicação acima, leia as regras do fórum.

 

Abraços.

Link para o comentário
Compartilhar em outros sites

data/global.lua:

function isWalkable(cid,pos)
local aux = pos
aux.stackpos = 253
if doTileQueryAdd(cid, pos) == 1 and getTilePzInfo(pos) == FALSE and isCreature(getThingFromPos(aux).uid) == FALSE then
	return TRUE
end
return FALSE
end

function getWeaponDistanceEffect(uid) 
local WeaponType = getItemWeaponType(uid) 
if WeaponType == WEAPON_CLUB then 
	return CONST_ANI_WHIRLWINDCLUB 
elseif WeaponType == WEAPON_SWORD then 
	return CONST_ANI_WHIRLWINDSWORD 
elseif WeaponType == WEAPON_AXE then 
	return CONST_ANI_WHIRLWINDAXE 
else 
	return CONST_ANI_NONE 
end 
end

function getOppositeSidePos(cid,centerPos)
local otherSideDirTable = {											  
	{SOUTH,SOUTHWEST,SOUTHEAST},  --NORTH
	{WEST,SOUTHWEST,NORTHWEST},   --EAST
	{NORTH,NORTHWEST,NORTHEAST},	 --SOUTH
	{EAST,SOUTHEAST,NORTHEAST},   --WEST
	{NORTH,EAST,NORTHEAST},	   --SOUTHWEST
	{NORTH,WEST,NORTHWEST},	   --SOUTHEAST
	{SOUTH,EAST,SOUTHEAST},	   --NORTHWEST
	{SOUTH,WEST,SOUTHWEST}		--NORTHEAST
}   
local PlayerDirection = (getDirectionTo(centerPos,getCreaturePosition(cid)))+1
local newDirection = otherSideDirTable[PlayerDirection][math.random(1,3)]
local newPos = getPosByDir(centerPos,newDirection)
if isWalkable(cid,getPosByDir(centerPos,newPos)) then
	return newPos
end
if newDirection == 1 then
	local rand = math.random(2,3)
	newDirection = otherSideDirTable[PlayerDirection][rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
	newDirection = otherSideDirTable[PlayerDirection][5-rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
elseif newDirection == 2 then
	local rand = math.random(1,2)
	if rand == 2 then rand = 3 end
	newDirection = otherSideDirTable[PlayerDirection][rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
	newDirection = otherSideDirTable[PlayerDirection][4-rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
elseif newDirection == 3 then
	local rand = math.random(1,2)
	newDirection = otherSideDirTable[PlayerDirection][rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
	newDirection = otherSideDirTable[PlayerDirection][3-rand]
	newPos = getPosByDir(centerPos,newDirection)
	if isWalkable(cid,newPos) then
		return newPos
	end
end
otherSideDirTable = {
	{EAST,WEST},					--NORTH	 
	{NORTH,SOUTH},				  --EAST	  
	{EAST,WEST},					--SOUTH	 
	{NORTH,SOUTH},				  --WEST	  
	{SOUTHEAST,NORTHWEST},		  --SOUTHWEST 
	{SOUTHWEST,NORTHEAST},		  --SOUTHEAST 
	{SOUTHWEST,NORTHEAST},		  --NORTHWEST 
	{SOUTHEAST,NORTHWEST}		   --NORTHEAST 
}
local rand = math.random(1,2)
newDirection = otherSideDirTable[PlayerDirection][rand]
newPos = getPosByDir(centerPos,newDirection)
if isWalkable(cid,newPos) then
	return newPos
end
newDirection = otherSideDirTable[PlayerDirection][3-rand]
newPos = getPosByDir(centerPos,newDirection)
if isWalkable(cid,newPos) then
	return newPos
end
otherSideDirTable = {
	{NORTHWEST,NORTHEAST},					--NORTH	 
	{SOUTHEAST,NORTHEAST},					--EAST	  
	{SOUTHWEST,SOUTHEAST},					--SOUTH	 
	{SOUTHWEST,NORTHWEST},					--WEST	  
	{SOUTH,WEST},							 --SOUTHWEST 
	{EAST,SOUTH},							 --SOUTHEAST 
	{NORTH,WEST},							 --NORTHWEST 
	{NORTH,EAST}							  --NORTHEAST 
}
local rand = math.random(1,2)
newDirection = otherSideDirTable[PlayerDirection][math.random(1,2)]
newPos = getPosByDir(centerPos,newDirection)
if isWalkable(cid,newPos) then
	return newPos
end
newDirection = otherSideDirTable[PlayerDirection][3-rand]
newPos = getPosByDir(centerPos,newDirection)
if isWalkable(cid,newPos) then
	return newPos
end
return getPosByDir(centerPos,PlayerDirection-1)
end

data/spells/spells.xml:

<instant name="Omnislash" words="Omnislash" lvl="50" mana="200" prem="1" range="1" needtarget="1" needweapon="1" exhaustion="0" needlearn="0" event="script" value="Omnislash.lua">
	<vocation id="4"/>
	<vocation id="8"/>
</instant>

data/spells/scripts/Omnislash.lua:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1.0, -0, 1.0, -0)

function OmnislashStrike(cid,combat,var,times,opos,Target)
if not isCreature(cid) or not isCreature(Target) then 
	doCreatureSetNoMove(Target, false)
	doCreatureSetNoMove(cid, false)
	return true
end
doCreatureSetNoMove(Target, true)
doCreatureSetNoMove(cid, true)
local newPos = getOppositeSidePos(cid,getCreaturePosition(Target))
if times == 15 then
	if not doComparePositions(getCreaturePosition(cid),opos) then
		doTeleportThing(cid,opos)
		doSendDistanceShoot(newPos, opos, getWeaponDistanceEffect(getPlayerWeapon(cid).uid))
	end
	doCreatureSetNoMove(Target, false)
	doCreatureSetNoMove(cid, false)
	return doCombat(cid, combat, var)
else
	if isWalkable(cid,newPos) and newPos ~= getCreaturePosition(cid) then
		local fromPos = getCreaturePosition(cid)
		doTeleportThing(cid,newPos)
		doSendDistanceShoot(fromPos, newPos, getWeaponDistanceEffect(getPlayerWeapon(cid).uid))
	end
	doCombat(cid, combat, var)
	return addEvent(OmnislashStrike,333,cid,combat,var,times+1,opos,Target)
end
end

function onCastSpell(cid, var)
return addEvent(OmnislashStrike,0,cid,combat,var,0,getCreaturePosition(cid),getCreatureTarget(cid))
end

 

 

Créditos: Quetzalma (da otf***)

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...