Ir para conteúdo

JG6

Visconde
  • Total de itens

    325
  • Registro em

  • Última visita

  • Dias Ganhos

    6

Posts postados por JG6

  1. Em 20/07/2021 em 12:07, DaniSancca disse:
    Versão do Servidor: TFS - 1.2
    Tipo de Script: npc
    Código:
      Mostrar conteúdo oculto
    
    
    local focus = 0
    local max_distance = 8
    local talk_start = 0
    local conv = 0
    local fighting = false
    local challenger = 0
    local afk_limit_time = 300	-- seconds
    local afk_time = 0		-- don't change
    local battle_turn = 1		-- don't change
    local challenger_turn = 0	-- don't change
    
    local pokemons = {
    {name = "Gyarados", optionalLevel = 450, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Tentacruel", optionalLevel = 450, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Vaporeon", optionalLevel = 450, sex = SEX_FEMALE, nick = "", ball = "normal"},
    {name = "Golduck", optionalLevel = 450, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Blastoise", optionalLevel = 450, sex = SEX_MALE, nick = "", ball = "normal"},
    {name = "Starmie", optionalLevel = 450, sex = SEX_FEMALE, nick = "", ball = "normal"},
    }
    
    
    local function doSummonGymPokemon(npc)
    	local this = npc
    	if #getCreatureSummons(this) >= 1 or focus == 0 then return true end
    	local it = pokemons[battle_turn]
    	doSummonMonster(this, it.name)
    	local summon = getCreatureSummons(this)[1]
    	local balleffect = pokeballs["normal"].effect
    		if it.ball and pokeballs[it.ball] then
    			balleffect = pokeballs[it.ball].effect
    		end
    	doSendMagicEffect(getThingPos(summon), balleffect)
    	setPlayerStorageValue(summon, 10000, balleffect)
    	setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name))
    	setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name)
    	doSetMonsterGym(summon, focus)
    	addEvent(adjustWildPoke, 15, summon, it.optionalLevel)
    	local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name
    	doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1)
    	fighting = true
    	battle_turn = battle_turn + 1
    end
    
    local function doWinDuel(cid, npc)
    	if not isCreature(cid) then return true end
    	local this = npc
    	local a = gymbadges[getCreatureName(this)] + 8
    	doCreatureSay(npc, "You won the duel! Congratulations, take this "..getItemNameById(a - 8).." as a prize.", 1)
    	local b = getPlayerItemById(cid, true, a)
    	if b.uid > 0 then doTransformItem(b.uid, b.itemid - 8) end
    doPlayerSendCancel(cid, "#getBadges# "..getCreatureName(this).." "..getPlayerItemCount(cid, gymbadges[getCreatureName(this)]))
    end
    
    function onCreatureSay(cid, type, msg)
    
    	local msg = string.lower(msg)
    
    	if focus == cid then
    		talk_start = os.clock()
    	end
    
    	if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 4 then
    		focus = cid
    		talk_start = os.clock()
    		conv = 1
    		selfSay("Hello "..getCreatureName(cid)..", my name is Misty and I'm Cerulean's Gym Leader. How may I help you?")
    	return true
    	end
    
    	if isDuelMsg(msg) and conv == 1 and focus == cid then
    
    		--if getPlayerItemCount(cid, gymbadges[getCreatureName(getThis())]) >= 1 then
    		--	selfSay("You have already won my Cascade Badge, maybe some other day we can fight.")
    		--	focus = 0
    		--return true
    		--end
    
    		if not hasPokemon(cid) then
    			selfSay("To battle agains't a gym leader you need pokemons.")
    		return true
    		end
    
    		selfSay("You are challenging me to a battle. It will be a "..#pokemons.." pokemon limit battle, let's start?")
    		conv = 2
    
    	return true
    	end
    
    	if isConfirmMsg(msg) and conv == 2 and focus == cid then
    
    		challenger = focus
    		setPlayerStorageValue(cid, 990, 1)
    		selfSay("Yea, let's fight!")
    		talk_start = os.clock()
    		addEvent(doSummonGymPokemon, 850, getThis())
    		conv = 3
    
    	return true
    	end
    
    	if isNegMsg(msg) and conv == 2 and focus == cid then
    
    		focus = 0
    		selfSay("It is better for you to refuse a battle against me!")
    
    	return true
    	end
    
    	if msgcontains(msg, 'bye') and focus == cid then
    		selfSay('Bye and do your best trainer!')
    		setPlayerStorageValue(focus, 990, -1)
    		focus = 0
    	return true
    	end
    end
    
    local afk_warning = false
    
    function onThink()
    
    	--doSendAnimatedText(getThingPos(getThis()), getCreatureName(getThis()), 215)
    
    	if focus == 0 then
    		selfTurn(2)
    		fighting = false
    		challenger = 0
    		challenger_turn = 0
    		battle_turn = 1
    		afk_time = 0
    		afk_warning = false
    
    		if #getCreatureSummons(getThis()) >= 1 then
    			setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0)
    			doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1]))
    		end
    
    	return true
    	else
    
    	if not isCreature(focus) then
    		focus = 0
    	return true
    	end
    
    	if fighting then
    
    		talk_start = os.clock()
    
    		if not isCreature(getCreatureTarget(getThis())) then
    			if #getCreatureSummons(challenger) >= 1 then
    			   if getCreatureOutfit(getCreatureSummons(challenger)[1]).lookType ~= 2 then --alterado v1.6
    			      selfAttackCreature(getCreatureSummons(challenger)[1])
    				  challenger_turn = challenger_turn + 1
    				  afk_time = 0
    	           end
    			else
    				afk_time = afk_time + 0.5
    			end
    		end
    
    		if afk_time > afk_limit_time then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    			selfSay("I have waited too long, come back when you are ready!")
    		return true
    		end
    
    		if not afk_warning and afk_time > afk_limit_time / 2 then
    			selfSay("Where's your pokemon? Let's fight!")
    			afk_warning = true
    		end
    
    
    		if #getCreatureSummons(getThis()) == 0 then
    			if battle_turn > #pokemons then
    				addEvent(doWinDuel, 1000, focus, getThis())
    				setPlayerStorageValue(focus, 990, -1)
    				focus = 0
    			return true
    			end
    			addEvent(doSummonGymPokemon, 1000, getThis())
    		end
    
    		if not hasPokemon(challenger) or challenger_turn >= 7 or challenger_turn > #pokemons then
    			selfSay("You lost our duel! Maybe some other time you'll defeat me.")
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		return true
    		end
    
    	end
    
    		local npcpos = getThingPos(getThis())
    		local focpos = getThingPos(focus)
    
    		if npcpos.z ~= focpos.z then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    			selfSay("Bye then.")
    		return true
    		end
    
    		if (os.clock() - talk_start) > 30 then
    			selfSay("Good bye and keep training!")
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		end
    
    		if getDistanceToCreature(focus) > max_distance then
    			setPlayerStorageValue(focus, 990, -1)
    			focus = 0
    		return true
    		end
    
    		local dir = doRedirectDirection(getDirectionTo(npcpos, focpos))	
    		selfTurn(dir)
    	end
    return true
    end

    Ola pessoal, alguém conseguiria me orientar como arrumar o bug do gym na base do "HuatsonOT(DXPv3)"?

     

           Procurei bastante e não achei nenhuma solução para o bug "To battle agains't a gym leader you need pokemons.".

    alguem ja conseguiu arrumar isso?

     

    Já olhou a mana do player? Se for igual a 0 o npc entende q não tem pokemon

  2. E ai pessoal, faz muito tempo que não passo nesse fórum, como acompanho o mangá de Boruto decidi fazer uma sprite da nova forma do Naruto, quando eu terminar quem sabe eu posto, ainda falta alguns detalhes.

     

    Desculpem pela formatação do tópico, faz muito tempo que não mexo aqui kkk

     

    Tamanho 32x32:

    Spoiler

    534887838_NarutoBarion.png.aeb81e8c92ad1c23efcf6911ddda9f9c.png

    Tamanho Ampliado:

    Spoiler

    1357230930_NarutoBarion2.png.bed67865296f0de3c9a6476e97759530.png

    Pra quem não sabe a forma é essa:

    Spoiler

    Render.thumb.png.30e6ae7d4f0c4caef39e9d3ee610e17f.png

    Quem quiser adicionar no discord ta aí:

    JG#6768

  3. Em 13/08/2020 em 13:50, Marcos VMA disse:

    Boa tarde, vim fazer um pedido pra quem puder me ajudar, a colocar um sistema de gender tipico do otpokemon..

     

    Como é o sistema?

     

    Os pokemons summon e dos player que for do [SEXO MALE] ficar com o nome com a cor azul

    Os pokemons summon e dos player que for do [SEXO FEMALE] ficar com o nome com cor rosa

     

    Caso não puder ajudar, se puder falar onde fica esse tipo de sistema, irei atrás de bases com esse sistema e tentar pega-los.. Obrigado a todos ❤️

    Vá nas sources do Otclient,  abra o arquivo creature.cpp e procure por:

    	if (g_game.getFeature(Otc::GameBlueNpcNameColor) && isNpc() && m_healthPercent == 100 && !useGray)
    		fillColor = Color(0xff, 0x42, 0x00);

    De duas vezes enter e cole esse: 

    	if (m_skull == Otc::SkullRed && !useGray)
    		fillColor = Color(0x38, 0xB0, 0xDE);
    	if (m_skull == Otc::SkullWhite && !useGray)
    		fillColor = Color(0xFF, 0x6E, 0xC7);
    	if (m_skull == Otc::SkullYellow && !useGray)
    		fillColor = Color(0xD9, 0xD9, 0x19);

     

    Pronto só compilar, ai eu estou usando a Red para o azul, White pro rosa e a Yellow para o indefinido.

    Caso venham falar, esse código foi eu que fiz usando o de cima como base.

  4. Troca por esse ADDON:

     local addons = {
    			                  [13986] = {pokemon= "Shiny Vaporeon" , looktype = 1517, fly = 0, ride = 0, surf = 1518},
                    [13989] = {pokemon= "Jolteon" , looktype = 1520, fly = 0, ride = 0, surf = 1518},
                    [13988] = {pokemon= "Flareon" , looktype = 1519, fly = 0, ride = 0, surf = 1518},
                    [14008] = {pokemon= "Alakazam" , looktype = 1533, fly = 0, ride = 0, surf = 0},
                    [14017] = {pokemon= "Alakazam" , looktype = 1535, fly = 0, ride = 0, surf = 0},
                    [14009] = {pokemon= "Alakazam" , looktype = 1537, fly = 0, ride = 0, surf = 0},
                    [14010] = {pokemon= "Alakazam" , looktype = 1539, fly = 0, ride = 0, surf = 0},
                    [14020] = {pokemon= "Electabuzz" , looktype = 1529, fly = 0, ride = 0, surf = 0},
                    [14014] = {pokemon= "Electabuzz" , looktype = 1530, fly = 0, ride = 0, surf = 0},
                    [14013] = {pokemon= "Electabuzz" , looktype = 1531, fly = 0, ride = 0, surf = 0},
                    [14012] = {pokemon= "Magmar" , looktype = 1532, fly = 0, ride = 0, surf = 0},
                    [14023] = {pokemon= "Xatu" , looktype = 0, fly = 0, ride = 0, surf = 0},
                    [14011] = {pokemon= "Shiny Vileplume" , looktype = 1525, fly = 0, ride = 0, surf = 0},
                    [13985] = {pokemon= "Miltank" , looktype = 1517, fly = 0, ride = 0, surf = 0},
                    [14018] = {pokemon= "Jynx" , looktype = 1550, fly = 0, ride = 0, surf = 0},
                    [14019] = {pokemon= "Jynx" , looktype = 1551, fly = 0, ride = 0, surf = 0},
                    [14021] = {pokemon= "Tangela" , looktype = 1543, fly = 0, ride = 0, surf = 0},
                    [14026] = {pokemon= "Charizard" , looktype = 1544, fly = 1545, ride = 0, surf = 0},
                    [14045] = {pokemon= "Shiny Charizard" , looktype = 1583, fly = 1584, ride = 0, surf = 0},
                    [14032] = {pokemon= "Arcanine" , looktype = 1546, fly = 0, ride = 1547, surf = 0},
                    [13987] = {pokemon= "Scizor" , looktype = 1521, fly = 0, ride = 0, surf = 0},
                    [14015] = {pokemon= "Scizor" , looktype = 1523, fly = 0, ride = 0, surf = 0},
                    [14022] = {pokemon= "Marowak" , looktype = 1541, fly = 0, ride = 0, surf = 0},
                    [14016] = {pokemon= "Slowking" , looktype = 1548, fly = 0, ride = 0, surf = 0},
                    [14043] = {pokemon= "Blissey" , looktype = 1576, fly = 0, ride = 0, surf = 0},--
                    [14039] = {pokemon= "Blissey" , looktype = 1559, fly = 0, ride = 0, surf = 0},
                    [14044] = {pokemon= "Shiny Gengar" , looktype = 1588, fly = 1587, ride = 0, surf = 0},
    				-- [] = {pokemon = "" , looktype = , fly = 0, ride = 0, surf = 0}
    				
    				
    			   }
     
                   local function getOldAddon (looktype)
    	for index, value in pairs (addons) do
    		if value.looktype == looktype then
    			return index
    		end
    	end
    end
    
    function onUse(cid, item, fromPosition, itemEx, toPosition)
    	local numero = addons[item.itemid].looktype
    	local id = addons[item.itemid].id
    	local fly = addons[item.itemid].fly
    	local ride = addons[item.itemid].ride
    	local surf = addons[item.itemid].surf
    	local pb = getPlayerSlotItem(cid, 8).uid
    	local pk = addons[item.itemid].pokemon
    	
    	if not isPokeball(itemEx.itemid) then 
    		doPlayerSendCancel(cid, "Voce so poder usar este item em uma poke ball.")
    	return true
    	end
    	
    	if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then
    		doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.")
    	return true
    	end
    	
    	if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then
    		doPlayerSendCancel(cid, "Seu pokemon ja esta com este addon.")
    	return true
    	end     
    	
    	if #getCreatureSummons(cid) > 0 then
    		doPlayerSendCancel(cid, "Por favor, volte o seu pokemon para a poke ball.")
    	return true
    	end   
    	
    	if getItemAttribute(pb, "poke") ~= pk then
    		doPlayerSendCancel(cid, "Desculpe, voce nao pode adicionar este addon neste pokemon.")
    	return true
    	end
    	
    	if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then
    		doPlayerSendTextMessage(cid, 27, "Voce substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).." addon!")
    	else
    		doPlayerSendTextMessage(cid, 27, "Agora seu pokemon usara este "..getItemNameById (item.itemid).."!")
    	end
    	
    	doRemoveItem(item.uid, 1)
    	doSetItemAttribute(pb, "addon", numero) 
    	doSetItemAttribute(pb, "flyAddon", fly)
    	doSetItemAttribute(pb, "rideAddon", ride)
    	doSetItemAttribute(pb, "surfAddon", surf)
    	doSetItemAttribute(pb, "idItemAddon", id)
        setPlayerStorageValue(cid, 32000, 1)
    return true
    end

    Aquela parte do Configuration.lua vai ajudar, é só vc add as looktype desse arquivo do fly

  5. 1 minuto atrás, raulcdj disse:

    de boa qualquer ajuda ja vale muito 

     [Error - Action Interface] 
    [23/05/2020 18:25:18] In a timer event called from: 
    [23/05/2020 18:25:18] data/actions/scripts/order.lua:onUse
    [23/05/2020 18:25:18] Description: 
    [23/05/2020 18:25:18] data/lib/order.lua:298: attempt to index global 'flysAddon' (a nil value)
    [23/05/2020 18:25:19] stack traceback:
    [23/05/2020 18:25:19]     data/lib/order.lua:298: in function 'recheck'
    [23/05/2020 18:25:19]     data/lib/order.lua:374: in function <data/lib/order.lua:357>

    [23/05/2020 18:25:20] [Error - Action Interface] 
    [23/05/2020 18:25:20] data/actions/scripts/order.lua:onUse
    [23/05/2020 18:25:20] Description: 
    [23/05/2020 18:25:20] data/actions/scripts/order.lua:69: attempt to index global 'flysAddon' (a nil value)
    [23/05/2020 18:25:20] stack traceback:
    [23/05/2020 18:25:20]     data/actions/scripts/order.lua:69: in function <data/actions/scripts/order.lua:20>
     

     

    Vc adicionou isso no configuration.lua?

    flysAddon = {
    [looktype normal] = {looktype voando, velocidade}, -- Charizard Mech
    }
  6. No Actions troca essa parte:

        local pkjg = getCreatureSummons(cid)[1]
                   local pkza = getPlayerSlotItem(cid, 8).uid
                    local pkxd = getItemAttribute(pkjg,"addon")
                    if not pkxd then
                                    doSetItemAttribute(pkza,"addon",0) 
    
    
                     elseif pkxd > 0 then
                                    doSetCreatureOutfit(pkjg, {lookType = pkxd}, -1)

    por essa 

    	local pb = getPlayerSlotItem(cid, 8).uid	
    	local flyAdd = flysAddon[getItemAttribute(pb, "addon")]	
    	local rideAdd = ridesAddon[getItemAttribute (pb, "addon")]		
    		if flyAdd then		
    		if getItemAttribute(pb, "addon") > 1 then			
    		doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1)		
    	end	
    		elseif rideAdd then		
    		if getItemAttribute(pb, "addon") > 1 then			
    		doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1)		
    		end	
    	end

    No Lib troca esse:

            local addonfly= getPlayerSlotItem(cid, 8).uid
                    local addofly = getItemAttribute(addonfly,"addonfly")
                    if not addofly then
                                    doSetItemAttribute(addonfly,"addonfly",0) 
    
                    end
                    if addofly > 0 then
                                    doSetCreatureOutfit(cid, {lookType = addofly}, -1)
    
                    end

    Por esse:

    local pb = getPlayerSlotItem(cid, 8).uid				
    		if getItemAttribute(pb, "addon") < 1 then			
    		doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1)		
    		else			
    		doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1)		
    		end

    E ve se funciona, lembrando nao sou scripter to aprendendo ainda

    Agora, joaopera disse:

    No Actions troca essa parte:

    
        local pkjg = getCreatureSummons(cid)[1]
                   local pkza = getPlayerSlotItem(cid, 8).uid
                    local pkxd = getItemAttribute(pkjg,"addon")
                    if not pkxd then
                                    doSetItemAttribute(pkza,"addon",0) 
    
    
                     elseif pkxd > 0 then
                                    doSetCreatureOutfit(pkjg, {lookType = pkxd}, -1)

    por essa 

    
    	local pb = getPlayerSlotItem(cid, 8).uid	
    	local flyAdd = flysAddon[getItemAttribute(pb, "addon")]	
    	local rideAdd = ridesAddon[getItemAttribute (pb, "addon")]		
    		if flyAdd then		
    		if getItemAttribute(pb, "addon") > 1 then			
    		doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1)		
    	end	
    		elseif rideAdd then		
    		if getItemAttribute(pb, "addon") > 1 then			
    		doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1)		
    		end	
    	end

    No Lib troca esse:

    
            local addonfly= getPlayerSlotItem(cid, 8).uid
                    local addofly = getItemAttribute(addonfly,"addonfly")
                    if not addofly then
                                    doSetItemAttribute(addonfly,"addonfly",0) 
    
                    end
                    if addofly > 0 then
                                    doSetCreatureOutfit(cid, {lookType = addofly}, -1)
    
                    end

    Por esse:

    
    local pb = getPlayerSlotItem(cid, 8).uid				
    		if getItemAttribute(pb, "addon") < 1 then			
    		doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1)		
    		else			
    		doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1)		
    		end

    E ve se funciona, lembrando nao sou scripter to aprendendo ainda

     

    E na parte do configuration.lua antes do flys adiciona isso:

    flysAddon = {
    [looktype normal] = {looktype voando, velocidade}, -- Charizard Mech
    }

     

  7. 14 horas atrás, Eulleererrrr disse:

    opa foi mal ai man to meio pertubado k

    https://pastebin.com/78V3dHf3

    Mano como o rapaz disse ai, vc ja fez o tutorial certo? só muda essa linha 

    1.         static const int32_t maxClientViewportX = 8;
    2.         static const int32_t maxClientViewportY = 6
    Por essa 
    1.         static const int32_t maxClientViewportX = 14;
    2.         static const int32_t maxClientViewportY = 8;
    E Compila
  8. 3 horas atrás, manojl disse:

    Pode me falar como fez ???

    GYM para poketibia...

    Eu tinha pego uma base não lembro qual vou ver se acho, depois foi só mexer em algumas coisas

  9. Eai povo, faz um tempo q não posto nada, estava sem fazer nada na quarentena e decidir fazer um remake do milotic já q o antigo é feio pacas, a imagem ta borrada pois irei usar em meu projeto, Desculpem a formatação mais é apenas para mostrar mesmo.

    1850231966_SemTtulo-2.png.db4ee0201cd8f42f5d5be80cf1f98c8b.png

  • Quem Está Navegando   0 membros estão online

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