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

Solved Ghost Mode

Syryniss

Member
Joined
Feb 13, 2014
Messages
206
Reaction score
20
Hi. I wanted to ask if anyone know where I can find function that make player ghost. I want to disable this on going effect that is visible to us, when we are in ghost mode. In talkaction there were only effects which trigger at turning it on and off, so it must be somewhere in sources.
 
may this help but i want to sleep so i won't give more edits now
but i can copy paste code :D
condition.cpp Line 1629
Code:
bool Creature::isInvisible() const
{
    return std::find_if(conditions.begin(), conditions.end(), [] (const Condition* condition) {
        return condition->getType() == CONDITION_INVISIBLE;
    }) != conditions.end();
}
 
@zbizu
Seems easy, but could you give me an example?
Outfit_t is a struct, so I tried
Code:
client->sendCreatureOutfit(creature, {1,0,0,0,0,0,0,0});
or
Code:
static Outfit_t outfit = {1,0,0,0,0,0,0,0};
client->sendCreatureOutfit(creature, outfit);
but it seems like I can't initialize anything in player.h:
kexMH5P.png

I guess now it's just mine noob C++ mistake...
 
Damn. I will think about it later, going sleep now. Thanks both of You for helping me out, I wouldn't do this without You :D
 
Okey, if anyone interested how I finally did what I want, here you go.
Code:
static Outfit_t outfit;
                    client->sendCreatureOutfit(creature, outfit);
This lines are setting mine outfit and something (yup, I STILL don't know what) is sending continious animation when the outfit = 0. The outfit = 0, because there is default constructor in enums.h which you can see here:
Code:
struct Outfit_t {
    Outfit_t() {
        lookHead   = 0;
        lookBody   = 0;
        lookLegs   = 0;
        lookFeet   = 0;
        lookType   = 0;
        lookTypeEx = 0;
        lookAddons = 0;
        lookMount  = 0;
    }

    uint16_t lookType;
    uint16_t lookTypeEx;
    uint8_t lookHead;
    uint8_t lookBody;
    uint8_t lookLegs;
    uint8_t lookFeet;
    uint8_t lookAddons;
    uint16_t lookMount;
};
So, I did a research and this default constructor is used only for ghost mode connected scripts, so I won't broke anything else if I change that. I made new blank outfit and changed lookType in this constructor to match it. Everything works so far.
 
I really need this for a system but i didn't understand where is these parts in the source
What i need is exaclty what @zbizu did by "accident"
Go invisible but keep the outfit! I don't need it to be the talkaction /ghost i can make it work with the utana vid one just need to get rid of the effect and keep the outif

If someone can point it for me where do i have to change it(Utana Vid or Ghost)
client->sendCreatureOutfit(creature, outfit);
try replacing to
client->sendCreatureOutfit(creature, creature->getCurrentOutfit());


Okey, if anyone interested how I finally did what I want, here you go.
Code:
static Outfit_t outfit;
                    client->sendCreatureOutfit(creature, outfit);
This lines are setting mine outfit and something (yup, I STILL don't know what) is sending continious animation when the outfit = 0. The outfit = 0, because there is default constructor in enums.h which you can see here:
Code:
struct Outfit_t {
    Outfit_t() {
        lookHead   = 0;
        lookBody   = 0;
        lookLegs   = 0;
        lookFeet   = 0;
        lookType   = 0;
        lookTypeEx = 0;
        lookAddons = 0;
        lookMount  = 0;
    }

    uint16_t lookType;
    uint16_t lookTypeEx;
    uint8_t lookHead;
    uint8_t lookBody;
    uint8_t lookLegs;
    uint8_t lookFeet;
    uint8_t lookAddons;
    uint16_t lookMount;
};
So, I did a research and this default constructor is used only for ghost mode connected scripts, so I won't broke anything else if I change that. I made new blank outfit and changed lookType in this constructor to match it. Everything works so far.
 
Sorry to relive the topic.

Does anyone know how I can do to make someone in ghost mode attacked?
Because ghost mode currently causes the player to take no damage.
 
Back
Top