mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
Merge pull request #107 from AcedArmy/master
//gm teri and Debug Cleanup
This commit is contained in:
commit
eb4f53be03
2 changed files with 14 additions and 59 deletions
|
@ -176,33 +176,6 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
pPlayer->queuePacket( setActorPosPacket );
|
||||
|
||||
}
|
||||
else if( ( subCommand == "zone" ) && ( params != "" ) )
|
||||
{
|
||||
int32_t zoneId;
|
||||
sscanf( params.c_str(), "%i", &zoneId );
|
||||
|
||||
if( zoneId < 1 )
|
||||
pPlayer->sendUrgent( "Zone id out of range." );
|
||||
else
|
||||
{
|
||||
pPlayer->setPosition( pPlayer->getPos() );
|
||||
pPlayer->performZoning( zoneId, pPlayer->getPos(), 0);
|
||||
}
|
||||
|
||||
}
|
||||
else if( ( subCommand == "hp" ) && ( params != "" ) )
|
||||
{
|
||||
int32_t hp;
|
||||
sscanf( params.c_str(), "%i", &hp );
|
||||
|
||||
pPlayer->setHp( hp );
|
||||
|
||||
auto control = Network::Packets::Server::ActorControlPacket142( pPlayer->getId(), Common::ActorControlType::HpSetStat, 1, pPlayer->getHp() );
|
||||
|
||||
pPlayer->sendToInRangeSet( control, true );
|
||||
|
||||
}
|
||||
|
||||
else if( ( subCommand == "tele" ) && ( params != "" ) )
|
||||
{
|
||||
int32_t aetheryteId;
|
||||
|
@ -324,37 +297,7 @@ void Core::DebugCommandHandler::add( char * data, Core::Entity::PlayerPtr pPlaye
|
|||
"subCommand " + subCommand + " params: " + params );
|
||||
|
||||
|
||||
if( ( subCommand == "item" ) && ( params != "" ) )
|
||||
{
|
||||
int32_t catalogId;
|
||||
int32_t amount;
|
||||
|
||||
sscanf( params.c_str(), "%d %d", &catalogId, &amount );
|
||||
|
||||
if( amount < 1 || amount > 99 )
|
||||
{
|
||||
amount = 1;
|
||||
}
|
||||
|
||||
if( ( catalogId == 0xcccccccc ) )
|
||||
{
|
||||
pPlayer->sendUrgent( "Syntaxerror." );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !pPlayer->addItem( -1, catalogId, amount ) )
|
||||
pPlayer->sendUrgent( "Item " + std::to_string( catalogId ) + " not found..." );
|
||||
|
||||
}
|
||||
else if( subCommand == "exp" )
|
||||
{
|
||||
int32_t amount;
|
||||
|
||||
sscanf( params.c_str(), "%d", &amount );
|
||||
|
||||
pPlayer->gainExp( amount );
|
||||
}
|
||||
else if( subCommand == "status" )
|
||||
if( subCommand == "status" )
|
||||
{
|
||||
int32_t id;
|
||||
int32_t duration;
|
||||
|
@ -540,4 +483,3 @@ void Core::DebugCommandHandler::serverInfo( char * data, Core::Entity::PlayerPtr
|
|||
pPlayer->sendDebug( "SapphireServer " + Version::VERSION + " - " + Version::GIT_HASH );
|
||||
pPlayer->sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ enum GmCommand
|
|||
QuestInspect = 0x0131,
|
||||
GC = 0x0154,
|
||||
GCRank = 0x0155,
|
||||
Teri = 0x0258,
|
||||
TeriInfo = 0x025D,
|
||||
Jump = 0x025E,
|
||||
JumpNpc = 0x025F,
|
||||
|
@ -269,6 +270,18 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
|
|||
"\nNextWeather:" + std::to_string( pPlayer->getCurrentZone()->getNextWeather() ) );
|
||||
break;
|
||||
}
|
||||
case GmCommand::Teri:
|
||||
{
|
||||
if( param1 < 128 )
|
||||
pPlayer->sendUrgent( "Zone ID out of range." );
|
||||
else
|
||||
{
|
||||
targetPlayer->setPosition( targetPlayer->getPos() );
|
||||
targetPlayer->performZoning( param1, targetPlayer->getPos(), 0 );
|
||||
pPlayer->sendNotice( targetPlayer->getName() + " was warped to Zone " + std::to_string( param1 ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GmCommand::Jump:
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue