void AddStats(int aIndex) { if (!IsAddCmd) return; cObj->Init(aIndex); if (!strcmpi(Message, "/add")) { MessageOutput(aIndex, "Useage: /add <Type> <Amount>"); MessageOutput(aIndex, "The price for Add is: %d, Maximum stats: %d", AddPrice, AddMax); return; } if (cObj->Money < AddPrice) { MessageOutput(aIndex, "You are lacking zen! %d", AddPrice - cObj->Money); return; } char Param1[100]; memset(Param1, 0x00, 100); GetParam(1, Message, Param1); int AddType = 0; if (!strcmpi(Param1, "str")) AddType = 0xB8; if (!strcmpi(Param1, "agi")) AddType = 0xBA; if (!strcmpi(Param1, "vit")) AddType = 0xBC; if (!strcmpi(Param1, "eng")) AddType = 0xBE; if (!strcmpi(Param1, "cmd")) AddType = 0xD8; if (!AddType) { MessageOutput(aIndex, "You have selected wrong type! The types are: str, agi, vit, eng, cmd"); return; } if (cObj->Class != 4 && AddType == 0xD8) { MessageOutput(aIndex, "Only Dark Lords can use the add cmd type."); return; } char Param2[100]; memset(Param2, 0x00, 100); GetParam(2, Message, Param2); int StatsToAdd = atoi(Param2); if (cObj->LvlUpPoints < StatsToAdd) { MessageOutput(aIndex, "You are lacking level up points! %d", StatsToAdd - cObj->LvlUpPoints); return; } int NowStats = cObj->GetWord(AddType); if ((StatsToAdd + NowStats) > AddMax) { MessageOutput(aIndex, "You are not allowed to add more than %d points!", AddMax); return; } BYTE Packet[5] = {0xC1, 0x05, 0x0F3, 0x06}; Packet[4] = ((AddType % 16) ^ 8) / 2; // Nice algorithm by coNsept to convert from gObj Offsets to the add types :P if (AddType == 0xD8) Packet[4] = 0x04; if (StatsToAdd <= 100) for (int i=0; i<StatsToAdd; i++) CGLevelUpPointAdd(Packet, aIndex); else { int Amount = (cObj->LvlUpPoints - StatsToAdd - 1); cObj->SetInt(0xA4, Amount); cObj->AddInt(AddType, StatsToAdd - 1); CGLevelUpPointAdd(Packet, aIndex); } cObj->SetInt(0xB4, cObj->Money - AddPrice); CGMoneySend(aIndex, cObj->Money - AddPrice); cObj->Init(aIndex); MessageOutput(aIndex, "You've added %d points. You have now %d points left.", StatsToAdd, cObj->LvlUpPoints); if (StatsToAdd > 100) MessageOutput(aIndex, "Please relog and your stats will be updated."); |
1>------ Build started: Project: Snippets, Configuration: Release Win32 ------ 1>Build started 9/13/2012 8:21:14 PM. 1>InitializeBuildStatus: 1> Creating "Release\Snippets.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> Snippets.cpp 1>Snippets.cpp(4): error C2065: 'IsAddCmd' : undeclared identifier 1>Snippets.cpp(5): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(5): error C2227: left of '->Init' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(6): error C2065: 'Message' : undeclared identifier 1>Snippets.cpp(6): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(8): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(9): error C2065: 'AddPrice' : undeclared identifier 1>Snippets.cpp(9): error C2065: 'AddMax' : undeclared identifier 1>Snippets.cpp(9): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(12): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(12): error C2227: left of '->Money' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(12): error C2065: 'AddPrice' : undeclared identifier 1>Snippets.cpp(14): error C2065: 'AddPrice' : undeclared identifier 1>Snippets.cpp(14): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(14): error C2227: left of '->Money' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(14): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(18): error C3861: 'memset': identifier not found 1>Snippets.cpp(19): error C2065: 'Message' : undeclared identifier 1>Snippets.cpp(19): error C3861: 'GetParam': identifier not found 1>Snippets.cpp(21): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(22): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(23): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(24): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(25): error C3861: 'strcmpi': identifier not found 1>Snippets.cpp(28): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(31): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(31): error C2227: left of '->Class' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(33): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(37): error C3861: 'memset': identifier not found 1>Snippets.cpp(38): error C2065: 'Message' : undeclared identifier 1>Snippets.cpp(38): error C3861: 'GetParam': identifier not found 1>Snippets.cpp(39): error C3861: 'atoi': identifier not found 1>Snippets.cpp(40): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(40): error C2227: left of '->LvlUpPoints' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(42): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(42): error C2227: left of '->LvlUpPoints' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(42): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(45): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(45): error C2227: left of '->GetWord' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(46): error C2065: 'AddMax' : undeclared identifier 1>Snippets.cpp(48): error C2065: 'AddMax' : undeclared identifier 1>Snippets.cpp(48): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(51): error C2065: 'BYTE' : undeclared identifier 1>Snippets.cpp(51): error C2146: syntax error : missing ';' before identifier 'Packet' 1>Snippets.cpp(51): error C2065: 'Packet' : undeclared identifier 1>Snippets.cpp(51): error C2059: syntax error : '{' 1>Snippets.cpp(51): error C2143: syntax error : missing ';' before '{' 1>Snippets.cpp(51): error C2143: syntax error : missing ';' before '}' 1>Snippets.cpp(52): error C2065: 'Packet' : undeclared identifier 1>Snippets.cpp(53): error C2065: 'Packet' : undeclared identifier 1>Snippets.cpp(56): error C2065: 'Packet' : undeclared identifier 1>Snippets.cpp(56): error C3861: 'CGLevelUpPointAdd': identifier not found 1>Snippets.cpp(59): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(59): error C2227: left of '->LvlUpPoints' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(60): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(60): error C2227: left of '->SetInt' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(61): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(61): error C2227: left of '->AddInt' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(62): error C2065: 'Packet' : undeclared identifier 1>Snippets.cpp(62): error C3861: 'CGLevelUpPointAdd': identifier not found 1>Snippets.cpp(64): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(64): error C2227: left of '->SetInt' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(64): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(64): error C2227: left of '->Money' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(64): error C2065: 'AddPrice' : undeclared identifier 1>Snippets.cpp(65): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(65): error C2227: left of '->Money' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(65): error C2065: 'AddPrice' : undeclared identifier 1>Snippets.cpp(65): error C3861: 'CGMoneySend': identifier not found 1>Snippets.cpp(66): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(66): error C2227: left of '->Init' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(67): error C2065: 'cObj' : undeclared identifier 1>Snippets.cpp(67): error C2227: left of '->LvlUpPoints' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>Snippets.cpp(67): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(69): error C3861: 'MessageOutput': identifier not found 1>Snippets.cpp(70): fatal error C1075: end of file found before the left brace '{' at 'Snippets.cpp(3)' was matched 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:01.22 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
#include <windows.h>
#include <cstring>