Ir para conteúdo
  • Cadastre-se

Posts Recomendados

BOM dia, Criei um tópico para que pudesse concluir um script aqui em casa.  Tentei desta maneira, Mais não consigo termina-lo, fazendo com que as conditions funcione em monstros.

Resumindo, é um script de bleed e conditions que funciona por ataque, eu ja completei ele bastante. Ja ta quase um mod, kkk,.

Queria saber se onStatsChange funciona em monstros porque, a compraracão isMonster(cid) parece nao fazer efeito. Ou oque está errado? Eu fiz um recorte para montar esse sistema, Peguei outros scripts já existentes como modelo, como o Experience Weapon system by whitewolf e cykotitan.  Testando em TFS 0.4, 9.83. 

 

 

Aqui vai o meu Script que não dá conditions em monstros:  

 

è um lua do creaturescripts.



local gelocondition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(gelocondition, CONDITION_PARAM_TICKS, 2000)   
setConditionFormula(gelocondition, -0.9, 0, -0.9, 0)  

local tera = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(tera, CONDITION_PARAM_TICKS, 4000)
setConditionParam(tera, CONDITION_PARAM_BUFF, true)
setConditionParam(tera, CONDITION_PARAM_SKILL_CLUBPERCENT, 80)
setConditionParam(tera, CONDITION_PARAM_SKILL_SWORDPERCENT, 80)
setConditionParam(tera, CONDITION_PARAM_SKILL_AXEPERCENT, 80)
setConditionParam(tera, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 80)
setConditionParam(tera, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 80)
setConditionParam(tera, CONDITION_PARAM_SKILL_SHIELDPERCENT, 80)


local manaup = createConditionObject(CONDITION_FOOD)
setConditionParam(manaup, CONDITION_PARAM_TICKS, 5000)
setConditionParam(manaup, CONDITION_PARAM_BUFF, true)
setConditionParam(manaup, CONDITION_PARAM_MANAGAIN, 15)
setConditionParam(manaup, CONDITION_PARAM_MANATICKS, 1000)

local healthup = createConditionObject(CONDITION_FOOD)
setConditionParam(healthup, CONDITION_PARAM_TICKS, 5000)
setConditionParam(healthup, CONDITION_PARAM_BUFF, true)
setConditionParam(healthup, CONDITION_PARAM_HEALTHGAIN, 5)
setConditionParam(healthup, CONDITION_PARAM_HEALTHTICKS, 1000)      
			
	local area = createCombatArea(
	{
	{0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0},
	{0, 0, 3, 0, 0},
	{0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0}
	})
			


					
					local bleedaxe = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(bleedaxe, CONDITION_PARAM_DELAYED, 1)
                    local damageTable1 = {
                         {math.random(3), -(math.random(25))},
                         {math.random(3), -(math.random(15))},
                         {math.random(3), -(math.random(5))},
                          }
                    for i = 1, #damageTable1 do
                    local t = damageTable1[i]
                    addDamageCondition(bleedaxe, t[1], 1000, t[2])
                    end	
                    
					local bleeddistance = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(bleeddistance, CONDITION_PARAM_DELAYED, 1)
                    local damageTable2 = {
                         {math.random(3), -(math.random(30))},
                         {math.random(3), -(math.random(10))},
                         {math.random(3), -(math.random(15))},
                          }
                    for i = 1, #damageTable2 do
                    local t = damageTable2[i]
                    addDamageCondition(bleeddistance, t[1], 1000, t[2])
                    end

					local fire = createConditionObject(CONDITION_FIRE)
                    setConditionParam(fire, CONDITION_PARAM_DELAYED, 1)
                    local damageTable3 = {
                         {math.random(3), -(math.random(30))},
                         {math.random(3), -(math.random(10))},
                         {math.random(3), -(math.random(15))},
                          }
                    for i = 1, #damageTable3 do
                    local t = damageTable3[i]
                    addDamageCondition(fire, t[1], 1000, t[2])
                    end											
	                
					local teradamage = createConditionObject(CONDITION_POISON)
                    setConditionParam(teradamage, CONDITION_PARAM_DELAYED, 1)
                    local damageTable4 = {
                         {1, -(math.random(9))},
                         {2, -(math.random(9))},
                         {1, -(math.random(9))},
                          }
                    for i = 1, #damageTable4 do
                    local t = damageTable4[i]
                    addDamageCondition(teradamage, t[1], 1000, t[2])
                    end	

                    local holydamage = createConditionObject(CONDITION_DAZZLED)
                    setConditionParam(holydamage, CONDITION_PARAM_DELAYED, 1)
                    local damageTable5 = {
                         {math.random(3, 13), -(math.random(2))},
                         {math.random(7, 20), -(math.random(3))},
                         {math.random(9, 27), -(math.random(4))},
                          }
                    for i = 1, #damageTable5 do
                    local t = damageTable5[i]
                    addDamageCondition(holydamage, t[1], 4000, t[2])
                    end

                    local deathdamage = createConditionObject(CONDITION_CURSED)
                    setConditionParam(deathdamage, CONDITION_PARAM_DELAYED, 1)
                    local damageTable6 = {
                         {1, -(math.random(2))},
                         {1, -(math.random(12))},
                         {1, -(math.random(26))},
						 {1, -(math.random(28))},
						 {1, -(math.random(14))},
                          }
                    for i = 1, #damageTable6 do
                    local t = damageTable6[i]
                    addDamageCondition(deathdamage, t[1], 5000, t[2])
                    end	

                    local gelo = createConditionObject(CONDITION_FREEZING)
                    setConditionParam(gelo, CONDITION_PARAM_DELAYED, 1)
                    local damageTable7 = {
                         {1, -(math.random(6))},
                         {1, -(math.random(4))},
                         {1, -(math.random(3))},
						 {1, -(math.random(2))},
                          }
                    for i = 1, #damageTable7 do
                    local t = damageTable7[i]
                    addDamageCondition(gelo, t[1], 10000, t[2])
                    end	
                    
					local monster = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(monster, CONDITION_PARAM_DELAYED, 1)
                    local damageTable8 = {
                         {1, -(math.random(2))},
                         {1, -(math.random(2))},
                         {1, -(math.random(1))},
						 {1, -(math.random(1))},
                          }
                    for i = 1, #damageTable8 do
                    local t = damageTable8[i]
                    addDamageCondition(monster, t[1], 1000, t[2])
                    end	
					
					local monstersmall = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(monstersmall, CONDITION_PARAM_DELAYED, 1)
                    local damageTable9 = {
                         {1, -(math.random(16))},
                         {1, -(math.random(14))},
                         {1, -(math.random(13))},
						 {1, -(math.random(12))},
                          }
                    for i = 1, #damageTable9 do
                    local t = damageTable9[i]
                    addDamageCondition(monstersmall, t[1], 1000, t[2])
                    end	
					
					local monsteremedium = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(monsteremedium, CONDITION_PARAM_DELAYED, 1)
                    local damageTable10 = {
                         {1, -(math.random(40, 66))},
                         {1, -(math.random(30, 44))},
                         {1, -(math.random(10, 23))},
						 {1, -(math.random(5, 18))},
                          }
                    for i = 1, #damageTable10 do
                    local t = damageTable10[i]
                    addDamageCondition(monsteremedium, t[1], 1000, t[2])
                    end	
					
					local monsterbig = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(monsterbig, CONDITION_PARAM_DELAYED, 1)
                    local damageTable11 = {
                         {1, -(math.random(60, 106))},
                         {1, -(math.random(50, 94))},
                         {1, -(math.random(40, 70))},
						 {1, -(math.random(30, 60))},
                          }
                    for i = 1, #damageTable11 do
                    local t = damageTable11[i]
                    addDamageCondition(monsterbig, t[1], 1000, t[2])
                    end	
					
					local monsterbigger = createConditionObject(CONDITION_BLEEDING)
                    setConditionParam(monsterbigger, CONDITION_PARAM_DELAYED, 1)
                    local damageTable12 = {
                         {1, -(math.random(120, 190))},
                         {1, -(math.random(100, 170))},
                         {1, -(math.random(80, 140))},
						 {1, -(math.random(60, 120))},
						 {1, -(math.random(40, 100))},
                          }
                    for i = 1, #damageTable12 do
                    local t = damageTable12[i]
                    addDamageCondition(monsterbigger, t[1], 1000, t[2])
                    end	
					
					local fire2 = createConditionObject(CONDITION_FIRE)
                    setConditionParam(fire2, CONDITION_PARAM_DELAYED, 1)
                    local damageTable13 = {
                         {math.random(3), -(math.random(30, 45))},
                         {math.random(3), -(math.random(10, 34))},
                         {math.random(3), -(math.random(15, 45))},
                          }
                    for i = 1, #damageTable13 do
                    local t = damageTable13[i]
                    addDamageCondition(fire2, t[1], 1000, t[2])
                    end
					
					local fire3 = createConditionObject(CONDITION_FIRE)
                    setConditionParam(fire3, CONDITION_PARAM_DELAYED, 1)
                    local damageTable14 = {
                         {math.random(3), -(math.random(40, 60))},
                         {math.random(3), -(math.random(50, 60))},
                         {math.random(3), -(math.random(65, 75))},
                          }
                    for i = 1, #damageTable14 do
                    local t = damageTable14[i]
                    addDamageCondition(fire3, t[1], 1000, t[2])
                    end		



function onStatsChange(cid, attacker, type, combat, value)
   if type == STATSCHANGE_HEALTHLOSS then  
    
	    if isPlayer(attacker) and isPlayer(cid) then
		    if combat ==  COMBAT_PHYSICALDAMAGE then
			
			  if getWeapon(attacker) ~= false and getCreatureStorage(cid, 65) == -1 and math.random(100) < (91) and value >= 40 then
			    local f = getItemWeaponType((getWeapon(attacker)).uid)
			    if (f == 1 or f == 3) then			       	  				    		
																				
					doCreatureSetStorage(cid, 65, 1)
			        doTargetCombatCondition(cid, bleedaxe, 255) 
				    doCreatureSetStorage(cid, 65, -1)	
			    
				
				elseif f == 4 and getDistanceBetween(getThingPos(cid), getThingPos(attacker)) >= 2 then
				    local distance = getDistanceBetween(getThingPos(cid), getThingPos(attacker))
					doCreatureSetStorage(cid, 65, 1)
			        doTargetCombatCondition(cid, bleeddistance, 255) 
				    doCreatureSetStorage(cid, 65, -1)					
			         				
				
				elseif f == 2 then
			        damage = getItemInfo((getWeapon(attacker)).itemid).attack
					doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, getThingPos(cid), area, -2*(tonumber(damage)), -4*(tonumber(damage)), 34)
			
			
			    end
			  end
			end 
			 
			if combat == COMBAT_FIREDAMAGE then 
			
		      if getCreatureStorage(cid, 66) == -1 and math.random(100) < (100) then
			        if value <= 150 then
				        doCreatureSetStorage(cid, 66, 1)
			            doTargetCombatCondition(cid, fire, 255)
			            doCreatureSetStorage(cid, 66, -1)
				    end
					if value > 150 and value <= 400 then
					    doCreatureSetStorage(cid, 66, 1)
			            doTargetCombatCondition(cid, fire2, 255)
			            doCreatureSetStorage(cid, 66, -1)
				    end
					if value > 400 then
					    doCreatureSetStorage(cid, 66, 1)
			            doTargetCombatCondition(cid, fire3, 255)
			            doCreatureSetStorage(cid, 66, -1)
				    end
				
				 
		      end
			end
			
			
			if combat == COMBAT_ENERGYDAMAGE then			   
			 
			   if getCreatureStorage(cid, 67) == -1 and math.random(100) < (101) and value >= 30 then
			      
				   function onGetFormulaValues(cid, level, maglevel)
	               local min = -((maglevel*1.4)+8)
	               local max = -(((level/12)+(maglevel*1.7))+13)
	               return min, max
                   end				   
				   
				   doCreatureSetStorage(cid, 67, 1)
				   doAddCondition(attacker, manaup)
				   doTargetCombatMana(atacker, cid, -(min), -(max), 1)
				   doCreatureSetStorage(cid, 67, -1)
				       for i = 1, 5 do
					   addEvent(function()
						if isCreature(attacker) then
						doSendMagicEffect(getThingPos(attacker), 12)
						end
					   end, 1 + (1000*i))
					  end 
			
			
			


			   end
			end
	    
	
	    
            if combat == COMBAT_EARTHDAMAGE  then
                
				if getCreatureStorage(cid, 68) == -1 and math.random(100) < (101) and value >= 10 then			
		            doCreatureSetStorage(cid, 68, 1)
					doTargetCombatCondition(cid, teradamage, 255)
					doAddCondition(cid, tera)
					doCreatureSetStorage(cid, 68, -1)
		        
				
				
				
				
				end
		    
								
			end
		
		    
			
			if combat == COMBAT_HOLYDAMAGE then 
		         
		        if getCreatureStorage(cid, 69) == -1 and math.random(100) < (101) and value >= 10 then
		            doCreatureSetStorage(cid, 69, 1)
					doTargetCombatCondition(cid, holydamage, 255)
					doCreatureSetStorage(cid, 69, -1)
		
		
		        
				end
		    
			end
		
		
		   
		   
		    if combat == COMBAT_DEATHDAMAGE then
			   
		        
		        if getCreatureStorage(cid, 70) == -1 and math.random(100) < (101) and value >= 10 then   
		            
					doCreatureSetStorage(cid, 70, 1)
		            doAddCondition(attacker, healthup)
				    doTargetCombatCondition(cid, deathdamage, 255)
				    doCreatureSetStorage(cid, 70, -1)
				       for i = 1, 5 do
					   addEvent(function()
						if isCreature(attacker) then
						doSendMagicEffect(getThingPos(attacker), 12)
						end
					   end, 1 + (1000*i))
					  end 
		    
			
			
			
			    
				
				
				end
			
			end


            if combat == COMBAT_ICEDAMAGE then

                if getCreatureStorage(cid, 71) == -1 and math.random(100) < (100) and value >= 10 then   
			
			        doCreatureSetStorage(cid, 71, 1)
					doAddCondition(cid, gelocondition)
					doTargetCombatCondition(cid, gelo, 255)
			        doCreatureSetStorage(cid, 71, -1)
			
			    
			
			
			    end
			
			end
		
		
		
		
		
		
		
		
		end
	    
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		if isMonster(attacker) and isPlayer(cid) then
	        if combat == COMBAT_PHYSICALDAMAGE then 
			  if math.random(100) < (90) and value >= 40 then
	             local mdmg = getCreatureMaxHealth(attacker)                   
					if mdmg > 20 and mdmg <= 50 and getCreatureStorage(cid, 72) == -1 then
				  
				  doCreatureSetStorage(cid, 72, 1)				 
				  doTargetCombatCondition(cid, monster, 255)
			      doCreatureSetStorage(cid, 72, -1)
	                end
	                
					if mdmg > 50 and mdmg <= 400 and getCreatureStorage(cid, 73) == -1 then
                  doCreatureSetStorage(cid, 73, 1)				 
				  doTargetCombatCondition(cid, monstersmall, 255)
			      doCreatureSetStorage(cid, 73, -1)
                    end
					
					if mdmg > 400 and mdmg <= 800 and getCreatureStorage(cid, 74) == -1 then
                  doCreatureSetStorage(cid, 74, 1)				 
				  doTargetCombatCondition(cid, monstermedium, 255)
			      doCreatureSetStorage(cid, 74, -1)
                    end

                   if mdmg > 800 and mdmg <= 1200 and getCreatureStorage(cid, 75) == -1 then
                  doCreatureSetStorage(cid, 75, 1)				 
				  doTargetCombatCondition(cid, monsterbig, 255)
			      doCreatureSetStorage(cid, 75, -1)
                    end
					
					 if mdmg > 1200 and getCreatureStorage(cid, 76) == -1 then
                  doCreatureSetStorage(cid, 76, 1)				 
				  doTargetCombatCondition(cid, monsterbigger, 255)
			      doCreatureSetStorage(cid, 76, -1)
                    end
				
	          end
			end
	    
		
		    if combat == COMBAT_FIREDAMAGE then
			    
				if getCreatureStorage(cid, 77) == -1 and math.random(100) < (100) then
		            if value < 150 then
					    doCreatureSetStorage(cid, 77, 1)				 
				        doTargetCombatCondition(cid, fire, 255)
			            doCreatureSetStorage(cid, 77, -1)
		            end
		            if value > 150 and value <= 400 then
					    doCreatureSetStorage(cid, 77, 1)
			            doTargetCombatCondition(cid, fire2, 255)
			            doCreatureSetStorage(cid, 77, -1)
				    end		            					
					if value > 400 then
					    doCreatureSetStorage(cid, 77, 1)
			            doTargetCombatCondition(cid, fire3, 255)
			            doCreatureSetStorage(cid, 77, -1)
				    end
		        
				
				end
		
		
		
		
		
		    end
		
		    if combat == COMBAT_ENERGYDAMAGE then
		    
			    if getCreatureStorage(cid, 78) == -1 and math.random(100) < (100) and value >= 30 then
		            
				    doCreatureSetStorage(cid, 78, 1)				
				    doTargetCombatMana(atacker, cid, -(math.random(10, 40)), -(math.random(40,90)), 1)
				    doCreatureSetStorage(cid, 78, -1)
				
				
				end
			
		    
			
			
			
			end
		
		    if combat == COMBAT_EARTHDAMAGE then
		
		        if getCreatureStorage(cid, 79) == -1 and math.random(100) < (100) and value >= 20 then
		            
					doCreatureSetStorage(cid, 79, 1)
					doTargetCombatCondition(cid, teradamage, 255)
					doAddCondition(cid, tera)
					doCreatureSetStorage(cid, 79, -1)
		
		
		        end
		
						
		    end
		
		    if combat == COMBAT_HOLYDAMAGE then
		        
				if getCreatureStorage(cid, 80) == -1 and math.random(100) < (100) and value >= 10 then
		    
		            doCreatureSetStorage(cid, 80, 1)
					doTargetCombatCondition(cid, holydamage, 255)
					doCreatureSetStorage(cid, 80, -1)
		
		
			    end
		
		    
			
			end
		
		
		
	        if combat == COMBAT_DEATHDAMAGE then
		
		
		        if getCreatureStorage(cid, 81) == -1 and math.random(100) < (100) and value >= 10 then
		            
					doCreatureSetStorage(cid, 81, 1)		           
				    doTargetCombatCondition(cid, deathdamage, 255)
				    doCreatureSetStorage(cid, 81, -1)
				       
		
		
		        
				
				
				end
			end
		
		
		
		end
	    
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
    
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	end
return true
end

E não dá nenhum erro na distro.

 

Obrigado Pela atenção. E estou a Espera se Alguém tiver interesse em ajudar.

 

EDIT 19/12:

 

Não consegui ainda fazer com que desse conditions em monstros ou players nesse script com a função onStatsChange. Quem tiver alguma opinião de como fazer para complementar para esse fim. fica a vontade para incrementar o tópico. Ele ta bem grande, mais acho que oque vale é a função. 

 

EDIT 26/12:

 

É parece que a função de Statschange, não reconhece a vida dos monstros né isso? mais como faço para que esse script se estenda também a monstros, Alguém tem solução? 

Atualmente ele funciona em PVP contra players e quando um monstro ataca, mais só. Abraços e cometem. E também se for possível, e não trabalhoso como faço para diminuir o script?  

 

Editado por lucasvtr1
Eu Procurei editar aqui em casa e consegui funcionar nos players. Mas ainda não funciona nos monstros. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Esta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.

Spoiler

This is an automated message! This topic has been moved to the correct area.
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Doria Louro
      Olá nobre senhores, tudo bem com vocês?
      Servidor: TFS 0.3.6
      Cliente:    8.60
       
      Estou com a seguinte ideia, criar conjuntos de equipamentos em meu servidor, que aumente os atributos do player ao utilizar o conjunto/set completo, exemplo:

       
      Um exemplo dos itens contidos no meu itens.xml:
      <item id="2487" article="a" name="warrior armor"> <attribute key="weight" value="9000" /> <attribute key="armor" value="13" /> <attribute key="skillSword" value="1" /> <attribute key="skillAxe" value="1" /> <attribute key="skillClub" value="1" /> <attribute key="slotType" value="body" /> <attribute key="healthGain" value="2" /> <attribute key="healthTicks" value="3000" /> <attribute key="description" value="+2 HP every 3s, Sale value: $5000" /> </item>  
      Em meu movements.xml:
      <movevent type="Equip" itemid="2487" level="30" slot="armor" event="function" value="onEquipItem"> <vocation id="8" /> </movevent> <movevent type="DeEquip" itemid="2487" slot="armor" event="function" value="onDeEquipItem" />  
      Entretanto eu fico limitado aos eventos de Equip default, se eu altero para meu script full_set.lua:
      <movevent type="Equip" itemid="2487" level="30" slot="armor" event="script" value="full_set.lua"> <vocation id="8" /> </movevent>  
      Executando meu script  eu perco os atributos contidos no itens.xml, tais como o aumento de skill, ganho de HP por segundo e também qualquer vocação pode utilizar o equipamento.
       
      Simplificando, é possível utilizar os recursos padrões de Equip do movements e adicionar um/mais scripts personalizáveis sem perder as funcionalidades da function onEquipItem?
      Meu objetivo é quanto mais partes do set o jogador possuir, mais bônus ele obterá, um exemplo:
       
      Warrior Set
      [2 peças] - Aumenta em 100 HP total
      [4 peças] - Aumenta em 2 shielding
       
      Eu tenho uma ideia de colocar essa verificação no creaturescripts, entretanto não gostaria de tomar esse rumo pois acredito que poderia sobrecarregar meu servidor com as verificações por thing.
      Efetuei consultas pela internet e geralmente o pessoa que tem essa duvida utiliza itens que não tem status, tipo um ring, no meu caso é diferente.
       
      Possível solução: Seria utilizar o código Equip padrão no meu script e depois aplicar meu código, entretanto eu não encontrei em nenhum local esse script de Equip,
       
      Quem puder me ajudar eu ficaria eternamente grato já que esse é um sistema chave no meu projeto, agradeço desde já
    • Por Imperius
      Tinha visto isso no servidor do MegaTibia / Kaldrox e achei bem interessante.
       
      Todos os tópicos que encontrei sobre o assunto de alterar a cor das mensagens dos GMs, CMs e ADM no channel Help para vermelho, falavam que tinham que fazer uma configuração na própria source do servidor.
       
      Fiz uma gambiarra que funciona, sem a necessidade de mexer na source do servidor e de utilizar comandos para isso. Testei somente em TFS 0.4 e funciona tranquilamente.
       
      segue abaixo como configurar em seu otserver:
       
      data > talkactions > scripts > crie um arquivo chamado gmsayred.lua e cole o código abaixo:
       
      function onSay(cid, words, param, channel) if channel == CHANNEL_HELP then for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', "".. getCreatureName(cid) .. ": ".. words, TALKTYPE_CHANNEL_R1, CHANNEL_HELP) end return true end end  
      em talkactions.xml cole a tag abaixo:

       
      <!-- Gamemasters --> <talkaction default="yes" filter="quotation" logged="no" access="3" event="script" value="gmsayred.lua"/>    
      e pronto! Agora é só enviar alguma mensagem no Help que a mensagem ficará em vermelho.
       

       
    • Por Maniaco
      Salve TibiaKing!!! TFS 0.4 . 8.60
       
      Estou implementando o Sistema do @WooX de Cave Exlusiva

      Link:
       
      Porem estou com um problema seguindo o tutorial completo dele acabo tendo um retorno de erro na Distro! E ja que o mesmo nao entra no forum deis de 14/01! Venho solicitar ajuda de vocês!
      Caso alguem tenha o Discord Dele Favor me Passe  
      Vamos lá!
      Erro:
       
      Script :
       
      Lib
       
       
      Print Rme:
       
       
      Lembrando que nao esta funcionando em geral, Acrédito que eu tenha pulado algo ou deixado passar despercebido!
      Espero que alguem consiga me ajudar vlw!
    • Por Maniaco
      Boa Tarde TibiaKing!!!
       
      Bom estou precisando arrumar um script, não deve ser muito difícil !! (pra quem sabe  !)
      Quem poder ajudar já agradeço.
       
      Resumindo apartir do momento que falo Travel, Yes para o npc ele me teleporta para posicao inicial me transformando(LookType) e precisa me levar até o destino final. (posFinal)
      até ai tudo bem problema que ele comeca a funcionar e me leva para lugar aleatorio e fica parado lá imovel. ( não da erro na Distro ) Apenas fico parado na LookType de barco.
       
      Uso tfs 0.4 8.60
       
      local posis = {
      --[pos do npc] = {pos inicial, pos final},
      [{x = 115, y = 143, z = 10}] = {posIni = {x = 114, y = 134, z = 10}, posFinal = {x = 76, y = 134, z = 10}},
      [{x = 74, y = 132, z = 10}] = {posIni = {x = 76, y = 134, z = 10}, posFinal = {x = 95, y = 147, z = 10}},
      }
       
       é um NPC
       
       
      .LUA DO NPC
       
      LIB - TRAVEL.LUA
       
       
       
      ,XML
       
    • Por MatteusDeli
      Nesse tópico você irá aprender a diferença entre ItemID, ActionID e UniqueID na criação de scripts.
       
      Primeiramente vamos começar com o ItemID, imagine que você está criando um simples script que o player pode ter acesso a uma área VIP, só que para ele entrar, primeiro precisará passar por um tile especial que possui o ID 471, até aqui tudo bem, só que qualquer player do servidor irá ter acesso também, já que não possui nenhuma restrição.
       
      Como poderíamos resolver isso?
       
      É aqui que entra a função da ActionID, com ela podemos dizer que os tiles que tiverem o valor 1000 no atributo ActionID, serão os tiles referentes a área VIP. Agora temos uma maneira de diferenciar os tiles comuns dos que são VIPs, veja como ficaria:
       

      (tiles sem as ActionIDs no valor de 1000)
       
      Repare que os 3 tiles tem apenas o atributo ItemID: [471]. Todos os players poderiam passar sem problemas… Caso você use apenas esse tipo de tile para as suas áreas VIPs então não tem problema, agora se você usa esses mesmos tiles para outras finalidades, então você precisará recorrer a ActionID, para que assim consiga diferenciá-los.
       
      Vamos adicionar as ActionIDs então:
       

      (tiles com as ActionIDs adicionados no valor de 1000)
       
      Pronto, agora apenas esse tiles terão a função de controlar a entrada para a área VIP!
       
      Bom, então você deve estar se perguntando, aonde que o UniqueID entra nessa história?
       
      O UniqueID é parecido com a ActionID com apenas uma diferença. O valor que você define para ele deve ser único para o servidor inteiro, caso ele se repita aparecerá um aviso na sua distro, mais ou menos como este…
       

       
      Repare quantos UniqueIDs duplicados existem, isso é ruim porque quanto mais tiver mais tempo demorará para o servidor iniciar, entre outras coisas como conflitos de scripts.
       
      Concluindo…
       
      O ItemID é usado quando você quer que todos os itens com esse ID façam uma ação, por exemplo a fishing rod, qualquer player pode comprar uma no NPC e começar a pescar.
       
      A ActionID é usado geralmente quando você quer diferenciar os mesmos itens um dos outros. Eu tenho 2 crystal rings só que apenas um deles vai me curar 500 de vida quando usá-lo.
       
      O UniqueID é quando você quer definir um ID único para um determinado item e só terá apenas um dele no servidor, um exemplo seria uma estátua que vai dar ao player um determinado item e só existirá somente uma dela no jogo.
       
      Tentei ser o mais breve e direto sobre esse assunto, espero que tenha ficado claro… Agora é só praticar!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo