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

📄 gmcmds.cpp.svn-base

📁 ROSE的源代码。了解的自己研究,编译通过
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
               {
                    BEGINPACKET(pak, 0x721);
                    ADDWORD    (pak, 0x0004);
                    ADDWORD    (pak, 0x00D3);
                    ADDWORD    (pak, 0x0000);
                    thisclient->client->SendPacket(&pak); 

                    RESETPACKET( pak, 0x730);
                    ADDBYTE(pak, 0x05);
                    ADDBYTE(pak, 0x00);    
                    ADDWORD(pak, 0xdc3b);
                    ADDWORD(pak, 0x20cd);
                	thisclient->client->SendPacket( &pak );                       
                    thisclient->CharInfo->Job=211;                                            
               }   
               else
               if(strcmp(job,"hawker")==0)
               {
                     BEGINPACKET(pak, 0x721);
                     ADDWORD    (pak, 0x0004);
                     ADDWORD    (pak, 0x0137);
                     ADDWORD    (pak, 0x0000);
                     thisclient->client->SendPacket(&pak);  

                     RESETPACKET( pak, 0x730);
                     ADDBYTE(pak, 0x05);
                     ADDBYTE(pak, 0x00);    
                     ADDWORD(pak, 0x1104);
                     ADDWORD(pak, 0x5150);
                	 thisclient->client->SendPacket( &pak );                                             
                     thisclient->CharInfo->Job=311;                                      
               }                                            
               else               
               if(strcmp(job,"dealer")==0)
               {
                    BEGINPACKET(pak, 0x721);
                    ADDWORD    (pak, 0x0004);
                    ADDWORD    (pak, 0x019b);
                    ADDWORD    (pak, 0x0000);
                    thisclient->client->SendPacket(&pak); 

                    RESETPACKET( pak, 0x730);
                    ADDBYTE(pak, 0x05);
                    ADDBYTE(pak, 0x00);    
                    ADDWORD(pak, 0x4c1c);
                    ADDWORD(pak, 0xef69);
                	thisclient->client->SendPacket( &pak );                        
                    thisclient->CharInfo->Job=411;                                            
          }             
     }        
     else if (strcmp(command, "set")==0) 
     {      
        if(Config.Command_Set > thisclient->Session->accesslevel)
                    return true; 
        int refine;
        if ((tmp = strtok(NULL, " "))==NULL) 
            return true; 
        int id=atoi(tmp);                         
        if ((tmp = strtok(NULL, " "))==NULL) 
            refine = 0; 
        else
            refine=atoi(tmp); 
        refine *= 16;
        BEGINPACKET( pak, 0);
        if(EquipList[2].Index[id]!=NULL)
        {  
            thisclient->items[2].itemnum = id;
    		thisclient->items[2].itemtype = 2;
    		thisclient->items[2].refine =refine;
    		thisclient->items[2].durability = 50;
    		thisclient->items[2].lifespan = 100;
    		thisclient->items[2].count = 1;
    		thisclient->items[2].stats = 0;
    		thisclient->items[2].socketed = false;
    		thisclient->items[2].appraised = true;	
        	thisclient->items[2].gem = 0;   
            thisclient->UpdateInventory( 2 );                  	
            
    	    RESETPACKET( pak, 0x7a5);     
    	    ADDWORD( pak, thisclient->clientid );
    	    ADDWORD( pak, 0x0002);							
    	    ADDWORD( pak, id);	// ITEM NUM
    	    ADDWORD( pak, BuildItemRefine( thisclient->items[2] ) );	// REFINE
    	    ADDWORD( pak, thisclient->Stats->Move_Speed );	// REFINE
    	    SendToVisible( &pak,thisclient );             
        }
    	if(EquipList[3].Index[id]!=NULL)
    	{
    		thisclient->items[3].itemnum = id;
    		thisclient->items[3].itemtype = 3;
    		thisclient->items[3].refine =refine;
    		thisclient->items[3].durability = 50;
    		thisclient->items[3].lifespan = 100;
    		thisclient->items[3].count = 1;
    		thisclient->items[3].stats = 0;
    		thisclient->items[3].socketed = false;
    		thisclient->items[3].appraised = true;	
        	thisclient->items[3].gem = 0;    
            thisclient->UpdateInventory( 3 );               
            
	        RESETPACKET( pak, 0x7a5);     
    	    ADDWORD( pak, thisclient->clientid );
    	    ADDWORD( pak, 0x0003);							
    	    ADDWORD( pak, id);	// ITEM NUM
    	    ADDWORD( pak, BuildItemRefine( thisclient->items[3] ));	// REFINE
    	    ADDWORD( pak, thisclient->Stats->Move_Speed );	// REFINE
    	    SendToVisible( &pak,thisclient );                
        }
        if(EquipList[4].Index[id]!=NULL)
        {
    		thisclient->items[5].itemnum = id;
    		thisclient->items[5].itemtype = 4;
    		thisclient->items[5].refine =refine;
    		thisclient->items[5].durability = 50;
    		thisclient->items[5].lifespan = 100;
    		thisclient->items[5].count = 1;
    		thisclient->items[5].stats = 0;
    		thisclient->items[5].socketed = false;
    		thisclient->items[5].appraised = true;	
        	thisclient->items[5].gem = 0;   
                   		
            thisclient->UpdateInventory( 4 );	
            
    	    RESETPACKET( pak, 0x7a5);     
     	    ADDWORD( pak, thisclient->clientid );            	               
	        ADDWORD( pak, 5);							
    	    ADDWORD( pak, id);	// ITEM NUM
    	    ADDWORD( pak, BuildItemRefine( thisclient->items[5] ));	// REFINE
    	    ADDWORD( pak, thisclient->Stats->Move_Speed );	// REFINE 2602
    	    SendToVisible( &pak,thisclient );             		
        }
        if(EquipList[5].Index[id]!=NULL)		
        {
    		thisclient->items[6].itemnum = id;
    		thisclient->items[6].itemtype = 5;
    		thisclient->items[6].refine =refine;
    		thisclient->items[6].durability = 50;
    		thisclient->items[6].lifespan = 100;
    		thisclient->items[6].count = 1;
      		thisclient->items[6].stats = 0;
    		thisclient->items[6].socketed = false;
    		thisclient->items[6].appraised = true;	
        	thisclient->items[6].gem = 0;  
                             
            thisclient->UpdateInventory( 6 );            

    	    RESETPACKET( pak, 0x7a5);     
    	    ADDWORD( pak, thisclient->clientid );
    	    ADDWORD( pak, 6);							
    	    ADDWORD( pak, id);	// ITEM NUM
    	    ADDWORD( pak, BuildItemRefine( thisclient->items[6] ));	// REFINE
    	    ADDWORD( pak, thisclient->Stats->Move_Speed);	// REFINE
    	    SendToVisible( &pak,thisclient );
        }  	        
        thisclient->SetStats( );	         	   
    }
    else if (strcmp(command, "cha")==0) 
    {
         if(Config.Command_Cha > thisclient->Session->accesslevel)
	                    return true;
        int slot;
        int tipo;
        int id;
        int stats;
        int socket;
        int refine;
        if ((tmp = strtok(NULL, " "))==NULL)return true;
        if(strcmp(tmp, "mask")==0)
        {
            slot=1;    
            tipo=1;
        }
        else                    
        if(strcmp(tmp, "cap")==0)
        {
            slot=2;                    
            tipo=2;
        }
        else            
        if(strcmp(tmp, "suit")==0)
        {
            slot=3; 
            tipo=3;
        }
        else            
        if(strcmp(tmp, "back")==0)
        {
            slot=4;                                   
            tipo=6;
        }
        else            
        if(strcmp(tmp, "glov")==0)
        {
            slot=5;              
            tipo=4;
        }
        else            
        if(strcmp(tmp, "shoe")==0)
        {
            slot=6;                                                         
            tipo=5;
        }
        else                            
        if(strcmp(tmp, "weap")==0)
        {
            slot=7;           
            tipo=8;
        }
        else            
        if(strcmp(tmp, "shield")==0)
        {
            slot=8;     
            tipo=9;
        }
        else
            return true;                                                                                            
        if ((tmp = strtok(NULL, " "))==NULL)return true;
            id=atoi(tmp);       
        if ((tmp = strtok(NULL, " "))==NULL)
            stats=0;
        else
            stats=atoi(tmp);      
        if ((tmp = strtok(NULL, " "))==NULL)
            socket=0;
        else
            socket=1;                            
        if ((tmp = strtok(NULL, " "))==NULL)
            refine=0;
        else
            refine=atoi(tmp);                                        
	   thisclient->items[slot].itemnum = id;
	   thisclient->items[slot].itemtype = tipo;
	   thisclient->items[slot].refine = refine;
	   thisclient->items[slot].durability = 50;
	   thisclient->items[slot].lifespan = 100;
	   thisclient->items[slot].count = 1;
	   thisclient->items[slot].stats = stats;
	   thisclient->items[slot].socketed = socket;
	   thisclient->items[slot].appraised = true; 
	   thisclient->items[slot].gem = 0;               
	   BEGINPACKET( pak, 0x7a5);     
	   ADDWORD( pak, thisclient->clientid );
	   ADDWORD( pak, slot);							
	   ADDWORD( pak, id);	// ITEM NUM
	   ADDWORD( pak, BuildItemRefine(  thisclient->items[slot] ));	// REFINE
	   ADDWORD( pak, thisclient->Stats->Move_Speed );	// REFINE 2602	   
	   SendToVisible( &pak,thisclient );        	         
	   
      thisclient->UpdateInventory( slot );	   	   
       thisclient->SetStats( );                                  
		return true;	
    }    
    else if (strcmp(command, "item")==0)//Modified by Hiei (added refine/socket/stats)
    {
         if(Config.Command_Item > thisclient->Session->accesslevel)
	                    return true;
        UINT itemrefine, itemstats, itemls, itemsocket;
        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 : /item %i,%i,%i,%i,%i,%i" , thisclient->CharInfo->charname, itemid, itemtype, itemamount , itemrefine , itemsocket ,itemstats);
        return pakGMItem( thisclient , itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket );        
    }
    else if (strcmp(command, "levelup")==0) 
    {
         if(Config.Command_LevelUp > thisclient->Session->accesslevel)
	            return true;
        Log( MSG_GMACTION, " %s : /levelup" , thisclient->CharInfo->charname);
		thisclient->CharInfo->Exp += thisclient->GetLevelEXP();
	} 
    else if (strcmp(command, "drop")==0) 
    {
         if(Config.Command_Drop > thisclient->Session->accesslevel)
	             return true;
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemtype=atoi(tmp);
		if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemid=atoi(tmp);
        Log( MSG_GMACTION, " %s : /drop %i,%i" , thisclient->CharInfo->charname, itemtype, itemid);

		CDrop* thisdrop = new CDrop;
		assert(thisdrop);
		thisdrop->clientid = GetNewClientID();
		thisdrop->type = 2; 
		thisdrop->pos.x = thisclient->Position->current.x;
		thisdrop->pos.y = thisclient->Position->current.y;
		thisdrop->posMap = thisclient->Position->Map;
		thisdrop->droptime = time(NULL);

		ClearItem(thisdrop->item);
		thisdrop->item.itemnum = itemid;
		thisdrop->item.itemtype = itemtype;
		thisdrop->item.count = 1;
		thisdrop->item.refine = 0;
		thisdrop->item.durability = 35;
		thisdrop->item.lifespan = 100;
		thisdrop->item.appraised = true;
		thisdrop->item.socketed = false;
		thisdrop->item.stats = 0;
		thisdrop->item.gem = 0;

⌨️ 快捷键说明

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