Gostei, otimo script haha o do Zoom ele so postou para otx né? e tu colocou tbm para tfs REP +
- Fórum
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- Death System 2016 versão frag consecutivo!
Death System 2016 versão frag consecutivo!
Por Yan Liima, 05 de fev. de 2016 em Globalevents e Spells
info
Grupo: Campones
Registrado: 01/05/15
Posts: 49
Reputação: +2

info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

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
info
Grupo: Artesão
Registrado: 03/08/07
Posts: 129
Reputação: +12
Gênero: Masculino

Como faz para o Channel abrir automaticamente quando o jogador entrar no servidor?
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

45 minutos atrás, Adolfohrq disse:Como faz para o Channel abrir automaticamente quando o jogador entrar no servidor?
Qual distro você usa?
info
Grupo: Artesão
Registrado: 03/08/07
Posts: 129
Reputação: +12
Gênero: Masculino

TFS 0.4
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

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.
info
Grupo: Artesão
Registrado: 03/08/07
Posts: 129
Reputação: +12
Gênero: Masculino

Vish, é a 3777
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

@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 por nedroesdoksdja
info
Grupo: Administrador
Registrado: 08/07/05
Posts: 5.8k
Reputação: +1.4k
Gênero: Outro

Está mobilizando conteúdos e dando suporte de uma forma incrível e respeitosa. Parabéns!
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:-- 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:
-- 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+!
info
Grupo: Campones
Registrado: 30/04/18
Posts: 1
Reputação: 0

@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 ?
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

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 por nedroesdoksdja
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)
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

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.





info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night
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 :
em data/creaturescripts/creaturescripts.xml :
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:
-- 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:
-- 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 por nedroesdoksdja