📄 gmcmds.cpp.svn-base
字号:
thisdrop->amount = 1;
thisdrop->owner = 0;
CMap* map = MapList.Index[thisdrop->posMap];
map->AddDrop( thisdrop );
}
else if(strcmp(command, "givezuly")==0)
{
if(Config.Command_GiveZuly > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
if((tmp = strtok(NULL, " "))==NULL) return true; int zuly=atoi(tmp);
Log( MSG_GMACTION, " %s : /givezuly %s, %i" , thisclient->CharInfo->charname, name, zuly);
return pakGMZulygive(thisclient, name, zuly);
}
else if(strcmp(command, "npc")==0)
{
if(Config.Command_Npc > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned npcid=atoi(tmp);
unsigned npcdialog = 0;
if((tmp = strtok(NULL, " "))!=NULL)
npcdialog=atoi(tmp);
Log( MSG_GMACTION, " %s : /npc %i, %i" , thisclient->CharInfo->charname, npcid, npcdialog);
return pakGMNpc(thisclient, npcid, npcdialog);
}
else if(strcmp(command, "givefairy")==0)
{
if(Config.Command_GiveFairy > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned mode=atoi(tmp);
Log( MSG_GMACTION, " %s : /givefairy %s, %i" , thisclient->CharInfo->charname, name, mode);
return pakGMFairyto(thisclient, name, mode);
}
else if(strcmp(command, "fairymode")==0)
{
if(Config.Command_ManageFairy > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned mode=atoi(tmp);
Log( MSG_GMACTION, " %s : /fairymode mode: %i" , thisclient->CharInfo->charname, mode);
return pakGMManageFairy(thisclient, mode);
}
else if(strcmp(command, "fairywait")==0)
{
if(Config.Command_ChangeFairyWait > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned value=atoi(tmp);
Log( MSG_GMACTION, " %s : /fairywait value: %i" , thisclient->CharInfo->charname, value);
return pakGMChangeFairyWait(thisclient, value);
}
else if(strcmp(command, "fairystay")==0)
{
if(Config.Command_ChangeFairyStay > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned value=atoi(tmp);
Log( MSG_GMACTION, " %s : /fairystay value: %i" , thisclient->CharInfo->charname, value);
return pakGMChangeFairyStay(thisclient, value);
}
else if(strcmp(command, "fairytestmode")==0)
{
if(Config.Command_ChangeFairyTestMode > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; unsigned mode=atoi(tmp);
Log( MSG_GMACTION, " %s : /fairytestmode mode: %i" , thisclient->CharInfo->charname, mode);
return pakGMChangeFairyTestMode(thisclient, mode);
}
else if (strcmp(command, "move")==0)
{
if(Config.Command_Move > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned map=atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL) return true; float x=(float)atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL) return true; float y=(float)atoi(tmp);
Log( MSG_GMACTION, " %s : /move %s,%i,%i,%i" , thisclient->CharInfo->charname, name, map, x, y);
return pakGMTeleOtherPlayer(thisclient, name, map, x, y);
}
else if (strcmp(command, "goto")==0)
{
if(Config.Command_Goto > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
Log( MSG_GMACTION, " %s : /goto %s" , thisclient->CharInfo->charname, name);
return pakGMTeleToPlayer(thisclient, name);
}
else if (strcmp(command, "teletome")==0)
{
if(Config.Command_TeleToMe > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
Log( MSG_GMACTION, " %s : /teletome %s" , thisclient->CharInfo->charname, name);
if(strcmp(name,"all")==0)
{
return pakGMTeleAllHere(thisclient);
}
return pakGMTelePlayerHere(thisclient, name);
}
else if(strcmp(command, "CharInfo")==0)
{
if(Config.Command_PlayerInfo > thisclient->Session->accesslevel)
return true;
if((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
Log( MSG_GMACTION, " %s : /CharInfo %s" , thisclient->CharInfo->charname, name);
return pakGMInfo(thisclient, name);
}
else if (strcmp(command, "give2")==0)
{
if(Config.Command_Item > thisclient->Session->accesslevel)
return true;
UINT itemrefine, itemstats, itemls, itemsocket;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemid =atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemtype =atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemamount =atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL)
itemrefine =0;
else
itemrefine = atoi(tmp)<10?atoi(tmp)*16:9*16;
if ((tmp = strtok(NULL, " "))==NULL)
itemls =100;
else
itemls = atoi(tmp);
if ((tmp = strtok(NULL, " "))==NULL)
itemsocket =0;
else
itemsocket =atoi(tmp)==0?false:true;
if ((tmp = strtok(NULL, " "))==NULL)
itemstats =0;
else
itemstats =atoi(tmp);
Log( MSG_GMACTION, " %s : /give2 %s,%i,%i,%i,%i,%i,%i,%i" , thisclient->CharInfo->charname, name, itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket);
return pakGMItemtoplayer( thisclient , name , itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket );
}
else if (strcmp(command, "ban")==0)
{
if(Config.Command_Ban > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
Log( MSG_GMACTION, " %s : /ban %s" , thisclient->CharInfo->charname, name);
return pakGMBan( thisclient, name );
}
else if (strcmp(command, "ani")==0)
{
if(Config.Command_Ani > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true;
unsigned anid =atoi(tmp);
Log( MSG_GMACTION, " %s : /ani %i" , thisclient->CharInfo->charname, anid);
pakGMDoEmote( thisclient, anid );
}
else if(strcmp(command,"summon")==0)
{
if(Config.Command_Summon > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true;
unsigned int summon = atoi(tmp);
Log( MSG_GMACTION, " %s : /summon %i" , thisclient->CharInfo->charname, summon);
fPoint position = RandInCircle( thisclient->Position->current, 5 );
CMap* map = MapList.Index[thisclient->Position->Map];
map->AddMonster( summon, position, thisclient->clientid );
//Start Animation
BEGINPACKET( pak, 0x7b2 );
ADDWORD ( pak, thisclient->clientid );
ADDWORD ( pak, 2802 );
SendToVisible( &pak, thisclient );
//Finish Animation
RESETPACKET( pak, 0x7bb );
ADDWORD ( pak, thisclient->clientid );
SendToVisible( &pak, thisclient );
//????
RESETPACKET( pak, 0x7b9);
ADDWORD ( pak, thisclient->clientid);
ADDWORD ( pak, 1286 );
SendToVisible( &pak, thisclient );
// Add our Mob to the mobs list
}
else if (strcmp(command, "reloadquest")==0)
{
if(Config.Command_ReloadQuest > thisclient->Session->accesslevel)
return true;
QuestList.clear( );
LoadQuestData( );
Log( MSG_GMACTION, " %s : /reloadquest" , thisclient->CharInfo->charname);
return true;
}
else if (strcmp(command, "shutdown")==0)
{
if(Config.Command_Shutdown > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true;
unsigned int minutes =atoi(tmp);
char text[200];
sprintf( text, "Server will shutdown in %i minutes, Please logout NOW to be sure your information is saved correctly.",
minutes );
BEGINPACKET( pak, 0x702 );
ADDSTRING ( pak, thisclient->CharInfo->charname );
ADDSTRING ( pak, "> " );
ADDSTRING ( pak, text );
ADDBYTE ( pak, 0x00 );
SendToAll ( &pak );
pthread_create( &WorldThread[SHUTDOWN_THREAD], NULL, ShutdownServer, (PVOID)minutes);
Log( MSG_GMACTION, " %s : /shutdown %u" , thisclient->CharInfo->charname, shutdown);
}
else if(strcmp(command, "dquest")==0)
{
if(Config.Command_DQuest > thisclient->Session->accesslevel)
return true;
char line0[200];
if( thisclient->questdebug )
{
Log(MSG_INFO,"Quest Debug deactivated");
sprintf(line0, "Quest Debug deactivated");
thisclient->questdebug = false;
}
else
{
Log(MSG_INFO,"Quest Debug activated");
sprintf(line0, "Quest Debug activated");
thisclient->questdebug = true;
}
SendPM(thisclient, line0 );
}
else if(strcmp(command, "iquest")==0)
{
if(Config.Command_IQuest > thisclient->Session->accesslevel)
return true;
int n=1;
if ((tmp = strtok(NULL, " "))==NULL) return true;
unsigned int itemquest =atoi(tmp);
if ((tmp = strtok(NULL, " "))!=NULL)
n=atoi(tmp);
if( thisclient->questdebug )
{
for(int i=0;i<n;i++)
{
BEGINPACKET( pak, 0x731 )
ADDWORD ( pak, itemquest );
thisclient->client->SendPacket( &pak );
}
}
}
else if (strcmp(command, "shoptype")==0)
{
if(Config.Command_ShopType > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true;
unsigned int shoptype =atoi(tmp);
thisclient->Shop->ShopType = shoptype;
Log( MSG_GMACTION, " %s : /shoptype %i" , thisclient->CharInfo->charname, shoptype);
}
else if (strcmp(command, "stat")==0) /// Code By Minoc
{
if(Config.Command_Stat > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; char* statname =(char*)tmp;
if ((tmp = strtok(NULL, " "))==NULL) return true; int statvalue = atoi(tmp);
if (statvalue > Config.MaxStat) /// code by PurpleYouko for setting max stat to 300
statvalue = Config.MaxStat; /// extra code to match setting in worldserver.conf by Atomsk
Log( MSG_GMACTION, " %s : /stat %s,%i" , thisclient->CharInfo->charname, statname, statvalue);
return pakGMStat( thisclient , statname , statvalue);
}
else if (strcmp(command, "statp")==0)
{
if (Config.Command_Stat > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; int statvalue = atoi(tmp);
char* name;
if ((tmp = strtok(NULL, " "))==NULL)
name = thisclient->CharInfo->charname;
else
name = tmp;
CPlayer* otherclient = GetClientByCharName(name);
if (otherclient == NULL)
return true;
if ((int)otherclient->CharInfo->StatPoints + statvalue < 0)
otherclient->CharInfo->StatPoints = 0;
else
otherclient->CharInfo->StatPoints += statvalue;
BEGINPACKET( pak, 0x720 );
ADDWORD( pak, 32 );
ADDWORD( pak, statvalue );
ADDWORD( pak, 0 );
otherclient->client->SendPacket( &pak );
RESETPACKET( pak, 0x0730 );
ADDWORD( pak, 5 );
ADDWORD( pak, 0xa24d );
ADDWORD( pak, 0x40b3 );
otherclient->client->SendPacket( &pak );
Log(MSG_GMACTION, " %s : /stats %i %s", thisclient->CharInfo->charname, statvalue, name);
return true;
}
else if (strcmp(command, "skillp")==0)
{
if (Config.Command_Stat > thisclient->Session->accesslevel)
return true;
if ((tmp = strtok(NULL, " "))==NULL) return true; int skillp = atoi(tmp);
char* name;
if ((tmp = strtok(NULL, " "))==NULL)
name = thisclient->CharInfo->charname;
else
name = tmp;
CPlayer* otherclient = GetClientByCharName(name);
if (otherclient == NULL)
return true;
if ((int)otherclient->CharInfo->SkillPoints + skillp < 0)
otherclient->CharInfo->SkillPoints = 0;
else
otherclient->CharInfo->SkillPoints += skillp;
BEGINPACKET( pak, 0x720 );
ADDWORD( pak, 37 );
ADDWORD( pak, skillp );
ADDWORD( pak, 0 );
otherclient->client->SendPacket( &pak );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -