Ir para conteúdo

Featured Replies

Postado

Bom dia, gostaria que alguém me ajudasse com um boss, eu quero que ele a cada 2 minutos, mude o outfit dele pra um morgaroth e não receba dano nenhum enquanto estiver com o outfit de morgaroth durante 15 segundos, após os 15 segundos ele volta ao outfit normal e pode levar danos novamente.

tfs 0.4

Postado

imortal.lua

Spoiler

local tempo = 15 -- TEMPO DE DURAÇÃO DO EFEITO ( SEGUNDOS )
local intervalo = 2 -- TEMPO EM MINUTOS PARA ATIVAR O SCRIPT
local Outfit = "Morgaroth" -- outfit do boss
local minutos = 0 -- variavel de controle, nao mexa.

-- VARIAVEIS DE CONTROLE, NÃO MEXA !
imortal = false


function onStatsChange(cid, attacker, type, combat, value) 


	if (type == 1 or type == 0) and  imortal == false then
		if os.time() >= minutos then
			addEvent(cleanFlag, tempo*1000, cid,getCreatureOutfit(cid))	
			doCreatureSay(cid, "I am the king of triangle of horror, the immortal !!! hahaha", TALKTYPE_ORANGE_1)
			imortal = true		
			minutos = os.time()+intervalo*60
			doSetMonsterOutfit(cid, Outfit, tempo*1000)
			end
		else
			doSendMagicEffect(getCreaturePosition(cid), 24)
			return false

	end
return true
end

function cleanFlag(cid,outfit)
	imortal = false
end

 

 

TAG no creaturescripts

<event type="statschange" name="Imortal" event="script" value="Imortal.lua"/>

 

Exemplo, de um monstro com o evento, caso não saiba adicionar:

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Empire Medusa" nameDescription="a empire medusa" race="blood" experience="9050" speed="280" manacost="0">
	<health now="6500" max="6500"/>
	<look type="330" corpse="10524"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="0"/>
		<flag canpushitems="1"/>
		<flag canpushcreatures="1"/>
		<flag targetdistance="1"/>
		<flag staticattack="85"/>
		<flag runonhealth="275"/>
	</flags>
	<attacks>
		<attack name="melee" interval="2000" skill="100" attack="135" poison="920"/>
		<attack name="earth" interval="1000" chance="10" length="8" spread="3" min="-450" max="-650">
			<attribute key="areaEffect" value="carniphila"/>
		</attack>
		<attack name="lifedrain" interval="1000" chance="15" range="7" min="-220" max="-400"> 
			<attribute key="shootEffect" value="earth"/>
			<attribute key="areaeffect" value="carniphila"/>
		</attack>
		<attack name="speed" interval="1000" chance="10" radius="5" target="0" duration="12000" speedchange="-700">
			<attribute key="areaEffect" value="poff"/>
		</attack>
		<attack name="speed" interval="1000" chance="30" range="7" duration="12000" speedchange="-700">
			<attribute key="areaEffect" value="redshimmer"/>
			<outfit type="333"/>
		</attack>
	</attacks>
	<defenses armor="25" defense="25">
		<defense name="healing" interval="1000" chance="22" min="400" max="600">
			<attribute key="areaEffect" value="blueshimmer"/>
		</defense>
	</defenses>
	<elements>
		<element icePercent="20"/>
		<element firePercent="-10"/>
		<element energyPercent="-10"/>
	</elements>
	<immunities>
		<immunity earth="1"/>
		<immunity paralyze="1"/>
		<immunity invisible="1"/>
	</immunities>
	<script>
		<event name = "Imortal"/>
	</script>
	<voices interval="5000" chance="10">
		<voice sentence="You will ssuch a fine ssstatue!"/>
		<voice sentence="There isss no chhhanccce of esscape"/>
		<voice sentence="Are you tired or why are you moving thhat sslow"/>
	</voices>
	<loot>
		<item id="2148" countmax="80" chance="46000"/><!-- gold coin -->
		<item id="2130" chance="6000"/><!-- gold coin -->
		<item id="8473" chance="6250"/><!-- ultimate health potion -->
		<item id="7590" countmax="5" chance="6750"/><!-- great mana potion -->
		<item id="2476" chance="2600"/><!-- knight armor -->
		<item id="7761" countmax="3" chance="2600"/><!-- pedrinha encantada -->
		<item id="2152" countmax="2" chance="565000"/><!-- platinum coin -->
		<item id="1988" chance="100000"><!-- bag-->
		<inside>
			<item id="2149" countmax="3" chance="4000"/><!-- small emerald -->
			<item id="7456" chance="1750"/><!-- white pearl -->
			<item id="2536" chance="3600"/><!-- medusa shield -->
			<item id="7590" chance="6750"/><!-- great mana potion -->
			<item id="8473" chance="6250"/><!-- ultimate health potion -->
			<item id="7887" chance="3550"/><!-- terra amulet -->
			<item id="7884" chance="550"/><!-- terra mantle -->
			<item id="2789" countmax="8" chance="9250"/><!-- BROWN MUSHROOM -->
			<item id="7413" chance="1300"/><!-- titan axe -->
			<item id="10219" chance="1500"/><!-- sacred tree amulet -->
			<item id="9810" chance="650"/><!-- rusty amor -->
			<item id="7885" chance="850"/><!-- terra legs -->
		</inside>
    </item>
	</loot>
</monster>

 

 

Editado por Nandozeraah (veja o histórico de edições)

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.7k

Informação Importante

Confirmação de Termo