Ir para conteúdo

gabrielzika

Campones
  • Total de itens

    92
  • Registro em

  • Última visita

  • Dias Ganhos

    6

Posts postados por gabrielzika

  1. @Marcos VMA

     

    Substitua por isso:

    Spoiler
    
    local janelaWindow = nil
    local pokeBarWindow = nil
    local pokeBarButton = nil
    local barList = {}
    local barVar = nil
    
    function init()
       connect(g_game, { onGameStart = online,
    				      onGameEnd = offline})
       janelaWindow = g_ui.displayUI('janela.otui')
       pokeBarWindow = g_ui.displayUI('selectPokemon',  modules.game_interface.getRightPanel())
      
       pokeBarWindow:move(250,50)
       pokeBarWindow:hide()
       janelaWindow:hide()
       g_keyboard.bindKeyDown('Ctrl+L', toggle)
      
       ProtocolGame.registerExtendedOpcode(160, receive)
       connect(g_game, 'onTextMessage', portrait)
    end
    
    
    function terminate()
      disconnect(g_game, { onGameStart = online,
                             onGameEnd = offline})
      pokeBarWindow:destroy()
      janelaWindow:destroy()
      g_keyboard.unbindKeyDown('CTRL+L')
      disconnect(g_game, 'onTextMessage', portrait)
    end
    
    function portrait(mode, text)
        if not g_game.isOnline() then return end
        if mode == MessageModes.Failure then 
    		local t = text:explode(",")
            table.remove(t, 1)
    		
            if string.find(text, 'p#') then
    		    for i = 6, 1, -1 do
    			    barVar = #t
    				pokeBarWindow:setHeight((66*#t))
    			    if i <= #t then
    			        local t2 = t[i]:explode("|")
    					pokeBarWindow:getChildById('slot'..i):setVisible(true)
    					pokeBarWindow:getChildById('slot'..i):setItemId(tonumber(t2[1]))
    					pokeBarWindow:getChildById('bar'..i).onClick = function() g_game.talk('!@pokebar@ '..tonumber(t2[3])) end
    					pokeBarWindow:getChildById('L'..i):setColor("red")
    					pokeBarWindow:getChildById('bar'..i):setImageSource("bar.png")
    					pokeBarWindow:getChildById('bar'..i):setVisible(true)
    					pokeBarWindow:getChildById('gl'..i):setVisible(true)
    					
    					pokeBarWindow:getChildById('N'..i):setVisible(true)
    					pokeBarWindow:getChildById('B'..i):setVisible(true)
    					pokeBarWindow:getChildById('EXP'..i):setVisible(true)
    					receive(i, t2[2], tonumber(t2[4]), tonumber(t2[5]), tonumber(t2[6]), tonumber(t2[7]), tonumber(t2[8]))
    					barList["list"..tonumber(t2[3])] = {num = i} 
    				else
    					pokeBarWindow:getChildById('slot'..i):setItemId(3283)
    					pokeBarWindow:getChildById('slot'..i):setVisible(false)
    					pokeBarWindow:getChildById('bar'..i):setVisible(false)
    					pokeBarWindow:getChildById('gl'..i):setVisible(false)
    					pokeBarWindow:getChildById('N'..i):setVisible(false)
    					pokeBarWindow:getChildById('B'..i):setVisible(false)
    					pokeBarWindow:getChildById('EXP'..i):setVisible(false)
    					pokeBarWindow:getChildById('bar'..i).onClick = function()  end
    					receive(i, "", 0, 0, 0, 0, 0)
    				end
    			end
    		elseif string.find(text, 'pGS') then
    			local t2 = t[1]:explode("|")
    			lifeBarAtual(tonumber(t2[2]), tonumber(t2[1]), t2[3])
    		elseif string.find(text, 'KGT') then
    			    local t2 = t[1]:explode("|")
    					levelBarAtual(t2[1], 0)
    		elseif string.find(text, 'bCGT') then
    			    local t2 = t[1]:explode("|")
    				imageBarAtual(t2[1])
    		elseif string.find(text, 'LHDN') then
    			    local t2 = t[1]:explode("|")
    				imageBarAtualS(t2[1])
    		end
        end
    end
    function imageBarAtualS(i)
    	pokeBarWindow:getChildById('bar'..i):setImageSource("bar.png")
    	pokeBarWindow:getChildById('L'..i):setColor("red")
    end
    function imageBarAtual(i)
    	pokeBarWindow:getChildById('bar'..i):setImageSource("bar1.png")
    	pokeBarWindow:getChildById('L'..i):setColor("green")
    end
    
    function levelBarAtual(i, level)
    	pokeBarWindow:getChildById('bar'..i):setImageSource("bar1.png")
    	pokeBarWindow:getChildById('L'..i):setColor("green")
    end
    
    function lifeBarAtual(i, hp, level)
        color = '#'
    	pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#ff0000")
    	if tonumber(hp) == 0 then
    		pokeBarWindow:getChildById('HP'..i):setText("Desmaiado")
    		pokeBarWindow:getChildById('HP'..i):setPercent(100);
    		pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#202020")
    		pokeBarWindow:getChildById('L'..i):setColor("gray")
    		pokeBarWindow:getChildById('bar'..i):setImageSource("bar2.png")
    	else
    		color = color..string.format("%.2x",255-math.ceil(hp)*2.5)..string.format("%.2x",math.ceil(hp)*2.5)..string.format("%.2x",0)
    				
    		pokeBarWindow:getChildById('HP'..i):setBackgroundColor(color)
    		if tonumber(hp) == -1 then
    			pokeBarWindow:getChildById('HP'..i):setPercent(100);
    			pokeBarWindow:getChildById('HP'..i):setText(string.format( "%3d %%", 100 ) ) ;
    		else
    			pokeBarWindow:getChildById('HP'..i):setPercent(hp);
    			pokeBarWindow:getChildById('HP'..i):setText(hp.."%");
    		end
    	end
    end
    
    function receive(i, name, sexo, hp, lvl, boost, expL)
        color = '#'
    	pokeBarWindow:getChildById('L'..i):setText(name)
    	if tonumber(boost) then
    		pokeBarWindow:getChildById('B'..i):setText("boost: +"..boost)
    	else
    		pokeBarWindow:getChildById('B'..i):setText("boost: +0")
    	end
    	pokeBarWindow:getChildById('N'..i):setText("Lv. "..lvl)
    	if tonumber(sexo) == 3 then
    		pokeBarWindow:getChildById('gl'..i):setImageSource('skull_white.png')
    	elseif tonumber(sexo) == 4 then
    	    pokeBarWindow:getChildById('gl'..i):setImageSource('skull_red.png')
    	elseif tonumber(sexo) == 7 then
    		pokeBarWindow:getChildById('gl'..i):setImageSource('skull_pink.png')
    	end
    	pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#ff0000")
    	if tonumber(hp) == 0 then
    		pokeBarWindow:getChildById('HP'..i):setText("Desmaiado")
    		pokeBarWindow:getChildById('HP'..i):setPercent(100);
    		pokeBarWindow:getChildById('HP'..i):setBackgroundColor("#202020")
    		pokeBarWindow:getChildById('L'..i):setColor("gray")
    		pokeBarWindow:getChildById('bar'..i):setImageSource("bar2.png")
    	else
    		color = color..string.format("%.2x",255-math.ceil(hp)*2.5)..string.format("%.2x",math.ceil(hp)*2.5)..string.format("%.2x",0)
    				
    		pokeBarWindow:getChildById('HP'..i):setBackgroundColor(color)
    		if tonumber(hp) == -1 then
    			pokeBarWindow:getChildById('HP'..i):setPercent(100);
    			pokeBarWindow:getChildById('HP'..i):setText(string.format( "%3d %%", 100 ) ) ;
    		else
    			pokeBarWindow:getChildById('HP'..i):setPercent(hp);
    			pokeBarWindow:getChildById('HP'..i):setText(hp.."%");
    		end
    	end
    	
    	if tonumber(expL) == 0 then
    		pokeBarWindow:getChildById('EXP'..i):setText("0%")
    		pokeBarWindow:getChildById('EXP'..i):setPercent(0);
    	else
    		if tonumber(expL) == -1 then
    			pokeBarWindow:getChildById('EXP'..i):setPercent(0);
    			pokeBarWindow:getChildById('EXP'..i):setText(string.format( "%3d %%", 0 ) ) ;
    		else
    			pokeBarWindow:getChildById('EXP'..i):setPercent(expL);
    			pokeBarWindow:getChildById('EXP'..i):setText(expL.."%");
    		end
    	end
       
    end
    
    function toggle()
      if pokeBarWindow:isVisible() then
        pokeBarWindow:hide()
      else
        pokeBarWindow:show()
      end
    end
    
    function online()
    	if g_game.isOnline() then
    		pokeBarWindow:show()
    		janelaWindow:show()
    	end
    end
    
    function offline()
    	pokeBarWindow:hide()
    	janelaWindow:hide()
    	pokeBarButton:setOn(false)
    end
    
    function onMoveBottomPanelHoverChange(widget)
      if widget:isHovered() and not g_mouse.isPressed(MouseLeftButton) then
        addEvent(function() g_effects.fadeIn(widget, 250) end)
      elseif not widget:isHovered() and not g_mouse.isPressed(MouseLeftButton) then
        addEvent(function() g_effects.fadeOut(widget, 250) end)
      end
    end
    
    function getMoveBottomPanel()
      return gameRootPanel:recursiveGetChildById('moveBottomPanel')
    end

     

     

  2. @Taiger malz ksks, tenta agr!

     

    	local pokesCheck = {"Alakazam", "Blastoise"}
    	if isInArray(pokesCheck, poke) or pokes[poke].wildLvl >= 80 or poke:find("Shiny") then
    		local text_color = poke:find("Shiny") and TALKTYPE_CHANNEL_O or TALKTYPE_CHANNEL_W
    		for _, oid in ipairs(getPlayersOnline()) do
    			doPlayerSendChannelMessage(oid, cid, "[Catch Channel] O jogador [".. getCreatureName(cid) .."] capturou um ["..poke.."]!.", text_color, 5)
    		end
    	end

     

  3. @Taiger

     

    	local pokesCheck = {"Alakazam", "Blastoise"}
    	if isInArray(pokesCheck, poke) or pokes[poke].wildLvl >= 80 or poke:find("Shiny") then
    		local text_color = poke:find("Shiny") and TALKTYPE_CHANNEL_O or TALKTYPE_CHANNEL_W
    		for _, oid in ipairs(getPlayersOnline()) do
    			doPlayerSendChannelMessage(oid, cid, "[Catch Channel] O jogador [".. getCreatureName(cid) .."] capturou um ["..poke.."]!.", text_color, 5)
    		end
    	end

     

  4. @Taiger veja se é isso:

     

    	if pokes[poke].wildLvl >= 80 or poke:find("Shiny") then
    		local text_color = poke:find("Shiny") and TALKTYPE_CHANNEL_O or TALKTYPE_CHANNEL_W
    		for _, oid in ipairs(getPlayersOnline()) do
    			doPlayerSendChannelMessage(oid, cid, "[Catch Channel] O jogador [".. getCreatureName(cid) .."] capturou um ["..poke.."]!.", text_color, 5)
    		end
    	end

     

  5. @Taiger Tenta assim:

     

    local function doReceiveTeamRocket(cid)
    	math.randomseed = os.time()
    	local q1 = math.random(1,10)
    	local q = math.random(q1, 20)
    	local sto = 17067
    	local Clans = {
    		{1, stones={fire, fire}}, -- volcanic
    		{2, stones={water, ice}}, -- seavell
    		{3, stones={rock, earth}}, -- orebound
    		{4, stones={heart, heart}}, -- wingeon
    		{5, stones={dark, venom}}, -- malefic
    		{6, stones={heart, punch}}, -- gardestrike
    		{7, stones={enigma, enigma}}, -- psycraft
    		{8, stones={grass, coccon}}, -- naturia
    		{9, stones={thunder, thunder}}, -- raibolt
    	}
    	local function addStonePerClan(cid, table, q)
    		for z=1, #table do
    			doPlayerAddItem(cid, table[z], q)
    		end
    	end
    	if Clans[getPlayerClanNum(cid)] then
    		local clan = getPlayerClanNum(cid)
    		addStonePerClan(cid, Clans[clan].stones, q)
    		playerAddExp(cid, q*1000)
    		setPlayerStorageValue(cid, sto, 1)
    	else
    		doPlayerAddItem(cid, 2160, q)
    		playerAddExp(cid, q*1000)
    		setPlayerStorageValue(cid, sto, 1)
    	end
    	doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    end
    
    function onDeath(cid, corpse, deathList)
        --if not isCreature(cid) then return true end
        if isSummon(cid) or not deathList or getCreatureNameWithProtect(cid) == "Evolution" then return true end --alterado v1.8
    	local pokedexp = getCreatureNameWithProtect(cid)
        -------------Edited Golden Arena-------------------------   --alterado v1.7 \/\/
        if getPlayerStorageValue(cid, 22546) == 1 then
    		setGlobalStorageValue(22548, getGlobalStorageValue(22548)-1)
    		if corpse.itemid ~= 0 then doItemSetAttribute(corpse.uid, "golden", 1) end  --alterado v1.8    
    	end   
        if getPlayerStorageValue(cid, 22546) == 1 and getGlobalStorageValue(22548) == 0 then
    		local wave = getGlobalStorageValue(22547)
    		for _, sid in ipairs(getPlayersOnline()) do
    			if isPlayer(sid) and getPlayerStorageValue(sid, 22545) == 1 then
    				if getGlobalStorageValue(22547) < #wavesGolden+1 then
    					doPlayerSendTextMessage(sid, 20, "Wave "..wave.." will begin in "..timeToWaves.."seconds!")   
    					doPlayerSendTextMessage(sid, 28, "Wave "..wave.." will begin in "..timeToWaves.."seconds!") 
    					addEvent(creaturesInGolden, 100, GoldenUpper, GoldenLower, false, true, true)
    					addEvent(doWave, timeToWaves*1000)
    				elseif getGlobalStorageValue(22547) == #wavesGolden+1 then
    					doPlayerSendTextMessage(sid, 20, "Você foi o último sobrevivente da Golden arena tome sua recompensa!")
    					doPlayerAddItem(sid, 2152, getPlayerStorageValue(sid, 22551)*2)    --premio
    					setPlayerStorageValue(sid, 22545, -1)
    					doTeleportThing(sid, getClosestFreeTile(sid, posBackGolden), false) 
    					setPlayerRecordWaves(sid)
    				end
    			end
    		end
    		if getGlobalStorageValue(22547) == #wavesGolden+1 then
    			endGoldenArena()
    		end
    	end 
        ---------------------------------------------------   /\/\
        local givenexp = getWildPokemonExp(cid)
        ---local killer = getItemAttribute(corpse.uid, "corpseowner")  
        local pkpos = getThingPos(cid)
        local topleft = {x=1879, y=1027, z=8}
        local bottomright = {x=1893, y=1073, z=8}
        if pokedexp == "Unown Legion" and ((pkpos.x >= topleft.x and pkpos.x <= bottomright.x) and (pkpos.y >= topleft.y and pkpos.y <= bottomright.y))then
            addEvent(function() doSummonCreature("Unown Legion", pkpos) end, 60000)
        end
    	if tonumber(givenexp) and givenexp >= 0 then
    		for a = 1, #deathList do
    			local pk = deathList[a]
    			---
    			local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)
    			if pokedexp == "Rocket Team" and isInParty(pk) then
    				break
    			end 
    			if isCreature(pk) then 
    				--local expTotal = math.floor(givenexp * getDamageMapPercent(pk, cid))
    				local expTotal = math.floor(givenexp)
    				local party = getPartyMembers(pk)
    				if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then
    					expTotal = math.floor(expTotal/#party)         --alterado v1.6.1
    					for i = 1, #party do  
    						if isInArray(list, party) then              
    							--playerAddExp(party, expTotal)
    							playerAddExp(getCreatureMaster(party), expTotal * ExperienceLib.rate(getPlayerLevel(getCreatureMaster(party))))
    						end
    					end
    				elseif not isInParty(pk) then
    					if pokedexp == "Rocket Team" then
    						doReceiveTeamRocket(getCreatureMaster(pk))
    					return true
    					end
    					--playerAddExp(pk, expTotal)
    					playerAddExp(getCreatureMaster(pk), math.floor((ExperienceLib.rate(getPlayerLevel(getCreatureMaster(pk))) * (givenexp))))
    				end       
    			end
    		end
    	end
        if isNpcSummon(cid) then
            local master = getCreatureMaster(cid)
            doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))
            doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)
            doRemoveCreature(cid)
        return false
        end
    	if corpse.itemid ~= 0 then   --alterado v1.8
    		doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))
    		doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))  
    	end
    return true
    end

     

  6. @Kuro o Shiniga Bom script, acho que faltou algo ali em action, isso:

    if getPlayerStorageValue(cid, 2307) < 1 and getPlayerStorageValue(cid, 2308) < 1 and getPlayerStorageValue(cid, 2309) < 1 then
    	return doPlayerSendCancel(cid, "Desculpe, você não possui nenhuma morte recente")
    end

    Ficando assim:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
    	if getTilePzInfo(getCreaturePosition(cid)) == false then
    		return doCreatureSay(cid, "Não pode usar fora do pz", TALKTYPE_ORANGE_1) and doSendMagicEffect(getPlayerPosition(cid), 2)
    	end
    
    	if getPlayerStorageValue(cid, 2307) < 1 and getPlayerStorageValue(cid, 2308) < 1 and getPlayerStorageValue(cid, 2309) < 1 then
    		return doPlayerSendCancel(cid, "Desculpe, você não possui nenhuma morte recente")
    	end
    	
    	local pose = {x=getPlayerStorageValue(cid, 2307), y=getPlayerStorageValue(cid, 2308), z=getPlayerStorageValue(cid, 2309)}
    
    	doSendMagicEffect(getThingPos(cid), 10)
    	doTeleportThing(cid, pose)
    	doSendMagicEffect(getThingPos(cid), 61)
    	doPlayerSendTextMessage(cid, 22, "Return to death")
    	setPlayerStorageValue(cid, 2307, -1)
    	setPlayerStorageValue(cid, 2308, -1)
    	setPlayerStorageValue(cid, 2309, -1)
    	doRemoveItem(item.uid, 1)
    return true
    end

     

  7. @diego2908 Veja:

     

    local addons = {
    	[21078] = {pokemon = "Togekiss" , looktype = 2909, fly = 1722, ride = 0, surf = 0},
    }
    
    local msgs = {
    	return_poke = {
    		[0] = "Por favor volte seu pokémon.",
    		[1] = "Por favor, vuelve su pokémon.",
    		[2] = "Please back your pokémon."
    	},
    	cant_use = {
    		[0] = "Desculpa, você não pode usar esse addon nesse pokémon.",
    		[1] = "Lo sentimos, no se puede utilizar este addon en esse pokémon.",
    		[2] = "Sorry, you can't use this addon on this pokémon."
    	}
    }
    
    function onUse(cid, item, fromPosition, itemEx, toPosition)
    
    	local pb = getPlayerSlotItem(cid, 8).uid
    	if pb <= 0 then
    		doPlayerSendCancel(cid, "Desculpe, você não tem um pokemon no slot")
    		return false
    	end
    
    	if #getCreatureSummons(cid) > 0 then
    		doPlayerSendCancel(cid, msgs.return_poke[getPlayerLanguage(cid)])
    		return false
    	end 
    	
    	local addonNum = addons[item.itemid].addon_num
    	local addon = addons[item.itemid].looktype
    	local fly = addons[item.itemid].fly
    	local ride = addons[item.itemid].ride
    	local surf = addons[item.itemid].surf
    	local addonlook = addons[item.itemid].nome
    
    	local pk = addons[item.itemid].pokemon
    	if getItemAttribute(pb, "poke") ~= pk then
    		doPlayerSendCancel(cid, msgs.cant_use[getPlayerLanguage(cid)])
    		return false
    	end
    	
    	if getItemAttribute(pb, "pokeballusada") == 0 then
    		doRemoveItem(item.uid, 1)
    		doSendMagicEffect(fromPosition, 173)
    		
    		updateAddonAttr(pb, "addon"    , addon    , addonNum)
    		updateAddonAttr(pb, "addonfly" , fly      , addonNum)
    		updateAddonAttr(pb, "addonride", ride     , addonNum)
    		updateAddonAttr(pb, "addonsurf", surf     , addonNum)
    		updateAddonAttr(pb, "addonlook", addonlook, addonNum)
    		
    		if not getItemAttribute(pb, "current_addon") then
    			doSetItemAttribute(pb, "current_addon", addonNum)
    		end
    		return true
    	end
    	return false
    	end

     

  8. @AdilsonHacker veja se funciona:

    local storage_guild = getGlobalStorageValue(123123)
    local rate = 1.3 -- 30%
    function onLogin(cid)
    if getPlayerGuildId(cid) == storage_guild then
    	doPlayerSetRate(cid, SKILL__LEVEL, rate)
    	doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Você tem "..((rate - 1)*100).."% de exp a mais!")
    else
    	doPlayerSetRate(cid, SKILL__LEVEL, 1.0)
    	-- Pode remover as storages dos players por aqui por exemplo: setPlayerStorageValue(cid, 154154, -1)
    	setPlayerStorageValue(cid, 154154, -1)
    end
    return true
    end

    créditos Yan Liima...

  9. @Walox neste caso, no script do Tony basta coloca isso depois do penultimo end:

     

    doSetItemActionId(item.uid, 0)

    Ficando assim: 

     

    function onUse(cid, item, fromPosition, itemEx, toPosition)
    	if getItemAttribute(item.uid, "corpseowner") ~= cid then
    		return doPlayerSendCancel(cid, "You're not the owner.")
    	end
    	local items = {}
    	for i = 0, getContainerSize(item.uid) do
    		local it = getContainerItem(item.uid, i)
    		if it.uid > 0 then
    			table.insert(items, {it.itemid, it.type})
    			doRemoveItem(it.uid)
    		end
    	end
    	if #items > 0 then
    		for k = 1, #items do
    			local playerItem = getPlayerItemById(cid, true, items[k][1])
    			if playerItem.uid > 0 then
    				if (playerItem.type + items[k][2]) > 100 then
    					doPlayerAddItem(cid, items[k][1], (playerItem.type + items[k][2]) - 100)
    					doTransformItem(playerItem.uid, items[k][1], 100)
    				else
    					doTransformItem(playerItem.uid, items[k][1], playerItem.type + items[k][2])
    				end
    			else
    				doPlayerAddItem(cid, items[k][1], items[k][2])
    			end
    		end
    		return true
    	end
    	doSetItemActionId(item.uid, 0)
    	return false
    end

    Depois que o player coletar uma vez o corpse deixa de ter a ActionID, assim impossibilitando de o player tentar trollar o sistema.

  • Quem Está Navegando   0 membros estão online

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