Ir para conteúdo
  • Cadastre-se

Pedido Exp Ring que aumenta 20% de exp


Posts Recomendados

Gostaria de um Exp Ring não Double Exp, quero que invéz de dobrar a exp do player apenas aumente 20% de exp a mais para ele exemplo:

 

uma morgaroth dá 10000 de xp então com + de 20% de exp bonus o player receberia 12000 de exp

 

o Exp Ring teria duração de 1 hora 

 

e se pudesse colocar um exhausted de 30 segundos para equipar e desequipar o ring.

exemplo o player acaba de colocar o ring e não tirar no mesmo instante pra retirar tem que esperar 30 segundos e ao retirar tentar coloca-lo novamente teria que esperar os 30 segundos.

Link para o post
Compartilhar em outros sites

movement.xml

PHP:
    <!-- Exp Ring -->
    <
movevent type="Equip" itemid="6301" slot="ring" event="function" value="onEquipItem"/>
    <
movevent type="Equip" itemid="6300" slot="ring" event="script" value="expring.lua"/>
    <
movevent type="DeEquip" itemid="6300" slot="ring" event="function" value="onDeEquipItem"/>
    <
movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="expring.lua"/>

expring.lua

local config = { 
rate = 1.2, -- 20%
 
function onDeEquip(cid, item, slot) 
if(item.itemid == 6301) then 
doPlayerSetExperienceRate(cid, 1.0) 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
doTransformItem(item.uid, 6300)
getConfigValue(key) --only worked with this line on my server, Delete it to test if it works without it
end 
return true
end 
 
function onEquip(cid, item, slot) 
 
if(item.itemid == 6300) then 
if getConfigValue("experienceStages") == "yes" then
doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.") 
doTransformItem(item.uid, 6301)
doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
else
doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2) 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.") 
doTransformItem(item.uid, 6301)
doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
end
return true
end
end 

 

items.xml


    <item id="6300" article="an" name="experience ring">
        <
attribute key="transformEquipTo" value="6301" />
        <
attribute key="weight" value="80" />
        <
attribute key="slotType" value="ring" />
        <
attribute key="stopduration" value="1" />
        <
attribute key="showduration" value="1" />
    </
item>
    <
item id="6301" article="an" name="experience ring">
        <
attribute key="weight" value="80" />
        <
attribute key="slotType" value="ring" />
        <
attribute key="decayTo" value="0" />
        <
attribute key="transformDeEquipTo" value="6300" />
        <
attribute key="duration" value="30000" />
        <
attribute key="showduration" value="1" />
    </
item>

 

Dúvidas me mande uma msg

Creditos: rangoo (otland)

Link para o post
Compartilhar em outros sites

mano ajuda aki tem algum erro no script que faz parar de contar o tempo de duração do ring, eu testei o ring sem o script e o tempo vai decendo normal + com o script o ring fica infinito fiz tudo certinho.

Editado por KennyXD (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 3 months later...

KennyXD, em 06 Ago 2014 - 12:49 AM, disse:

Gostaria de um Exp Ring não Double Exp, quero que invéz de dobrar a exp do player apenas aumente 20% de exp a mais para ele exemplo:

o Exp Ring teria duração de 1 hora

Vou usar os aneis de ID 7697 (anel inativo), 7698 (anel ativo) como exemplo.

expring.lua (data/movements/scripts):

local tab = {
    perc = 1.2, -- 1.2 = 20%
    etime = {30, 15551} -- {seconds, storage}
}

function onEquip(cid, item, slot)
    if exhaustion.check(cid, tab.etime[2]) then
        doPlayerSendCancel(cid, "You must wait "..tab.etime[1].." seconds before inserting/removing the ring again.")
        return false
    end
    
        if getConfigValue("experienceStages") == "yes" then
            doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*tab.perc)
        else
            doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*tab.perc)
        end
    
    doTransformItem(item.uid, item.itemid + 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your experience was increased by "..((tab.perc - 1)*100).."%.")
    doDecayItem(item.uid)
    return true
end
 
function onDeEquip(cid, item, slot)
    doPlayerSetExperienceRate(cid, 1.0)
    doTransformItem(item.uid, item.itemid - 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your experience is back to normal.")
    exhaustion.set(cid, tab.etime[2], tab.etime[1])
    return true
end

 

Tags - movements.xml (data/movements):

<movevent type="Equip" itemid="7697" slot="ring" event="script" value="expring.lua"/>
<movevent type="DeEquip" itemid="7698" slot="ring" event="script" value="expring.lua"/>

 

items.xml

Procure pelo ID do anel "inativo"/fora do slot (usei o ID 7697 como exemplo) e substitua o script do item pelos códigos seguintes:

<item id="7697" article="a" name="experience ring">
    <attribute key="weight" value="80" />
    <attribute key="slotType" value="ring" />
    <attribute key="transformEquipTo" value="7698" />
    <attribute key="stopduration" value="1" />
    <attribute key="showduration" value="1" />
</item>

 

Faça o mesmo com o ID do item "ativo"/ao ser posto no slot/equipado (usei o ID 7698 como exemplo):

<item id="7698" article="a" name="experience ring">
    <attribute key="weight" value="80" />
    <attribute key="description" value="This ring increases the experience." />
    <attribute key="slotType" value="ring" />
    <attribute key="decayTo" value="0" />
    <attribute key="transformDeEquipTo" value="7697" />
    <attribute key="duration" value="3600" />
    <attribute key="showduration" value="1" />
</item>

Já enquanto ao exhausted de Equip/DeEquip, coloquei uma checagem pra que ele não equipe diretamente, só após os 30 segundos. Já pra retirar o item, não vejo porquê haver um intervalo.

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

The corrupt fear us.

The honest support us.

The heroic join us.

Link para o post
Compartilhar em outros sites
  • 4 years later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo