-
Total de itens
28 -
Registro em
-
Última visita
Tipo de Conteúdo
Perfis
Fóruns
Calendário
Publique
Posts postados por knepperzik
-
-
8 minutos atrás, FlameArcixt disse:
function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getPlayerStorageValue(cd,"COH_STATUS") == 1 then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "", math.random(1, 255)) doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!") else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getPlayerStorageValue(cd,"COH_STATUS")) == -1 then setPlayerStorageValue(cid,"COH_PREPARE1", -1) setPlayerStorageValue(cid,"COH_PREPARE2", -1) setPlayerStorageValue(cid,"COH_STATUS", 1) doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!") doCastleRemoveEnemies() doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao possui uma Guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "", math.random(1, 255)) if (getPlayerStorageValue(cd,"COH_PREPARE1")) ~= 0 then setPlayerStorageValue(cid,"COH_PREPARE1", 1) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, " Você nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "", math.random(1, 255)) end return true end
Você ta setando valor do servidor e nao do player, ele ta checando se o servidor tem a storage, se o servidor tiver entao o player entra, ou seja, os enemigos também entram, botei pra setar valor nos players, testa agora
deu o mesmo problema ali de cima, o player passa em cima do tile que domina, porem a action "16202" não ativa.
-
5 minutos atrás, FlameArcixt disse:
function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue("COH_STATUS") == 1 then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "", math.random(1, 255)) doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!") else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue("COH_STATUS")) == -1 then setGlobalStorageValue("COH_PREPARE1", -1) setGlobalStorageValue("COH_PREPARE2", -1) setGlobalStorageValue("COH_STATUS", 1) doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!") doCastleRemoveEnemies() doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao possui uma Guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "", math.random(1, 255)) if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then setGlobalStorageValue("COH_PREPARE1", 1) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, " Você nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "", math.random(1, 255)) end return true end
Deu certo, deu para dominar, após reiniciar o servidor o mesmo erro conforme a imagem.
Será que pode ser alguma coisa relacionada com a source? -
15 minutos atrás, FlameArcixt disse:
Erro meu, deixei alguns parenteses abertos.
function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue("COH_STATUS") == 1 then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "", math.random(1, 255)) doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!") else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue("COH_STATUS")) ~= -1 then setGlobalStorageValue("COH_PREPARE1", -1) setGlobalStorageValue("COH_PREPARE2", -1) setGlobalStorageValue("COH_STATUS", 1) doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!") doCastleRemoveEnemies() doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao possui uma Guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "", math.random(1, 255)) if (getGlobalStorageValue("COH_PREPARE1")) ~= 0 then setGlobalStorageValue("COH_PREPARE1", 1) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, " Você nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "", math.random(1, 255)) end return true end
Ao passar no tile que domina o castle, não esta ativando a action. "16202"
-
10 minutos atrás, FlameArcixt disse:
O erro é que vc ta setando valor de texto em storage, ja vou corrigir aqui
function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue("COH_STATUS") == 1 then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "", math.random(1, 255)) doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..getPlayerGuildName(cid).."]!") else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao pertence a Guild dominante.") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue("COH_STATUS") ~= -1 then setGlobalStorageValue("COH_PREPARE1", -1) setGlobalStorageValue("COH_PREPARE2", -1) setGlobalStorageValue("COH_STATUS", 1) doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!") doCastleRemoveEnemies() doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..getPlayerGuildName(cid).."] !") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao possui uma Guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "", math.random(1, 255)) if (getGlobalStorageValue("COH_PREPARE1") ~= 0 then setGlobalStorageValue("COH_PREPARE1", 1) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, " Você nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "", math.random(1, 255)) end return true end
Coloquei a script, e ocorreu o seguinte erro, não deixa nem passar em cima da tile. -
13 minutos atrás, FlameArcixt disse:
Tenta assim
function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue("COH_STATUS") == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "", math.random(1, 255)) doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..tostring(getGlobalStorageValue("COH_STATUS")).."] !") else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao pertence a Guild "..getGlobalStorageValue("COH_STATUS")..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue("COH_STATUS") ~= getPlayerGuildName(cid)) then setGlobalStorageValue("COH_PREPARE1", -1) setGlobalStorageValue("COH_PREPARE2", -1) setGlobalStorageValue("COH_STATUS", getPlayerGuildName(cid)) doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!") doCastleRemoveEnemies() doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..tostring(getGlobalStorageValue("COH_STATUS")).."] !") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "Voce nao possui uma Guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "", math.random(1, 255)) if (getGlobalStorageValue("COH_PREPARE1") ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid))) then setGlobalStorageValue("COH_PREPARE1", getPlayerGuildName(cid)) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, " Você nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "", math.random(1, 255)) if (getGlobalStorageValue("COH_PREPARE2") ~= getPlayerGuildName(cid)) then setGlobalStorageValue("COH_PREPARE2", getPlayerGuildName(cid)) doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta muito proxima do dominio!") end end return true end
Ao reiniciar o servidor ainda permanece o mesmo erro, como segue a imagem. -
1 minuto atrás, FlameArcixt disse:
Cade o codigo do castle?
Acabei esquecendo de colocar, sorry
data/movements/scripts/COH.luaSpoiler
function onStepIn(cid, item, pos, fromPosition)
local pos = getThingPos(cid)
if item.actionid == 16203 then
if not isPlayer(cid) then
return true
end
if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
doSendMagicEffect(getThingPos(cid), 14)
doSendAnimatedText(pos, "", math.random(1, 255))
doPlayerSendTextMessage(cid, 20, "Seja Bem Vindo Guild ["..tostring(getGlobalStorageValue(COH_STATUS)).."] !")
else
doSendMagicEffect(getThingPos(cid), 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "Voce nao pertence a Guild "..getGlobalStorageValue(COH_STATUS)..".")
end
return true
endif item.actionid == 16202 then
if not isPlayer(cid) then
return true
end
if getPlayerGuildId(cid) > 0 then
if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then
setGlobalStorageValue(COH_PREPARE1, -1)
setGlobalStorageValue(COH_PREPARE2, -1)
setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid))
doBroadcastMessage("[Vilarejo] O jogador ["..getCreatureName(cid).."] e sua Guild ["..getPlayerGuildName(cid).."] estao Dominando o Vilarejo , va impedir isso!")
doCastleRemoveEnemies()
doPlayerSendTextMessage(cid, 20, "[Vilarejo] Voce e sua Guild estao Dominando["..tostring(getGlobalStorageValue(COH_STATUS)).."] !")
end
else
doSendMagicEffect(pos, 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, "Voce nao possui uma Guild.")
end
return true
end
if item.actionid == 16200 then
if not isPlayer(cid) then
return true
end
if getPlayerGuildId(cid) > 0 then
doSendAnimatedText(pos, "", math.random(1, 255))
if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then
setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid))
doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta tentando Dominar Vilarejo, preparem-se!")
end
else
doSendMagicEffect(pos, 2)
doTeleportThing(cid, fromPosition, false)
doPlayerSendCancel(cid, " Você nao possui uma guild.")
return true
end
end
if item.actionid == 16201 then
if not isPlayer(cid) then
return true
end
doSendAnimatedText(pos, "", math.random(1, 255))
if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then
setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
doBroadcastMessage("[Vilarejo] Atencao! A Guild "..getPlayerGuildName(cid).." esta muito proxima do dominio!")
end
end
return true
end -
Estou usando OTX.
Fala galera,
Estou com um probleminha em meu servidor, sobre o castle, não esta salvando a guild dominante.
Ja verifiquei o config.lua e sim esta como "true" saveGlobalStorage=true.
Se alguem conseguir dar uma ajuda. -
Em 13/02/2021 em 14:37, MatteusDeli disse:
Então o jeito que eu tinha feito é que toda fez que o player logar iria resetar as storages da task, então ele teria que finalizar a task sempre online. Eu fiz uma alteração no script tente fazer desta forma pra ver se funciona, toda vez que o servidor iniciar ele vai zerar todas as storages dos players que começaram a task, segue o script:
Primeiro de tudo, vá no arquivo data/creaturescripts/scripts e abra o login.lua e remova as linhas que você adicionou usando o script anterior:
if getPlayerStorageValue(cid, task_start) > 0 then ClearAllStoragePlayer(cid) setPlayerStorageValue(cid, task_start, -1) end if getPlayerStorageValue(cid, task_finish) > 0 then setPlayerStorageValue(cid, task_finish , -1) end if getPlayerStorageValue(cid, task_start_opcao1) > 0 then setPlayerStorageValue(cid, task_start_opcao1, -1) end if getPlayerStorageValue(cid, task_start_opcao2) > 0 then setPlayerStorageValue(cid, task_start_opcao2, -1) end
Vá em data/globalevents/scripts e crie um arquivo chamado dailyReset.lua e cole isto dentro:
function onStartup() local players = db.getResult("SELECT `id` FROM `players`;") findPlayersID(players) end function findPlayersID(players) if(players:getID() ~= -1) then repeat local playerID = players:getDataInt("id") findPlayersStorageKey(playerID) until not(result:next()) players:free() end end function findPlayersStorageKey(playerID) local playerStorage = db.getResult("SELECT `key` FROM `player_storage` WHERE player_id = "..playerID..";") if(playerStorage:getID() ~= -1) then repeat querysResetValueStoragePlayer(playerID) until not(result:next()) end end function querysResetValueStoragePlayer(playerID) local storageValueReset = -1 db.executeQuery("UPDATE `player_storage` SET `value` = "..storageValueReset.." WHERE `player_id` = ".. playerID .." AND `key` = "..task_start..";") db.executeQuery("UPDATE `player_storage` SET `value` = "..storageValueReset.." WHERE `player_id` = ".. playerID .." AND `key` = "..task_start..";") db.executeQuery("UPDATE `player_storage` SET `value` = "..storageValueReset.." WHERE `player_id` = ".. playerID .." AND `key` = "..task_start_opcao1..";") db.executeQuery("UPDATE `player_storage` SET `value` = "..storageValueReset.." WHERE `player_id` = ".. playerID .." AND `key` = "..task_start_opcao2..";") end
Registre o script no globalevents.xml adicionando esta linha nele :
<globalevent name="dailyReset" type="startup" event="script" value="dailyReset.lua"/>
Agora, vá em data/npc/scripts e procuro pelo script do NPC daily que se chama tasker (caso tenha mudado o nome então procuro pelo nome que voce alterou) e troque por esse script :
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local opcao1 = nil local opcao2 = nil local pokemonNameOpcao1 = '' local pokemonNameOpcao2 = '' local opcaoSelecionada = nil function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'daily') then if (getPlayerStorageValue(cid, task_start) >= 1) then return selfSay("Voce ja escolheu uma task hoje, termine-a primeiro.") end if (getPlayerStorageValue(cid, task_storage_time) > os.time()) then return selfSay("Voce ja terminou a sua task hoje, volte amanha.") end setPlayerStorageValue(cid, task_storage_time, -1) selfSay("Diga 'monsters' para saber quais monsters estao disponiveis hoje.") talkState[cid] = 0 end if (getPlayerStorageValue(cid, task_storage_time) < os.time()) then if msgcontains(msg, 'monsters') and talkState[cid] == 0 and pokemonNameOpcao1 == '' and pokemonNameOpcao2 == '' then opcao1 = PokemonOpcao1() opcao2 = PokemonOpcao2() pokemonNameOpcao1 = opcao1.PokemonName pokemonNameOpcao2 = opcao2.PokemonName selfSay("Opcao 1: Voce tera que derrotar "..opcao1.Count.." "..opcao1.PokemonName.."(s).") selfSay("Opcao 2: Voce tera que derrotar "..opcao2.Count.." "..opcao2.PokemonName.."(s).") talkState[cid] = 1 end if msgcontains(msg, 'monsters') and talkState[cid] == 0 and pokemonNameOpcao1 ~= '' and pokemonNameOpcao2 ~= '' then selfSay("Essas sao as opcoes de monsters para voce hoje.") selfSay("Opcao 1: Voce tera que derrotar "..opcao1.Count.." "..opcao1.PokemonName.."(s).") selfSay("Opcao 2: Voce tera que derrotar "..opcao2.Count.." "..opcao2.PokemonName.."(s).") talkState[cid] = 1 end end if msgcontains(string.lower(msg), string.lower(pokemonNameOpcao1)) and talkState[cid] == 1 then opcaoSelecionada = opcao1 GetOpcaoSelecionada(cid, msg, opcao1) StorageStartTaskOpcao1 = opcao1 setPlayerStorageValue(cid, task_start_opcao1, task_info_table_opcao1) talkState[cid] = 0 end if msgcontains(string.lower(msg), string.lower(pokemonNameOpcao2)) and talkState[cid] == 1 then opcaoSelecionada = opcao2 GetOpcaoSelecionada(cid, msg, opcao2) setPlayerStorageValue(cid, task_start_opcao2, task_info_table_opcao2) talkState[cid] = 0 end if (getPlayerStorageValue(cid, task_finish) >= 1) then if (msgcontains(msg, 'reward')) then if (opcaoSelecionada ~= nil) then selfSay("Parabens voce acabou a task diaria de hoje. Voce ganhou "..opcaoSelecionada.Experience.." de experiencia e "..opcaoSelecionada.Reward..".") doPlayerAddExperience(cid, opcaoSelecionada.Experience) doPlayerAddItem(cid, opcaoSelecionada.Reward) setPlayerStorageValue(cid, task_storage_time, os.time() + (60 * 60 * task_time)) setPlayerStorageValue(cid, task_start, -1) setPlayerStorageValue(cid, task_finish, -1) pokemonNameOpcao1 = '' pokemonNameOpcao2 = '' opcaoSelecionada = nil talkState[cid] = 0 end end end return TRUE end function GetOpcaoSelecionada(cid, msg, opcao) if (string.lower(msg) == string.lower(opcao.PokemonName)) then ClearAllStoragePlayer(cid) setPlayerStorageValue(cid, task_start, 1) selfSay("Voce comecou a task, voce precisa matar ["..opcao.Count.." "..opcao.PokemonName.."]. Boa Sorte!") npcHandler:releaseFocus(cid) talkState[cid] = 0 end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Voltou a dar o mesmo erro
Parece que não estava salvando a storage -
.Qual servidor ou website você utiliza como base?
OTX
Qual o motivo deste tópico?
Eae galera,
Estou com um probleminha que é o seguinte:
Um level 400 morre para um level 500, o cara 400 não perde se quer um level.
Mas se o 400 matar o 500, o cara 500 perde level.
Deu para entender?
No Login esta com o DeathLostPercent:12
e no lua DeathLostPercent:13
#EDIT: TENHO ACESSO A MINHA DISTRO!! -
Em 11/02/2021 em 16:22, MatteusDeli disse:
Boa tarde, vá até a pasta data/creaturescripts/scripts abra o arquivo login.lua e embaixo aonde está function onLogin(cid) coloque este trecho de código:
if getPlayerStorageValue(cid, task_start) > 0 then ClearAllStoragePlayer(cid) setPlayerStorageValue(cid, task_start, -1) end if getPlayerStorageValue(cid, task_finish) > 0 then setPlayerStorageValue(cid, task_finish , -1) end if getPlayerStorageValue(cid, task_start_opcao1) > 0 then setPlayerStorageValue(cid, task_start_opcao1, -1) end if getPlayerStorageValue(cid, task_start_opcao2) > 0 then setPlayerStorageValue(cid, task_start_opcao2, -1) end
Funcionou de certa forma, ao dar o Server Save ele reseta as tasks, então ele teria que terminar a task antes do Server Save?
-
1 minuto atrás, Pisces disse:
Coloca pra zerar as storages da task quando o servidor iniciar
Poderia me mostrar ?
-
Qual o motivo deste tópico?
Opa pessoal estou aqui mais uma vez para pedir um suporte!
É o seguinte, estou com um npc que ele da task daily, ok, ele te da 2 opções de task, até ai normal.
Da para você escolher as duas normal.
O problema vem a seguir, exemplo:
* Supondo que eu escolhi a Opção 1, tendo que matar 500 Rat, se o servidor cair ou reiniciar antes que eu termine os 500 Rat, o personagem buga.
* O bug consiste em ficar preso na missão de 500 Rat para sempre, não tem como entregar pois o comando para entrar "reward" não funciona, e não tem como tentar começar outra task pois ele fala que você tem que terminar essa de 500 Rat primeiro. ( Tasker: Voce ja escolheu uma task hoje, termine-a primeiro. )
*Resumindo tudo: Se o player esta no meio da task, e o servidor cai ou reinicia, ele trava naquela task, não consegue entregar e nem tentar entrar em outra.
Irei postar a script e xml do npc, foi modificada um pouco por mim, mas total Crédito ao: @MatteusDeli
Citar<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tasker" script="data/npc/scripts/tasker.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="10" head="19" body="113" legs="95" feet="115" addons="0"/>
<parameters>
<parameter key="message_greet" value="|PLAYERNAME|! Eu tenho uma tarefa para você, diga {daily} pra saber mais. Caso tenha finalizado diga {reward}." />
</parameters>
</npc>Citarlocal keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() endlocal opcao1 = nil
local opcao2 = nil
local pokemonNameOpcao1 = ''
local pokemonNameOpcao2 = ''
local opcaoSelecionada = nilfunction creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
endif msgcontains(msg, 'daily') then
if (getPlayerStorageValue(cid, task_start) >= 1) then
return selfSay("Voce ja escolheu uma task hoje, termine-a primeiro.")
endif (getPlayerStorageValue(cid, task_storage_time) > os.time()) then
return selfSay("Voce ja terminou a sua task hoje, volte amanha.")
endsetPlayerStorageValue(cid, task_storage_time, -1)
selfSay("Diga 'monsters' para saber quais monsters estao disponiveis hoje.")
talkState[cid] = 0
endif (getPlayerStorageValue(cid, task_storage_time) < os.time()) then
if msgcontains(msg, 'monsters') and talkState[cid] == 0 and pokemonNameOpcao1 == '' and pokemonNameOpcao2 == '' then
opcao1 = PokemonOpcao1()
opcao2 = PokemonOpcao2()pokemonNameOpcao1 = opcao1.PokemonName
pokemonNameOpcao2 = opcao2.PokemonNameselfSay("Opcao 1: Voce tera que derrotar "..opcao1.Count.." "..opcao1.PokemonName.."(s).")
selfSay("Opcao 2: Voce tera que derrotar "..opcao2.Count.." "..opcao2.PokemonName.."(s).")
talkState[cid] = 1
endif msgcontains(msg, 'monsters') and talkState[cid] == 0 and pokemonNameOpcao1 ~= '' and pokemonNameOpcao2 ~= '' then
selfSay("Essas sao as opcoes de monsters para voce hoje.")
selfSay("Opcao 1: Voce tera que derrotar "..opcao1.Count.." "..opcao1.PokemonName.."(s).")
selfSay("Opcao 2: Voce tera que derrotar "..opcao2.Count.." "..opcao2.PokemonName.."(s).")
talkState[cid] = 1end
end
if msgcontains(string.lower(msg), string.lower(pokemonNameOpcao1)) and talkState[cid] == 1 then
opcaoSelecionada = opcao1
GetOpcaoSelecionada(cid, msg, opcao1)
StorageStartTaskOpcao1 = opcao1
setPlayerStorageValue(cid, task_start_opcao1, task_info_table_opcao1)
talkState[cid] = 0
endif msgcontains(string.lower(msg), string.lower(pokemonNameOpcao2)) and talkState[cid] == 1 then
opcaoSelecionada = opcao2
GetOpcaoSelecionada(cid, msg, opcao2)
setPlayerStorageValue(cid, task_start_opcao2, task_info_table_opcao2)
talkState[cid] = 0
endif (getPlayerStorageValue(cid, task_finish) >= 1) then
if (msgcontains(msg, 'reward')) then
if (opcaoSelecionada ~= nil) then
selfSay("Parabens voce acabou a task diaria de hoje. Voce ganhou "..opcaoSelecionada.Experience.." de experiencia e "..opcaoSelecionada.Reward..".")
doPlayerAddExperience(cid, opcaoSelecionada.Experience)
doPlayerAddItem(cid, opcaoSelecionada.Reward)
setPlayerStorageValue(cid, task_storage_time, os.time() + (60 * 60 * task_time))
setPlayerStorageValue(cid, task_start, -1)
setPlayerStorageValue(cid, task_finish, -1)
pokemonNameOpcao1 = ''
pokemonNameOpcao2 = ''
opcaoSelecionada = nil
talkState[cid] = 0
end
end
endreturn TRUE
endfunction GetOpcaoSelecionada(cid, msg, opcao)
if (string.lower(msg) == string.lower(opcao.PokemonName)) then
setPlayerStorageValue(cid, task_start, 1)
selfSay("Voce comecou a task, voce precisa matar ["..opcao.Count.." "..opcao.PokemonName.."]. Boa Sorte!")
npcHandler:releaseFocus(cid)
talkState[cid] = 0end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
+REP, para quem conseguir me ajudar!
Grato desde já! -
-
Qual o motivo deste tópico?
Estou usando OTX
Estou com um problema, ao clicar em " Set Outfit " não esta abrindo a janela.
Porem minha cfg.lua ja esta com esta configuração.Citar
allowChangeOutfit = true
allowChangeColors = false
allowChangeAddons = false
disableOutfitsForPrivilegedPlayers = false
addonsOnlyPremium = trueQuando deixo o disableOutfitsForPrivilegedPlayers = true , o adm consegue acessar o set outfit e o player não.
Já quando eu deixo disableOutfitsForPrivilegedPlayers = false , nem o adm e nem o player consegue acessar.
em Outfit.xml
Citar<?xml version="1.0"?>
<outfits><outfit id="44" premium="no" default="0">
<list gender="0-3" lookType="541" name="Kakuzu"/>
</outfit>
<outfit id="45" premium="no" default="0">
<list gender="0-3" lookType="440" name="Naruto"/>
</outfit><outfit id="46" premium="no" default="0">
<list gender="0-3" lookType="392" name="Ragnarok"/>
</outfit><outfit id="47" premium="no" default="0">
<list gender="0-3" lookType="160" name="Thor"/>
</outfit>
<outfit id="48" premium="no" default="0">
<list gender="0-3" lookType="249" name="Loki"/>
</outfit>
</outfits>
Quem poder ajudar, receberá +REP
Obrigado! -
2 horas atrás, ITALOx disse:
Até aonde eu sei, essa script é apenas para outfit para mexer no próprio outfit da cip. Mas creio que eu tenha esse script do action que só dá pra tal vocação. Vou procurar no discord e te mando!!
Então, acabei encontrando um que funciona a parte do vocation, porem a skin não fica guardada no "set outfit".
-
Qual o motivo deste tópico?
Boa noite/dia/tarde, gostaria de uma script "action" que ao usar item dê uma skin para o player.
Porem para uma vocação especifica.
Exemplo: Item que da a skin para o naruto, somente o naruto pode usar, quando alguma outra vocação for usar apareça "Somente Naruto pode usar essa skin.".Estava tentando fazer algumas gambiarras porem nenhuma funcionou
estava tentando usar a função " getPlayerVocation(cid) " mas não consegui encaixar ela na script.Id da vocação Naruto: 1
Estou utilizando essa script! créditos: @Celulose @ITALOx
Citarfunction onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 7379 and (getPlayerStorageValue(cid, 8002) == EMPTY_STORAGE) then doPlayerAddOutfitId(cid, 44, 3) setPlayerStorageValue(cid, 8002, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE) doPlayerSendTextMessage(cid,22,"Parabéns, você recebeu a Outfit!") doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid,"Você já recebeu essa roupa!") end end
-
12 horas atrás, Naze disse:
troca o getPlayerLevel(cid) por getPlayerSkillLevel(cid, SKILL_SWORD)
Ainda não funcionou!
Pode ser a tag?
Citar<movevent type="StepIn" uniqueid="10059" script="tile2.lua"/>
@EDIT: Na verdade consegui resolver, muito obrigado @Naze! +REP pra ti
-
Qual o motivo deste tópico?
Estou precisando de uma ajuda, procurei sobre a script porem sem resposta...
Gostaria de fazer um tile, que apenas players com MENOS de 50 "sword" poderia passar.Tenho uma script, que peguei do @Naze, talvez possa ajudar com a ideia.
function onStepIn(cid, item, position, fromPosition) local min = 0 local max = 50 local lvl = getPlayerLevel(cid) if lvl < min and lvl > max then doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED) doPlayerSendCancel(cid,"Somente level maior que " .. min .. " e menor que ".. max .." podem passar aqui.") end return TRUE end
-
18 horas atrás, MatteusDeli disse:
Boa tarde, como seria essas missões diárias que o npc 2 vai dar, matar monstro, pegar items?
Opa, se for possível gostaria que tivesse as duas opções, só que fosse sortidas a cada dia por exemplo: ontem eu peguei 2 missões de pegar itens e 1 de matar monstro / e hoje eu peguei 3 de matar monstro.. Algo nesse sentido.
Mas se não for possível, pode ser somente para matar monstro.
#EDIT: Acabei me esquecendo, no NPC 2 ao entregar a missão, ele dará uma recompensa. -
-
Em 11/11/2020 em 10:47, Shiuns disse:
function onAdvance(cid, skill, oldLevel, newLevel) local config = { [50] = {item = 2160, count = 5}, [100] = {item = 2160, count = 15}, [150] = {item = 2160, count = 20}, [200] = {item = 2160, count = 25}, [250] = {item = 2160, count = 30}, [300] = {item = 2160, count = 50}, [350] = {item = 4891, count = 1}, [400] = {item = 4892, count = 1}, } if skill == SKILL_CLUB then for level, info in pairs(config) do if newLevel >= level and (getPlayerStorageValue(cid, 30705) == -1 or not (string.find(getPlayerStorageValue(cid, 30705), "'" .. level .. "'"))) then doPlayerAddItem(cid, info.item, info.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Parabéns, você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".") local sat = getPlayerStorageValue(cid, 30705) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30705) .. ",'" .. level .. "'" setPlayerStorageValue(cid, 30705, sat) end end end return true end
Desculpa pela demora, estava sem computador!
Mas resolveu a minha dúvida!Obrigado!
-
Qual o motivo deste tópico?
Preciso de uma ajuda, peguei uma script de recompensa por level, e gostaria de fazer algumas mudanças nessa script, porem estou quebrando a cabeça para tentar resolver pois sou novato e não entendo 100% de script.
Script da recompensa original:
function onAdvance(cid, skill, oldLevel, newLevel) local config = { [50] = {item = 2160, count = 5}, [100] = {item = 2160, count = 15}, [150] = {item = 2160, count = 20}, [200] = {item = 2160, count = 25}, [250] = {item = 2160, count = 30}, [300] = {item = 2160, count = 50}, [350] = {item = 4891, count = 1}, [400] = {item = 4892, count = 1}, } if skill == 8 then for level, info in pairs(config) do if newLevel >= level and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then doPlayerAddItem(cid, info.item, info.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Parabéns, você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".") local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'" setPlayerStorageValue(cid, 30700, sat) end end end return TRUE end
Aqui está o que eu "tentei" alterar:
Citarfunction onAdvance(cid, skill, oldClub, newClub)
local config = {
[12] = {item = 2160, count = 5},
[13] = {item = 2160, count = 15},
[14] = {item = 2160, count = 20},
[15] = {item = 2160, count = 25},
[16] = {item = 2160, count = 30},
[17] = {item = 2160, count = 50},
[350] = {item = 4891, count = 1},
[608] = {item = 11499, count = 1},
}if skill == 8 then
for club, info in pairs(config) do
if newClub >= club and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then
doPlayerAddItem(cid, info.item, info.count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Parabéns, você atingiu o level "..newClub.." e ganhou "..info.count.." "..getItemNameById(info.item)..".")
local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'"
setPlayerStorageValue(cid, 30700, sat)
end
end
endreturn TRUE
endResumo:
Preciso que ao upar a skill Club você possa ganhar uma recompensa.
Darei +REP para quem ajudar!!
(creditos:Absolute) Pela script de recompensa por level.
-
20 minutos atrás, Gabrieldsadaxas disse:
cara, é muito simples
cada vocação tem uma "especialização" com armas digamos assim, knight upa bem a sword mas upa mal o ml, e o knight de alguma forma pegar ml 120 e usar um exura vita da vida o servidor vai freezar, do mesmo jeito que se um sorcerer pegar sword 120 e tentar atacar com ela o servidor vai freezar. Isso é definido no vocations.xml
ve o valor da sword do knight e poe esse valor em sword de todos, ml do mage pra todas tambem, desse jeito n vai ter freeze
Fiz isso, e por enquanto parece que funcionou! Valeu +rep
-
Boa Noite!
Detalhes: tfs 0.4, narutibia.
Então, estou com um problema gigantesco, peço a ajuda de vocês!
Por exemplo:
Vocações que usa gloves, quando vai usar uma sword e vai hitar alguma coisa, simplesmente o servidor congela!!
Sem nenhum erro na distro.
Castle não esta salvando guild dominante
em Suporte Tibia Alternativo
Postado
ainda não foi