Bom, hoje venho trazendo 3 scripts, claro, sei que os 2 primeiros se não me engano já existem aqui no xtibia. Porém o Outifit Slot não está aqui ainda e os outros 2 veêm com uma inovação.
Vamos ao que interessa:
⁞⁞ • Outifit Party • ⁞⁞
Como funciona, é bem simples, ele troca o outifit dos membros da party:
local config =
{
sexChangeable = false,
copyOutfitAndAddonsEverytime = false
}
function onSay(cid, words, param, channel)
party = getPlayerParty(cid)
if (config.sexChangeable == true) then
sex = getPlayerSex(cid)
end
if (party) then
if (party == cid) then
outfit = getCreatureOutfit(cid)
members = getPartyMembers(party)
if (#members >= 1) then
tmp = outfit
for i=1,#members do
if (config.sexChangeable == true) then
if (sex ~= getPlayerSex(members)) then
doPlayerSetSex(members, sex)
end
end
if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members, tmp.lookType, tmp.lookAddons) ~= true) then
local tmpOutfit = getCreatureOutfit(members)
tmp.lookType = tmpOutfit.lookType
tmp.lookAddons = tmpOutfit.lookAddons
end
doCreatureChangeOutfit(members, tmp)
doSendMagicEffect(getCreaturePosition(members), 66)
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Este comando somente o lider da Party pode usar!")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não está em nenhuma Party!")
end
return true
end
<talkaction words="!party" event="script" value="YourScriptName.lua"/>
____________________________
⁞⁞ • Outifit Guild • ⁞⁞
Também funciona da mesma maneira do script acima, bããs, troca o outifit de todos os membros da guild (apenas leaders podem usar)
local config = {
exhaustionInSeconds = 30,
storage = 34534
}
function onSay(cid, words, param)
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendCancel(cid, "You can change outfit only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
return TRUE
end
local playerGuild = getPlayerGuildId(cid)
if(playerGuild == FALSE) then
doPlayerSendCancel(cid, "Desculpe, voce nao tem guild.")
return TRUE
end
local playerGuildLevel = getPlayerGuildLevel(cid)
if(playerGuildLevel < GUILDLEVEL_LEADER) then
doPlayerSendCancel(cid, "Voce precisa ser lider da guild pra usar esse comando.")
return TRUE
end
local players = getPlayersOnline()
local outfit = getCreatureOutfit(cid)
local message = "Seu outifit foi trocado. O mesmo se deu para todos os membros da sua guild. (Trocado pelo jogador: " .. getCreatureName(cid) .. ")"
local members = 0
local tmp = {}
for i, tid in ipairs(players) do
if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then
tmp = outfit
if(canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons) ~= TRUE) then
local tidOutfit = getCreatureOutfit(tid)
tmp.lookType = tidOutfit.lookType
tmp.lookAddons = tidOutfit.lookAddons
end
doSendMagicEffect(getCreaturePosition(tid), 66)
doCreatureChangeOutfit(tid, tmp)
doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
members = members + 1
end
end
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doPlayerSendCancel(cid, "Voce trocou o outifit dos membros da guild. (Total: " .. members .. " trocados.)")
return TRUE
end
<talkaction words="!guildoutifit" event="script" value="YourScriptName.lua"/>
⁞⁞ • Outifit Slot • ⁞⁞
Esta é a inovação perante aos 3 scripts. Bom o outifit slot funciona dessa maneira:
O Player fala '!outifit 1, save' daí o outifit que ele estiver usando, salvará e daí ele pode salvar até 5 outifits. (!outifit 2, save)
Para vestir a roupa após salvo, basta dizer !outifit 1.
local foncig = {
outfitSlots = {
[1] = {storage = "7985", prem = false},
[2] = {storage = "7986", prem = false},
[3] = {storage = "7987", prem = true},
[4] = {storage = "7988", prem = true},
[5] = {storage = "7989", prem = true}
},
acceptedOutfits = {136, 128, 137, 129, 138, 130, 139, 131, 140, 132, 141, 133, 142, 134, 147, 143, 148, 144, 149, 145, 150, 146, 155, 151, 156, 152, 157, 153, 158, 154, 252, 251, 269, 268, 270, 273, 279, 278, 288, 289, 324, 325, 336, 335, 366, 367, 329, 328}
}
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando inválido, para salvar ou escolher seu outifit diga: ex.: !outfit 1 ou !outfit 1, save)")
return true
end
local t = string.explode(param, ",")
t[1] = tonumber(t[1])
if(foncig.outfitSlots[t[1]]) then
if(not isPremium(cid) and foncig.outfitSlots[t[1]].prem == true) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este outifit é para jogadores PACC.")
end
if(t[2] and t[2] == "save") then
local currentOutfit = getCreatureOutfit(cid)
if(isInArray(foncig.acceptedOutfits, currentOutfit.lookType)) then
doCreatureSetStorage(cid, foncig.outfitSlots[t[1]].storage, "_".. currentOutfit.lookType ..",_".. currentOutfit.lookHead ..",_".. currentOutfit.lookBody ..",_".. currentOutfit.lookLegs ..",_".. currentOutfit.lookFeet ..",_".. currentOutfit.lookAddons)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Outifit salvo no slot ".. t[1] ..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua roupa atual não pode ser salva.")
end
return true
end
local o = tostring(getCreatureStorage(cid, foncig.outfitSlots[t[1]].storage)):gsub('_', ''):explode(',')
if(o[6]) then
doCreatureChangeOutfit(cid, {lookType = o[1], lookHead = o[2], lookBody = o[3], lookLegs = o[4], lookFeet = o[5], lookAddons = o[6]})
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu outifit foi trocado pelo outifit de slot numero ".. t[1] ..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem nenhuma roupa guardada no slot ".. t[1] ..".")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Esse slot não existe.")
end
return true
end
<talkaction words="!outifit" event="script" value="YourScriptName.lua"/>