Demonbholder
-
Total de itens
1551 -
Registro em
-
Última visita
-
Dias Ganhos
24
Posts postados por Demonbholder
-
-
function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then start = start + 1 end end end end end if start == 4 then doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end
Coloquei pra mandar qnd ele pisar no tile.
A respeito do animated text, eu não to com nada aqui pra ver qual função substituiu ela, se alguém souber, ajuda ele ai.
-
Então o código antigo tava funcionando? Não sei se eu entendi direito o que você quer, vê se é isso:
local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then start = start + 1 end end end end end if start == 4 then doCreatureSay(cid, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) doSendAnimatedText({x = 33261, y = 31086, z = 8}, "The army is complete again. You hear a hatch opening elsewhere, followed by a grinding sound.", TALKTYPE_ORANGE_1) doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end
-
Tá e até agora você não ordenou os valores da tabela.
kkkkkkkkkk
-
-
Sim, o Techrlz falou que essa função não existe mais no tfs 1.0, mas não era a esse erro que eu tava me referindo.
-
Realmente, testei aqui agora, tem alguns problemas. Vou tirar e talvez eu poste novamente quando resolver.
Abraço ;]
Não precisa tirar, a sua função ta certa, só alguns detalhes que daria pra mudar.
Anyway, não sei se vai fugir muito do que o slicer postou.
-
Eu fiz assim:
function doRepeatEffect(cid, effect, vezes, intervalo) if not effect then return end if not vezes then return end if not intervalo then intervalo = 1000 end local pos = getThingPos(cid) for i = 1, vezes do addEvent(doSendMagicEffect, i*intervalo, pos, effect) end end
Lembrando que o intervalo deve ser em Milesegundos.
doRepeatEffect(cid, 3, 10, 1000)
Abraços
Tem que cuidar que o player pode deslogar.
Outra coisa é que ele chama vários addEvents, se você usasse recursividade, se alguma das condições desse errada, ele já parava por ali.
-
Estranho que ele ta fazendo o start ficar 4, e pra isso, ele tem que pegar o storage dos players nas 4 posições...
E outra, se você ta falando que com só 1 ele já ta dando, deveria dar erro quando ele chama a função doCreatureSay, já que ele não acha a criatura.
Vou ficar aguardando o resultado.
-
hahaha, com ou sem parênteses, nesse caso, da no mesmo kkkk
...
-
Copiou tudo que eu coloquei ali mesmo? Até o start = 0 e if start == 4? O código fica assim:
local pos = { {x = 33258, y = 31079, z = 8}, {x = 33259, y = 31089, z = 8}, {x = 33266, y = 31084, z = 8}, {x = 33263, y = 31093, z = 8} } function doClearMissionArea(fromPos, toPos) for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do if(getTopCreature({x = x, y = y, z = z}).uid > 0) then if(isPlayer(getTopCreature({x = x, y = y, z = z}).uid)) then doTeleportThing(getTopCreature({x = x, y = y, z = z}).uid, {x = 33353, y = 31410, z = 8}) doSendMagicEffect({x = 33353, y = 31410, z = 8}, CONST_ME_TELEPORT) else doRemoveCreature(getTopCreature({x = x, y = y, z = z}).uid) end end end end end return true end function TirarEscada() local escada = getTileItemById({x = 33265, y = 31116, z = 8}, 3687) local escada2 = getTileItemById({x = 33265, y = 31116, z = 7}, 3219) if escada then doRemoveItem(escada.uid, 1) doRemoveItem(escada2.uid, 1) doCreateItem(11097, 1, {x = 33265, y = 31116, z = 7}) end return true end function onStepIn(cid, item, position, lastPosition) start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end if start == 4 then doCreateItem(3687, 1, {x = 33265, y = 31116, z = 8}) doCreateItem(3219, 1, {x = 33265, y = 31116, z = 7}) addEvent(TirarEscada, 30 * 1000) setGlobalStorageValue(8014, 1) addEvent(setGlobalStorageValue, 8014, 0) creature = "" for k = 1, 4 do for j = 1, 20 do if(k < 3) then creature = "eternal guardian" else creature = "lizard chosen" end summonPos = {x = math.random(33239, 33295), y = math.random(31100, 31132), z = 7} addEvent(doSummonCreature, k * 30 * 1000, creature, summonPos) addEvent(doSendMagicEffect, k * 30 * 1000, summonPos, CONST_ME_TELEPORT) end end addEvent(doClearMissionArea, 5 * 30 * 1000, {x = 33239, y = 31100, z = 7}, {x = 33295, y = 31132, z = 7}) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 15335, 2) addEvent(setPlayerStorageValue, 5 * 30 * 1000, cid, 1050, 20) end end return true end
ps: eu não to testando, mas acho que deve funcionar...
-
Isso?
start = 0 if item.actionid == 8014 then for i = 1, 4 do local creature = getTopCreature(pos[i]).uid if creature > 0 then if isPlayer(creature) then if getGlobalStorageValue(8014) < 1 then if getPlayerStorageValue(creature, 1050) == 19 then doCreatureSay(creature, "A clicking sound tatters the silence.", TALKTYPE_ORANGE_1) start = start + 1 end end end end end if start == 4 then
-
Não é permitido venda de códigos no xtibia.com
-
Relaxa, não precisa se preocupar com isso
Vou reportar pra moverem o tópico.
-
Substitui o código do npc por este:
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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local storage = 2014042021 local vocation = 350 if(msgcontains(msg, 'mestre kame') or msgcontains(msg, 'kame')) then selfSay('Voce realmente deseja se tornar um {Mestre Kame}.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerItemCount(cid, 9971) >= 30) then doPlayerRemoveItem(cid, 9971, 30) doPlayerSetVocation(cid, vocation) setPlayerStorageValue(cid, storage, vocation) selfSay('Voce se tornou um Mestre Kame.', cid) else selfSay('Você não tem {vip coins} suficientes.', cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Cria um arquivo .lua em data/creaturescripts/scripts e coloca isso:
function onLogin(cid) local storage = getPlayerStorageValue(cid, 2014042021) if storage ~= -1 then doPlayerSetVocation(cid, storage) end return true end
Depois é só colocar a tag no creaturescripts.xml (me avisa se vc n souber fazer)
-
Um tabela? Serio? Isso é contra a LEI! AUHAUHAUHAU
Muito bom, adorei isso!
Abraço
Tabela?
É só um outro jeito de representar strings. Pelo que eu saiba, tem 3 jeitos: aspas duplas "", aspas simples '' e colchetes duplos [[ ]].
A diferença é que nos colchetes, vc não tem o \n, \t, etc, mas pode quebrar linha, por exemplo.
-
Tem um outro jeito que é mais fácil de configurar pra quem não sabe programar:
function onLogin(cid) local msg = [[Bem Vindo(a) ao BadOT, Compre Já Sua Vip e tenha muito mais vantagens. Comprando a VIP você recebe: Tag [VIP], 5 Vip Coin, +500x de UP, Acesso a Area VIP com Hunts Novas. Isso tudo por Apenas 10 Reais, Acesse: badot.com , By.: [ADM]Akiiro By.: [ADM]Akiiro ]] doPlayerPopupFYI(cid, msg) return true end
-
Essa é a fala padrão dele quando não tem nada especificado no xml.
Resumindo, tem que adicionar uma fala no xml dele.
-
Boa tarde,
Qual a diferença, eu sempre fico em duvida com quais funções usar e tals, tem algum site que mostre a diferença uma da outra? ESPECIFICAMENTE
Agora pensando melhor, acredito que o doRemoveItem se enquandra melhor mesmo, pois se o player tiver outro item desse na backpack, poderá desaparecer o item que ele não usou, e usando o doRemoveItem vai remover o que foi usado certo? Esse é o unico motivo? Vou alterar aqui, obrigado pela dica ;]
Grande abraço.
Opa, acho que é melhor usar doRemoveItem, porque se ele usar um item que está no chão, por exemplo, o item vai ser removido. Se fosse a doPlayerRemoveItem, só removeria se o item estivesse com o player.
-
Acho que seria interessante trocar
doPlayerRemoveItem(cid, item.itemid, 1)
por:
doRemoveItem(item.uid, 1)
-
é pra mandar de 1 em 1 segundo? se for...
function unparalyze(cid) return isPlayer(cid) and doCreatureSetNoMove(cid, false) end function magicEfe(cid, times) if times > 0 and isPlayer(cid) then doSendMagicEffect(getCreaturePosition(cid), 189) addEvent(magicEfe, 1000, cid, times-1) end end function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not isCreature(target) then doPlayerSendCancel(cid, 'You may only use this on human targets.') return false end doCreatureSetNoMove(target, true) addEvent(unparalyze, 5000, target) doSendMagicEffect(getCreaturePosition(target), 189) addEvent(magicEfe, 1000, target, 5) return true end
ps: não testei, vê como ta -
Coloca isso antes do ultimo end
doCreatureAddHealth(cid, -(getCreatureHealth(cid)*0.7))
-
O addEvent é realmente necessário? Tenta tirar ele e ver se da alguma diferença.
-
Seta um storage e depois faz um onLogin pra colocar a vocação de novo.
-
Hmmm não sabia que ele era salvo assim na memória, valeu pela explicação.
Só um correção, 4 em binário seria 0100.
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
Script movements não esta executando da forma correta
em Lixeira Pública
Postado
Boa, essa função é nova ou já tinha antes? Não lembro de ter visto ela...