mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
Merge pull request #366 from DantestyleXD/DebugCommand
Debug command for QuestBitFlags
This commit is contained in:
commit
1f73f477a0
1 changed files with 52 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,58 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost:
|
||||||
{
|
{
|
||||||
pTerriMgr->disableCurrentFestival();
|
pTerriMgr->disableCurrentFestival();
|
||||||
}
|
}
|
||||||
|
else if ( subCommand == "BitFlag" )
|
||||||
|
{
|
||||||
|
uint16_t questId;
|
||||||
|
uint8_t questBit;
|
||||||
|
int8_t BitFlag;
|
||||||
|
sscanf( params.c_str(), "%hhu %hu %hhu", &BitFlag, &questId, &questBit );
|
||||||
|
|
||||||
|
if( !player.hasQuest( questId ) )
|
||||||
|
{
|
||||||
|
player.sendDebug( "Player doesn't have the quest with ID: " + std::to_string( questId ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( questBit == 0 || questId == 0 )
|
||||||
|
{
|
||||||
|
player.sendDebug( "Params are not correct" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( BitFlag )
|
||||||
|
{
|
||||||
|
case 8:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag8( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 16:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag16( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 24:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag24( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 32:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag32( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 40:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag40( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 48:
|
||||||
|
{
|
||||||
|
player.setQuestBitFlag48( questId, questBit, true );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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