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

Stealth, /ghost problem spell

Swiftxd

Member
Joined
Apr 5, 2014
Messages
85
Reaction score
5
Hey, i've doing a stealth spell then i take a few notes:
1. the /ghost spell only work if your group is higher than others.
2. if youre in same group that other stealth, you both can see eachother.

so, i made the spell to change the group to 2 and use the talkaction. But its a rogue spell, so if have 5 stealth rogue, the 5 will be on group 2 and will see each other.
How i can fix this ?
 
In the source there should be a spot where it checks if you can see a creature. In the event of both creatures being a player it then checks each players group to determine if the players group is the same or higher. You would want to change it so it is only higher.
 
in player.cp
change
Code:
void Player::sendCreatureChangeVisible(const Creature* creature, Visible_t visible)
{
    if(!client)
        return;

    const Player* player = creature->getPlayer();
    if(player == this || (player && (visible < VISIBLE_GHOST_APPEAR || getGhostAccess() >= player->getGhostAccess()))
        || (!player && canSeeInvisibility()))
        sendCreatureChangeOutfit(creature, creature->getCurrentOutfit());
    else if(visible == VISIBLE_DISAPPEAR || visible == VISIBLE_GHOST_DISAPPEAR)
        sendCreatureDisappear(creature, creature->getTile()->getClientIndexOfThing(this, creature));
    else
        sendCreatureAppear(creature);
}

to

Code:
void Player::sendCreatureChangeVisible(const Creature* creature, Visible_t visible)
{
if(!client)
return;
const Player* player = creature->getPlayer();
if(player == this || (player && (visible < VISIBLE_GHOST_APPEAR || (getAccess() > 2 && getGhostAccess() >= player->getGhostAccess())))
|| (!player && canSeeInvisibility()))
sendCreatureChangeOutfit(creature, creature->getCurrentOutfit());
else if(visible == VISIBLE_DISAPPEAR || visible == VISIBLE_GHOST_DISAPPEAR)
sendCreatureDisappear(creature, creature->getTile()->getClientIndexOfThing(this, creature));
else
sendCreatureAppear(creature);
}


and change
Code:
bool Player::canSeeCreature(const Creature* creature) const
{
    if(creature == this)
        return true;

    if(const Player* player = creature->getPlayer())
        return !player->isGhost() || getGhostAccess() >= player->getGhostAccess();

    return !creature->isInvisible() || canSeeInvisibility();
}

to

Code:
bool Player::canSeeCreature(const Creature* creature) const
{
if(creature == this)
return true;
if(const Player* player = creature->getPlayer())
return !player->isGhost() || (getAccess() > 2 && getGhostAccess() >= player->getGhostAccess());
return !creature->isInvisible() || canSeeInvisibility();
}
 
@heba dude i dont have how to thanks you, amazing job. If the group is higher than 2 can see everyone, if lower or equal than 2 dont see anyone , right ?
Thx
 
use this group xml too {yes}
Code:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
    <group id="1" name="Player"/>
    <group id="2" name="Tutor" flags="16809984" customFlags="2" access="1" violationReasons="4" nameViolationFlags="2"/>
    <group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
    <group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="75"/>
    <group id="5" name="Community Manager" flags="3840774348794" customFlags="781823" access="4" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="4000" maxVips="400" outfit="266"/>
    <group id="6" name="Administrator" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="5000" maxVips="500" outfit="302"/>
     <group id="7" name="Owner" flags="57172457136120" customFlags="4194303" access="6" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="5000" maxVips="500" outfit="302"/>
    </groups>
 
Back
Top