Ir para conteúdo

Featured Replies

Resolvido por Dwarfer

Ir para solução
  • Respostas 7
  • Visualizações 591
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Em creaturescritps/scripts crie um arquivo:   tpskill.lua     No arquivo do monstro, antes de </monster>, adicione:  <script> <event name="RewardTp"/>

  • Sim, dá sim. Só tenta explicar tudo de uma vez para não ficar esse muda muda rsrsrs. Segue o script:     Valeu!

Posted Images

Postado

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

Spoiler

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

 

                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Postado

Em creaturescritps/scripts crie um arquivo:

 

tpskill.lua

 

Spoiler

local new_pos = {x = 1, y = 1, z = 1} -- posição para onde o player será teleportado
local addSkill = SKILL_AXE -- qual o skill
local amount = 1 -- quanto de skill adicionará

function onDeath(cid, corpse, deathList)
local player = deathList[1]
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You have defeated the " .. getCreatureName(cid).."!")
doPlayerAddSkill(player, addSkill, amount) 
addEvent(doTeleportThing,1,player,new_pos)
return true
end

function doPlayerAddSkill(cid, skill, amount, round)
	local amount = amount or 1
	if(skill == SKILL__LEVEL) then
		return doPlayerAddLevel(cid, amount, round)
	elseif(skill == SKILL__MAGLEVEL) then
		return doPlayerAddMagLevel(cid, amount)
	end
	for i = 1, amount do
		doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false)
	end
	return true
end

 

 

No arquivo do monstro, antes de </monster>, adicione: 
<script>
<event name="RewardTp"/>
</script>

 

Em creaturescripts.xml, adicione a tag:  <event type="death" name="RewardTp" event="script" value="tpskill.lua"/>

Contato:

 

Postado
  • Autor
41 minutos atrás, Dwarfer disse:

Em creaturescritps/scripts crie um arquivo:

 

tpskill.lua

 

  Ocultar conteúdo


local new_pos = {x = 1, y = 1, z = 1} -- posição para onde o player será teleportado
local addSkill = SKILL_AXE -- qual o skill
local amount = 1 -- quanto de skill adicionará

function onDeath(cid, corpse, deathList)
local player = deathList[1]
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You have defeated the " .. getCreatureName(cid).."!")
doPlayerAddSkill(player, addSkill, amount) 
addEvent(doTeleportThing,1,player,new_pos)
return true
end

function doPlayerAddSkill(cid, skill, amount, round)
	local amount = amount or 1
	if(skill == SKILL__LEVEL) then
		return doPlayerAddLevel(cid, amount, round)
	elseif(skill == SKILL__MAGLEVEL) then
		return doPlayerAddMagLevel(cid, amount)
	end
	for i = 1, amount do
		doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false)
	end
	return true
end

 

 

No arquivo do monstro, antes de </monster>, adicione: 
<script>
<event name="RewardTp"/>
</script>

 

Em creaturescripts.xml, adicione a tag:  <event type="death" name="RewardTp" event="script" value="tpskill.lua"/>

 

Esse que estou usando é apenas para TEST.

É normal aquele event ficar preto ?

image.thumb.png.6f5736b1b34e3e010f07b09c56998078.png

 

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

Informação Importante

Confirmação de Termo