Ir para conteúdo

GamerGoiano

Membro
  • Registro em

  • Última visita

Solutions

  1. GamerGoiano's post in [AJUDA] Potion Exp was marked as the answer   
    Opção 1:
    local function getPlayerData(guid) if not expPotions.playerData[guid] then expPotions.playerData[guid] = {} for itemId in pairs(potions) do expPotions.playerData[guid][itemId] = {rate = 0, duration = 0} end end return expPotions.playerData[guid] end function expPotions:onUse(cid, item, fromPosition, itemEx, toPosition) local itemId = item.itemid local potion = potions[itemId] if not potion then return false end if getPlayerLevel(cid) < potion.needLevel then doPlayerSendCancel(cid, ('Você precisa ser level %d+ para usar esta potion.'):format(potion.needLevel)) return true end local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) local expData = playerData[itemId] local now = os.time() if expData.duration > now then doCreatureSay(cid, 'Aguarde o bônus atual acabar para usar novamente.', TALKTYPE_ORANGE_1, false, cid) return true end expData.rate = expData.rate + potion.rate expData.duration = potion.duration + now doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Agora você tem +%d%% de experiência por %s.'):format( potion.rate * 100, string.diff(potion.duration, true) )) doRemoveItem(item.uid, 1) return true end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) getPlayerData(guid) return true end  
    Opção 2:
    local function getPlayerData(guid) if not expPotions.playerData[guid] then expPotions.playerData[guid] = {} for itemId in pairs(potions) do expPotions.playerData[guid][itemId] = {rate = 0, duration = 0} end end return expPotions.playerData[guid] end function expPotions:onUse(cid, item, fromPosition, itemEx, toPosition) local itemId = item.itemid local potion = potions[itemId] if not potion then return false end if getPlayerLevel(cid) < potion.needLevel then doPlayerSendCancel(cid, ('Você precisa ser level %d+ para usar esta potion.'):format(potion.needLevel)) return true end local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) local expData = playerData[itemId] local now = os.time() if expData.duration > now then doCreatureSay(cid, 'Aguarde o bônus atual acabar para usar novamente.', TALKTYPE_ORANGE_1, false, cid) return true end expData.rate = expData.rate + potion.rate expData.duration = potion.duration + now doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Agora você tem +%d%% de experiência por %s.'):format( potion.rate * 100, string.diff(potion.duration, true) )) doRemoveItem(item.uid, 1) -- Salvar as informações na storage Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_rate', expData.rate) Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_duration', expData.duration) return true end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) -- Restaurar as informações da storage for itemId in pairs(potions) do local rate = Game.getStorageValue(cid, 'expPotion_' .. itemId .. '_rate') local duration = Game.getStorageValue(cid, 'expPotion_' .. itemId .. '_duration') if rate ~= nil and duration ~= nil then playerData[itemId].rate = rate playerData[itemId].duration = duration end end return true end function expPotions:onDeath(cid, corpse, killer) -- Limpar as informações das poções ativas ao morrer local guid = getPlayerGUID(cid) local playerData = getPlayerData(guid) for itemId in pairs(potions) do playerData[itemId].rate = 0 playerData[itemId].duration = 0 Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_rate', nil) Game.setStorageValue(cid, 'expPotion_' .. itemId .. '_duration', nil) end return true end function expPotions:onSay(cid, words, param) local str = 'Experience Potion Combos:\n' local playerData = self.playerData[getPlayerGUID(cid)] if playerData then for itemId, expData in pairs(playerData) do str = str .. ('\n%s - %d%%'):format(getItemInfo(itemId).name, expData.rate * 100) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str) return true end function expPotions:getCombo(cid) local playerData = self.playerData[getPlayerGUID(cid)] local potionsCombo = 1 if playerData then for itemId, expData in pairs(playerData) do potionsCombo = potionsCombo + expData.rate end end return potionsCombo end function expPotions:onLook(cid, thing, position, lookDistance) if not isPlayer(thing) then return false end local combo = self:getCombo(thing) if combo > 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Combo de Experiência: +%d%%'):format((combo - 1) * 100)) end return false end function expPotions:onLogin(cid) local guid = getPlayerGUID(cid) self.playerData[guid] = {} for itemId in pairs(potions) do self.playerData[guid][itemId] = {rate = 0, duration = 0} end return true end function expPotions:onLogout(cid) local guid = getPlayerGUID(cid) self.playerData[guid] = nil return true end function expPotions:onDeath(cid, corpse, killer) local guid = getPlayerGUID(cid) self.playerData[guid] = nil return true end  
  2. GamerGoiano's post in (Resolvido)[Error] Tela Estendida TFS 0.4 was marked as the answer   
    Tem um arquivo que tem que editar, const.h
    Muda pra 300000 (trezentos mil) no lugar de 24500
    #define NETWORKMESSAGE_MAXSIZE 24590
  3. GamerGoiano's post in (Resolvido)Remoção de item por X tempo was marked as the answer   
    @XGaduX 
    <attribute key="duration" value="xxx" />
  4. GamerGoiano's post in (Resolvido)[OTC] Tela buga ao entrar em teleporte was marked as the answer   
    @zLockey9 Voce aumentou o tamanho da tela? se aumentou tamanho da tela tem que aumentar o network message max size no const.h da source 

    Também voce pode verificar no modulo game_things no things.lua, debaixo da function load abaixo de   local version = g_game.getClientVersion()
    Ve se tem:
    g_game.enableFeature(GameMagicEffectU16)
    g_game.enableFeature(GameDiagonalAnimatedText)

    Se não tiver os 2 enable feature, adiciona la e me fala se resolveu

Informação Importante

Confirmação de Termo