Ir para conteúdo

MaTTch

Membro
  • Registro em

  • Última visita

Tudo que MaTTch postou

  1. O erro de morrer e não voltar mais não tem qualquer relação com o script. Tenta trocar: function onTarget(cid, target) por: function onAttack(cid, target) não esquece da TAG. OBS: O monstro apesar de não te atacar ele pode continuar te seguindo como target.
  2. Muda: doPlayerRemoveMoney(cid, quantidade) para: doPlayerRemoveMoney(cid, money)
  3. Ué... Tem certeza que não é algum script seu que ta interferindo?
  4. Script: local config = { --["nome do monstro"] = {storage, storage_quant} ["Monster_Name1"] = {22222, 1}, ["Monster_Name2"] = {22223, 1}, ["Monster_Name3"] = {22224, 1} } function onKill(cid, target, lastHit) if((isPlayer(cid) and isMonster(target)) and config[getCreatureName(target):lower()] ~= nil) then local a = config[getCreatureName(target):lower()] setPlayerStorageValue(cid, a[1], a[2]) end return true end TAG: <event type="kill" name="EVENT_NAME" event="script" value="NOME_DO_ARQUIVO.lua"/> login.lua: registerCreatureEvent(cid, "EVENT_NAME")
  5. Vá em creaturescripts/scripts e crie um arquivo LUA, dentro você coloca isso: local storage = 55555 function onTarget(cid, target) if(isPlayer(target) and getPlayerStorageValue(target, storage) == -1) then return false end return true end em creaturescripts.xml adicione a TAG: <event type="target" name="EVENT_NAME" event="script" value="NOME_DO_ARQUIVO.lua"/> e finalmente vá no monstro que você quer que utilize o sistema e adicione: <script> <event name="EVENT_NAME"/> </script> o resto você deve saber...
  6. <channel id="9" name="Help" logged="yes" muted="120" conditionId="4" conditionMessage="Wait 2 minutes."/>
  7. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 function onCreatureSayCallBack(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if(msgcontains(msg, 'item')) then if(getPlayerStorageValue(cid, 99746) == -1) then npcHandler:say('Opa, então voce ainda não tem items e precisa de ajuda ? tome isto vai lhe ajudar em sua jornada', cid) doPlayerAddItem(cid, 2160, 100) setPlayerStorageValue(cid, 99746, 1) return true end else npcHandler:say('Saia daqui já lhe ajudei', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, "onCreatureSayCallback") npcHandler:addModule(FocusModule:new())
  8. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 function onCreatureSayCallBack(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if getPlayerStorageValue(cid, 99746) == false then if msgcontains(msg, 'item') then npcHandler:say('Opa, então voce ainda não tem items e precisa de ajuda ? tome isto vai lhe ajudar em sua jornada', cid) doPlayerAddItem(cid, 2160, 100) setPlayerStorageValue(cid, 99746) return true end else npcHandler:say('Saia daqui já lhe ajudei', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, "onCreatureSayCallback") npcHandler:addModule(FocusModule:new())
  9. MaTTch postou uma resposta no tópico em Suporte Tibia OTServer
    Tenta com Object Builder
  10. local config = { timeToCreate = 1, -- minutes wallId = 9485, wallPos = { {x = 417, y = 65, z = 7}, {x = 417, y = 67, z = 7} } } function removeWalls() doBroadcastMessage("Somente para jogadores experientes.") addEvent(createWalls, config.timeToCreate * 60 * 1000) for _, pos in pairs(config.wallPos) do local a = getTileItemById(pos, config.wallId).uid if(a ~= 0) then doRemoveItem(a) doSendMagicEffect(pos, CONST_ME_MAGIC_RED) end end return true end function createWalls() for _, pos in pairs(config.wallPos) do local a = getTileItemById(pos, config.wallId).uid if(a == 0) then doCreateItem(config.wallId, 1, pos) doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) end end return true end function onThink(interval, lastExecution) doBroadcastMessage("Blood castle aberto!.") addEvent(removeWalls, 1000) return true end
  11. doCreatureExecuteTalkAction(cid, "/aloot add:2148", true)
  12. Em creaturescripts/scripts cria algum arquivo LUA e coloca isso dentro: local skillMsgs = { [SKILL_FIST] = "You advanced in fist fighting.", [SKILL_CLUB] = "You advanced in club fighting.", [SKILL_SWORD] = "You advanced in sword fighting.", [SKILL_AXE] = "You advanced in axe fighting.", [SKILL_DISTANCE] = "You advanced in distance fighting.", [SKILL_SHIELD] = "You advanced in shielding.", [SKILL_FISHING] = "You advanced in fishing.", [SKILL__MAGLEVEL] = "You advanced in magic level." } function onAdvance(cid, skill, oldlevel, newlevel) if(skillMsgs[skill]) then doCreatureSay(cid, skillMsgs[skill], TALKTYPE_MONSTER) end return true end Agora em login.lua coloca junto dos demais: registerCreatureEvent(cid, "EVENT_NAME") E em creaturescripts.xml coloca a tag: <event type="advance" name="EVENT_NAME" event="script" value="SCRIPT.lua"/>
  13. O "CreatureSay" da pra fazer por script, mas pra remover a mensagem em branco é por sources
  14. tenta assim que acho q é melhor: local tempo = 11 local position = {} function onCastSpell(cid, var) local itemid = math.random (118, 118) if(position[cid] == nil) then position[cid] = getThingPos(cid) doDecayItem(doCreateItem(itemid, position[cid])) doSendMagicEffect(position[cid], 3) addEvent(function() if(isCreature(cid)) then doPlayerSendTextMessage(cid, 22, "Expiro A Hiraishin Kunai.") position[cid] = nil end end, 1000*tempo) else doTeleportThing(cid, position[cid]) doSendMagicEffect(getThingPos(cid), 82) end return true end
  15. estara tirando para não trocar o crystal coin
  16. Deleta essa parte: elseif item.itemid == scarabid then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$", TEXTCOLOR_TEAL)
  17. @xBlackWolf seria config[1][1] já que você colocou o storage em outra table @Topic vai em creaturescripts/scripts/login.lua e abaixo de: if(accountManager == MANAGER_NONE) then coloca: setPlayerStorageValue(cid,49607, -1)
  18. local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')), showLevel = "yes", showVocations = "yes" } config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations) function onSay(cid, words, param, channel) local vocationsList = {"Sorcerer", "Druid", "Paladin", "Knight"} local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, "" for _, pid in ipairs(getPlayersOnline()) do if(added) then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. ", " end end for _, vocName in ipairs(vocationsList) do if(not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) and string.find(getVocationInfo(getPlayerVocation(pid)).name:lower(), vocName:lower())) then vocations[vocName] = vocations[vocName] ~= nil and vocations[vocName] + 1 or 1 end end added = false if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then strings[position] = strings[position] .. getCreatureName(pid) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "").."" i = i + 1 added = true end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end if(config.showVocations) then for vocName, quant in pairs(vocations) do vocStr = vocStr .. "todos "..vocName:lower()..""..(quant > 1 and "s" or "").." ("..quant.."), " end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..vocStr:gsub(", $", ".")) end return true end Tenta agora (não testei)
  19. local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')), showLevel = "yes", showVocations = "yes" } config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations) function onSay(cid, words, param, channel) local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, "" for _, pid in ipairs(getPlayersOnline()) do if(added) then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. ", " end end if(vocations[getPlayerVocation(pid)] ~= nil) then vocations[getPlayerVocation(pid)] = vocations[getPlayerVocation(pid)] + 1 else vocations[getPlayerVocation(pid)] = 1 end added = false if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then strings[position] = strings[position] .. getCreatureName(pid) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "").."" i = i + 1 added = true end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " online:") for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) end if(config.showVocations) then for vocId, quant in pairs(vocations) do vocStr = vocStr .. ""..getVocationInfo(vocId).name.." ["..quant.."], " end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vocations: "..vocStr:gsub(", $", ".")) end return true end
  20. Meu

    MaTTch postou uma resposta no tópico em Playground (Off-topic)
    Você ta queimando ele de tanto tocar punhe... trombeta.
  21. MaTTch postou uma resposta no tópico em Suporte Tibia OTServer
    Você tem que editar nessa linha: doEffect(cid, 50, 400, getPlayerVocation(cid)) -- doEffect(cid, efeito, delay, vocação)
  22. MaTTch postou uma resposta no tópico em Suporte Tibia OTServer
    Pra fazer você entender um pouco melhor, vou explicar: doEffect(cid, 50, 400, getPlayerVocation(cid)) Vermelho = Efeito que vai soltar Cinza = O delay (tempo) que vai ficar soltando o efeito (1000 = 1 seg) Azul = É o ID da vocação que vai soltar esse efeito
  23. Bom... Se não for agora, vou passar ter que deixar outra pessoa resolver. elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not isCreature(target) or not isCreature(cid) then return false end if getPlayerStorageValue(cid, 498587) == 1 then local life = getCreatureHealth(target) doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1) doSendMagicEffect(getThingPosWithDebug(cid), 12) doSendMagicEffect(getThingPosWithDebug(target), 45) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14) local newlife = isCreature(target) and (life - getCreatureHealth(target)) or 0 if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32) end end end, 1000*var) end
  24. MaTTch postou uma resposta no tópico em Suporte Tibia OTServer
    elseif getPlayerVocation(cid) == 490 then local function doEffect(cid, effect, delay, voc) if isCreature(cid) and getPlayerVocation(cid) == voc then doSendMagicEffect(getThingPos(cid), effect) addEvent(doEffect, delay, cid, effect, delay, voc) end end if getPlayerLevel(cid) >= 400 then doPlayerSetVocation(cid,491) doSendMagicEffect(getPlayerPosition(cid), 23) doSetOutfit(cid, 565) doEffect(cid, 50, 400, getPlayerVocation(cid)) -- doEffect(cid, efeito, delay, vocação) else doPlayerSendCancel(cid, "Kamisama, You need 400 level to transform") doSendMagicEffect(getPlayerPosition(cid), 2) doSendMagicEffect(getPlayerPosition(cid), 191) end else doPlayerSendCancel(cid, "You Cannot Transform.") doSendMagicEffect(getPlayerPosition(cid), 2) end end
  25. elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not isCreature(target) or not isCreature(cid) then return false end if getPlayerStorageValue(cid, 498587) == 1 then local life = getCreatureHealth(target) doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14) doSendMagicEffect(getThingPosWithDebug(cid), 12) doSendMagicEffect(getThingPosWithDebug(target), 45) local newlife = life - getCreatureHealth(target) if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32) end end end, 1000*var) end

Informação Importante

Confirmação de Termo