Ir para conteúdo

[Pedido] Como adicionar +10% de (skills/ml/loot) para jogadores Premium

Featured Replies

Postado

[Pedido] Como adicionar +10% de (skills/ml/loot) para jogadores Premium

(os que ficam no config lua)
exemplo: free tem 100x de skill rate,  os premium teriam 110x

 

alguem tem algum creaturescript semelhante? thanks

eu nao sei a função que coloca pra adicionar esses bonus, se possivel , pode colocar nesse script pra mim?

Citar

 

function onLogin(cid)
if isPremium(cid) then
doPlayerSendTextMessage(cid, 22, "[VIP ACCOUNT] \n \n [ATIVO] +25% de EXP \n [ATIVO] +10% Fast ATK  \n [ATIVO] Spells +4 e +5")
else

doPlayerSendTextMessage(cid, 22, "[FREE ACCOUNT] \n \n [INATIVO]      +25% de EXP \n     [INATIVO]      +10% Fast ATK  \n  [INATIVO]      Spells +4 e +5 \n        [INATIVO]    +10 Slots Autoloot \n [INATIVO] ")
end
return TRUE

end

 

 

Editado por poko360 (veja o histórico de edições)

  • Respostas 7
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
  • Este é um post popular.

Bônus skills/ml

 

Em creaturescripts/scripts crie um arquivo:

 

bonuspremium.lua

 

Spoiler

local skill_rates = {
[SKILL_FIST] = 10, -- % aumentado
[SKILL_CLUB] = 10,   
[SKILL_SWORD] = 10, 
[SKILL_AXE] = 10,    
[SKILL_DISTANCE] = 10, 
[SKILL_SHIELD] = 10, 
[SKILL__MAGLEVEL] = 10
}

function onLogin(cid)
local rateskill, rateML = getConfigValue("rateSkill"), getConfigValue("rateMagic")
if isPremium(cid) then
    for skill, percent in pairs(skill_rates) do
        local rate = skill == SKILL__MAGLEVEL and rateML or rateskill
        doPlayerSetRate(cid, skill, (1+(percent/100)) * rate)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Skill Rate] and [Loot Chance] bonus for premium players.")
end
return true
end

 

 

Em creaturescripts.xml adicione a tag: <event type="login" name="BonusPremium" event="script" value="bonuspremium.lua"/>

 

Bônus Loot

 

Em creaturescripts/scripts crie um arquivo:

 

bonusloot.lua

 

Spoiler

local BonusLoot = 10 -- % aumentado
local ignoredList = {1987} -- ids dos itens que não serão adicionados, pode deixar vazio {} caso queira que qualquer item seja adicionado

function onKill(cid, target, damage, flags)
if isPlayer(target) or isMonster(cid) or (not isPremium(cid)) then return true end
addEvent(addBonusLoot, 100, getCreaturePosition(target), getCreatureName(target), ignoredList) 
return true
end

function addBonusLoot(position, name, ignoredList)
    local check = false
    for i = 0, 255 do
        position.stackpos = i
        corpse = getTileThingByPos(position)
        if corpse.uid > 0 and isCorpse(corpse.uid) then
            check = true 
            break
        end
    end
    if check == true then
        local newRate = (1 + (BonusLoot/100)) * getConfigValue("rateLoot")
        local mainbp = doCreateItemEx(5949, 1)
        local monsterLoot = getMonsterLootList(name)
        for i, loot in pairs(monsterLoot) do
            if math.random(1, 100000) <= newRate * loot.chance then 
                if #ignoredList > 0 then
                    if (not isInArray(ignoredList, loot.id)) then
                        doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                    end
                else
                    doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                end
            end
        end
        doAddContainerItemEx(corpse.uid, mainbp)  
    end
end

 

 

Registre o evento no login.lua: registerCreatureEvent(cid, "BonusLoot")

 

Em creaturescripts.xml: <event type="kill" name="BonusLoot" event="script" value="bonusloot.lua"/>

Contato:

 

Postado
1 hora atrás, Jinx disse:

Como faria para colocar por storage ? tipo uma vip!

 

Spoiler

local skill_rates = {
[SKILL_FIST] = 10, -- % aumentado
[SKILL_CLUB] = 10,   
[SKILL_SWORD] = 10, 
[SKILL_AXE] = 10,    
[SKILL_DISTANCE] = 10, 
[SKILL_SHIELD] = 10, 
[SKILL__MAGLEVEL] = 10
}

local storage = 21457 -- coloque sua storage aqui

function onLogin(cid)
local rateskill, rateML = getConfigValue("rateSkill"), getConfigValue("rateMagic")
if getPlayerStorageValue(cid, storage) == 1  then
    for skill, percent in pairs(skill_rates) do
        local rate = skill == SKILL__MAGLEVEL and rateML or rateskill
        doPlayerSetRate(cid, skill, (1+(percent/100)) * rate)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Skill Rate] and [Loot Chance] bonus for premium players.")
end
return true
end

 

 

 

Spoiler

local BonusLoot = 10 -- % aumentado
local ignoredList = {1987} -- ids dos itens que não serão adicionados, pode deixar vazio {} caso queira que qualquer item seja adicionado

local storage = 21457 

function onKill(cid, target, damage, flags)
if isPlayer(target) or isMonster(cid) or (getPlayerStorageValue(cid, storage) == -1) then return true end
addEvent(addBonusLoot, 100, getCreaturePosition(target), getCreatureName(target), ignoredList) 
return true
end

function addBonusLoot(position, name, ignoredList)
    local check = false
    for i = 0, 255 do
        position.stackpos = i
        corpse = getTileThingByPos(position)
        if corpse.uid > 0 and isCorpse(corpse.uid) then
            check = true 
            break
        end
    end
    if check == true then
        local newRate = (1 + (BonusLoot/100)) * getConfigValue("rateLoot")
        local mainbp = doCreateItemEx(5949, 1)
        local monsterLoot = getMonsterLootList(name)
        for i, loot in pairs(monsterLoot) do
            if math.random(1, 100000) <= newRate * loot.chance then 
                if #ignoredList > 0 then
                    if (not isInArray(ignoredList, loot.id)) then
                        doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                    end
                else
                    doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                end
            end
        end
        doAddContainerItemEx(corpse.uid, mainbp)  
    end
end

 

 

Contato:

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo