function onThink(interval, lastExecution)
local outfits = {-- 136 number of female outfit its work for female and male np , Storage for check outfit with canPlayerWearOutfit , if u set enable true will add the bouns example if u set maxHealth true will add 100 health to player when get outfit
[136] = {Storage = 90001 , bonus = {{enable = true, type = "maxHealth", values = 100}, {enable = true, type = "maxMana", values = 100},{enable = true, type = "speed", values = 200},{enable = true, type = "Distance", values = 200},{enable = true, type = "Sword", values = 200},{enable = true, type = "Axe", values = 10},{enable = true, type = "Club", values = 10},{enable = true, type = "Shield", values = 10},{enable = true, type = "Magic", values = 1}}},
[137] = {Storage = 90002 , bonus = {{enable = true, type = "maxHealth", values = 100}, {enable = true, type = "maxMana", values = 100},{enable = true, type = "speed", values = 200},{enable = true, type = "Distance", values = 200},{enable = true, type = "Sword", values = 200},{enable = true, type = "Axe", values = 10},{enable = true, type = "Club", values = 10},{enable = true, type = "Shield", values = 10},{enable = true, type = "Magic", values = 1}}}
}
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
for k,v in pairs(outfits) do
if canPlayerWearOutfit(cid,k, 3) and getPlayerStorageValue(cid,v.Storage) <= 0 then
for i = 1, table.maxn(v.bonus) do
if(v.bonus[i].enable) then
if isInArray({"maxHealth", "Health", 1}, v.bonus[i].type) then
setCreatureMaxHealth(cid,(getCreatureMaxHealth(cid) + v.bonus[i].values))
elseif isInArray({"maxMana","Mana", 2}, v.bonus[i].type) then
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+ v.bonus[i].values))
elseif isInArray({"speed", 3}, v.bonus[i].type) then
doChangeSpeed(cid,getCreatureSpeed(cid) + v.bonus[i].values )
elseif isInArray({"Distance", 4}, v.bonus[i].type) then
doPlayerAddSkillTry(cid,SKILL_DISTANCE, getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, getPlayerSkillLevel(cid, SKILL_DISTANCE) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_DISTANCE), true)
elseif isInArray({"Sword", 5}, v.bonus[i].type) then
doPlayerAddSkillTry(cid,SKILL_SWORD, getPlayerRequiredSkillTries(cid, SKILL_SWORD, getPlayerSkillLevel(cid, SKILL_SWORD) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_SWORD), true)
elseif isInArray({"Axe", 7}, v.bonus[i].type) then
doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_AXE, getPlayerSkillLevel(cid, SKILL_AXE) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_AXE), true)
elseif isInArray({"Club", 8}, v.bonus[i].type) then
doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_CLUB, getPlayerSkillLevel(cid, SKILL_CLUB) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_CLUB), true)
elseif isInArray({"Shield", 9}, v.bonus[i].type) then
doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_SHIELD, getPlayerSkillLevel(cid, SKILL_SHIELD) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_SHIELD), true)
elseif isInArray({"Magic", 10}, v.bonus[i].type) then
doPlayerAddMagLevel(cid,v.bonus[i].values)
else
print("Bad bonus type: " .. v.bonus[i].type .. ", bonus could not be loaded.")
end
end
end
setPlayerStorageValue(cid, v.Storage,1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have new bonus.")
end
end
end
return true
end