Subversion Repositories WoWGM

Rev

Rev 7 | Rev 19 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 15
Line 22... Line 22...
22
  ClientServices_Send(&msg);
22
  ClientServices_Send(&msg);
23
  return TRUE;
23
  return TRUE;
24
}
24
}
25
 
25
 
26
//===========================================================================
26
//===========================================================================
-
 
27
BOOL CCommand_CreateItem(char const* command, char const* arguments)
-
 
28
{
-
 
29
	char string[256];
-
 
30
	SStrCopy(string, arguments, 0xffffffff);
-
 
31
	char *token = 0;
-
 
32
	token = strtok(string, " \t");
-
 
33
	int itemId = atoi(token);
-
 
34
	int quantity = 1;
-
 
35
	if (token = strtok(NULL, "\r\n")) {
-
 
36
		quantity = atoi(token);
-
 
37
	}
-
 
38
	CDataStore msg;
-
 
39
	msg.Put(CMSG_CREATEITEM);
-
 
40
	msg.Put(itemId);
-
 
41
	msg.Put(quantity);
-
 
42
	msg.Finalize();
-
 
43
	ClientServices_Send(&msg);
-
 
44
	return TRUE;
-
 
45
}
-
 
46
 
-
 
47
//===========================================================================
27
BOOL CCommand_Learn(const char* command, const char* arguments)
48
BOOL CCommand_Learn(const char* command, const char* arguments)
28
{
49
{
29
	int spellId = 0;
50
	int spellId = 0;
30
	if (isdigit(*arguments)) {
51
	if (isdigit(*arguments)) {
31
		spellId = atoi(arguments);
52
		spellId = atoi(arguments);
Line 56... Line 77...
56
//===========================================================================
77
//===========================================================================
57
void DebugClientCommands::Install()
78
void DebugClientCommands::Install()
58
{
79
{
59
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
80
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
60
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
81
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
-
 
82
  ConsoleCommandRegister("ci",CCommand_CreateItem,GAME,NOHELP);
-
 
83
  ConsoleCommandRegister("createitem",CCommand_CreateItem,GAME,NOHELP);
61
}
84
}
62
 
85
 
63
//===========================================================================
86
//===========================================================================
64
void DebugClientCommands::Uninstall()
87
void DebugClientCommands::Uninstall()
65
{
88
{
66
  ConsoleCommandUnregister("bootme");
89
  ConsoleCommandUnregister("bootme");
67
  ConsoleCommandUnregister("learn");
90
  ConsoleCommandUnregister("learn");
-
 
91
  ConsoleCommandUnregister("ci");
-
 
92
  ConsoleCommandUnregister("createitem");
68
}
93
}