• 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!

[TFS 0.4, 8.6] Using monster looktype as outfit

jeffaklumpen

Member
Joined
Jan 20, 2022
Messages
76
Solutions
2
Reaction score
15
GitHub
jeffaklumpen
I'm trying to use monster looktypes as player outfits but I can't get it working. I'm trying to use Barbarian Skullhunter and brutetamer.

In Outfits.xml I have:

XML:
    <outfit id="38" premium="no" default ="1">
        <list gender="0" lookType="264" name="Dungeon master">
        <stats maxHealth="250"/>
        <stats magLevel="2"/>
        <stats maxMana="250"/>
        <skills shielding="2"/>
        <attribute speed="20"/>
        <skills sword="2"/>
        <skills axe="2"/>
        <skills club="2"/>
        <skills dist="2"/>
        </list>
        <list gender="1" lookType="254" name="Dungeon master">
        <stats maxHealth="250"/>
        <stats magLevel="2"/>
        <stats maxMana="250"/>
        <skills shielding="2"/>
        <attribute speed="20"/>
        <skills sword="2"/>
        <skills axe="2"/>
        <skills club="2"/>
        <skills dist="2"/>
        </list>
    </outfit>

And in 000-constant.lua I have:

Lua:
maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 254, 268, 273, 278, 289, 325, 328, 335}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 264, 269, 270, 279, 288, 324, 329, 336}

I can choose the outfit in the list (image below) , but when i apply it doesn't change.

outfit.png
 
Any outfit id above 31 will not work, I don't know a solution for it but re-ordering your outfits.xml can help. There are a few unused GM outfits so you can add this one before them with an id lower than 31 and it should work.
 
Any outfit id above 31 will not work, I don't know a solution for it but re-ordering your outfits.xml can help. There are a few unused GM outfits so you can add this one before them with an id lower than 31 and it should work.
It worked, thank you so much! :)
Post automatically merged:

Hmm another issue happens now. I have 2 different custom outfit. One for King/queest and one for barbarians. It works fine if I unlock only one of the outfits. If I unlock the king outfit and THEN the barbarian one the barbarian outfit doesn't show up in the list. If I unlock the barbarian and THEN king outfit, the king replaces barbarian outfit.

This is the code in Outfits.xml:

XML:
    <outfit id="28" premium="no" default ="0">
        <list gender="0" lookType="331" name="Queen">
        <stats maxHealth="300"/>
        <stats magLevel="3"/>
        <stats maxMana="300"/>
        <skills shielding="3"/>
        <attribute speed="50"/>
        <skills sword="3"/>
        <skills axe="3"/>
        <skills club="3"/>
        <skills dist="3"/>
        </list>
        <list gender="1" lookType="332" name="King">
        <stats maxHealth="300"/>
        <stats magLevel="3"/>
        <stats maxMana="300"/>
        <skills shielding="3"/>
        <attribute speed="50"/>
        <skills sword="3"/>
        <skills axe="3"/>
        <skills club="3"/>
        <skills dist="3"/>
        </list>
    </outfit>
   
    <outfit id="29" premium="no" default ="0">
        <list gender="0" lookType="264" name="Dungeon master">
        <stats maxHealth="250"/>
        <stats magLevel="2"/>
        <stats maxMana="250"/>
        <skills shielding="2"/>
        <attribute speed="20"/>
        <skills sword="2"/>
        <skills axe="2"/>
        <skills club="2"/>
        <skills dist="2"/>
        </list>
        <list gender="1" lookType="254" name="Dungeon master">
        <stats maxHealth="250"/>
        <stats magLevel="2"/>
        <stats maxMana="250"/>
        <skills shielding="2"/>
        <attribute speed="20"/>
        <skills sword="2"/>
        <skills axe="2"/>
        <skills club="2"/>
        <skills dist="2"/>
        </list>
    </outfit>

Script for the item that unlocks king/queen outfit:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 10306 and (getPlayerStorageValue(cid, 8000) == EMPTY_STORAGE) then
        doPlayerAddOutfit(cid, 331, 3)
        doPlayerAddOutfit(cid, 332, 3)
        setPlayerStorageValue(cid, 8000, 1)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
          doPlayerSendTextMessage(cid,22,"You have unlocked the king/queen outfit!")
                doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid,"You've already unlocked this addon!.")
    end
end

Script that unlocks barbarian outfit:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 12701 and (getPlayerStorageValue(cid, 27002) == EMPTY_STORAGE) then
        doPlayerAddOutfit(cid, 264, 3)
        doPlayerAddOutfit(cid, 254, 3)
        setPlayerStorageValue(cid, 27002, 1)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
          doPlayerSendTextMessage(cid,22,"You have unlocked the dungeon master outfit!")
                doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid,"You've already unlocked this outfit!.")
    end
end
 
Last edited:
Any outfit id above 31 will not work, I don't know a solution for it but re-ordering your outfits.xml can help. There are a few unused GM outfits so you can add this one before them with an id lower than 31 and it should work.
Its cuz normal 8.6 client have limit and when you send too many outfits it will just crash. To handle that there is
C++:
#define OUTFITS_MAX_NUMBER 25
or whatever number there is (outfit.h) if there isnt any just check
C++:
void ProtocolGame::sendOutfitWindow()
in protocolgame.cpp and look for a loop with outfits, there is a limit.
Using otc you can just remove this limit and it should be ok
 
Back
Top