Ir para conteúdo
  • Cadastre-se

Apocalypse

Membro
  • Total de itens

    20
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Posts postados por Apocalypse

  1. bom primeiramente vc deve saber q a função getPlayerPosition(cid) retorna uma tabela, e tabelas não pode ser gravadas em uma storage somente numeros e strings.
     
    então vc pode fazer o seguinte montar uma string que salve os 3 valores separados por virgula assim; "x,y,z"
    local pos = getPlayerPosition(cid).x .. "," .. getPlayerPosition(cid).y .. "," .. getPlayerPosition(cid).z
    

    que sera a mesma coisa que;

    local pos = "x,y,z"
    

    depois vc salva na storage:

    setPlayerStorageValue(cid, 2220, pos)
    
    e por fim para retornar essa posição vc iria usar o auxilio do string.explode que transforma uma string em tabela, separando os valores de acordo com o separador que escolheu
    que nosso caso é a virgula.
     
    por exemplo:
    local pos = "x,y,z"
    
    local tab = string.explode(pos, ",") -- quando encontrar a virgula, ele passara para o proximo indice da tabela.
    

    que é a mesma coisa que isso:

    local tab = {"x", "y", "z"}
    
    oque eu tenha que fazer agora é colocar no doTeleportThing:
     
    lembrando que a função doTeleportThing para funcioar precisa de uma tabela da seguinte estrutura:
    {x = x, y = y, z = z}
    
    então teremos que montar essa tabela com os valores da string.explode
    local posFinal = {x = tab[1], y = tab[2], z = tab[3]} -- ou seja x é igual ao primeiro indice da tabela tab, y o segundo e z o terceiro.
    
    depois só mandar o comando:
     
    doTeleportThing(cid, posFinal)
     
    fazendo isso resumidamente ficaria o seguinte:
    setPlayerStorageValue(cid, 2220, getPlayerPosition(cid).x .. "," .. getPlayerPosition(cid).y .. "," .. getPlayerPosition(cid).z) -- gravei os valores da posição do player como uma string
    
    local pos = string.explode(getPlayerStorageValue(cid, 2220), ",") -- peguei o valor da storage que é a string, e separei as posições
    
    doTeleportThing(cid, {x = pos[1], y = pos[2], z = pos[3]}) -- montei a tabela que a função precisa com os valores da storage separados por indices.
    

    espero que tenha entendido, qualquer coisa tamo ae !

  2. function onSay(cid, words, param)
    	local str = "PLAYERS PKS\n\n"
    	for _, pid in pairs(getPlayersOnline()) do
    		if getCreatureSkullType(pid) >= 3 then
    			local skullsType = {"none", "none", "White Skull", "Red Skull", "Black Skull"}
    			str = str .. getCreatureName(pid) .. ", " .. getPlayerLevel(pid) .. ", " .. skullsType[getCreatureSkullType(pid)] .. "\n"
    		end
    	end
    	str = str == "PLAYERS PKS\n\n" and str .. "not found players pks" or str
    	doPlayerPopupFYI(cid, str)
    	return true
    end
    
  3. local LEVEL_VARIATION = 100
    local LOSER_EXP_PER_LEVEL = 5000
    
    function onKill(cid, target, lastHit)
    	if not isPlayer(target) or getCreatureSkullType(target) >= 1 then
    		return true
    	end
            if getPlayerLevel(target) > 150 then return true end
    	local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target))
    	if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then
    		local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL
    		doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.')
    		doPlayerAddExp(cid, -EXP_PUNISHMENT)
    		doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1)
    	end
    	return true
    end
    
  4. creio q o erro esta ocorrendo pq vc esta tentando verificar o level do target, sem verificar se o target é um player, ou seja se tem mesmo um level, eu faria assim:

    local LEVEL_VARIATION = 100
    local LOSER_EXP_PER_LEVEL = 5000
    
    function onKill(cid, target, lastHit)
    	if not isPlayer(target) or getCreatureSkullType(target) >= 1 then
    		return true
    	end
    	local TARGET_LEVEL_VARIATION = (getPlayerLevel(cid) - getPlayerLevel(target))
    	if TARGET_LEVEL_VARIATION >= LEVEL_VARIATION then
    		local EXP_PUNISHMENT = TARGET_LEVEL_VARIATION * LOSER_EXP_PER_LEVEL
    		doPlayerSendTextMessage(cid,22,'Voce foi punido por falta de honra! Matou um player com '..TARGET_LEVEL_VARIATION..' leveis de diferenca e perdeu '..EXP_PUNISHMENT..' pontos de exp.')
    		doPlayerAddExp(cid, -EXP_PUNISHMENT)
    		doCreatureSay(cid, "Power Abuse punido!", TALKTYPE_ORANGE_1)
    	end
    	return true
    end
    
  5. realmente eu não percebi tal bug, script feito novamente, e desculpe abandonar o script, na proxima não critique reporte o erro, obrigado !

    local configInv = {
    	["20:14"] = {nome = "The Demon Invasion", pos = {x=32369, y=32167, z=7}, monster = {"50 Demon", "1 The Imperor"}},
    	["14:35"] = {nome = "The Massive Dragon Invasion", pos = {x=32368, y=32188, z=8}, monster = {"200 Dragon"}},
    }
    
    function onThink(interval, lastExecution)
    	local hours = tostring(os.date("%X")):sub(1, 5)
    	if configInv[hours] then
    		if GlobalStorageValue(95473) == hours then return true end
    		doBroadcastMessage(hours .. " - " .. tb.nome .. " iníciou.")
    		for _,x in pairs(tb.monster) do
    			for s = 1, tonumber(x:match("%d+")) do
    				doSummonCreature(x:match("%s(.+)"), tb.pos)
    			end
    		end
    		setGlobalStorageValue(95473, hours)
    	end
    	return true
    end
    
  6. SISTEMA ATUALIZADO v3.0

    Log V3.0 ( 03/02/2013 ) :

    - Sistema de stages, pode ser totalmente configurado no script .

    - Anéis podem multiplicar a experiencia agora

    - Premium podem ter beneficios tambem na experiencia

    - Monstros sumonados por outros monstros, não vão dar mais experiencia.

    @Adriano SwaTT

    Eu fiz aquilo para toda exp, ser meio com numeros diferentes e não ficar uma coisa repetitiva pode perceber q a exp vem sempre diferente, não sempre a mesma ...

  7. Olá, eu estou montando um server de Cabal, baseando no tibia, eu estou fazendo o server todo sozinho, até pq sou scripter, programador e mapper, porém não sou spriter, e justamente oque mais vou precisar. Eu nunca fiz uma sprite antes, e tentei fazer esta espada, que é uma espada do cabal, a Osmium Blade. Queria a opinião de vocês.

    Espada Original:

    BL06.gif

    Sprite:

    osmiumblade.png

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo