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

Prevent mount use in some outfits

Jvkisuckbr

New Member
Joined
May 11, 2019
Messages
8
Reaction score
3
Location
Brazil
I'm putting together an ot, and I wanted to use several custom outfits, but I only have the outfits sprites standing, I don't have the outfits sprites on the mounts (assembled), I was testing some things and I realized that the GOD outfit, she can't use any mount, if you click on the mount command nothing will happen, I was wondering if I can make any outfit I want to be unable to use mount, so it would only be used in the normal way. Thank you and sorry for my bad english.
 
I'm not a spriter, so i want to block the mount
Oh..
Then you can do like this:

player.cpp
below
C++:
    const Outfit* playerOutfit = Outfits::getInstance().getOutfitByLookType(getSex(), defaultOutfit.lookType);
        if (!playerOutfit) {
            return false;
        }
add
C++:
if ((playerOutfit->lookType == xxx) || (playerOutfit->lookType == xxx)) {
   sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
   return false;
}

where xxx is just add the looktype you want to block, one for female and one for male outfits.
Then just add more if you want more outfits not to be able to mount.
 
Oh..
Then you can do like this:

player.cpp
below
C++:
    const Outfit* playerOutfit = Outfits::getInstance().getOutfitByLookType(getSex(), defaultOutfit.lookType);
        if (!playerOutfit) {
            return false;
        }
add
C++:
if ((playerOutfit->lookType == xxx) || (playerOutfit->lookType == xxx)) {
   sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
   return false;
}

where xxx is just add the looktype you want to block, one for female and one for male outfits.
Then just add more if you want more outfits not to be able to mount.

I'm gonna test, thanks
Post automatically merged:

Oh..
Then you can do like this:

player.cpp
below
C++:
    const Outfit* playerOutfit = Outfits::getInstance().getOutfitByLookType(getSex(), defaultOutfit.lookType);
        if (!playerOutfit) {
            return false;
        }
add
C++:
if ((playerOutfit->lookType == xxx) || (playerOutfit->lookType == xxx)) {
   sendCancelMessage(RETURNVALUE_NOTPOSSIBLE);
   return false;
}

where xxx is just add the looktype you want to block, one for female and one for male outfits.
Then just add more if you want more outfits not to be able to mount.


it worked, thank you very much
 
Last edited:
the code above didn't worked for me. might be the changes recently made to the sources? tfs 1,3
found this at protocolgame.cpp so there i added my new outfits
Lua:
std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);

        //edit
        static const std::string playerOutfitName = "Old-Citizen";
        protocolOutfits.emplace_back(playerOutfitName, 362, 0);
        static const std::string player1OutfitName = "Old-Hunter";
        protocolOutfits.emplace_back(player1OutfitName, 363, 0);

but i've added so many outfits so it would be better to get it in ranges. Does anybody could show me a way to add the outfits in ranges to avod adding so many lines??
thanks in advance
 
Back
Top