• 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 [C++] CreatureEventList not start

milbradt

New Member
Joined
Dec 25, 2011
Messages
177
Solutions
1
Reaction score
4
Hello..

Why does not the FOR start?

Is this going to start only if the creature has registered ??

C++:
bool Game::playerRequestOutfit(uint32_t playerId)
{
    Player* player = getPlayerByID(playerId);
    if(!player || player->isRemoved())
        return false;

    if(player->hasCondition(CONDITION_EXHAUST, 4))
    {
        player->sendTextMessage(MSG_STATUS_SMALL, "You have to wait a while.");
        return false;
    }

    if(Condition* conditionoutfit = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 300, 0, false, 4))
        player->addCondition(conditionoutfit);

    //player->sendOutfitWindow();
    // custom
    CreatureEventList events = player->getCreatureEvents(CREATURE_EVENT_REQUEST_OUTFIT_WINDOW);
    for(CreatureEventList::iterator it = events.begin(); it != events.end(); ++it) //no start =\
    {
        (*it)->executeCustomRequestOutfitWindow(player);
        player->sendTextMessage(MSG_STATUS_SMALL, "[FOR] start. ENTER PLEASE");
    }
    player->sendTextMessage(MSG_STATUS_SMALL, "[END] playerRequestOutfit.");
 
    return true;
}
 
Last edited:
How to register the creature when you click set outfit? o_O
here: protocolgame.cpp
Code:
void Game::playerChangeOutfit(uint32_t playerId, Outfit_t outfit)
{
    if (!g_config.getBoolean(ConfigManager::ALLOW_CHANGEOUTFIT)) {
        return;
    }

    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    if (outfit.lookMount != 0) {
        Mount* mount = mounts.getMountByClientID(outfit.lookMount);
        if (!mount) {
            return;
        }

        if (!player->hasMount(mount)) {
            return;
        }

        if (player->isMounted()) {
            Mount* prevMount = mounts.getMountByID(player->getCurrentMount());
            if (prevMount) {
                changeSpeed(player, mount->speed - prevMount->speed);
            }

            player->setCurrentMount(mount->id);
        } else {
            player->setCurrentMount(mount->id);
            outfit.lookMount = 0;
        }
    } else if (player->isMounted()) {
        player->dismount();
    }

    if (player->canWear(outfit.lookType, outfit.lookAddons)) {
        player->defaultOutfit = outfit;

        if (player->hasCondition(CONDITION_OUTFIT)) {
            return;
        }

        internalCreatureChangeOutfit(player, outfit);
    }
}
 
Back
Top