madmagebr 0 Postado Março 27, 2012 Share Postado Março 27, 2012 Boa tarde pessoal. Andei procurando mas não achei em lugar nenhum ! Queria um globalevent que desse double exp por 24h por exemplo. Alguem sabe como fazer ?? (Deragon 9.1 TFS 4.0 ) VLW ^^ Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/ Compartilhar em outros sites More sharing options...
0 Makelin1 89 Postado Abril 2, 2012 Share Postado Abril 2, 2012 olha ver esse script e o tutorial do matheusmkalo aki \/ abaixo Item ou potion de double exp. By: MatheusMkalo Primeiramente vamos ver oque o script tem de diferente dos outros: Se voce sair com o efeito da exp potion o tempo da potion continuara passando, se voce logar antes que ele acabe voce ainda vai poder aproveitar umpouco da double exp. Voce pode escolher varias opçoes, como escolher se so premium accounts podem usar o item, quanta mana vai gasta, se vai remover quando usar e outros AGORA O SCRIPT SOH ESTA DISPONIVEL EM MOD: Vá na pasta mods e adicione um arquivo.xml com o nome de ExpPotion.xml e bote isso: <?xml version="1.0" encoding="UTF-8"?> <mod name="AdvancedExpPotionSystem" enabled="yes" author="MatheusMkalo" forum="XTibia.com"> <!-- Configs and Functions --> <config name="PotionExpConfigs"><![CDATA[ ------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE configs = { time = 1, ---- TIME IN MINUTES needpa = TRUE, needlvl = {TRUE, level = 50}, costmana = {TRUE, mana = 300}, addrate = 20, -- Exp que vai adicionar em % removeonuse = TRUE } function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end CreatureEventChecker = function(event, ...) -- Colex if isCreature(arg[1]) then event(unpack(arg)) end end creatureEvent = function(event, delay, ...) -- Colex addEvent(CreatureEventChecker, delay, event, unpack(arg)) end function getPlayerExtraExpRate(cid) -- By MatheusMkalo return (getPlayerRates(cid)[8]-1)*100 end ]]></config> <!-- exppotion.lua --> <action itemid="7440" event="script"><![CDATA[ domodlib('PotionExpConfigs') if getPlayerStorageValue(cid, 62164) >= 1 then return doPlayerSendCancel(cid, "You are already taking effect from this item.") end if configs.needpa and not isPremium(cid) then return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.") end if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.") end if configs.costmana[1] then if getCreatureMana(cid) < configs.costmana.mana then return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.") else doCreatureAddMana(cid, -configs.costmana.mana) end end if configs.removeonuse then doRemoveItem(item.uid, 1) end for i = configs.time*60, 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == configs.time*60 then creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) doPlayerSendTextMessage(cid, 22, "Agora voce ira receber mais exp por matar os mosntros.") setPlayerStorageValue(cid, 62164, os.time()) creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0) return TRUE ]]></action> <creaturescript type="login" name="ExpPotion" event="script"><![CDATA[ domodlib('PotionExpConfigs') local time = configs.time if os.time()-getPlayerStorageValue(cid, 62164) < time *60 then doPlayerSetExperienceRate(cid, (1+(configs.addrate/100))+(getPlayerExtraExpRate(cid)/100)) creatureEvent(doPlayerSetExperienceRate, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000, cid, 1+(getPlayerExtraExpRate(cid)/100-(configs.addrate/100))) creatureEvent(setPlayerStorageValue, (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) * 1000 , cid, 62164, 0) for i = (time*60-(os.time()-getPlayerStorageValue(cid, 62164))), 1, -1 do local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60)) if #a < 4 then a = string.sub(a,1,2) .. "0" .. string.sub(a, 3) end if i == (time*60-(os.time()-getPlayerStorageValue(cid, 62164))) then creatureEvent(doPlayerSendCancel, (time*60-(os.time()-getPlayerStorageValue(cid, 62164)))*1000, cid, "The effect of the exp potion end.") end creatureEvent(doPlayerSendCancel, ((time*60-(os.time()-getPlayerStorageValue(cid, 62164)))-i)*1000, cid, "The effect of the exp potion will end in "..a..".") end end return TRUE ]]></creaturescript> </mod> Tudo pronto, exp potion funcionando! O ID da potion usada no script foi o: 7440 (Mastermind Potion) Para usa-lo voce precisa tirar a linha no actions.xml da potion porque se nao vai bugar. Para trocar o id da potion eh so mudar essa linha: <action itemid="7440" event="script"><![CDATA[ Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230163 Compartilhar em outros sites More sharing options...
0 Beeki 284 Postado Abril 2, 2012 Share Postado Abril 2, 2012 @Smartbox ele não quer uma action e sim um globalevent que adicione double exp durante 24 Horas e depois retire. Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230165 Compartilhar em outros sites More sharing options...
0 Makelin1 89 Postado Abril 2, 2012 Share Postado Abril 2, 2012 ata nem sabia vlw ai pela dica + rep vlw ! Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230169 Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Abril 3, 2012 Share Postado Abril 3, 2012 (editado) global events/script script.lua function onThink(interval, lastExecution) local config = { days = {"Sunday", "Tuesday", "Friday"}, storage = 102590, hours = 24 } if isInArray(config.days, os.date("%A")) and getGlobalStorageValue(config.storage) - os.time() <= 0 then setGlobalStorageValue(config.storage, os.time()+config.hours*60*60) doBroadcastMessage("sua exp rate agr foi aumentada em 50% por "..config.hours.." horas! Aproveite.") end return true end globalevents.xml <globalevent name="ExpBonus" interval="60" event="script" value="script.lua"/> creaturescript/script script.lua function onKill(cid, target) if isPlayer(cid) and isMonster(target) then if getGlobalStorageValue(102590) - os.time() >= 1 then local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.5*exp)/2) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end else return TRUE end return TRUE end creaturescript.xml <event type="kill" name="ExpBonus" event="script" value="script.lua"/> creaturescript/script/login.lua adc registerCreatureEvent(cid, "ExpBonus") Ai você pode melhorar o script com textos de mensagens com tempo de quanto falta para acabar o bônus pq to sem saco pra faze, etc... Obs: já está configurado para dar 50% de extra exp para os jogadores, e sim, é com stages (: flw Editado Abril 3, 2012 por Vodkart Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230560 Compartilhar em outros sites More sharing options...
0 Beeki 284 Postado Abril 3, 2012 Share Postado Abril 3, 2012 @Vodkart Pode entrar no msn por favor ? preciso me relacionar com você, até Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230563 Compartilhar em outros sites More sharing options...
0 jhon992 371 Postado Abril 3, 2012 Share Postado Abril 3, 2012 (editado) Fiz um script tbm, vou postar pq começei a fazer antes do vod postar o dele. O meu script vai funcionar como um evento. O Gm ordena quando começa e acaba esse evento. Vai em data/creaturescripts/scripts, duplica um arquivo e nomeia para "login_exp" sem as aspas e nele cole: function onLogin(cid) local rate = 2 -- 100% local msg = "Aproveite o evento Doble Exp!" local stor = 13545 -- storage vip if (getGlobalStorageValue(stor) > 0) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, msg) end return TRUE end Em creaturescripts.xml cole a tag: <event type="login" name="Login_Exp" event="script" value="login_exp.lua"/> ------------------------------------------------------------------------------------------------------------ Vai em data/talkactions/scritps e duplica um arquivos, e nomeia para "eventexp" sem as aspas e nele cole: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if (param == "open") then if (getGlobalStorageValue(13545) > 0) then doPlayerSendTextMessage(cid, 22, "O evento ja esta aberto.") return true end setGlobalStorageValue(13545, 1) doBroadcastMessage("O evento Double Exp esta aberto, todos os player serão kikados após 10 segundos!") addEvent(RemoveAll, 10000, cid) elseif (param == "close") then if (getGlobalStorageValue(13545) <= 0) then doPlayerSendTextMessage(cid, 22, "O evento ja esta feixado.") return true end setGlobalStorageValue(13545, 0) doBroadcastMessage("O evento Double Exp esta feixado, todos os player serão kikados após 10 segundos!") addEvent(RemoveAll, 10000, cid) end return true end function RemoveAll(cid) local online = getOnlinePlayers() for i=1, #online do if (isPlayer(getPlayerByName(online[i]))) then doRemoveCreature(getPlayerByName(online[i])) end end end Em talkaction.xml cole a tag: <talkaction log="yes" access="5" words="eventxp" event="script" value="eventexp.lua"/> Para abrir o evento basta com o gm usar o comando "eventxp open" e para feixar "eventxp close". Editado Abril 3, 2012 por Jhon992 Rodrigo94 reagiu a isso 1 Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230653 Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Abril 3, 2012 Share Postado Abril 3, 2012 essa cid na função RemoveAll é totalmente desnecessária : function RemoveAll() for _, pid in pairs(getPlayersOnline()) do doRemoveCreature(pid, true) end end addEvent(RemoveAll, 10000) Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230686 Compartilhar em outros sites More sharing options...
0 jhon992 371 Postado Abril 3, 2012 Share Postado Abril 3, 2012 eu vi que n ia usar o cid dentro da função, mais passei sóh pra n deixar sem parametro nenhum. sahdua Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230702 Compartilhar em outros sites More sharing options...
0 madmagebr 0 Postado Abril 3, 2012 Autor Share Postado Abril 3, 2012 Muito Obrigado Jhon992 e Vodkart !!! Os dois scripts funcionaram perfeitamente !! Vodkart já reputado ^^ Jhon992, amanhã te dou rep+ tbm ok !!! Vlw pessoal ^^ Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1230720 Compartilhar em outros sites More sharing options...
0 HisashiitYamaguti 108 Postado Abril 4, 2012 Share Postado Abril 4, 2012 Tópico movido para a sessão de Dúvidas Respondidas. Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1231437 Compartilhar em outros sites More sharing options...
0 douglix 0 Postado Janeiro 3, 2013 Share Postado Janeiro 3, 2013 @Vodkart, como faço para colocar apenas 20% e nao o dobro ? Obrigado Link para o comentário https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/#findComment-1429718 Compartilhar em outros sites More sharing options...
Pergunta
madmagebr 0
Boa tarde pessoal.
Andei procurando mas não achei em lugar nenhum !
Queria um globalevent que desse double exp por 24h por exemplo.
Alguem sabe como fazer ??
(Deragon 9.1 TFS 4.0 )
VLW ^^
Link para o comentário
https://xtibia.com/forum/topic/183288-ajuda-pedido-globalevents-double-exp/Compartilhar em outros sites
11 respostass a esta questão
Posts Recomendados