Postado Outubro 26, 2019 5 anos Autor @Lyu Funcionou perfeitamente, só tive que trocar: local guild = player:getGuild() Por local guild = self:getGuild() local guild = self:getGuild() if guild and guild:getId() == guildExperienceBonus then exp = exp * 1.2 -- 20% bonus end Obrigado.
Postado Outubro 26, 2019 5 anos Em 26/10/2019 em 11:11, Avante disse: @Lyu Funcionou perfeitamente, só tive que trocar: local guild = player:getGuild() Por local guild = self:getGuild() Boaaa, na pressa esqueci que o trecho seria inserido dentro de um método da classe Player. Que bom que funcionou, é nois!
Postado Outubro 26, 2019 5 anos Em 25/10/2019 em 21:45, Lyu disse: Tente isso, fiz aqui rapidinho mas não testei (acredito que funcione como você espera) data/movements/scripts/guildexp.lua if not guildExperienceBonus then guildExperienceBonus = 0 -- default value; no guild end function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end local guild = player:getGuild() if guild then guildExperienceBonus = guild:getId() player:sendTextMessage(MESSAGE_INFO_DESCR, 'Sua guild agora possui o bônus em experiência.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end return true end data/movements/movements.xml <movevent event="StepIn" actionid="33462" script="guildexp.lua" /> data/events/scripts/player.lua --[[ Atenção, procure a função Player:onGainExperience(source, exp, rawExp) Adicione o código abaixo antes do último return exp ]] local guild = self:getGuild() if guild and guild:getId() == guildExperienceBonus then exp = exp * 1.2 -- 20% bonus end Aproveitando o tópico, consegue adaptar para OTX 8.60?
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.