mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
[Commands] QuestBitFlags Debug command
This commit is contained in:
parent
6a91291747
commit
570823166b
1 changed files with 96 additions and 1 deletions
|
@ -159,7 +159,6 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
pLog->debug( "[" + std::to_string( player.getId() ) + "] " +
|
pLog->debug( "[" + std::to_string( player.getId() ) + "] " +
|
||||||
"subCommand " + subCommand + " params: " + params );
|
"subCommand " + subCommand + " params: " + params );
|
||||||
|
|
||||||
|
|
||||||
if( ( ( subCommand == "pos" ) || ( subCommand == "posr" ) ) && ( params != "" ) )
|
if( ( ( subCommand == "pos" ) || ( subCommand == "posr" ) ) && ( params != "" ) )
|
||||||
{
|
{
|
||||||
int32_t posX;
|
int32_t posX;
|
||||||
|
@ -321,6 +320,102 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
{
|
{
|
||||||
pTerriMgr->disableCurrentFestival();
|
pTerriMgr->disableCurrentFestival();
|
||||||
}
|
}
|
||||||
|
else if ( subCommand == "BitFlag8" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if ( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if ( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag8( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
|
else if ( subCommand == "BitFlag16" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag16( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
|
else if ( subCommand == "BitFlag24" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag24( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
|
else if ( subCommand == "BitFlag32" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag32( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
|
else if ( subCommand == "BitFlag40" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag40( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
|
else if ( subCommand == "BitFlag48" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
sscanf( params.c_str(), "%hu %hhu", &questId, &questBit );
|
||||||
|
|
||||||
|
if( player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
if( !questBit == 0 || !questId == 0 )
|
||||||
|
player.setQuestBitFlag48( questId, questBit, true );
|
||||||
|
else
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.sendUrgent( subCommand + " is not a valid SET command." );
|
player.sendUrgent( subCommand + " is not a valid SET command." );
|
||||||
|
|
Loading…
Add table
Reference in a new issue