Ir para conteúdo

Demonbholder

Infante
  • Total de itens

    1551
  • Registro em

  • Última visita

  • Dias Ganhos

    24

Posts postados por Demonbholder

  1. 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.

  2. 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
    
    
  3. 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.

  4. 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.

  5. 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...

  6. 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
    
  7. 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)

  8. 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.

  9. 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
  10. 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.

  11. é 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
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...