Ir para conteúdo

Posts Recomendados

Postado (editado)
Aew galera do TK preciso muito de ajuda!.  acredito que esse seja a versão da TFS não sei ver!
tfs.thumb.png.82be1c02e9fe87384a499cf565
E nas pasta ta assim <?xml version="1.0" encoding="UTF-8"?>
 

Já peguei o talkactions de ot's baiak e globais que eu tenho aqui de outras versões mais em todas o comando !bless fica bugado.

Em talkactions ta assim
  Mostrar conteúdo oculto

        <talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />


Em talkactions/scripts - bless
  Mostrar conteúdo oculto

-- !blessing by artofwork
local bless = {1, 2, 3, 4, 5}
local cost = 10000
local maxlevel = 50000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = 35000
local target = getPlayerGUID(cid)


        for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless)) then
                        doPlayerSendCancel(cid, "Você já tem todas as blessings.")
                        return TRUE
                end
        end
        
        if (getPlayerLevel(cid) >= maxlevel)  then
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless)
                        end
                        doPlayerSendTextMessage(cid,18,"Você acaba de comprar uma blessing, e com ela veio um AOL, use-o pois a bless pode falhar")
                        local bp = doPlayerAddItem(cid, 2173, 1)
                else
                doPlayerPopupFYI(cid, "Você precisa de "..cost.." para comprar uma bless.")
                end
        
        elseif(getPlayerLevel(cid) < maxlevel) then
                if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless)
                        end
                        doPlayerSendTextMessage(cid,18,"Você acaba de comprar uma blessing, e com ela veio um AOL, use-o pois a bless pode falhar")
                        local bp = doPlayerAddItem(cid, 2173, 1)
                else
                        doPlayerPopupFYI(cid, "Você precisa de "..cost.." para comprar uma bless.")
                end
        end
        return FALSE
end

E Em talkactions/scripts - blessings
  Mostrar conteúdo oculto

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    local t = string.explode(param, ",")
    if(not t[2]) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")
        return true
    end

    local pid = getPlayerByNameWildcard(t[1])
    if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
        return true
    end

    t[2] = t[2]:lower()
    local blessing = BLESS_IDS[t[2]]
    if(not blessing) then
        blessing = tonumber(t[2])
        if(not blessing or blessing < BLESS_FIRST or blessing > BLESS_LAST) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This bless not found.")
            return true
        end
    end

    doPlayerAddBlessing(pid, blessing)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
    return true
end



Apos usar esse comando e tirar o aol que ganha caso você morra. perde a bp. queria esse comando entregando bless sem aol. e que quando morrer não perca loot
Irei dar Rep+ pra quem me ajudar!!
obrigado a todos desde já! 
Editado por compp
Atualizado Versão TFS (veja o histórico de edições)
  • Respostas 6
  • Created
  • Última resposta

Top Posters In This Topic

Postado (editado)

Geralmente esse script é a bless de servidores 1.0
 

function getCost(level)
	if level <= 30 then
		return 3000*5
	elseif level >= 120 then
		return 30000*5
	else
		return ((level - 20) * 200 * 5)
	end
end

function onSay(cid, words, param)
	local p = Player(cid)
	local cost = getCost(getPlayerLevel(cid))
	if(not(isPlayerPzLocked(cid))) then
		if(p:hasBlessing(1) and p:hasBlessing(2) and p:hasBlessing(3) and p:hasBlessing(4) and p:hasBlessing(5) and p:hasBlessing(6)) then
			p:sendCancelMessage("You have already been blessed by the gods.")
			return false
		end
		if(p:removeMoney(cost)) then
			for b = 1,6 do
				p:addBlessing(b)
			end
			p:getPosition():sendMagicEffect(39)
			p:sendTextMessage(19, "You have been blessed by the gods!")
		else
			p:sendCancelMessage("You need "..cost.." gold coins to buy all blessings.")
		end
	else
		p:sendCancelMessage("You can't buy bless, when you are in a battle.")
	end
return false
end
Editado por vankk (veja o histórico de edições)
Postado
@compp
O meu servidor é TFS 0.4 também..
Testa o meu bless.lua
(data/talkactions/scripts)

bless.lua
  Mostrar conteúdo oculto

function onSay(cid, words, param)
if getPlayerBlessing(cid,5) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 50,000 gp in backpack for blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA)
end
end
end

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo