D
Deleted member 49793
Guest
Anyone able to edit this to give bonuses based on number of addons obtained, not based on specific Addons?
Example: Currently you get lets say 300 max health points from warrior addon, 200 mana from wizard, 150 percent distance from hunter.
Instead: 50 health for first outfit you complete, 50 health + 10 shielding for having two complete outfits done, 50 health + 10 shielding + 3 to all weapon skills for three complete outfits (all addons)
Will give rep and <3's
Example: Currently you get lets say 300 max health points from warrior addon, 200 mana from wizard, 150 percent distance from hunter.
Instead: 50 health for first outfit you complete, 50 health + 10 shielding for having two complete outfits done, 50 health + 10 shielding + 3 to all weapon skills for three complete outfits (all addons)
Will give rep and <3's
Code:
local hp = Condition(CONDITION_ATTRIBUTES)
hp:setParameter(CONDITION_PARAM_TICKS, -1)
hp:setParameter(CONDITION_PARAM_SUBID, 100)
hp:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 300)
local distance = Condition(CONDITION_ATTRIBUTES)
distance:setParameter(CONDITION_PARAM_TICKS, -1)
distance:setParameter(CONDITION_PARAM_SUBID, 101)
distance:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150)
local sword = Condition(CONDITION_ATTRIBUTES)
sword:setParameter(CONDITION_PARAM_TICKS, -1)
sword:setParameter(CONDITION_PARAM_SUBID, 102)
sword:setParameter(CONDITION_PARAM_SKILL_SWORDPERCENT, 150)
oldOutfit = {}
outfitBonuses = {
[128] = {[1] = {condition = distance}, [2] = {condition = sword}, [3] = {condition = hp}},
[129] = {[3] = {condition = hp}},
[130] = {[3] = {condition = {distance, sword, hp}}}
}
function Creature:eek:nChangeOutfit(outfit)
if self:isPlayer() then
local getOutfit = self:getOutfit()
oldOutfit[self:getId()] = { --Colors (Head, Body, Legs, Feet) and lookTypeEx are unused, but I still keep them here because I'm stupid.
lookHead = getOutfit.lookHead;
lookBody = getOutfit.lookBody;
lookLegs = getOutfit.lookLegs;
lookFeet = getOutfit.lookFeet;
lookType = getOutfit.lookType;
lookTypeEx = getOutfit.lookTypeEx;
lookAddons = getOutfit.lookAddons;
lookMount = getOutfit.lookMount;
}
local old = oldOutfit[self:getId()]
local oldOutfit_t = outfitBonuses[old.lookType]
if oldOutfit_t and oldOutfit_t[old.lookAddons] then
local oldCondition = oldOutfit_t[old.lookAddons].condition
if type(oldCondition) == "table" then
for _, condition in pairs(oldCondition) do
self:removeCondition(condition:getType(), condition:getId(), condition:getSubId())
end
else
self:removeCondition(oldCondition:getType(), oldCondition:getId(), oldCondition:getSubId())
end
end
local currentOutfit = outfitBonuses[outfit.lookType]
if currentOutfit and currentOutfit[outfit.lookAddons] then
local newCondition = currentOutfit[outfit.lookAddons].condition
if type(newCondition) == "table" then
for _, condition in pairs(newCondition) do
self:addCondition(condition)
end
else
self:addCondition(newCondition)
end
end
end
return true
end
Last edited by a moderator: