• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Something with outfit/addon

Aliii96

New Member
Joined
Jul 14, 2014
Messages
39
Reaction score
0
Hello guys, I have a problem on my server, tfs 1.2 10.98.

Pictures will explain alot.
On mount, full hp as soon as I remove mount I get less hp, its something about addon bonuses and mounts I believe but I have no idea how to fix that.
Imgur
Here u can see the hp going down when I remove mount.
Imgur

Please help!

Thanks in advance.
 
Solution
try this out
Lua:
local function isMountOnly(outfit_one, outfit_two)
    if outfit_one.lookMount ~= outfit_two.lookMount then
        return outfit_one.lookType == outfit_two.lookType
    end
    return false
end

function Creature:onChangeOutfit(outfit)
    if self:isPlayer() then
        local getOutfit = self:getOutfit()
        -- if the only thing changed was mount id, don't re-apply the bonuses
        if isMountOnly(getOutfit, outfit) then
            return true
        end
        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 =...
in mounts.xml and outfits.xml

These are my mounts.xml and outfits.xml, I cant see anything wrong in them please look for yourself.

outfits.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<outfits>
    <!-- Female outfits -->
    <outfit type="0" looktype="136" name="Citizen" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="137" name="Hunter" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="138" name="Mage" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="139" name="Knight" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="140" name="Noblewoman" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="141" name="Summoner" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="142" name="Warrior" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="147" name="Barbarian" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="148" name="Druid" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="149" name="Wizard" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="150" name="Oriental" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="0" looktype="155" name="Pirate" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="156" name="Assassin" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="157" name="Beggar" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="158" name="Shaman" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="252" name="Norsewoman" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="269" name="Nightmare" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="270" name="Jester" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="279" name="Brotherhood" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="288" name="Demonhunter" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="324" name="Yalaharian" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="329" name="Wife" premium="no" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="336" name="Warmaster" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="366" name="Wayfarer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="431" name="Afflicted" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="433" name="Elementalist" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="464" name="Deepling" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="466" name="Insectoid" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="471" name="Entrepreneur" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="513" name="Crystal Warlord" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="514" name="Soil Guardian" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="542" name="Demon" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="575" name="Cave Explorer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="578" name="Dream Warden" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="618" name="Glooth Engineer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="620" name="Jersey" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="632" name="Champion" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="635" name="Conjurer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="636" name="Beastmaster" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="664" name="Chaos Acolyte" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="666" name="Death Herald" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="683" name="Ranger" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="694" name="Ceremonial Garb" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="696" name="Puppeteer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="698" name="Spirit Caller" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="724" name="Evoker" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="732" name="Seaweaver" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="745" name="Recruiter" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="749" name="Sea Dog" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="759" name="Royal Pumpkin" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="845" name="Rift Warrior" premium="yes" unlocked="no" enabled="yes" />
    <!--<outfit type="0" looktype="847" name="Outfit1" premium="yes" unlocked="no" enabled="yes" />-->
    <outfit type="0" looktype="852" name="Winter Warden" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="874" name="Philosopher" premium="yes" unlocked="no" enabled="yes" />
   
    <outfit type="0" looktype="884" name="Arena Champion" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="0" looktype="900" name="Lupine Warden" premium="yes" unlocked="no" enabled="yes" />
   
    <!-- Male outfits -->
    <outfit type="1" looktype="128" name="Citizen" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="129" name="Hunter" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="130" name="Mage" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="131" name="Knight" premium="no" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="132" name="Nobleman" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="133" name="Summoner" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="134" name="Warrior" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="143" name="Barbarian" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="144" name="Druid" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="145" name="Wizard" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="146" name="Oriental" premium="yes" unlocked="yes" enabled="yes" />
    <outfit type="1" looktype="151" name="Pirate" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="152" name="Assassin" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="153" name="Beggar" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="154" name="Shaman" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="251" name="Norseman" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="268" name="Nightmare" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="273" name="Jester" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="278" name="Brotherhood" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="289" name="Demonhunter" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="325" name="Yalaharian" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="328" name="Husband" premium="no" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="335" name="Warmaster" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="367" name="Wayfarer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="430" name="Afflicted" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="432" name="Elementalist" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="463" name="Deepling" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="465" name="Insectoid" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="472" name="Entrepreneur" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="512" name="Crystal Warlord" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="516" name="Soil Guardian" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="541" name="Demon" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="574" name="Cave Explorer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="577" name="Dream Warden" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="610" name="Glooth Engineer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="619" name="Jersey" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="633" name="Champion" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="634" name="Conjurer" premium="yes" unlocked="no" enabled="yes" />   
    <outfit type="1" looktype="637" name="Beastmaster" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="665" name="Chaos Acolyte" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="667" name="Death Herald" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="684" name="Ranger" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="695" name="Ceremonial Garb" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="697" name="Puppeteer" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="699" name="Spirit Caller" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="725" name="Evoker" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="733" name="Seaweaver" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="746" name="Recruiter" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="750" name="Sea Dog" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="760" name="Royal Pumpkin" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="846" name="Rift Warrior" premium="yes" unlocked="no" enabled="yes" />
    <!--<outfit type="1" looktype="848" name="Outfit1" premium="yes" unlocked="no" enabled="yes" />-->
    <outfit type="1" looktype="853" name="Winter Warden" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="873" name="Philosopher" premium="yes" unlocked="no" enabled="yes" />
   
    <outfit type="1" looktype="885" name="Arena Champion" premium="yes" unlocked="no" enabled="yes" />
    <outfit type="1" looktype="899" name="Lupine Warden" premium="yes" unlocked="no" enabled="yes" />
</outfits>



mounts.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mounts>
    <mount id="1" clientid="368" name="Widow Queen" speed="20" premium="no" />
    <mount id="2" clientid="369" name="Racing Bird" speed="20" premium="no" />
    <mount id="3" clientid="370" name="War Bear" speed="20" premium="no" />
    <mount id="4" clientid="371" name="Black Sheep" speed="20" premium="no" />
    <mount id="5" clientid="372" name="Midnight Panther" speed="20" premium="no" />
    <mount id="6" clientid="373" name="Draptor" speed="20" premium="no" />
    <mount id="7" clientid="374" name="Titanica" speed="20" premium="no" />
    <mount id="8" clientid="375" name="Tin Lizzard" speed="20" premium="no" />
    <mount id="9" clientid="376" name="Blazebringer" speed="20" premium="no" />
    <mount id="10" clientid="377" name="Rapid Boar" speed="20" premium="no" />
    <mount id="11" clientid="378" name="Stampor" speed="20" premium="no" />
    <mount id="12" clientid="379" name="Undead Cavebear" speed="20" premium="no" />
    <mount id="13" clientid="387" name="Donkey" speed="20" premium="no" />
    <mount id="14" clientid="388" name="Tiger Slug" speed="20" premium="no" />
    <mount id="15" clientid="389" name="Uniwheel" speed="20" premium="no" />
    <mount id="16" clientid="390" name="Crystal Wolf" speed="20" premium="no" />
    <mount id="17" clientid="392" name="War Horse" speed="20" premium="no" />
    <mount id="18" clientid="401" name="Kingly Deer" speed="20" premium="no" />
    <mount id="19" clientid="402" name="Tamed Panda" speed="20" premium="no" />
    <mount id="20" clientid="405" name="Dromedary" speed="20" premium="no" />
    <mount id="21" clientid="406" name="Scorpion King" speed="20" premium="no" />
    <mount id="22" clientid="421" name="Rented Horse" speed="20" premium="no" />
    <mount id="23" clientid="426" name="Armoured War Horse" speed="20" premium="yes" />
    <mount id="24" clientid="427" name="Shadow Draptor" speed="20" premium="yes" />
    <mount id="25" clientid="437" name="Rented Horse" speed="20" premium="no" />
    <mount id="26" clientid="438" name="Rented Horse" speed="20" premium="no" />
    <mount id="27" clientid="447" name="Lady Bug" speed="20" premium="no" />
    <mount id="28" clientid="450" name="Manta Ray" speed="20" premium="no" />
    <mount id="29" clientid="502" name="Ironblight" speed="20" premium="no" />
    <mount id="30" clientid="503" name="Magma Crawler" speed="20" premium="no" />
    <mount id="31" clientid="506" name="Dragonling" speed="20" premium="no" />
    <mount id="32" clientid="515" name="Gnarlhound" speed="20" premium="no" />
    <mount id="33" clientid="521" name="Crimson Ray" speed="20" premium="yes" />
    <mount id="34" clientid="522" name="Steelbeak" speed="20" premium="yes" />
    <mount id="35" clientid="526" name="Water Buffalo" speed="20" premium="no" />
    <mount id="36" clientid="546" name="Tombstinger" speed="20" premium="yes" /> 
    <mount id="37" clientid="547" name="Platesaurian" speed="20" premium="yes" />
    <mount id="38" clientid="548" name="Ursagrodon" speed="20" premium="no" />
    <mount id="39" clientid="559" name="Hellgrip" speed="20" premium="no" />
    <mount id="40" clientid="571" name="Noble Lion" speed="20" premium="no" />
    <mount id="41" clientid="572" name="Desert King" speed="20" premium="yes" />
    <mount id="42" clientid="580" name="Shock Head" speed="20" premium="no" />
    <mount id="43" clientid="606" name="Walker" speed="20" premium="no" />
    <mount id="44" clientid="621" name="Azudocus" speed="20" premium="yes" />
    <mount id="45" clientid="622" name="Carpacosaurus" speed="20" premium="yes" />
    <mount id="46" clientid="624" name="Death Crawler" speed="20" premium="yes" />
    <mount id="47" clientid="626" name="Flamesteed" speed="20" premium="yes" />
    <mount id="48" clientid="627" name="Jade Lion" speed="20" premium="yes" />
    <mount id="49" clientid="628" name="Jade Pincer" speed="20" premium="yes" />
    <mount id="50" clientid="629" name="Nethersteed" speed="20" premium="yes" />
    <mount id="51" clientid="630" name="Tempest" speed="20" premium="yes" />
    <mount id="52" clientid="631" name="Winter King" speed="20" premium="yes" />
    <mount id="53" clientid="644" name="Doombringer" speed="20" premium="yes" />
    <mount id="54" clientid="647" name="Woodland Prince" speed="20" premium="yes" />
    <mount id="55" clientid="648" name="Hailtorm Fury" speed="20" premium="yes" />
    <mount id="56" clientid="649" name="Siegebreaker" speed="20" premium="yes" />
    <mount id="57" clientid="650" name="Poisonbane" speed="20" premium="yes" />
    <mount id="58" clientid="651" name="Blackpelt" speed="20" premium="yes" />
    <mount id="59" clientid="669" name="Golden Dragonfly" speed="20" premium="yes" />
    <mount id="60" clientid="670" name="Steel Bee" speed="20" premium="yes" />
    <mount id="61" clientid="671" name="Copper Fly" speed="20" premium="yes" />
    <mount id="62" clientid="672" name="Tundra Rambler" speed="20" premium="yes" />
    <mount id="63" clientid="673" name="Highland Yak" speed="20" premium="yes" />
    <mount id="64" clientid="674" name="Glacier Vagabond" speed="20" premium="yes" />
    <mount id="65" clientid="688" name="Flying Divan" speed="20" premium="yes" />
    <mount id="66" clientid="689" name="Magic Carpet" speed="20" premium="yes" />
    <mount id="67" clientid="690" name="Floating Kashmir" speed="20" premium="yes" />
    <mount id="68" clientid="691" name="Ringtail Waccoon" speed="20" premium="yes" />
    <mount id="69" clientid="692" name="Night Waccoon" speed="20" premium="yes" />
    <mount id="70" clientid="693" name="Emerald Waccoon" speed="20" premium="yes" />
    <mount id="71" clientid="682" name="Glooth Glider" speed="20" premium="no" />
    <mount id="72" clientid="685" name="Shadow Hart" speed="20" premium="yes" />
    <mount id="73" clientid="686" name="Black Stag" speed="20" premium="yes" />
    <mount id="74" clientid="687" name="Emperor Deer" speed="20" premium="yes" />
    <mount id="75" clientid="726" name="Flitterkatzen" speed="20" premium="yes" />
    <mount id="76" clientid="727" name="Venompaw" speed="20" premium="yes" />
    <mount id="77" clientid="728" name="Batcat" speed="20" premium="yes" />
    <mount id="78" clientid="734" name="Sea Devil" speed="20" premium="yes" />
    <mount id="79" clientid="735" name="Coralripper" speed="20" premium="yes" />
    <mount id="80" clientid="736" name="Plumfish" speed="20" premium="yes" />
    <mount id="81" clientid="738" name="Gorongra" speed="20" premium="yes" />
    <mount id="82" clientid="739" name="Noctungra" speed="20" premium="yes" />
    <mount id="83" clientid="740" name="Silverneck" speed="20" premium="yes" />
   
    <mount id="84" clientid="761" name="Slagsnare" speed="20" premium="no" />
    <mount id="85" clientid="762" name="Nightstinger" speed="20" premium="no" />
    <mount id="86" clientid="763" name="Razorcreep" speed="20" premium="no" />
    <mount id="87" clientid="848" name="Rift Runner" speed="20" premium="no" />
    <mount id="88" clientid="849" name="Nightdweller" speed="20" premium="no" />
    <mount id="89" clientid="850" name="Frostflare" speed="20" premium="no" />
    <mount id="90" clientid="851" name="Cinderhoof" speed="20" premium="no" />
    <mount id="91" clientid="868" name="Mouldpincer" speed="20" premium="no" />
    <mount id="92" clientid="869" name="Bloodcurl" speed="20" premium="no" />
    <mount id="93" clientid="870" name="Leafscuttler" speed="20" premium="no" />
   
    <mount id="94" clientid="883" name="Sparkion" speed="20" premium="no" />
    <mount id="95" clientid="889" name="Neon Sparkid" speed="20" premium="no" />
    <mount id="96" clientid="890" name="Vortexion" speed="20" premium="no" />
   
    <mount id="97" clientid="886" name="Swamp Snapper" speed="20" premium="no" />
    <mount id="98" clientid="887" name="Mould Shell" speed="20" premium="no" />
    <mount id="99" clientid="888" name="Reed Lurker" speed="20" premium="no" />   
   
    <mount id="100" clientid="414" name="Thornfire Wolf" speed="60" premium="no" />
   
    <mount id="101" clientid="901" name="White Wolf" speed="20" premium="no" />
    <mount id="102" clientid="902" name="Black Wolf" speed="20" premium="no" />
    <mount id="103" clientid="903" name="Winter Wolf" speed="20" premium="no" />
</mounts>
 
That happens with every outfit/mount?

Yes every outfit and mount, if you use the best outfits like the ones that add like lets say 500hp then when you use mount with them and loose mount again you will go -500 hp and if you are level 8 500 hp is very much, almost full hp.
 
check events/scripts/creature.lua
look under Creature:eek:nChangeOutfit(outfit)


This is how it looks here, I cant see anything wrong? because it has the lookmount. Do you see the problem? am I missing something??
Code:
function Creature:onChangeOutfit(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
 
if you want to remove those bonuses in general, just replace all of that with the original code
Lua:
function Creature:onChangeOutfit(outfit)
    return true
end
 
if you want to remove those bonuses in general, just replace all of that with the original code
Lua:
function Creature:onChangeOutfit(outfit)
    return true
end

No mate, thats not what I want to do. The problem is when I have any outfit on I get bonus right? But when I put mount on with an outfit the bonus is still there but it goes back let me give an example, as in the picture.
lets say a player has 500 hp, with a bonus he gets 600 hp, heal up to 600hp but when put mount on the maxhp is still 600 but the hp goes down to 500, so the player has to heal up again and its the same all the time when puts on a mount and dismounts.
 
try this out
Lua:
local function isMountOnly(outfit_one, outfit_two)
    if outfit_one.lookMount ~= outfit_two.lookMount then
        return outfit_one.lookType == outfit_two.lookType
    end
    return false
end

function Creature:onChangeOutfit(outfit)
    if self:isPlayer() then
        local getOutfit = self:getOutfit()
        -- if the only thing changed was mount id, don't re-apply the bonuses
        if isMountOnly(getOutfit, outfit) then
            return true
        end
        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
 
Solution
try this out
Lua:
local function isMountOnly(outfit_one, outfit_two)
    if outfit_one.lookMount ~= outfit_two.lookMount then
        return outfit_one.lookType == outfit_two.lookType
    end
    return false
end

function Creature:onChangeOutfit(outfit)
    if self:isPlayer() then
        local getOutfit = self:getOutfit()
        -- if the only thing changed was mount id, don't re-apply the bonuses
        if isMountOnly(getOutfit, outfit) then
            return true
        end
        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

Static, replace that with what?? with the whole creature.lua or just some specific part??
 
try this out
Lua:
local function isMountOnly(outfit_one, outfit_two)
    if outfit_one.lookMount ~= outfit_two.lookMount then
        return outfit_one.lookType == outfit_two.lookType
    end
    return false
end

function Creature:onChangeOutfit(outfit)
    if self:isPlayer() then
        local getOutfit = self:getOutfit()
        -- if the only thing changed was mount id, don't re-apply the bonuses
        if isMountOnly(getOutfit, outfit) then
            return true
        end
        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


Thanks mate, it worked!! but now I am getting this message in the console, look picture: Imgur

Thanks again!
 
create a different thread, that's unrelated to this issue (you can also search here for that error, that's been an existing error for years and there's answers all around the forum)
 
Back
Top