FI

[Mod] Guildoutfit

Por Fir3element, 05 de set. de 2010 em Actions e Talkactions

5
1.7k
05 de setembro de 2010 às 15:30

Removido.

Editado Fevereiro 10 por fireelement

VodkartV
05 de setembro de 2010 às 16:00

sinceramente eu prefiro por talkactions.fica bem melhor que pelo MOD.

 

mais obrigado por trazer o conteudo ao xtibia

 

abraços

05 de setembro de 2010 às 16:10

O slawkens só faz coisa legal em MOD =D

 

Em talkaction seria isso?

 

local config = {
                       exhaustion = 30, -- in seconds
                       storage = 3002 -- storage value used to save exhaustion
               }

               function onSay(cid, words, param, channel)
                       if(exhaustion.check(cid, config.storage)) then
                               doPlayerSendCancel(cid, "You can change outfit only 1 time per " .. config.exhaustion .. " seconds.")
                               return true
                       end

                       local playerGuild = getPlayerGuildId(cid)
                       if(not playerGuild or playerGuild == 0) then
                               doPlayerSendCancel(cid, "Sorry, you're not in a guild.")
                               return true
                       end

                       if(getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then
                               doPlayerSendCancel(cid, "You have to be Leader of your guild to change outfits!")
                               return true
                       end

                       local outfit, members = getCreatureOutfit(cid), 0
                       local message = "*Guild* Your outfit has been changed by leader. (" .. getCreatureName(cid) .. ")"
                       for _, tid in ipairs(getPlayersOnline()) do
                               if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then
                                       local newOutfit = outfit
                                       if(not canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons)) then
                                               local tmpOutfit = getCreatureOutfit(tid)
                                               newOutfit.lookAddons = 0--tmpOutfit.lookAddons
                                               if(not canPlayerWearOutfit(tid, outfit.lookType, 0)) then
                                                       newOutfit.lookType = tmpOutfit.lookType
                                               end
                                       end

                                       doSendMagicEffect(getCreaturePosition(tid), 66)
                                       doCreatureChangeOutfit(tid, newOutfit)
                                       doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
                                       members = members + 1
                               end
                       end

                       exhaustion.set(cid, config.storage, config.exhaustion)
                       doPlayerSendCancel(cid, "Guild members outfit has been changed. (Total: " .. members .. ")")
                       return true
               end

8 meses depois...
joao33J
17 de maio de 2011 às 20:49

Vlw estou testando :D Obrigado por trazer ao :XTibia_smile:

GateuG
19 de maio de 2011 às 04:23

parabens a talkactions funcionou aki perfeitamente