Ir para conteúdo

(Resolvido)[Pedido][ tfs 1.3] Anunciar para todos um boss que morreu e quem matou

Featured Replies

Postado
  • Diretor
local boss = {"Diablo"}

function onKill(cid, target, lastHit)
	
	
		if isPlayer(cid) and isInArray(boss, getCreatureName(target)) then
			broadcastMessage("O jogador ".. getCreatureName(cid) .." matou o boss " .. getCreatureName(target) ..".")
		end
		
		
	return true
end

tag:

<event type="death" name="avisarServer" event="script" value="avisar.lua"/>

 

monstro.xml

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Diablo" nameDescription="Diablo" race="undead" experience="5000" speed="900" manacost="0" script="rewardboss.lua">
  <health now="2000000" max="2000000"/>
  <look type="12" head="0" body="77" legs="77" feet="77" corpse="5995"/>
  <targetchange interval="3000" chance="100"/>
  <strategy attack="65" defense="5"/>
  <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="90"/>
    <flag runonhealth="0"/>
  </flags>
   <script>
        <event name="diabloBroadcast"/>
    </script>
  <attacks>
    <attack name="melee" interval="1000" skill="200" attack="200"/>
    <attack name="death rain" interval="500"/>
    <attack name="diablo change" interval="1000"/>
    <attack name="orshabaal_deathstar" interval="10000" min="-500" max="-1500"/>
		<attack name="firefield" interval="1000" chance="30" radius="5" target="0">
			<attribute key="areaEffect" value="fireattack"/>
		</attack>
  </attacks>
  <defenses armor="10" defense="10">
    <defense name="healing" interval="20000" chance="5" min="1000" max="10000">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
    <defense name="speed" interval="2000" chance="8" speedchange="10" duration="5000">
      <attribute key="areaEffect" value="redshimmer"/>
    </defense>
  </defenses>
  <immunities>
    <immunity physical="0"/>
    <immunity energy="0"/>
    <immunity fire="1"/>
    <immunity poison="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
  </immunities>
	<loot>
		<item name="stealth ring" chance="13000"/>
		<item name="shield of honour" chance="50000"/>
		<item name="gold coin" chance="100000" countmax="35"/> <!-- Gold Coin -->
		<item name="fire rainbow shield" chance="75000"/>
		<item name="star amulet" chance="50000"/>
		<item name="magic plate armor" chance="75000"/>
		<item name="mastermind shield" chance="18000"/>
		<item name="gold coin" chance="100000" countmax="87"/> <!-- Gold Coin -->
		<item name="white pearl" countmax="15" chance1="13000"/>
		<item name="small amethyst" countmax="10" chance1="13000"/>
	</loot>
	
	    <script>
        <event name="avisarServer"/>
    </script>
	
</monster>

 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

  • Respostas 37
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vocês estão utilizando funções de 0.x em um 1.x.    Várias funções não são compatíveis, verifiquem isso.

  • resolvido @Faysal  desculpe a demora tive que dar uma estudada rapidinha pra pegar o jeito novamente rsrs     script.lua function onDeath(monster, corpse, killer, mostDamageKiller, unjus

Posted Images

Postado
  • Autor
6 minutos atrás, L3K0T disse:

local boss = {"Diablo"}

function onKill(cid, target, lastHit)
	
	
		if isPlayer(cid) and isInArray(boss, getCreatureName(target)) then
			broadcastMessage("O jogador ".. getCreatureName(cid) .." matou o boss " .. getCreatureName(target) ..".")
		end
		
		
	return true
end

tang:

 


<event type="death" name="avisarServer" event="script" value="avisar.lua"/>

monstro.xml

 


<?xml version="1.0" encoding="UTF-8"?>
<monster name="Diablo" nameDescription="Diablo" race="undead" experience="5000" speed="900" manacost="0" script="rewardboss.lua">
  <health now="2000000" max="2000000"/>
  <look type="12" head="0" body="77" legs="77" feet="77" corpse="5995"/>
  <targetchange interval="3000" chance="100"/>
  <strategy attack="65" defense="5"/>
  <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="90"/>
    <flag runonhealth="0"/>
  </flags>
   <script>
        <event name="diabloBroadcast"/>
    </script>
  <attacks>
    <attack name="melee" interval="1000" skill="200" attack="200"/>
    <attack name="death rain" interval="500"/>
    <attack name="diablo change" interval="1000"/>
    <attack name="orshabaal_deathstar" interval="10000" min="-500" max="-1500"/>
		<attack name="firefield" interval="1000" chance="30" radius="5" target="0">
			<attribute key="areaEffect" value="fireattack"/>
		</attack>
  </attacks>
  <defenses armor="10" defense="10">
    <defense name="healing" interval="20000" chance="5" min="1000" max="10000">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
    <defense name="speed" interval="2000" chance="8" speedchange="10" duration="5000">
      <attribute key="areaEffect" value="redshimmer"/>
    </defense>
  </defenses>
  <immunities>
    <immunity physical="0"/>
    <immunity energy="0"/>
    <immunity fire="1"/>
    <immunity poison="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
  </immunities>
	<loot>
		<item name="stealth ring" chance="13000"/>
		<item name="shield of honour" chance="50000"/>
		<item name="gold coin" chance="100000" countmax="35"/> <!-- Gold Coin -->
		<item name="fire rainbow shield" chance="75000"/>
		<item name="star amulet" chance="50000"/>
		<item name="magic plate armor" chance="75000"/>
		<item name="mastermind shield" chance="18000"/>
		<item name="gold coin" chance="100000" countmax="87"/> <!-- Gold Coin -->
		<item name="white pearl" countmax="15" chance1="13000"/>
		<item name="small amethyst" countmax="10" chance1="13000"/>
	</loot>
	
	    <script>
        <event name="avisarServer"/>
    </script>
	
</monster>

 

[Warning - Monster::Monster] Unknown event name: avisarServer

ja coloquei o evento no boss
ja registrei em others > login
e ja coloquei a tag em creaturescript

Postado
  • Diretor
1 minuto atrás, Faysal disse:

[Warning - Monster::Monster] Unknown event name: avisarServer

ja coloquei o evento no boss
ja registrei em others > login
e ja coloquei a tag em creaturescript

a tag do creaturescript é diferente manda o creaturescript.xml pra mim ver

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Postado
  • Diretor
1 minuto atrás, Faysal disse:

    <event type="kill" name="avisarServer" script="custom/turtleTask.lua"/>

tenta essa tag 

 

<event type="death" name="avisarServer" event="script" value="avisar.lua"/>

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo