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

Outfits by Quests

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I want to make certain outfits only accessible by quests and other outfits vocation related.

Server\data\XML\Outfits.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<outfits>
    <!-- Female outfits -->
    <outfit type="0" looktype="136" enabled="1" name="Citizen" premium="0"/>
    <outfit type="0" looktype="137" enabled="1" name="Archer" premium="0"/>
    <outfit type="0" looktype="138" enabled="1" name="Mage" premium="0"/>
    <outfit type="0" looktype="139" enabled="1" name="Knight" premium="0"/>
    <outfit type="0" looktype="140" enabled="1" name="Noblewoman" premium="1"/>
    <outfit type="0" looktype="141" enabled="1" name="Summoner" premium="1"/>
    <outfit type="0" looktype="142" enabled="1" name="Warrior" premium="1"/>
    <outfit type="0" looktype="147" enabled="1" name="Barbarian" premium="1"/>
    <outfit type="0" looktype="148" enabled="1" name="Druid" premium="1"/>
    <outfit type="0" looktype="149" enabled="1" name="Wizard" premium="1"/>
    <outfit type="0" looktype="150" enabled="1" name="Oriental" premium="1"/>
    <outfit type="0" looktype="155" enabled="1" name="Pirate" premium="1"/>
    <outfit type="0" looktype="156" enabled="1" name="Assassin" premium="1"/>
    <outfit type="0" looktype="157" enabled="1" name="Beggar" premium="1"/>
    <outfit type="0" looktype="158" enabled="1" name="Shaman" premium="1"/>
    <outfit type="0" looktype="252" enabled="1" name="Norsewoman" premium="1"/>
    <outfit type="0" looktype="269" enabled="1" name="Nightmare" premium="1"/>
    <outfit type="0" looktype="270" enabled="1" name="Jester" premium="1"/>
    <outfit type="0" looktype="279" enabled="1" name="Brotherhood" premium="1"/>
    <outfit type="0" looktype="288"    enabled="1" name="Demonhunter" premium="1"/>
    <outfit type="0" looktype="324" enabled="1" name="Yalaharian" premium="1"/>
    <outfit type="0" looktype="329" enabled="1" name="Wedding" premium="1"/>

    <!-- Male outfits -->
    <outfit type="1" looktype="128" enabled="1" name="Citizen" premium="0"/>
    <outfit type="1" looktype="129" enabled="1" name="Archer" premium="0"/>
    <outfit type="1" looktype="130" enabled="1" name="Mage" premium="0"/>
    <outfit type="1" looktype="131" enabled="1" name="Knight" premium="0"/>
    <outfit type="1" looktype="132" enabled="1" name="Nobleman" premium="1"/>
    <outfit type="1" looktype="133" enabled="1" name="Summoner" premium="1"/>
    <outfit type="1" looktype="134" enabled="1" name="Warrior" premium="1"/>
    <outfit type="1" looktype="143" enabled="1" name="Barbarian" premium="1"/>
    <outfit type="1" looktype="144" enabled="1" name="Druid" premium="1"/>
    <outfit type="1" looktype="145" enabled="1" name="Wizard" premium="1"/>
    <outfit type="1" looktype="146" enabled="1" name="Oriental" premium="1"/>
    <outfit type="1" looktype="151" enabled="1" name="Pirate" premium="1"/>
    <outfit type="1" looktype="152" enabled="1" name="Assassin" premium="1"/>
    <outfit type="1" looktype="153" enabled="1" name="Beggar" premium="1"/>
    <outfit type="1" looktype="154" enabled="1" name="Shaman" premium="1"/>
    <outfit type="1" looktype="251" enabled="1" name="Norseman" premium="1"/>
    <outfit type="1" looktype="268" enabled="1" name="Nightmare" premium="1"/>
    <outfit type="1" looktype="273" enabled="1" name="Jester" premium="1"/>
    <outfit type="1" looktype="278" enabled="1" name="Brotherhood" premium="1"/>
    <outfit type="1" looktype="289"    enabled="1" name="Demonhunter" premium="1"/>
    <outfit type="1" looktype="325" enabled="1" name="Yalaharian" premium="1"/>
    <outfit type="1" looktype="328" enabled="1" name="Wedding" premium="1"/>

    <!-- Archdemon -->
    <outfit type="2" looktype="12" enabled="1" name="Archdemon" premium="1"/>
    <!-- Elf outfits -->
    <outfit type="2" looktype="159" enabled="1" name="Elf" premium="1"/>
    <!-- Dwarf outfits -->
    <outfit type="2" looktype="160" enabled="1" name="Dwarf" premium="1"/>
    <!-- Frog outfits -->
    <outfit type="2" looktype="226" enabled="1" name="Frog" premium="1"/>
    <!-- Cult -->
    <outfit type="2" looktype="194" enabled="1" name="Cult" premium="1"/>
    <!-- Barbarians -->
    <outfit type="2" looktype="253" enabled="1" name="Headsplitter" premium="1"/>
    <outfit type="2" looktype="254" enabled="1" name="Skullhunter" premium="1"/>
    <outfit type="2" looktype="255" enabled="1" name="Bloodwalker" premium="1"/>
    <outfit type="2" looktype="264" enabled="1" name="Brutetamer" premium="1"/>
</outfits>

So what i would like to fix is make every outfit related to a certain player storage which I can handout at the creating of a character (related to the vocation) or after doing certain missions.

I've tried adding things like -> quest="77109" <- etc but it doesn't seem to work. Maybe some of you got any ideas of things that might work. If its c++ related, I fear it wont be in my powers yet but I'm willing to learn.

Thanks in advance.
 
I just got an idea which might help solving this problem if we ware to make several premium states and hand out the certain premium state for the mission in which the outfit will be accessible.

Ofc this can only work if the server recognizes more then 1 premium state.

Will try and test it soon.
 
enabled="1" to enabled="0"

and make quest like this
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 4767) < 1 then
doCreatureSay(cid, "You have gained your new outfit and may leave the reward room now!", TALKTYPE_ORANGE_1)
doPlayerAddOutfit(cid, 336, 1)
doPlayerAddOutfit(cid, 335, 1)
setPlayerStorageValue(cid, 4767, 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already gained your new outfit. You may leave the room now.")
end
return true
end
Script by http://otland.net/members/ninja.83269/
 
I tested it with putting enabled to '0' on my male citizen outfit and adding the doPlayerAddOutfit with the looktype of this outfit and it had no effect. It seems that once an outfit is disabled it's withdrawn from the game.
 
Last edited:
Hey there. It should be as easy as removing access from the players then simply adding the outfits as a reward.. either through a login script or through a quest of some sort.
You stated earlier it seems to remove the outfit completely if you set enable to 0?
I may have to do some research if that is the case, but at work atm.
 
Yup, it completely removes the outfit from the vocation and I'm not able to add it back with quests etc once I put enable at '0'. But thx that you are willing to look into this problem. It's one of the problems with major impact on my server because I love making quests and I'm planning to create full storylines for each kind of outfit.
 
Yup, it completely removes the outfit from the vocation and I'm not able to add it back with quests etc once I put enable at '0'. But thx that you are willing to look into this problem. It's one of the problems with major impact on my server because I love making quests and I'm planning to create full storylines for each kind of outfit.
If i remember correctly you have to do this within the sources, i did this once. But a looong time ago.
 
Guess I'll have to have to learn some source editing then :( Hoped I could fix my server without learning that part :D
 
Last edited:
Part of your request can be done by outfits.xml. Setting enabled value from 1 to 0 leaves the users unable to wear that outfit. When they find the quest that awards them through action scripts, when they'll be able to wear it.

Honestly haven't used 2.7 in ages. Correct me if I am wrong, but isn't there creature scripts for LUA? If so, you can easily set a little code up so if a player switches to an outfit, it will check for vocation and can return with either changes outfit back or proceeding.
 
The problem is that when I set the enabled value from 1 to 0 it just completly removes that outfit for the gender. Even if I reward the outfit lateron with a quest orso the outfit wont show for this gender because it is disabled in the outfits.xml file.

Once this is fixed the vocation thing shouldn't be that hard to fix with just a lua script, yes.
 
Well, the newbie solution is to enable the outfits (all of them) but don't let the player change to them (restrict them for any reason like "You need 'x' quest first or This outfit does not suit your vocation, etc)

The other solution is a source change at outfit.cpp, deleting the enable part so outfits are not added at all (or tweaking it somehow) and pulling something out of addAddons, it isn't looking as a nice easy solution though.
 
Well, the newbie solution is to enable the outfits (all of them) but don't let the player change to them (restrict them for any reason like "You need 'x' quest first or This outfit does not suit your vocation, etc)

The other solution is a source change at outfit.cpp, deleting the enable part so outfits are not added at all (or tweaking it somehow) and pulling something out of addAddons, it isn't looking as a nice easy solution though.


You mean like writing a script that when you close your change outfit window that checks if which outfit you have and if it's a restricted one you get a msg saying You don't own any cloths that look like this. secondly it changes your outfit looktype into the basic or the one you ware previously wearing.

Is that what you mean or am I going at this all wrong?
 
You mean like writing a script that when you close your change outfit window that checks if which outfit you have and if it's a restricted one you get a msg saying You don't own any cloths that look like this. secondly it changes your outfit looktype into the basic or the one you ware previously wearing.

Is that what you mean or am I going at this all wrong?

Exactly as you say, this can be done fairly easy with onOutfit and then returning false (to leave the same cloth) or changing to the previous (don't think anyone would like that lol). It would be annoying at first but it is a possibility without touching the sources. The outfits are still gonna be there, (players will see them) but won't be able to wear them unless they have a certain storage/level/vocation/whatever.
 
Oke I think I can live with this solution :)

The only thing I don't know how to script is where to add the script exactly and how to make it check at the moment you finish changing your outfit.
 
Well it is a creaturescript, onOutfit has the following prototype:
Code:
function onOutfit(cid, old, current)
After someone presses OK in the outfit window, your old and current outfit are no longer the same. In this case you are only worried about the current outfit, so you ought to check what happens with the current outfit and if it is permitted or not.
Think it like: current looktype is wizard well but you need storage X, does the player have it? yes -> return true (changes the outfit just fine) | no -> return false and give a cancel message.
 
Back
Top