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

[7.72] OTHire 0.0.1b - Based in OTServ Trunk (Latest)

@Ezzz @Nottinghster @topic

bro, its possible the time of decrease frags?

Player.cpp
Code:
                    if(it->isUnjustKill()){
                        attackerPlayer->addUnjustifiedDead(this);
                    }
                    #endif

I tried in diff ways, but without success.

Any idea?
Thanks!!!
 
:)
Code:
-- How long time the red skull will last in seconds (default 30 days)
red_skull_duration = 30*24*60*60

-- White skull duration, how long a player will get pz locked/white skull
unjust_skull_duration = 15*60*1000
np
 
@Topic

Now i find this functions in ioplayer.cpp (i think the unjust kill time is stored here)

Code:
if(player){
//reset unjust kill cache
UnjustCacheMap::iterator it = unjustKillCacheMap.find(player->getGUID());
if(it != unjustKillCacheMap.end()){
unjustKillCacheMap.erase(it);
}
DBInsert player_killers_stmt(db);
player_killers_stmt.setQuery("INSERT INTO `player_killers` (`kill_id`, `player_id`, `unjustified`) VALUES ");
query.str("");
query << kill_id << ", " << player->getGUID() << ", " << (de.isUnjustKill() ? 1 : 0);
if(!player_killers_stmt.addRow(query.str()))
return false;
if(!player_killers_stmt.execute())
return false;
}
else{ // Kill wasn't player, store name so next insert catches it
name = c->getNameDescription();
}
}

Its possible to edit the decrease time here?
 
Code:
-- how long does the player has to stay out of fight to get pz unlocked in ms (1000 = 1 second)
in_fight_duration = 60000
@secondlife ? or be more specific i can't understand
@Topic

Now i find this functions in ioplayer.cpp (i think the unjust kill time is stored here)

Code:
if(player){
//reset unjust kill cache
UnjustCacheMap::iterator it = unjustKillCacheMap.find(player->getGUID());
if(it != unjustKillCacheMap.end()){
unjustKillCacheMap.erase(it);
}
DBInsert player_killers_stmt(db);
player_killers_stmt.setQuery("INSERT INTO `player_killers` (`kill_id`, `player_id`, `unjustified`) VALUES ");
query.str("");
query << kill_id << ", " << player->getGUID() << ", " << (de.isUnjustKill() ? 1 : 0);
if(!player_killers_stmt.addRow(query.str()))
return false;
if(!player_killers_stmt.execute())
return false;
}
else{ // Kill wasn't player, store name so next insert catches it
name = c->getNameDescription();
}
}

Its possible to edit the decrease time here?
i think its if better if you make a new thread in support section man
 
How can i enable premium features, such as Premium Outfits for everyone?
There is no setting for this in the config.lua

Do i need to edit this source code?
CSS:
void ProtocolGame::parseSetOutfit(NetworkMessage& msg)
{
    uint16_t lookType = msg.GetU16();

    Outfit_t newOutfit;

    // only first 4 outfits
    uint8_t lastFemaleOutfit = 0x8B;
    uint8_t lastMaleOutfit = 0x83;

    // if premium then all 7 outfits
    if (player->getSex() == PLAYERSEX_FEMALE && player->isPremium())
        lastFemaleOutfit = 0x8E;
    else if (player->getSex() == PLAYERSEX_MALE && player->isPremium())
        lastMaleOutfit = 0x86;

    if ((player->getSex() == PLAYERSEX_FEMALE &&
        lookType >= 136 &&
        lookType <= lastFemaleOutfit) ||
        (player->getSex() == PLAYERSEX_MALE &&
        lookType >= 128 &&
        lookType <= lastMaleOutfit))
    {
        newOutfit.lookType = lookType;
        newOutfit.lookHead = msg.GetByte();
        newOutfit.lookBody = msg.GetByte();
        newOutfit.lookLegs = msg.GetByte();
        newOutfit.lookFeet = msg.GetByte();
    }

    addGameTask(&Game::playerChangeOutfit, player->getID(), newOutfit);
}
 
@Topic

Now i find this functions in ioplayer.cpp (i think the unjust kill time is stored here)

Code:
if(player){
//reset unjust kill cache
UnjustCacheMap::iterator it = unjustKillCacheMap.find(player->getGUID());
if(it != unjustKillCacheMap.end()){
unjustKillCacheMap.erase(it);
}
DBInsert player_killers_stmt(db);
player_killers_stmt.setQuery("INSERT INTO `player_killers` (`kill_id`, `player_id`, `unjustified`) VALUES ");
query.str("");
query << kill_id << ", " << player->getGUID() << ", " << (de.isUnjustKill() ? 1 : 0);
if(!player_killers_stmt.addRow(query.str()))
return false;
if(!player_killers_stmt.execute())
return false;
}
else{ // Kill wasn't player, store name so next insert catches it
name = c->getNameDescription();
}
}

Its possible to edit the decrease time here?
 
How can i enable premium features, such as Premium Outfits for everyone?
There is no setting for this in the config.lua

Do i need to edit this source code?
CSS:
void ProtocolGame::parseSetOutfit(NetworkMessage& msg)
{
    uint16_t lookType = msg.GetU16();

    Outfit_t newOutfit;

    // only first 4 outfits
    uint8_t lastFemaleOutfit = 0x8B;
    uint8_t lastMaleOutfit = 0x83;

    // if premium then all 7 outfits
    if (player->getSex() == PLAYERSEX_FEMALE && player->isPremium())
        lastFemaleOutfit = 0x8E;
    else if (player->getSex() == PLAYERSEX_MALE && player->isPremium())
        lastMaleOutfit = 0x86;

    if ((player->getSex() == PLAYERSEX_FEMALE &&
        lookType >= 136 &&
        lookType <= lastFemaleOutfit) ||
        (player->getSex() == PLAYERSEX_MALE &&
        lookType >= 128 &&
        lookType <= lastMaleOutfit))
    {
        newOutfit.lookType = lookType;
        newOutfit.lookHead = msg.GetByte();
        newOutfit.lookBody = msg.GetByte();
        newOutfit.lookLegs = msg.GetByte();
        newOutfit.lookFeet = msg.GetByte();
    }

    addGameTask(&Game::playerChangeOutfit, player->getID(), newOutfit);
}
I am also looking for a solution
 
How can i enable premium features, such as Premium Outfits for everyone?
There is no setting for this in the config.lua

Do i need to edit this source code?

If you want it as a config option, try this:
C++:
void ProtocolGame::parseSetOutfit(NetworkMessage& msg)
{
    uint16_t lookType = msg.GetU16();
    Outfit_t newOutfit;
    bool allOutfits = g_config.getBoolean(ConfigManager::ALL_OUTFITS);
   
    // only first 4 outfits
    uint8_t lastFemaleOutfit = (allOutfits ? 0x8E : 0x8B);
    uint8_t lastMaleOutfit = (allOutfits ? 0x86 : 0x83);
    // if premium then all 7 outfits
    if (!allOutfits) {
        if (player->getSex() == PLAYERSEX_FEMALE && player->isPremium())
            lastFemaleOutfit = 0x8E;
        else if (player->getSex() == PLAYERSEX_MALE && player->isPremium())
            lastMaleOutfit = 0x86;
    }
    if ((player->getSex() == PLAYERSEX_FEMALE &&
        lookType >= 136 &&
        lookType <= lastFemaleOutfit) ||
        (player->getSex() == PLAYERSEX_MALE &&
        lookType >= 128 &&
        lookType <= lastMaleOutfit))
    {
        newOutfit.lookType = lookType;
        newOutfit.lookHead = msg.GetByte();
        newOutfit.lookBody = msg.GetByte();
        newOutfit.lookLegs = msg.GetByte();
        newOutfit.lookFeet = msg.GetByte();
    }
    addGameTask(&Game::playerChangeOutfit, player->getID(), newOutfit);
}

And in configmanager.cpp add:
C++:
m_confInteger[ALL_OUTFITS] = getGlobalBoolean(L, "all_outfits", false);

And in configmanager.h under PARCEL_BLOCK, add:
Code:
ALL_OUTFITS

And then somewhere in config.lua add:
Code:
all_outfits = true
 
If you want it as a config option, try this:
C++:
void ProtocolGame::parseSetOutfit(NetworkMessage& msg)
{
    uint16_t lookType = msg.GetU16();
    Outfit_t newOutfit;
    bool allOutfits = g_config.getBoolean(ConfigManager::ALL_OUTFITS);
  
    // only first 4 outfits
    uint8_t lastFemaleOutfit = (allOutfits ? 0x8E : 0x8B);
    uint8_t lastMaleOutfit = (allOutfits ? 0x86 : 0x83);
    // if premium then all 7 outfits
    if (!allOutfits) {
        if (player->getSex() == PLAYERSEX_FEMALE && player->isPremium())
            lastFemaleOutfit = 0x8E;
        else if (player->getSex() == PLAYERSEX_MALE && player->isPremium())
            lastMaleOutfit = 0x86;
    }
    if ((player->getSex() == PLAYERSEX_FEMALE &&
        lookType >= 136 &&
        lookType <= lastFemaleOutfit) ||
        (player->getSex() == PLAYERSEX_MALE &&
        lookType >= 128 &&
        lookType <= lastMaleOutfit))
    {
        newOutfit.lookType = lookType;
        newOutfit.lookHead = msg.GetByte();
        newOutfit.lookBody = msg.GetByte();
        newOutfit.lookLegs = msg.GetByte();
        newOutfit.lookFeet = msg.GetByte();
    }
    addGameTask(&Game::playerChangeOutfit, player->getID(), newOutfit);
}

And in configmanager.cpp add:
C++:
m_confInteger[ALL_OUTFITS] = getGlobalBoolean(L, "all_outfits", false);

And in configmanager.h under PARCEL_BLOCK, add:
Code:
ALL_OUTFITS

And then somewhere in config.lua add:
Code:
all_outfits = true

It compiled successfully, but prem outfits is not available for free acc players, even if i set "all_outfits = true" in "config.lua"
 
It compiled successfully, but prem outfits is not available for free acc players, even if i set "all_outfits = true" in "config.lua"
Have no way to test it myself, I don't, see when looking at it, why it should not work
 
you´re being a bit lazy do it yourself he shared the code
lol.. where are you watching him share the code? he just posted a picture of the system running on his own server.
I told him to commit files if he wants to share with other othire users and.. nobody mentioned you in the conversation..
 
How can i add so that if a player is attacking another player, the text "PK!" should appear in red repeatedly above the attackers character, until the PZ is over?

Is this possible? :eek:
 
Back
Top