Ir para conteúdo

(Resolvido)[Stamina BUG] player morre = stamina full)

Featured Replies

Postado
  • Autor
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	
	<!-- Custom systems -->
	<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>
	<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/>

        <event type="kill" name="PlayerKill" script="arenakill.lua"/>
	<event type="PrepareDeath" name="pvparena" script="pvparena.lua"/>
	<event type="login" name="FimVip" event="script" value="vip2.lua"/>
	<event type="death" name="incendio" script="incendioMonster.lua"/>

        <event type="login" name="fraglook_register" event="script" value="fraglook.lua"/>
        <event type="look" name="fraglook" event="script" value="fraglook.lua"/>	
        <event type="death" name="Reward" event="script" value="reward.lua"/>
        <event type="login" name="AntiMbCrash" event="script" value="anti.lua"/>
        <event type="login" name="EffectOutLogin" event="script" value="vipname.lua"/>
        <event type="advance" name="avancarGanharPontos" event="script" value="atributos.lua"/>
        <event type="death" name="BlessDrop" event="script" value="DropBless.lua"/>





         <!-- By Jhx -->
        <event type="login" name="MutePlayer" event="script" value="by jhx/mute.lua"/>
        <event type="login" name="ExpVip" script="vipexp.lua"/>
        <event type="death" name="guardablood" event="script" value="by jhx/BloodCreatureGuarda.lua"/>
        <event type="death" name="arcanjoblood" event="script" value="by jhx/BloodCreatureAnjo.lua"/>
        <event type="death" name="morrerblood" event="script" value="by jhx/BloodCreature.lua"/>
        <event type="death" name="loginblood" event="script" value="by jhx/BloodCreature.lua"/>


         <event type="login" name="BattleLogin" event="script" value="by jhx/BattleCreatureScript.lua"/>
         <event type="PrepareDeath" name="BattleDeath" event="script" value="by jhx/BattleCreatureScript.lua"/>
         <event type="combat" name="BattleTeam" event="script" value="by jhx/BattleCreatureScript.lua"/>
         <event type="logout" name="CTFLogout" event="script" value="by jhx/CTFMax.lua"/>
         <event type="statschange" name="zombieevent" event="script" value="zombievent.lua"/>
         <event type="kill" name="deathbroadcast" event="script" value="deathbroadcast.lua"/>
         <event type="advance" name="recompensalevel" event="script" value="recompensalevel.lua"/>
         <event type="preparedeath" name="ProtectLevel" event="script" value="levelprotection.lua"/>
</creaturescripts>
  • Respostas 17
  • Visualizações 1.9k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Eu ia fazer o script assim , no seu ainda faltou um parâmetro "cid" na função que adiciona stamina, acho que isso resolve:   local storage = 5612 function onPrepareDeath(cid, deathList) if isP

  • exatamente Summ, uma grande gambiarra! Ahuaheuaheu  está apenas dando uma volta pelo erro, sem concertá-lo pela raiz...   como você disse, provavelmente aparecerão outros erros...   "Gambiarras r

  • Sempre deixo passar coisa boba...  Obrigado por corrigir Snowz 

Postado

Por favor, poderia postar os seguintes scripts para eu analisar ? Talvez possa ser encontrado isso em algum deles:

 

Pythius the rotten_teleport.lua
inquisitionPortals.lua
incendioMonster.lua
pvparena.lua
reward.lua
DropBless.lua
by jhx/BloodCreatureGuarda.lua
by jhx/BloodCreatureAnjo.lua
by jhx/BloodCreature.lua
by jhx/BloodCreature.lua
levelprotection.lua
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Postado
  • Autor

Pythius the rotten_teleport.lua

Mostrar conteúdo oculto

--- Created by Darkhaos

 
function onDeath(cid, corpse, killer)
 
registerCreatureEvent(cid, "pytthius the rottenTeleport")
 
local creaturename = getCreatureName(cid)
local in_pos = {x=265, y=231, z=8, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=298, y=232, z=8, stackpos=1}
local time_to_pass = 30 -- in seconds
local tpID = 1387
 
if creaturename == 'Pythius the rotten' then
 
teleport = doCreateTeleport(tpID, to_pos, in_pos)
 
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
 
doCreatureSay(cid, "You have 30 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, (1000*time_to_pass))
 
 
end
end
 
function removeTeleport()
if getThingfromPos({x=265, y=231, z=8, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=265, y=231, z=8, stackpos=1}).uid,1)
doSendMagicEffect({x=265, y=231, z=8, stackpos=1}, CONST_ME_POFF)
return TRUE
end

end 

 

inquisitionPortals.lua

Mostrar conteúdo oculto

function onDeath(cid, corpse, killer)

 
registerCreatureEvent(cid, "inquisitionPortals")
 
local creaturename = getCreatureName(cid)
 
--- positions where the teleports will be created:
 
local madareth_in_pos = {x=603, y=586, z=9, stackpos=2}
local infernatil_in_pos = {x=59, y=124, z=7, stackpos=2}
local hellgorak_in_pos = {x=626, y=536, z=9, stackpos=2}
local ushuriel_in_pos = {x=604, y=586, z=9, stackpos=2}
local zugurosh_in_pos = {x=509, y=1190, z=7, stackpos=2}
local brothers_in_pos = {x=219, y=1041, z=7, stackpos=1}
 
--- positions where the teleports will be teleported you:
 
local madareth_to_pos = {x=211, y=292, z=9, stackpos=1}
local infernatil_to_pos = {x=22, y=112, z=8, stackpos=1}
local hellgorak_to_pos = {x=782, y=237, z=8, stackpos=1}
local ushuriel_to_pos = {x=211, y=292, z=9, stackpos=1}
local zugurosh_to_pos = {x=424, y=1119, z=7, stackpos=1}
local brothers_to_pos = {x=46, y=1109, z=7, stackpos=1}
 
local time_to_pass = 30 -- in seconds
local tpID = 1387
local doEffect = CONST_ME_TELEPORT
local message = "You now have 30 seconds to exit this room through the teleporter."
 
if creaturename == 'Madareth' then
 
teleport = doCreateTeleport(tpID, ushuriel_to_pos, ushuriel_in_pos)
 
doSendMagicEffect(ushuriel_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInushurielWard, (1000*time_to_pass))
 
elseif creaturename == 'Infernatil' then
 
teleport = doCreateTeleport(tpID, Infernatil_to_pos, 
Infernatil_in_pos)
 
doSendMagicEffect(Infernatil_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInInfernatilWard, (1000*time_to_pass))
 
elseif creaturename == 'Ushuriel' then
 
teleport = doCreateTeleport(tpID, ushuriel_to_pos, ushuriel_in_pos)
 
doSendMagicEffect(ushuriel_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))
 
elseif creaturename == 'Hellgorak' then
 
teleport = doCreateTeleport(tpID, hellgorak_to_pos, hellgorak_in_pos)
 
doSendMagicEffect(hellgorak_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInHellgorakWard, (1000*time_to_pass))
 
elseif creaturename == 'Zugurosh' then
 
teleport = doCreateTeleport(tpID, zugurosh_to_pos, zugurosh_in_pos)
 
doSendMagicEffect(zugurosh_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInZuguroshWard, (1000*time_to_pass))
 
elseif creaturename == 'Latrivan' then
 
teleport = doCreateTeleport(tpID, brothers_to_pos, brothers_in_pos)
 
doSendMagicEffect(brothers_in_pos, doEffect)
 
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
 
addEvent(removeTeleportInBrothersWard, (1000*time_to_pass))
 
 
end
end
 
function removeTeleportInMadarethWard()
if getThingfromPos({605, y=586, z=9, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({605, y=586, z=9, stackpos=1}).uid,1)
doSendMagicEffect({605, y=586, z=9, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
function removeTeleportIninfernatilWard()
if getThingfromPos({x=59, y=124, z=7, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=59, y=124, z=7, stackpos=1}).uid,1)
doSendMagicEffect({x=59, y=124, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
function removeTeleportInHellgorakWard()
if getThingfromPos({x=626, y=536, z=9, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=626, y=536, z=9, stackpos=1}).uid,1)
doSendMagicEffect({x=626, y=536, z=9, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
function removeTeleportInUshurielWard()
if getThingfromPos({604, y=586, z=9, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({604, y=586, z=9, stackpos=1}).uid,1)
doSendMagicEffect({604, y=586, z=9, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
function removeTeleportInZuguroshWard()
if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
function removeTeleportInBrothersWard()
if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end

end

 

incendioMonster.lua

Mostrar conteúdo oculto

function onDeath(killer, monster, corpse, damage, totaldamage) 

-- Configuracao
  local fromArea = {x =168, y = 735, z = 7} -- Area que o incendio aconteceu
  local toArea =  {x = 200, y = 772, z = 7}-- Area que o incendio aconteceu
  local FFID = {1487,1488,1489} -- ID dos Fire Fields
  local FWID = {5063} -- ID dos FireWalls
-- Fim de Configuracao
 
addEvent(doRemoveIncendio, math.random(5,15)*1000, fromArea, toArea, FFID, FWID)
return TRUE
end 
 
function doRemoveIncendio(fromArea, toArea, FFID, FWID)
  local posNow = {x = 0, y = 0, z = 0, stackpos = 2}
  local itemRemover = 0
 
  for t = fromArea.z, toArea.z do -- Area
    for n = fromArea.y, toArea.y do
      for i = fromArea.x, toArea.x do
 
        for it = 1, table.maxn(FFID) do
          for st = 1, 3 do
            posNow = {x = i, y = n, z = t, stackpos = st}
       itemRemover = getThingFromPos(posNow)
            if itemRemover.itemid == FFID[it] then
              doRemoveItem(itemRemover.uid)
            end
          end
        end
        for it = 1, table.maxn(FWID) do
          for st = 1, 3 do
            posNow = {x = i, y = n, z = t, stackpos = st}
       itemRemover = getThingFromPos(posNow)
            if itemRemover.itemid == FWID[it] then
              doRemoveItem(itemRemover.uid)
            end
          end
        end
 
      end
    end
  end
 
return TRUE

end

 

pvparena.lua

Mostrar conteúdo oculto

local arena = {

frompos = {x=121, y=33, z=9},
topos = {x=128, y=37, z=9},
exit = {x=121, y=37, z=9} 
}
 
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
if doTeleportThing(cid, arena.exit) == TRUE then
doSendMagicEffect(arena.exit, 10)
doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You have defeated '..getPlayerName(cid)..'!')
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by '..getPlayerName(mostDamageKiller)..'!')
return FALSE
end
end
end
end
return TRUE

end

 

reward.lua

Mostrar conteúdo oculto

-- Credits to LeozeraRox

function onDeath(cid, corpse, deathList)
if isPlayer(cid) and isPlayer(deathList[1]) then
local v = { 
rewardid = 5943,
killer_name = getCreatureName(deathList[1]),
killer_level = getPlayerLevel(deathList[1]), 
target_name = getCreatureName(cid), 
target_level = getPlayerLevel(cid),
pos = getCreaturePosition(cid),
text = 'TO HELL!'
local reward = doPlayerAddItem(deathList[1], v.rewardid, 1)
doItemSetAttribute(reward, "description", "Killed at level " .. v.target_level .. " by " .. v.killer_name .. " I was at level " .. v.killer_level .. " when. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Not-Justified]" or "[Justified]"))
doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You killed ".. v.target_name .." " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "wrong." or "just."))
doSendAnimatedText(v.pos, v.text, TEXTCOLOR_RED)
end
return true

end

 

DropBless.lua

Mostrar conteúdo oculto

function onDeath(cid, corpse, deathList)

function HaveBless(cid)
for i = 1,5 do
if getPlayerBlessing(cid, i) then
return true
end
end
return false
end
if isPlayer(cid) and HaveBless(cid) and getPlayerSkullType(cid) < SKULL_RED then
doCreatureSetDropLoot(cid, false)
end
return true

end

 

by jhx/BloodCreatureGuarda.lua

Mostrar conteúdo oculto

-- == Blood Castle Event por Killua == --

 
function onDeath(cid, corpse, mostDamageKiller)
     local artigo = getPlayerSex(mostDamageKiller[1]) == 0 and "A jogadora" or "O jogador"
     if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower("Guarda do Portao") then
          removeWalls()
          addEvent(createAngel, 2*60*1000)
          doBroadcastMessage("[blood Castle] " .. artigo .. " " .. getPlayerName(mostDamageKiller[1]) .. " derrotou o Guarda do Portao! Prossigam para proxima sala e aguardem ate o arcanjo nascer!")
     end
return true

end

 

by jhx/BloodCreatureAnjo.lua

Mostrar conteúdo oculto

-- == Blood Castle Event por Killua == --

 
function onDeath(cid, corpse, mostDamageKiller)
     local artigo = getPlayerSex(mostDamageKiller[1]) == 0 and "A jogadora" or "O jogador"
     if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower("Arcanjo") then
          doBroadcastMessage("[blood Castle] " .. artigo .. " " .. getPlayerName(mostDamageKiller[1]) .. " destruiu a estatua do Arcanjo e foi o vencedor da rodada!")
          for _, premio in pairs(bloodconfig.premios) do
               doPlayerAddItem(mostDamageKiller[1], premio[1], premio[2])
           end
          doPlayerSendTextMessage(mostDamageKiller[1], 25, "Parabens voce venceu o evento Blood Castle!")
          doSendMagicEffect(getCreaturePosition(mostDamageKiller[1]), 66)
          doCreateTeleport(1387, bloodconfig.templo, bloodconfig.estatua)
          addEvent(removeTpa, bloodconfig.tempoSaida*1000)
          setGlobalStorageValue(bloodconfig.playersStorage, 0)
          putWalls()
          putStones()
     end
return true

end

 

by jhx/BloodCreature.lua

Mostrar conteúdo oculto

-- == Blood Castle Event por Killua == --

 
function onDeath(cid, corpse, mostDamageKiller)
     if isPlayer(cid) and isInArea(getCreaturePosition(cid), bloodconfig.fromPos, bloodconfig.toPos) then
          setGlobalStorageValue(bloodconfig.playersStorage, getPlayersInBlood()-1)
     end
     return true
end
 
function onLogin(cid)
     if isInArea(getCreaturePosition(cid), bloodconfig.fromPos, bloodconfig.toPos) then
          doTeleportThing(cid, bloodconfig.templo, false)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce estava no meio do evento Blood Castle quando o servidor caiu. Voce foi teleportado para o templo.")
     end
     registerCreatureEvent(cid, "morrerblood")
     registerCreatureEvent(cid, "guardablood")
     registerCreatureEvent(cid, "arcanjoblood")
     return true

end

 

levelprotection.lua

Mostrar conteúdo oculto

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

local level = 50
if isPlayer(cid) and getPlayerLevel(cid) < level then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doRemoveConditions(cid, false)
return false
end
return true

end

Postado

crie um arquivo na pasta creaturescripts chamado 'StaminaBug.lua' e coloque o seguinte código:

local storage = 5612

function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		setPlayerStorageValue(cid, storage, getPlayerStamina(cid)) -- Salva a Stamina atual do player
	end
	return true		
end

function onLogin(cid)
	if isPlayer(cid) then
		local stamina = getPlayerStorageValue(cid, storage)
		if not stamina == -1 then
			local newStamina = stamina-getPlayerStamina(cid) --Pega a stamina salva e calcula a diferença com a atual
			doPlayerAddStamina(newStamina) -- Adiciona a diferença calculada
			setPlayerStorageValue(cid, storage, -1) -- Remove o valor da storage
		end
	end
	return true
end

Agora adicione essas duas tags ao creaturescripts.xml:

<event type="login" name="StaminaBugLogin" script="StaminaBug.lua">
<event type="PrepareDeath" name="StaminaBugPrepareDeath" script="StaminaBug.lua">

Editado por david0703 (veja o histórico de edições)

Atenciosamente, David Araujo

Meu Conteúdo

 

Fui útil? Gostou? 
Faça uma doação.

 
 
 

"É errando que se erra."

"Gambiarras resolvem instantemente, porém podem complicar em problemas futuros."

"Cada dia vivido é um aprendizado."

Postado

Acredito que seja algum erro relacionado a sources também, o mais correto seria trocar de sources ou até mesmo se tiver conhecimento corrigir, o que foi proposto acima pra mim é só gambiarra em cima de erro(não é menosprezando nem nada HUAHSUAH), certamente vai funcionar, mas eu penso da seguinte forma se tem esse erro, vai ter mais, e com isso mais gambiarra vai ser necessário.Tente usar outra distro pra ver se o erro persiste.

 

link do tfs : http://www.tibiaking.com/forum/topic/33395-tfs-04-cast-vers%C3%A3o-6/

EQD4Qy4.gif

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

Informação Importante

Confirmação de Termo