Ir para conteúdo
  • 0

Ajuda com alguns scripts


Anuudek

Pergunta

9 respostass a esta questão

Posts Recomendados

  • 0

Ah, entendi. Deixa assim:

 

login.lua:

 

 

-- ordered as in creaturescripts.xml
local events = {
'pythiusDead',
'bossesGrayIsland',
'ElementalSpheres',
'ElementalSpheresKill',
'ElementalSpheresLogin',
'WarzoneThree',
'WarzoneTwo',
'bossesWarzone',
'SvargrondArenaKill',
'PharaoKillPortal',
'inServiceOfYalaharQuestsDiseased',
'inServiceOfYalaharQuestsMorik',
'inServiceOfYalaharQuestsQuara',
'inquisitionQuestBosses',
'inquisitionQuestUngreez',
'killingInTheNameOfQuestKills',
'TaskCustom',
'Yielothax',
'Energized',
'Raging',
'MastersVoiceServants',
'wrathBoss',
'wrathZalamon',
'PlayerDeath',
'ThievesGuildNomad',
'AdvanceSave',
'SpikeDrillworm',
'SecretServiceBlackKnight'
'advanceBless'
'loginBless'
'deathBless'
'advanceBless'
'loginBless'
'deathBless'
}
 
function onLogin(cid)
local player = Player(cid)
 
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
 
loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
 
for i = 1, #events do
player:registerEvent(events[i])
end
for b = 1, 5 do
  if player:getLevel(cid) <= 80 then
    player:addBlessing(cid, b)
  end
end
return true
end

 

 

 

creaturescripts.xml:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
 
<!-- Secret Service Quest -->
<event type="kill" name="SecretServiceBlackKnight" script="others/blackKnight.lua"/>
 
<!-- Spike Task: Drillworm -->
<event type="kill" name="SpikeDrillworm" script="spike task/drillworm.lua"/>
 
<!-- Thieves Guild Quest -->
<event type="kill" name="ThievesGuildNomad" script="others/nomad.lua"/>
 
<!-- Pythius The Rotten -->
<event type="kill" name="pythiusDead" script="pythius the rotten/pythiusDead.lua" />
 
<!-- Gray Island -->
<event type="kill" name="bossesGrayIsland" script="gray island/bossesgrayisland.lua"/> 
 
<!-- The Elemental Spheres -->
<event type="death" name="ElementalSpheres" script="elemental spheres quest/the_elemental_spheres.lua"/>
<event type="kill" name="ElementalSpheresKill" script="elemental spheres quest/the_elemental_spheres.lua"/>
<event type="login" name="ElementalSpheresLogin" script="elemental spheres quest/the_elemental_spheres.lua"/>
 
<!-- Gnomebase -->
<event type="kill" name="WarzoneTwo" script="gnomebase/warzone2.lua"/>
<event type="kill" name="WarzoneThree" script="gnomebase/warzone3.lua"/>
<event type="kill" name="bossesWarzone" script="gnomebase/bossesWarzone.lua"/> 
 
<!-- Svargrond Arena: Killing a boss -->
<event type="kill" name="SvargrondArenaKill" script="svargrond arena quest/arena_kill.lua"/>
 
<!-- Pharaos: Portal to reward room -->
<event type="kill" name="PharaoKillPortal" script="others/pharaoPortal.lua"/>
 
<!-- In Service Of Yalahar Quest -->
<event type="kill" name="inServiceOfYalaharQuestsDiseased" script="in service of yalahar quest/inServiceOfYalaharQuestsDiseased.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsMorik" script="in service of yalahar quest/inServiceOfYalaharQuestsMorik.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsQuara" script="in service of yalahar quest/inServiceOfYalaharQuestsQuara.lua"/>
 
<!-- Inquisition Quest -->
<event type="kill" name="inquisitionQuestBosses" script="inquisition quest/inquisitionQuestBosses.lua"/>
<event type="kill" name="inquisitionQuestUngreez" script="inquisition quest/inquisitionQuestUngreez.lua"/>
 
<!-- Killing In The Name Of Quest -->
<event type="kill" name="killingInTheNameOfQuestKills" script="killing in the name of quest/killingInTheNameOfQuestKills.lua"/>
<event type="kill" name="TaskCustom" script="killing in the name of quest/taskcustom.lua"/>
 
<!-- Raging Mage Tower -->
<event type="kill" name="Yielothax" script="raging mage tower/yielothax.lua"/>
<event type="kill" name="Energized" script="raging mage tower/energized.lua"/>
<event type="kill" name="Raging" script="raging mage tower/raging.lua"/>
 
<!-- The Masters Voice Quest -->
<event type="kill" name="MastersVoiceServants" script="their master's voice quest/ServantsKill.lua"/>
 
<!-- Wrath of Emperor -->
<event type="kill" name="wrathBoss" script="wrath of the emperor quest/wrathOfTheEmperorQuestBoss.lua"/>
<event type="kill" name="wrathZalamon" script="wrath of the emperor quest/wrathOfTheEmperorQuestZalamon.lua"/>
 
<!-- Others -->
<event type="advance" name="advanceBless" event="script" value="playerBless.lua"/>
<event type="login" name="loginBless" event="script" value="playerBless.lua"/>
<event type="death" name="deathBless" event="script" value="playerBless.lua"/>
<event type="logout" name="Cast" script="others/cast.lua"/>
<event type="login" name="PlayerLogin" script="others/login.lua"/>
<event type="death" name="PlayerDeath" script="others/playerdeath.lua"/>
<event type="advance" name="AdvanceSave" script="others/advance_save.lua"/>
<event type="advance" name="AdvanceRook" script="others/advance_rook.lua"/>
<event type="advance" name="Recompense" script="others/recompense.lua"/>
<event type="login" name="AddonsMounts" script="others/addons-montarias.lua"/>

<event type="advance" name="advanceBless" script="playerBless.lua"/>
<event type="login" name="loginBless" script="playerBless.lua"/>
<event type="death" name="deathBless" script="playerBless.lua"/>
 
</creaturescripts>

 

 


Tópico movido para dúvidas / pedidos resolvidos.

Link para o comentário
Compartilhar em outros sites

  • 0

Mano, eu sou muito BURRO e LERDO. Fiquei horas procurando no config.lua não achei, agora que fui achar! Vou te da REP+... Você sabe onde acho o script de free bless?

Link para o comentário
Compartilhar em outros sites

  • 0

Aqui. Vá em data\creaturescripts no arquivo creaturescripts.xml e adicione essas tags:

<event type="advance" name="advanceBless" event="script" value="playerBless.lua"/>
<event type="login" name="loginBless" event="script" value="playerBless.lua"/>
<event type="death" name="deathBless" event="script" value="playerBless.lua"/>

Agora vá em data\creaturescripts\scripts no arquivo login.lua e adicione isso antes do ultimo return true:

registerCreatureEvent(cid, "advanceBless")
registerCreatureEvent(cid, "loginBless")
registerCreatureEvent(cid, "deathBless")

Agora vá em data\creaturescripts\scripts e crie um arquivo chamado playerBless.lua e coloque isso dentro:

local maxLevel = 10 --level maximo pro player ganhar bless

function onAdvance(cid, skill, oldLevel, newLevel)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

function onDeath(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

function onLogin(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

#CASO ESSE SCRIPT Ñ PEGUE, TENTE ASSIM:

local maxLevel = 10 --level maximo pro player ganhar bless

function onAdvance(cid, skill, oldLevel, newLevel)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		end
	end
return true
end

function onDeath(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		end
	end
return true
end

function onLogin(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
		doPlayerAddBlessing(cid, i)
		end
	end
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

mano tenta isso

 

Em "Data/creaturescripts/scripts" no arquivo login.lua, adicione isso antes do ultimo return true:

for b = 1, 5 do
if player:getLevel(cid) <= 50 then
player:addBlessing(cid, b)
end
end


 

Aqui. Vá em data\creaturescripts no arquivo creaturescripts.xml e adicione essas tags:

<event type="advance" name="advanceBless" event="script" value="playerBless.lua"/>
<event type="login" name="loginBless" event="script" value="playerBless.lua"/>
<event type="death" name="deathBless" event="script" value="playerBless.lua"/>

Agora vá em data\creaturescripts\scripts no arquivo login.lua e adicione isso antes do ultimo return true:

registerCreatureEvent(cid, "advanceBless")
registerCreatureEvent(cid, "loginBless")
registerCreatureEvent(cid, "deathBless")

Agora vá em data\creaturescripts\scripts e crie um arquivo chamado playerBless.lua e coloque isso dentro:

local maxLevel = 10 --level maximo pro player ganhar bless

function onAdvance(cid, skill, oldLevel, newLevel)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

function onDeath(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

function onLogin(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

#CASO ESSE SCRIPT Ñ PEGUE, TENTE ASSIM:

local maxLevel = 10 --level maximo pro player ganhar bless

function onAdvance(cid, skill, oldLevel, newLevel)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		end
	end
return true
end

function onDeath(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		end
	end
return true
end

function onLogin(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
		doPlayerAddBlessing(cid, i)
		end
	end
return true
end

Teria como subir a msg quando o o player morrer e avisar q a bless e ate o lvl ditado?

Link para o comentário
Compartilhar em outros sites

  • 0

@@frank008, botei pra qnd o player morre e pra qnd o player loga:

local maxLevel = 10 --level maximo pro player ganhar bless
local msg = "Você atualmente tem o bless gratuito. Ele durará até o level "..maxLevel..""


function onAdvance(cid, skill, oldLevel, newLevel)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		end
	end
return true
end

function onDeath(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
        doPlayerAddBlessing(cid, i)
		doPlayerSendTextMessage(cid,18, msg)
		end
	end
return true
end

function onLogin(cid)
	if getPlayerLevel(cid) <= maxLevel then
		for i = 1, 5 do
		doPlayerAddBlessing(cid, i)
		doPlayerSendTextMessage(cid,18, msg)
		end
	end
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Confira o ultimo script que eu mandei aqui. Tem logo no inicio dele uma parte pra vc colocar a mensagem que vc quer que apareça pro player que está com o free bless. Vc pode colocar o que vc quiser, apenas deixe a mensagem entre as aspas duplas.


Mas caso tenha dado erro, é por causa das functions que eu usei... Aqui está outra versão, que provavelmente funcionará pra tfs 1.1/1.2:

local maxLevel = 10 --level maximo pro player ganhar bless
local msg = "FREE BLESS"  --mensagem dizendo que o player tem free bless. DEIXE ELA ENTRE ASPAS DUPLAS!
local msgType = 18  --tipo de mensagem

function onAdvance(cid, skill, oldLevel, newLevel)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
		doPlayerSendTextMessage(cid, msgType, msg)
        end
    end
return true
end

function onDeath(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
        end
    end
return true
end

function onLogin(cid)
    if player:getLevel(cid) <= maxLevel then
        for i = 1, 5 do
        player:addBlessing(cid, i)
		doPlayerSendTextMessage(cid, msgType, msg)
        end
    end
return true
end
Editado por Danihcv
script adicionado
Link para o comentário
Compartilhar em outros sites

  • 0

Pelo que me deparei no meu creaturescripts.xml

<event type="advance" name="advanceBless" event="script" value="playerBless.lua"/>
<event type="login" name="loginBless" event="script" value="playerBless.lua"/>
<event type="death" name="deathBless" event="script" value="playerBless.lua"/>

essa parte ai o "event="script" não tem nos outros scripts, tem problema se eu colocar?

@EDIT Não funcionou! Meu login.lua

 

 

-- ordered as in creaturescripts.xml

local events = {
'pythiusDead',
'bossesGrayIsland',
'ElementalSpheres',
'ElementalSpheresKill',
'ElementalSpheresLogin',
'WarzoneThree',
'WarzoneTwo',
'bossesWarzone',
'SvargrondArenaKill',
'PharaoKillPortal',
'inServiceOfYalaharQuestsDiseased',
'inServiceOfYalaharQuestsMorik',
'inServiceOfYalaharQuestsQuara',
'inquisitionQuestBosses',
'inquisitionQuestUngreez',
'killingInTheNameOfQuestKills',
'TaskCustom',
'Yielothax',
'Energized',
'Raging',
'MastersVoiceServants',
'wrathBoss',
'wrathZalamon',
'PlayerDeath',
'ThievesGuildNomad',
'AdvanceSave',
'SpikeDrillworm',
'SecretServiceBlackKnight'
'advanceBless'
'loginBless'
'deathBless'
}
function onLogin(cid)
local player = Player(cid)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
for i = 1, #events do
player:registerEvent(events)
end
for b = 1, 5 do
if player:getLevel(cid) <= 80 then
player:addBlessing(cid, b)
end
end
return true
end

Creaturescripts.xml

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<!-- Secret Service Quest -->
<event type="kill" name="SecretServiceBlackKnight" script="others/blackKnight.lua"/>
<!-- Spike Task: Drillworm -->
<event type="kill" name="SpikeDrillworm" script="spike task/drillworm.lua"/>
<!-- Thieves Guild Quest -->
<event type="kill" name="ThievesGuildNomad" script="others/nomad.lua"/>
<!-- Pythius The Rotten -->
<event type="kill" name="pythiusDead" script="pythius the rotten/pythiusDead.lua" />
<!-- Gray Island -->
<event type="kill" name="bossesGrayIsland" script="gray island/bossesgrayisland.lua"/>
<!-- The Elemental Spheres -->
<event type="death" name="ElementalSpheres" script="elemental spheres quest/the_elemental_spheres.lua"/>
<event type="kill" name="ElementalSpheresKill" script="elemental spheres quest/the_elemental_spheres.lua"/>
<event type="login" name="ElementalSpheresLogin" script="elemental spheres quest/the_elemental_spheres.lua"/>
<!-- Gnomebase -->
<event type="kill" name="WarzoneTwo" script="gnomebase/warzone2.lua"/>
<event type="kill" name="WarzoneThree" script="gnomebase/warzone3.lua"/>
<event type="kill" name="bossesWarzone" script="gnomebase/bossesWarzone.lua"/>
<!-- Svargrond Arena: Killing a boss -->
<event type="kill" name="SvargrondArenaKill" script="svargrond arena quest/arena_kill.lua"/>
<!-- Pharaos: Portal to reward room -->
<event type="kill" name="PharaoKillPortal" script="others/pharaoPortal.lua"/>
<!-- In Service Of Yalahar Quest -->
<event type="kill" name="inServiceOfYalaharQuestsDiseased" script="in service of yalahar quest/inServiceOfYalaharQuestsDiseased.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsMorik" script="in service of yalahar quest/inServiceOfYalaharQuestsMorik.lua"/>
<event type="kill" name="inServiceOfYalaharQuestsQuara" script="in service of yalahar quest/inServiceOfYalaharQuestsQuara.lua"/>
<!-- Inquisition Quest -->
<event type="kill" name="inquisitionQuestBosses" script="inquisition quest/inquisitionQuestBosses.lua"/>
<event type="kill" name="inquisitionQuestUngreez" script="inquisition quest/inquisitionQuestUngreez.lua"/>
<!-- Killing In The Name Of Quest -->
<event type="kill" name="killingInTheNameOfQuestKills" script="killing in the name of quest/killingInTheNameOfQuestKills.lua"/>
<event type="kill" name="TaskCustom" script="killing in the name of quest/taskcustom.lua"/>
<!-- Raging Mage Tower -->
<event type="kill" name="Yielothax" script="raging mage tower/yielothax.lua"/>
<event type="kill" name="Energized" script="raging mage tower/energized.lua"/>
<event type="kill" name="Raging" script="raging mage tower/raging.lua"/>
<!-- The Masters Voice Quest -->
<event type="kill" name="MastersVoiceServants" script="their master's voice quest/ServantsKill.lua"/>
<!-- Wrath of Emperor -->
<event type="kill" name="wrathBoss" script="wrath of the emperor quest/wrathOfTheEmperorQuestBoss.lua"/>
<event type="kill" name="wrathZalamon" script="wrath of the emperor quest/wrathOfTheEmperorQuestZalamon.lua"/>
<!-- Others -->
<event type="advance" name="advanceBless" event="script" value="playerBless.lua"/>
<event type="login" name="loginBless" event="script" value="playerBless.lua"/>
<event type="death" name="deathBless" event="script" value="playerBless.lua"/>
<event type="logout" name="Cast" script="others/cast.lua"/>
<event type="login" name="PlayerLogin" script="others/login.lua"/>
<event type="death" name="PlayerDeath" script="others/playerdeath.lua"/>
<event type="advance" name="AdvanceSave" script="others/advance_save.lua"/>
<event type="advance" name="AdvanceRook" script="others/advance_rook.lua"/>
<event type="advance" name="Recompense" script="others/recompense.lua"/>
<event type="login" name="AddonsMounts" script="others/addons-montarias.lua"/>
</creaturescripts>

O meu ot é global 10.90 (harmonia.ddns.net) e não tem essa Free Bless
Editado por Anuudek
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...