⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gmcmds.cpp.svn-base

📁 ROSE的源代码。了解的自己研究,编译通过
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
        else
        {
            SendPM(thisclient, "Please input a number after the go command, below is a list of places and their appropriate number");
            SendPM(thisclient, "1 = Adventurers plains");
            SendPM(thisclient, "2 = The city of Zant");
            SendPM(thisclient, "3 = Junon Polis");
            SendPM(thisclient, "4 = The city of Eucar");
            SendPM(thisclient, "5 = Xita Refuge");
            SendPM(thisclient, "6 = Training grounds");
            SendPM(thisclient, "7 = El Verloon Desert");
            SendPM(thisclient, "8 = Goblin Cave (B1)");
            SendPM(thisclient, "9 = Desert of the Dead");
            SendPM(thisclient, "10 = Sikuku Underground Prison");
            SendPM(thisclient, "Example; /go 3");
        }
        if ( thisclient->Stats->HP < (thisclient->Stats->MaxHP / 2) || thisclient->Stats->HP < 1 || thisclient->Session->inGame == false )
        {
             SendPM(thisclient, "You need at least 50% HP in order to warp");
             return true;
        }

        if( (x != 0) && (y != 0) && (map != 0) )
        {
            fPoint coord;
            coord.x = x;
            coord.y = y;
            MapList.Index[map]->TeleportPlayer( thisclient, coord, false );
            Log( MSG_GMACTION, " %s : /go %i" , thisclient->CharInfo->charname, loc);
        }
        return true;
    }
    //******************************* START RESPAWN ***************************
    else if (strcmp(command, "SSPAWN")==0)
    { //STARTPOINT IDMOB CANTMIN CANTMAX RESPAWNTIME(s)  (3 points minim)
    if(Config.Command_SSpawn > thisclient->Session->accesslevel)
	                    return true;
        thisclient->GMRespawnPoints.map = thisclient->Position->Map;                
        if ((tmp = strtok(NULL, " "))==NULL)
        {
            thisclient->GMRespawnPoints.b=0;    
            return true; 
        }
        thisclient->GMRespawnPoints.mobID=atoi(tmp); 
        if ((tmp = strtok(NULL, " "))==NULL)
        {
            thisclient->GMRespawnPoints.b=0;    
            return true; 
        }
        thisclient->GMRespawnPoints.min=atoi(tmp);  
        if ((tmp = strtok(NULL, " "))==NULL)
        {
            thisclient->GMRespawnPoints.b=0;    
            return true; 
        }
        thisclient->GMRespawnPoints.max=atoi(tmp);   
        if ((tmp = strtok(NULL, " "))==NULL)
        {
            thisclient->GMRespawnPoints.b=0;    
            return true; 
        }
        thisclient->GMRespawnPoints.n=0;        
        thisclient->GMRespawnPoints.respawntime=atoi(tmp);                  
        thisclient->GMRespawnPoints.b=1;
		BEGINPACKET( pak, 0x702 );
		ADDSTRING( pak, "STARTPOINT" );
		ADDBYTE( pak, 0 );            
		thisclient->client->SendPacket(&pak);
		thisclient->GMRespawnPoints.d=0;
        return true;
    }
    else if (strcmp(command, "SET")==0) 
    {
         if(Config.Command_Set > thisclient->Session->accesslevel)
	                    return true;
        if(thisclient->GMRespawnPoints.b==1 && thisclient->GMRespawnPoints.n<50)        
        {         
            int n=thisclient->GMRespawnPoints.n;   
            thisclient->GMRespawnPoints.points[n].x=floor(thisclient->Position->destiny.x);
            thisclient->GMRespawnPoints.points[n].y=floor(thisclient->Position->destiny.y);            
            thisclient->GMRespawnPoints.n++;
            char text[10];
            sprintf(text,"--POINT #%i",thisclient->GMRespawnPoints.n);
		    BEGINPACKET( pak, 0x702 );
		    ADDSTRING( pak,text );
		    ADDBYTE( pak, 0 );            
		    thisclient->client->SendPacket(&pak);
            return true;
        }
        return true;
    }
    else if (strcmp(command, "ESPAWN")==0) 
    {
         if(Config.Command_ESpawn > thisclient->Session->accesslevel)
	                    return true;
        if(thisclient->GMRespawnPoints.n>3 && thisclient->GMRespawnPoints.b==1)
        {
            if ((tmp = strtok(NULL, " "))==NULL)
                return true; 
            int id=atoi(tmp);
            if ((tmp = strtok(NULL, " "))==NULL)
                return true; 
            int agressive=atoi(tmp);            
            int n=thisclient->GMRespawnPoints.n;
            char points[1000] = "";
            sprintf(&points[0],"%i",n);
            for(int i=0;i<n;i++)
            {
                sprintf(&points[strlen(points)],"|%.0f,%.0f",thisclient->GMRespawnPoints.points[i].x,thisclient->GMRespawnPoints.points[i].y);                
            }
            DB->QExecute("INSERT into list_spawnareas (id,map,montype,respawntime,points,min,max,agressive) values (%i,%i,%i,%i,'%s',%i,%i,%i)",
            id,thisclient->GMRespawnPoints.map, thisclient->GMRespawnPoints.mobID,thisclient->GMRespawnPoints.respawntime,
            points,thisclient->GMRespawnPoints.min,thisclient->GMRespawnPoints.max,agressive);
            thisclient->GMRespawnPoints.b=0;
            thisclient->GMRespawnPoints.d=1;    
		    BEGINPACKET( pak, 0x702 );
		    ADDSTRING( pak,"ENDSPAWN" );
		    ADDBYTE( pak, 0 );       
		    thisclient->client->SendPacket(&pak);
		    ReloadMobSpawn(thisclient, id );
            return true;
        }        
        return true;
    }    else if (strcmp(command, "DSPAWN")==0) 
    {
         if(Config.Command_DSpawn > thisclient->Session->accesslevel)
	                    return true;
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        int id=atoi(tmp);         
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        thisclient->GMRespawnPoints.mobID=atoi(tmp); 
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        thisclient->GMRespawnPoints.min=atoi(tmp);  
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        thisclient->GMRespawnPoints.max=atoi(tmp);    
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        thisclient->GMRespawnPoints.respawntime=atoi(tmp);                  
        if ((tmp = strtok(NULL, " "))==NULL)
            return true; 
        int agressive = atoi(tmp);        
        if(thisclient->GMRespawnPoints.n>3 && thisclient->GMRespawnPoints.d==1)
        {
            int n=thisclient->GMRespawnPoints.n;
            char points[1000] = "";
            sprintf(&points[0],"%i",n);
            for(int i=0;i<n;i++)
            {
                sprintf(&points[strlen(points)],"|%.0f,%.0f",thisclient->GMRespawnPoints.points[i].x,thisclient->GMRespawnPoints.points[i].y);                
            }
            DB->QExecute("INSERT into list_spawnareas (id,map,montype,respawntime,points,min,max,agressive) values (%i,%i,%i,%i,'%s',%i,%i,%i)",
            id,thisclient->GMRespawnPoints.map,
            thisclient->GMRespawnPoints.mobID,thisclient->GMRespawnPoints.respawntime,
            points,thisclient->GMRespawnPoints.min,thisclient->GMRespawnPoints.max,agressive);
            thisclient->GMRespawnPoints.b=0;
		    BEGINPACKET( pak, 0x702 );
		    ADDSTRING( pak, "DUPESPAWN" );
		    ADDBYTE( pak, 0 );              
		    thisclient->client->SendPacket(&pak);
		    ReloadMobSpawn(thisclient, id );
            return true;
        }        
        return true;
    }  
    else if(strcmp(command, "DELETESPAWN")==0)
    {
         if(Config.Command_DelSpawn > thisclient->Session->accesslevel)
	                    return true;
        if ((tmp = strtok(NULL, " "))==NULL)
             return true; 
        int id=atoi(tmp);    
        DB->QExecute("DELETE from list_spawnareas where id=%i",id);
		BEGINPACKET( pak, 0x702 );
		ADDSTRING( pak, "DELETESPAWN" );
		ADDBYTE( pak, 0 );             
        thisclient->client->SendPacket(&pak);  
        CSpawnArea* thisspawn = GetSpawnArea( id );  
        if(thisspawn==NULL)
            return true;        
        CMap* map = MapList.Index[thisspawn->map];
        for(UINT i=0;i<map->MonsterList.size();i++)
        {
            CMonster* thismon = map->MonsterList.at(i);
            BEGINPACKET( pak, 0x794 );
            ADDWORD    ( pak, thismon->clientid );
            SendToVisible( &pak, thismon );
            MapList.Index[thisspawn->map]->DeleteMonster( thismon );
        }  
        DeleteSpawn( thisspawn );
        Log( MSG_GMACTION, " %s : /deletespawn %i" , thisclient->CharInfo->charname, id);               
    }//******************************** FINISH RESPAWN ***************************
    else if(strcmp(command, "p")==0)  //*** READ THE PACKET.TXT AND SEND IT
    {
         if(Config.Command_Pak > thisclient->Session->accesslevel)
	                    return true;
         if ((tmp = strtok(NULL, " "))==NULL)
             return true; 	        
            char buffer;              
            std::string filename = "packet/packet";
            filename += tmp;
            filename += ".txt";               
            FILE *packet1 = fopen(filename.c_str(),"r");                                            
            if(packet1==NULL)
            {
                printf("Error opening packet.txt!\n");
                return true;
            }
            unsigned int command = 0;
            fread( &command, 1, 2, packet1 );
            BEGINPACKET(pak,command);
            while((fscanf(packet1,"%c",&buffer))!=EOF)
                    ADDBYTE(pak,buffer);
    		thisclient->client->SendPacket( &pak );    
            fclose(packet1);     
    }     
    else if (strcmp(command, "level")==0)
    {
         if(Config.Command_Level > thisclient->Session->accesslevel)
                        return true;
        char* name;
        if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned level=atoi(tmp);
        if ((tmp = strtok(NULL, " "))==NULL) name = thisclient->CharInfo->charname; else name = tmp;
        Log( MSG_GMACTION, " %s : /level %i %s" , thisclient->CharInfo->charname, level, name);
        return pakGMLevel( thisclient, level, name );
    }
    else if (strcmp(command, "info")==0) 
    {       
            if(Config.Command_Info > thisclient->Session->accesslevel)
	                    return true;
            Log( MSG_GMACTION, " %s : /info" , thisclient->CharInfo->charname);        
            thisclient->GetPlayerInfo( );		    
            return true;
	}	
    else if (strcmp(command, "exp")==0)
    {
         if(Config.Command_Exp > thisclient->Session->accesslevel)
                        return true;
        if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned exp=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;
        otherclient->CharInfo->Exp += exp;
        BEGINPACKET( pak, 0x79b );
        ADDDWORD   ( pak, otherclient->CharInfo->Exp );
        ADDWORD    ( pak, otherclient->CharInfo->stamina );
        ADDWORD    ( pak, 0 );
        otherclient->client->SendPacket( &pak );
        Log( MSG_GMACTION, " %s : /exp %i %s" , thisclient->CharInfo->charname, exp, name);
    }
    else if (strcmp(command, "mon")==0) {
         if(Config.Command_Mon > thisclient->Session->accesslevel)
	                    return true;
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned montype=atoi(tmp);
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned moncount=atoi(tmp);
		Log( MSG_GMACTION, " %s : /mon %i,%i" , thisclient->CharInfo->charname, montype, moncount);
		return pakGMMon( thisclient, montype, moncount );
	}
    else if (strcmp(command, "mon2")==0)
    {    //Spawn "x" monsters
         if(Config.Command_Mon2 > thisclient->Session->accesslevel)
	                    return true;
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned montype=atoi(tmp);
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned moncount=atoi(tmp);
		
		for (int k=0;k<moncount;k++)
	    {
             Log( MSG_GMACTION, " %s : /mon2 %i,%i" , thisclient->CharInfo->charname, montype+k, moncount); 
             pakGMMon( thisclient, montype+k, 1 );            
        }
				
		return true;
	} 
    else if (strcmp(command, "kick")==0)
    {
        if(Config.Command_Kick > thisclient->Session->accesslevel)
	       return true;
        if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
        Log( MSG_GMACTION, " %s : /kick %s" , thisclient->CharInfo->charname, name);        
        return pakGMKick( thisclient, name );
    }
    else if (strcmp(command, "job")==0) // *** Change Job *****
    { 
         if(Config.Command_Job > thisclient->Session->accesslevel)
	       return true;
               char* tmp;
               if ((tmp = strtok(NULL, " "))==NULL) return true; char* job=tmp;
               Log( MSG_GMACTION, " %s : /job %s" , thisclient->CharInfo->charname, job);
               if(thisclient->CharInfo->Job != 0 || thisclient->Stats->Level<10)
                    return true;
               if(strcmp(job,"soldier")==0)
               {
                    BEGINPACKET(pak, 0x721);
                    ADDWORD    (pak, 0x0004);
                    ADDWORD    (pak, 0x006f);
                    ADDWORD    (pak, 0x0000);
                    thisclient->client->SendPacket(&pak);

                    RESETPACKET( pak, 0x730);
                    ADDBYTE(pak, 0x05);
                    ADDBYTE(pak, 0x00);    
                    ADDWORD(pak, 0xf52f);
                    ADDWORD(pak, 0x2964);
                	thisclient->client->SendPacket( &pak );                                            
                    thisclient->CharInfo->Job=111;                       
               }
               else
               if(strcmp(job,"muse")==0)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -