[src] Npc Kill Logger

Codes already submitted by people of the forums.
Post Reply
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Well, this code will create a new file for your players where it will log every kill, for every NPC type. If file already exists, it will load it and increase the amount of kills you already have. Won't take you more than 2 minutes to add this code to your server.

I'll add commands (/killcount slime, /killcount troll...) to check the amount of kills for every npc this weekend, i have no time now. Making Some PHPs for displaying the Players kills, top xxx monster killer... If you need some specific code / phpscript, just ask, and i'll see if i can help.


Create a new directory in your HB Server Root called NpcKillLogs. Then open your Visual Studio :)

<span style='color:red'>OPEN CLIENT.H</span>

ADD

Code: Select all

// NPC Kill Log By Diuuude
	int m_iSlimeKillCount, m_iRabbitKillCount, m_iCatKillCount, m_iGiantAntKillCount, m_iAmphisKillCount, m_iOrcKillCount, m_iDummyKillCount;
	int m_iAttackDummyKillCount, m_iZombieKillCount, m_iScorpionKillCount, m_iSkeletonKillCount, m_iOrcMageKillCount, m_iClayGolemKillCount;
	int m_iStoneGolemKillCount, m_iHellboundKillCount, m_iGiantFrogKillCount, m_iRudolphKillCount, m_iTrollKillCount, m_iCyclopsKillCount;
	int m_iIceGolemKillCount, m_iBeholderKillCount, m_iCannibalPlantKillCount, m_iOrgeKillCount, m_iMountainGiantKillCount, m_iDireBoarKillCount;
	int m_iTentocleKillCount, m_iGiantCrayfishKillCount, m_iGiantPlantKillCount, m_iLicheKillCount, m_iStalkerKillCount, m_iWerewolfKillCount;
	int m_iDarkElfKillCount, m_iFrostKillCount, m_iClawTurtleKillCount, m_iBarlogKillCount, m_iEttinKillCount, m_iDemonKillCount;
	int m_iUnicornKillCount, m_iGagoyleKillCount, m_iCentaurusKillCount, m_iGiantLizardKillCount, m_iMasterMageOrcKillCount, m_iMinotaursKillCount;
	int m_iNizieKillCount, m_iHellclawKillCount, m_iTigerwormKillCount, m_iWyvernKillCount, m_iFireWyvernKillCount, m_iAbaddonKillCount, m_iCropsKillCount;
<span style='color:red'>OPEN CLIENT.CPP</span>

FIND

Code: Select all

m_bIsBeingResurrected = FALSE;
	m_bMagicConfirm = FALSE;
	m_bMagicItem = FALSE;
	m_iSpellCount = 0;
	m_bMagicPauseTime = FALSE;
AFTER ADD

Code: Select all

// NPC Kill Log by Diuuude
m_iSlimeKillCount = 0;
	m_iRabbitKillCount = 0;
	m_iCatKillCount = 0;
	m_iGiantAntKillCount = 0;
	m_iAmphisKillCount = 0;
	m_iOrcKillCount = 0;
	m_iDummyKillCount = 0;
	m_iAttackDummyKillCount = 0;
	m_iZombieKillCount = 0;
	m_iScorpionKillCount = 0;
	m_iSkeletonKillCount = 0;
	m_iOrcMageKillCount = 0;
	m_iClayGolemKillCount = 0;
	m_iStoneGolemKillCount = 0;
	m_iHellboundKillCount = 0;
	m_iGiantFrogKillCount = 0;
	m_iRudolphKillCount = 0;
	m_iTrollKillCount = 0;
	m_iCyclopsKillCount = 0;
	m_iIceGolemKillCount = 0;
	m_iBeholderKillCount = 0;
	m_iCannibalPlantKillCount = 0;
	m_iOrgeKillCount = 0;
	m_iMountainGiantKillCount = 0;
	m_iDireBoarKillCount = 0;
	m_iTentocleKillCount = 0;
	m_iGiantCrayfishKillCount = 0;
	m_iGiantPlantKillCount = 0;
	m_iLicheKillCount = 0;
	m_iStalkerKillCount = 0;
	m_iWerewolfKillCount = 0;
	m_iDarkElfKillCount = 0;
	m_iFrostKillCount = 0;
	m_iClawTurtleKillCount = 0;
	m_iBarlogKillCount = 0;
	m_iEttinKillCount = 0;
	m_iDemonKillCount = 0;
	m_iUnicornKillCount = 0;
	m_iGagoyleKillCount = 0;
	m_iCentaurusKillCount = 0;
	m_iGiantLizardKillCount = 0;
	m_iMasterMageOrcKillCount = 0;
	m_iMinotaursKillCount = 0;
	m_iNizieKillCount = 0;
	m_iHellclawKillCount = 0;
	m_iTigerwormKillCount = 0;
	m_iWyvernKillCount = 0;
	m_iFireWyvernKillCount = 0;
	m_iAbaddonKillCount = 0;
	m_iCropsKillCount = 0;
<span style='color:red'>OPEN GAME.H</span>

ADD

Code: Select all

	// NPC Kill Log By Diuuude
	void ReadNpcKillLogFile(char * cPlayer, int iClientH);
	void SaveNpcKillLogFile(char * cPlayer, int iClientH);
<span style='color:red'>OPEN GAME.CPP</span>

ADD

Code: Select all

// NPC Kill Log by Diuuude
void CGame::ReadNpcKillLogFile(char * cPlayer, int iClientH) 
{ 
   FILE * pFile; 
   HANDLE hFile; 
   DWORD  dwFileSize; 
   char * cp, * token, cReadMode;
   char cFn[120], cTxt[120]; 
   char seps[] = "= \t\n"; 
   class CStrTok * pStrTok; 

   cReadMode = 0; 

   strcpy (cFn,"..\\..\\NpcKillLogs\\");
   strcat (cFn,cPlayer);
   strcat (cFn,".txt");

   hFile = CreateFile(cFn, GENERIC_READ, NULL, NULL, OPEN_EXISTING, NULL, NULL); 
   dwFileSize = GetFileSize(hFile, NULL); 
   if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile); 

   pFile = fopen(cFn, "rt"); 
   if (pFile == NULL) {  
      return; 
   } 
   else { 
      cp = new char[dwFileSize+2]; 
      ZeroMemory(cp, dwFileSize+2); 
      fread(cp, dwFileSize, 1, pFile); 

      pStrTok = new class CStrTok(cp, seps); 
      token = pStrTok->pGet(); 
      //token = strtok( cp, seps );    
      while( token != NULL )   { 

         if (cReadMode != 0) { 
            switch (cReadMode) { 

            case 1: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iSlimeKillCount = atoi(token); 
               }
               cReadMode = 0; 
               break; 
            case 2: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iRabbitKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 3: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iCatKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 4: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGiantAntKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 5: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iAmphisKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 6: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iOrcKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 7: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iDummyKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 8: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iAttackDummyKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 9: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iZombieKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 10: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iScorpionKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 11: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iSkeletonKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 12: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iOrcMageKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 13: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iClayGolemKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 14: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iStoneGolemKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 15: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iHellboundKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 16: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGiantFrogKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 17: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iRudolphKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 18: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iTrollKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 19: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iCyclopsKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 20: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iIceGolemKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 21: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iBeholderKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 22: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iCannibalPlantKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 23: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iOrgeKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 24: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iMountainGiantKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 25: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iDireBoarKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 26: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iTentocleKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 27: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGiantCrayfishKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 28: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGiantPlantKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 29: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iLicheKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 30: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iStalkerKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 31: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iWerewolfKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 32: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iDarkElfKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 33: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iFrostKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 34: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iClawTurtleKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 35: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iBarlogKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 36: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iEttinKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 37: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iDemonKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 38: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iUnicornKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 39: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGagoyleKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 40: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iCentaurusKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 41: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iGiantLizardKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 42: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iMasterMageOrcKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 43: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iMinotaursKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 44: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iNizieKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 45: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iHellclawKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 46: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iTigerwormKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 47: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iWyvernKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 48: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iFireWyvernKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 49: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iAbaddonKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
            case 50: 
               if ((strlen(token) != 0) && (strlen(token) <= 10000) && (strlen(token) >= 1)) 
               { 
                  m_pClientList[iClientH]->m_iCropsKillCount = atoi(token); 
               } 
               cReadMode = 0; 
               break; 
              }
         } 
         else { 
            if (memcmp(token, "Slime"  , 5) == 0)   cReadMode = 1;
            if (memcmp(token, "Rabbit"  , 6) == 0)   cReadMode = 2;
            if (memcmp(token, "Cat"  , 3) == 0)   cReadMode = 3; 
            if (memcmp(token, "Giant-Ant"  , 9) == 0)   cReadMode = 4; 
            if (memcmp(token, "Amphis"  , 6) == 0)   cReadMode = 5; 
            if (memcmp(token, "Orc"  , 3) == 0)   cReadMode = 6; 
            if (memcmp(token, "Dummy"  , 5) == 0)   cReadMode = 7; 
            if (memcmp(token, "Attack-Dummy"  , 12) == 0)   cReadMode = 8; 
            if (memcmp(token, "Zombie"  , 6) == 0)   cReadMode = 9; 
            if (memcmp(token, "Scorpion"  , 8) == 0)   cReadMode = 10; 
            if (memcmp(token, "Skeleton"  , 8) == 0)   cReadMode = 11; 
            if (memcmp(token, "Orc-Mage"  , 8) == 0)   cReadMode = 12; 
            if (memcmp(token, "Clay-Golem"  , 10) == 0)   cReadMode = 13; 
            if (memcmp(token, "Stone-Golem"  , 11) == 0)   cReadMode = 14;
            if (memcmp(token, "Hellbound"  , 9) == 0)   cReadMode = 15; 
            if (memcmp(token, "Giant-Frog"  , 10) == 0)   cReadMode = 16; 
            if (memcmp(token, "Rudolph"  , 7) == 0)   cReadMode = 17;
            if (memcmp(token, "Troll"  , 5) == 0)   cReadMode = 18; 
            if (memcmp(token, "Cyclops"  , 7) == 0)   cReadMode = 19; 
            if (memcmp(token, "Ice-Golem"  , 9) == 0)   cReadMode = 20; 
  	if (memcmp(token, "Beholder"  , 8) == 0)   cReadMode = 21;
  	if (memcmp(token, "Cannibal-Plant"  , 14) == 0)   cReadMode = 22;
  	if (memcmp(token, "Orge"  , 4) == 0)   cReadMode = 23;
  	if (memcmp(token, "Mountain-Giant"  , 14) == 0)   cReadMode = 24;
  	if (memcmp(token, "DireBoar"  , 8) == 0)   cReadMode = 25;
  	if (memcmp(token, "Tentocle"  , 8) == 0)   cReadMode = 26;
  	if (memcmp(token, "Giant-Crayfish"  , 14) == 0)   cReadMode = 27;
  	if (memcmp(token, "Giant-Plant"  , 11) == 0)   cReadMode = 28;
  	if (memcmp(token, "Liche"  , 5) == 0)   cReadMode = 29;
  	if (memcmp(token, "Stalker"  , 7) == 0)   cReadMode = 30;
  	if (memcmp(token, "WereWolf"  , 8) == 0)   cReadMode = 31;
  	if (memcmp(token, "Dark-Elf"  , 8) == 0)   cReadMode = 32;
  	if (memcmp(token, "Frost"  , 5) == 0)   cReadMode = 33;
  	if (memcmp(token, "Claw-Turtle"  , 11) == 0)   cReadMode = 34;
  	if (memcmp(token, "Barlog"  , 6) == 0)   cReadMode = 35;
  	if (memcmp(token, "Ettin"  , 5) == 0)   cReadMode = 36;
  	if (memcmp(token, "Demon"  , 5) == 0)   cReadMode = 37;
  	if (memcmp(token, "Unicorn"  , 7) == 0)   cReadMode = 38;
  	if (memcmp(token, "Gagoyle"  , 7) == 0)   cReadMode = 39;
  	if (memcmp(token, "Centaurus"  , 9) == 0)   cReadMode = 40;
  	if (memcmp(token, "Giant-Lizard"  , 12) == 0)   cReadMode = 41;
  	if (memcmp(token, "MasterMage-Orc"  , 12) == 0)   cReadMode = 42;
  	if (memcmp(token, "Minotaurs"  , 9) == 0)   cReadMode = 43;
  	if (memcmp(token, "Nizie"  , 5) == 0)   cReadMode = 44;
  	if (memcmp(token, "Hellclaw"  , 8) == 0)   cReadMode = 45;
  	if (memcmp(token, "Tigerworm"  , 9) == 0)   cReadMode = 46;
  	if (memcmp(token, "Wyvern"  , 6) == 0)   cReadMode = 47;
  	if (memcmp(token, "Fire-Wyvern"  , 11) == 0)   cReadMode = 48;
  	if (memcmp(token, "Abaddon"  , 7) == 0)   cReadMode = 49;
  	if (memcmp(token, "Crops"  , 5) == 0)   cReadMode = 50;
         } 

         token = pStrTok->pGet(); 
         //token = strtok( NULL, seps ); 
      } 

      delete pStrTok; 
      delete cp; 
   } 
   if (pFile != NULL) fclose(pFile); 

   wsprintf(cTxt, "(*) Loaded NPC Kill LogFile for Player: (%s)", cPlayer); 
   PutLogList(cTxt);

   return; 
} 
ADD

Code: Select all

// NPC Kill Log By Diuuude
void CGame::SaveNpcKillLogFile(char * cPlayer, int iClientH)
{
 FILE * pFile;
 HANDLE hFile;
 DWORD  dwFileSize;
 char cFn[120];
 char cBuffer[10];
 char cFn2[1200];
 char cTxt[120];
	
	strcpy (cFn,"..\\..\\NpcKillLogs\\");
    strcat (cFn,cPlayer);
    strcat (cFn,".txt");

	hFile = CreateFile(cFn, GENERIC_READ, NULL, NULL, OPEN_EXISTING, NULL, NULL); 
    dwFileSize = GetFileSize(hFile, NULL); 
    if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile); 

    pFile = fopen(cFn, "wt"); 
    if (pFile == NULL) {  
      return; 
    } 
	
	strcpy(cFn2, "Slime = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iSlimeKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Rabbit = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iRabbitKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Cat = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iCatKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Giant-Ant = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGiantAntKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Amphis = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iAmphisKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Orc = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iOrcKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Dummy = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iDummyKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Atack-Dummy = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iAttackDummyKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Zombie = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iZombieKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Scorpion = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iScorpionKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Skeleton = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iSkeletonKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Orc-Mage = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iOrcMageKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Clay-Golem = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iClayGolemKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Stone-Golem = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iStoneGolemKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Hellbound = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iHellboundKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Giant-Frog = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGiantFrogKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Rudolph = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iRudolphKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Troll = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iTrollKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Cyclops = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iCyclopsKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Ice-Golem = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iIceGolemKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Beholder = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iBeholderKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Cannibal-Plant = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iCannibalPlantKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Orge = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iOrgeKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Mountain-Giant = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iMountainGiantKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "DireBoar = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iDireBoarKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Tentocle = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iTentocleKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Giant-Crayfish = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGiantCrayfishKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Giant-Plant = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGiantPlantKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Liche = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iLicheKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Stalker = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iStalkerKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "WereWolf = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iWerewolfKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Dark-Elf = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iDarkElfKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Frost = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iFrostKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Claw-Turtle = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iClawTurtleKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Barlog = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iBarlogKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Ettin = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iEttinKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Demon = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iDemonKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Unicorn = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iUnicornKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Gagoyle = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGagoyleKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Centaurus = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iCentaurusKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Giant-Lizard = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iGiantLizardKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "MasterMage-Orc = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iMasterMageOrcKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Minotaurs = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iMinotaursKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Nizie = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iNizieKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Hellclaw = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iHellclawKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Tigerworm = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iTigerwormKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Wyvern = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iWyvernKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Fire-Wyvern = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iFireWyvernKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Abaddon = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iAbaddonKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	strcat(cFn2, "Crops = ");
	wsprintf(cBuffer, "%d", m_pClientList[iClientH]->m_iCropsKillCount);
	strcat (cFn2, cBuffer);
    strcat (cFn2,"\n");
	fwrite(cFn2, 1, strlen(cFn2), pFile);

	fclose(pFile);

	wsprintf(cTxt, "(*) Saved NPC Kill LogFile for Player: (%s)", cPlayer); 
	PutLogList(cTxt);
}
Read The Next Post...
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Ok, here is the next Step, still in GAME.CPP

GO TO FUNCTION

Code: Select all

CGame::NpcKilledHandler()
FIND IN FUNCTION

Code: Select all

// v1.41 Ư¼ö¸ó½ºÅÃ￾°¡ Ã￾×¾úÀ» °æ¿ìÀÇ ó¸® 
	if (cAttackerType == DEF_OWNERTYPE_PLAYER) {
  switch (m_pNpcList[iNpcH]->m_sType) {
  case 32:
  	// À¯´Ã￾ÄÜÀÌ Ã￾×¾ú´Ù. Ã￾×ÀÎ ÀÚ¿¡°Ô Æä³ÎƼ¸¦ ¹°¸°´Ù. 
  	m_pClientList[sAttackerH]->m_iRating -= 5;
  	if (m_pClientList[sAttackerH]->m_iRating < -10000) m_pClientList[sAttackerH]->m_iRating = 0;
  	if (m_pClientList[sAttackerH]->m_iRating >  10000) m_pClientList[sAttackerH]->m_iRating = 0;
  	break;

  case 33:
  	break;
  }
	}
AFTER ADD

Code: Select all

// NPC Kill Log By Diuuude 
	if (cAttackerType == DEF_OWNERTYPE_PLAYER) {
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Slime", 5) == 0) m_pClientList[sAttackerH]->m_iSlimeKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Rabbit", 6) == 0) m_pClientList[sAttackerH]->m_iRabbitKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Cat", 3) == 0) m_pClientList[sAttackerH]->m_iCatKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Giant-Ant", 9) == 0) m_pClientList[sAttackerH]->m_iGiantAntKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Amphis", 6) == 0) m_pClientList[sAttackerH]->m_iAmphisKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Orc", 3) == 0) m_pClientList[sAttackerH]->m_iOrcKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Dummy", 5) == 0) m_pClientList[sAttackerH]->m_iDummyKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Attack-Dummy", 12) == 0) m_pClientList[sAttackerH]->m_iAttackDummyKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Zombie", 6) == 0) m_pClientList[sAttackerH]->m_iZombieKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Scorpion", 8) == 0) m_pClientList[sAttackerH]->m_iScorpionKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Skeleton", 8) == 0) m_pClientList[sAttackerH]->m_iSkeletonKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Orc-Mage", 8) == 0) m_pClientList[sAttackerH]->m_iOrcMageKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Clay-Golem", 10) == 0) m_pClientList[sAttackerH]->m_iClayGolemKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Stone-Golem", 11) == 0) m_pClientList[sAttackerH]->m_iStoneGolemKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Hellbound", 9) == 0) m_pClientList[sAttackerH]->m_iHellboundKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Giant-Frog", 10) == 0) m_pClientList[sAttackerH]->m_iGiantFrogKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Rudolph", 7) == 0) m_pClientList[sAttackerH]->m_iRudolphKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Troll", 5) == 0) m_pClientList[sAttackerH]->m_iTrollKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Cyclops", 7) == 0) m_pClientList[sAttackerH]->m_iCyclopsKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Ice-Golem", 9) == 0) m_pClientList[sAttackerH]->m_iIceGolemKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Beholder"  , 8) == 0) m_pClientList[sAttackerH]->m_iBeholderKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Cannibal-Plant"  , 14) == 0) m_pClientList[sAttackerH]->m_iCannibalPlantKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Orge"  , 4) == 0) m_pClientList[sAttackerH]->m_iOrgeKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Mountain-Giant"  , 14) == 0) m_pClientList[sAttackerH]->m_iMountainGiantKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "DireBoar"  , 8) == 0) m_pClientList[sAttackerH]->m_iDireBoarKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Tentocle"  , 8) == 0) m_pClientList[sAttackerH]->m_iTentocleKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Giant-Crayfish"  , 14) == 0) m_pClientList[sAttackerH]->m_iGiantCrayfishKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Giant-Plant"  , 11) == 0) m_pClientList[sAttackerH]->m_iGiantPlantKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Liche"  , 5) == 0) m_pClientList[sAttackerH]->m_iLicheKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Stalker"  , 7) == 0) m_pClientList[sAttackerH]->m_iStalkerKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "WereWolf"  , 8) == 0) m_pClientList[sAttackerH]->m_iWerewolfKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Dark-Elf"  , 8) == 0) m_pClientList[sAttackerH]->m_iDarkElfKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Frost"  , 5) == 0) m_pClientList[sAttackerH]->m_iFrostKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Claw-Turtle"  , 11) == 0) m_pClientList[sAttackerH]->m_iClawTurtleKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Barlog"  , 6) == 0) m_pClientList[sAttackerH]->m_iBarlogKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Ettin"  , 5) == 0) m_pClientList[sAttackerH]->m_iEttinKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Demon"  , 5) == 0) m_pClientList[sAttackerH]->m_iDemonKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Unicorn"  , 7) == 0) m_pClientList[sAttackerH]->m_iUnicornKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Gagoyle"  , 7) == 0) m_pClientList[sAttackerH]->m_iGagoyleKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Centaurus"  , 9) == 0) m_pClientList[sAttackerH]->m_iCentaurusKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Giant-Lizard"  , 12) == 0) m_pClientList[sAttackerH]->m_iGiantLizardKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "MasterMage-Orc"  , 14) == 0) m_pClientList[sAttackerH]->m_iMasterMageOrcKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Minotaurs"  , 9) == 0) m_pClientList[sAttackerH]->m_iMinotaursKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Nizie"  , 5) == 0) m_pClientList[sAttackerH]->m_iNizieKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Hellclaw"  , 8) == 0) m_pClientList[sAttackerH]->m_iHellclawKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Tigerworm"  , 9) == 0) m_pClientList[sAttackerH]->m_iTigerwormKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Wyvern"  , 6) == 0) m_pClientList[sAttackerH]->m_iWyvernKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Fire-Wyvern"  , 11) == 0) m_pClientList[sAttackerH]->m_iFireWyvernKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Abaddon"  , 7) == 0) m_pClientList[sAttackerH]->m_iAbaddonKillCount += 1;
  if (memcmp(m_pNpcList[iNpcH]->m_cNpcName, "Crops"  , 5) == 0) m_pClientList[sAttackerH]->m_iCropsKillCount += 1;
	}
GO TO FUNCTION

Code: Select all

CGame::InitPlayerData()
ADD, JUST BEFORE THE LAST return;

Code: Select all

// NPC Kill Log By Diuuude
ReadNpcKillLogFile(m_pClientList[iClientH]->m_cCharName, iClientH);
GO TO FUNCTION

Code: Select all

CGame::NpcKilledHandler()
FIND IN FUNCTION

Code: Select all

if (m_pClientList[iClientH] == NULL) return;
BEFORE, ADD

Code: Select all

SaveNpcKillLogFile(m_pClientList[iClientH]->m_cCharName, iClientH);

Should compile without any errors or warnings. I hope it will be usefull to anyone, even without the php scripts...
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

nice code, will work well if used for like abaddons, wyverns, HC and TW and such but wont logging that much data add alot more lag to a server? because thats alot of monsters killed per second if you think about it, like people killing scorps with es and such, Im not dissing the code cuz I really like it, just wondering about how much that could decrease proformance
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

You can modify it to log the BOSS only.

Nice work.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

good job i might use it for boss and high lvl mosnters
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

locobans wrote: You can modify it to log the BOSS only.

Nice work.
yea like I said I would probably only use it for boss monsters...atleast I think I said that, but I was just saying it probably wouldnt be a smart idea to log everything but it was a really smart idea to log NPC deaths, mainly abaddons and stuff to make sure u dont have any security leaks :P
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
RageIlluminati
Outpost bitch
Posts: 559
Joined: Wed Mar 30, 2005 6:45 am

Post by RageIlluminati »

mhm.. doesnt it make server laggy? extra memory needed and extra I/O and extra space on HDD..

wouldn't it be nice.. if you could turn this feature on/off from settings.cfg

and I looked this code... didn't understand.. is it dynamical.. I mean does it read all NPC's from npc.cfg.. or hardcoded?

but nice work...
<img src='http://helbreath.pri.ee/userbars/hbest-gamemaster2.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/hbsoccer-owner.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/scorpa-rider.jpg' border='0' alt='user posted image' /> <img src='http://helbreath.pri.ee/userbars/logout-master.jpg' border='0' alt='user posted image' /> <br>.<br>................................Ego sum Rage, flagellum Dei!<br><br>The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? (bash.org)
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

Works like this :

Load the txt file (charname.txt) with npc kill count when init the player data.

Increase the values of the npc kill count on every NPC dead.

Save the file when client Logout / change HG


I don't think it would make the server lag because it save the file only once and for example, the skill SSN read the attacks data on every hit without lag... This code read only the npc dead and then increse some vars (like the skill SSN but read infos less often).


If you want it fot working only with boss monsters, you"ll have to delete some code.
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

this is for when player kills monster or if monster kills player?
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

When you kill a monster (for example a Demon), it will increase the demonkillcount value by 1, and when you logout, the server save it into a file (NpcKillLogs/charname.txt). The fille looks like this

Slime = xxx
Skeleton = xxx
Demon = xxx

Then when you login, the server will load your file and still increase your stats when you kill monsters. If your player don't have a file already created, the server will create one only when you'll log out. The values for each monster kill count are set to 0 in the CCLient class so it won't crash the server if someone logs in without having already a Kill logfile.


I'll add some stuff in the settings.cfg File to select the npc to log (all, mighty, boss) and another to set the logging ON / OFF.

I had an idea for events, create a command for GMS to set it ON /OFF in game, then the players must kill the most npc they can. With a PHP Script, you can check the logs and then give points for each monster and a prize in game (exp, gold, item...).

No time for now but i'll write down any idea you'll have for using it.
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Post Reply