Diretor Yan Liima 578 Postado Fevereiro 5, 2016 Diretor Share Postado Fevereiro 5, 2016 (editado) Eae galera do xtibia beleza? hoje venho trazer o Death System um sisteminha que um amigo meu fez, é bem utilizado atualmente. Antes de tudo gostaria de deixar bem claro que não fui eu que fiz. Créditos no final do tópico. Testado em OTX Server 8.60 e TheForgottenServer 0.4 8.60... Como funciona?O Death System em alguns servidores possui um channel chamado "Mortes" ou "Death Channel", mas há alguns servidores que preferem que seja anunciado no default mesmo e a função é informar quem matou quem, ou quem foi morto por certo monstro. O que há de novo? Bom, agora quem matar x jogadores(configurável) e essa quantia for uma consecutiva, será anunciado isso : E se algum jogador derrotá-lo dentro a consecutiva, será anunciado isso : Vamos ao sistema : em data/XML/channels.xml, adicione isso : <channel id="15" name="Death Channel"/> em data/creaturescripts/creaturescripts.xml : <event type="death" name="deathchannel" event="script" value="deathchannel.lua"/> em data/creaturescripts/login.lua, adicione isso antes do último return true : registerCreatureEvent(cid, "deathchannel") em data/creaturescripts/scripts, crie um arquivo deathchannel.lua e cole isso dentro : TFS: Spoiler -- Coded by Zoom.. local info, win, lose = "%s [Level: %s] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos." local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50}, 30045 function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1)) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_O, 0xF) for _, frag in ipairs(frags) do if(getCreatureStorage(target, storage) == frag) then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF) end if(getCreatureStorage(cid, storage) >= frag) then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_CHANNEL_RN, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end OTX: Spoiler -- Coded by Zoom.. local info, win, lose = "%s [Level: %s] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos." local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50}, 30045 function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1)) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_ORANGE, 0xF) for _, frag in ipairs(frags) do if(getCreatureStorage(target, storage) == frag) then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_MANAGEMENT, 0xF) end if(getCreatureStorage(cid, storage) >= frag) then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_GAMEMASTER_CHANNEL, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end Há uma única configuração, que é as consecutivas : local frags = {10, 15, 20, 25, 30, 35, 40, 45, 50} completou 10 frags? anuncia! e assim sucessivamente.. Créditos: Zoom Editado Abril 24, 2016 por nedroesdoksdja diarmaint, Yan Liima e Spring Trap reagiu a isso 3 Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/ Compartilhar em outros sites More sharing options...
Spring Trap 2 Postado Fevereiro 23, 2016 Share Postado Fevereiro 23, 2016 Gostei, otimo script haha o do Zoom ele so postou para otx né? e tu colocou tbm para tfs REP + Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1686764 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Fevereiro 23, 2016 Autor Diretor Share Postado Fevereiro 23, 2016 Gostei, otimo script haha o do Zoom ele so postou para otx né? e tu colocou tbm para tfs REP + Não na verdade ele já havia colocado o da TFS porém não incrementou no tópico, então eu coloquei aqui para vocês xD Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1686766 Compartilhar em outros sites More sharing options...
Adolfohrq 12 Postado Junho 27, 2016 Share Postado Junho 27, 2016 Como faz para o Channel abrir automaticamente quando o jogador entrar no servidor? Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697774 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Junho 27, 2016 Autor Diretor Share Postado Junho 27, 2016 45 minutos atrás, Adolfohrq disse: Como faz para o Channel abrir automaticamente quando o jogador entrar no servidor? Qual distro você usa? Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697786 Compartilhar em outros sites More sharing options...
Adolfohrq 12 Postado Junho 27, 2016 Share Postado Junho 27, 2016 TFS 0.4 Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697788 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Junho 27, 2016 Autor Diretor Share Postado Junho 27, 2016 11 minutos atrás, Adolfohrq disse: TFS 0.4 rev3884? Se for basta colocar isso em seu login.lua doPlayerOpenChannel(cid, 15) Se for 3777 teria que adicionar a função na source, pois a rev3777 não vem com essa função adicionada. Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697789 Compartilhar em outros sites More sharing options...
Adolfohrq 12 Postado Junho 27, 2016 Share Postado Junho 27, 2016 Vish, é a 3777 Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697790 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Junho 27, 2016 Autor Diretor Share Postado Junho 27, 2016 (editado) @Adolfohrq A alteração é muito simples, você tem as sources em mãos? Se tiver vamos lá ... no luascript.cpp procure por: lua_register(m_luaState, "doPlayerSendToChannel", LuaInterface::luaDoPlayerSendToChannel); Embaixo adicione isto: //doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaInterface::luaDoPlayerOpenChannel); Depois procure por: int32_t LuaInterface::luaDoPlayerSendToChannel(lua_State* L) { //doPlayerSendToChannel(cid, targetId, SpeakClasses, message, channel[, time]) ScriptEnviroment* env = getEnv(); uint32_t time = 0; if(lua_gettop(L) > 5) time = popNumber(L); uint16_t channelId = popNumber(L); std::string text = popString(L); uint32_t speakClass = popNumber(L), targetId = popNumber(L); Player* player = env->getPlayerByUID(popNumber(L)); if(!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } Creature* creature = env->getCreatureByUID(targetId); if(!creature) { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); return 1; } player->sendToChannel(creature, (SpeakClasses)speakClass, text, channelId, time); lua_pushboolean(L, true); return 1; } Embaixo adicione: int32_t LuaInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint16_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); if(env->getPlayerByUID(cid)) { lua_pushboolean(L, g_game.playerOpenChannel(cid, channelId)); return 1; } errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } no luascript.h procure por: static int32_t luaDoPlayerSendToChannel(lua_State* L); Embaixo adicione: static int32_t luaDoPlayerOpenChannel(lua_State* L); Prontinho Seria melhor verificar antes, vai que já tem essa linda função em suas sources. Dependendo da pessoa que disponibilizou deve ter adicionado ela. Editado Junho 28, 2016 por nedroesdoksdja Yan Liima reagiu a isso 1 Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697792 Compartilhar em outros sites More sharing options...
Administrador Administrador 1437 Postado Junho 28, 2016 Administrador Share Postado Junho 28, 2016 @Yan Liima Está mobilizando conteúdos e dando suporte de uma forma incrível e respeitosa. Parabéns! Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1697863 Compartilhar em outros sites More sharing options...
fearwar 0 Postado Setembro 15, 2017 Share Postado Setembro 15, 2017 Em 05/02/2016 at 14:05, Yan Liima disse: Eae galera do xtibia beleza? hoje venho trazer o Death System um sisteminha que um amigo meu fez, é bem utilizado atualmente. Antes de tudo gostaria de deixar bem claro que não fui eu que fiz. Créditos no final do tópico. Testado em OTX Server 8.60 e TheForgottenServer 0.4 8.60... Como funciona?O Death System em alguns servidores possui um channel chamado "Mortes" ou "Death Channel", mas há alguns servidores que preferem que seja anunciado no default mesmo e a função é informar quem matou quem, ou quem foi morto por certo monstro. O que há de novo? Bom, agora quem matar x jogadores(configurável) e essa quantia for uma consecutiva, será anunciado isso : E se algum jogador derrotá-lo dentro a consecutiva, será anunciado isso : Vamos ao sistema : em data/XML/channels.xml, adicione isso : <channel id="15" name="Death Channel"/> em data/creaturescripts/creaturescripts.xml : <event type="death" name="deathchannel" event="script" value="deathchannel.lua"/> em data/creaturescripts/login.lua, adicione isso antes do último return true : registerCreatureEvent(cid, "deathchannel") em data/creaturescripts/scripts, crie um arquivo deathchannel.lua e cole isso dentro : TFS: Mostrar conteúdo oculto -- Coded by Zoom.. local info, win, lose = "%s [Level: %s] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos." local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50}, 30045 function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1)) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_O, 0xF) for _, frag in ipairs(frags) do if(getCreatureStorage(target, storage) == frag) then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF) end if(getCreatureStorage(cid, storage) >= frag) then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_CHANNEL_RN, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end OTX: Mostrar conteúdo oculto -- Coded by Zoom.. local info, win, lose = "%s [Level: %s] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos." local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50}, 30045 function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1)) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_ORANGE, 0xF) for _, frag in ipairs(frags) do if(getCreatureStorage(target, storage) == frag) then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_MANAGEMENT, 0xF) end if(getCreatureStorage(cid, storage) >= frag) then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_GAMEMASTER_CHANNEL, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end Há uma única configuração, que é as consecutivas : local frags = {10, 15, 20, 25, 30, 35, 40, 45, 50} completou 10 frags? anuncia! e assim sucessivamente.. Créditos: Zoom Muito bom! Ao invés de: <channel id="15" name="Death Channel"/> Utilizei: <channel id="15" active="no" logged="yes" name="Death Channel"/> Assim nenhum player consegue utilizar o channel! Valeu REP+! Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1722017 Compartilhar em outros sites More sharing options...
Hit ToPlay 0 Postado Setembro 8, 2018 Share Postado Setembro 8, 2018 @Yan Liima Por favor, poderia adaptar o Script para que não mostrasse o level dos players no chat ? poderia também me dizer onde retiro os códigos de todos os lugares para que não possa mostrar o level dos players tanto no chat quando manda mensagem, quanto no death channel ? Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1743497 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Setembro 13, 2018 Autor Diretor Share Postado Setembro 13, 2018 (editado) Em 08/09/2018 em 03:40, Hit ToPlay disse: @Yan Liima Por favor, poderia adaptar o Script para que não mostrasse o level dos players no chat ? poderia também me dizer onde retiro os códigos de todos os lugares para que não possa mostrar o level dos players tanto no chat quando manda mensagem, quanto no death channel ? Testa ai TFS: -- Coded by Zoom.. local info, win, lose = "%s foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos." local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50}, 30045 function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1)) for _, pid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and "."), TALKTYPE_CHANNEL_O, 0xF) for _, frag in ipairs(frags) do if(getCreatureStorage(target, storage) == frag) then doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF) end if(getCreatureStorage(cid, storage) >= frag) then doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_CHANNEL_RN, 0xF) end end end doCreatureSetStorage(cid, storage, 0) return true end Editado Setembro 19, 2018 por nedroesdoksdja Diego Souzaaaaa e Spring Trap reagiu a isso 2 Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1743735 Compartilhar em outros sites More sharing options...
bilaux 0 Postado Dezembro 31, 2018 Share Postado Dezembro 31, 2018 não achei na soruces - tfs 0.4, não lembro rev q é a minha, tem como eu algum arquivo da source eu descobrir ?? int32_t LuaInterface::luaDoPlayerSendToChannel(lua_State* L) Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1746731 Compartilhar em outros sites More sharing options...
Diretor Yan Liima 578 Postado Janeiro 1, 2019 Autor Diretor Share Postado Janeiro 1, 2019 23 horas atrás, bilaux disse: não achei na soruces - tfs 0.4, não lembro rev q é a minha, tem como eu algum arquivo da source eu descobrir ?? int32_t LuaInterface::luaDoPlayerSendToChannel(lua_State* L) Ao abrir a distro, nas primeiras linhas aparece a REV. Link para o comentário https://xtibia.com/forum/topic/239290-death-system-2016-vers%C3%A3o-frag-consecutivo/#findComment-1746765 Compartilhar em outros sites More sharing options...
Posts Recomendados