Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Room Tag Scanner

Status
Not open for further replies.

Lib

Experienced Elementalist
Joined
Oct 22, 2013
Messages
241
Reaction score
80
Hi,

TagScanner.h
PHP:
////////////////////////////////////////    TagScanner (C) HeroBanana/////////////////////////////////////#include "stdafx.h"
#ifndef _ZTAGSCANNER_H#define _ZTAGSCANNER_H
enum ZTagNames{    ZTN_DMG2 = 0;    ZTN_DMG3,    ZTN_END = 32};
class ZTagScanner {protected:    // Storage Settings;    int nTags[32];    int nNumber[32];    string strOutput;private:    int SetTags(int A, int B, int C = 0)    {           nTags[A] = B;           nNumber[A] = C;    }public:    ZTagScanner() { };    ~ZTagScanner() { };

    bool Find(int A, int B)    {        if (nTags[A] == B)            return true;        else            return false;    }
    int Param(int A)    {        return nNumber[A];    }
    string Output()    {        return strOutput;    }
    bool Create(const char* StageName)    {        char RoomName[STAGENAME_LENGTH];        memcpy(RoomName, StageName, STAGENAME_LENGTH);
        for (int i = 0; i < STAGENAME_LENGTH; i++)        {            RoomName[i] = tolower(RoomName[i]);        }
        for (int i = 0; i < 32; i++)        {            nTags[i] = 0;            nNumber[i] = 0;        }            strOutput = "";
        int nRoomMod = 0;        int nNumber = 0;
        char szPreOutput[512] = "";
#define ADD_ROOMMOD_STR(name)    \        {                                \            strcat(szPreOutput, name);        \            strcat(szPreOutput, " - ");    \            nRoomMod++;                    \        }
#define FINALIZE_ROOMMOD_STR()                    \        {                                                \            int nStrLen = (int) strlen(szPreOutput);        \            static const int nRemoveLen = (int) strlen(" - ");    \            szPreOutput[nStrLen - nRemoveLen] = '\0';        \        }
        if (strstr(RoomName, "[dmg2]"))        {            this->SetTags(ZTN_DMG2, TRUE);            ADD_ROOMMOD_STR("Multiple damage");        }        else        {            this->SetTags(ZTN_DMG2, FALSE);        }
        if (strstr(RoomName, "[dmg3]"))        {            this->SetTags(ZTN_DMG3, TRUE);            ADD_ROOMMOD_STR("Triple damage");        }        else        {            this->SetTags(ZTN_DMG2, FALSE);        }                if (nRoomMod != 0)        {            FINALIZE_ROOMMOD_STR();            char szOutput[1024];            sprintf(szOutput, "[Room Modifiers (%d)] %s", nRoomMod, szPreOutput);            strOutput = szOutput;        }        return true;    }};
#endif
CleanSource:

Install tag scanner (ZGameClient.cpp) (void ZGameClient::OnStageJoin(const MUID& uidChar ....)
PHP:
    char szText[256];    if (uidChar == GetPlayerUID())    {        ZGetGameInterface()->GetChat()->Clear(ZChat::CL_STAGE);
        char szTmp[ 256];        sprintf(szTmp, "(%03d)%s", nRoomNo, szStageName);
        ZTransMsg( szText, MSG_JOINED_STAGE, 1, szTmp);        ZChatOutput(szText, ZChat::CMT_SYSTEM, ZChat::CL_STAGE);
        //Room Tag Scanner         if (ZApplication::GetInstance()->GetTagScanner()->Create(szStageName) == true)        {            ZChatOutput(ZApplication::GetInstance()->GetTagScanner()->Output().c_str(), ZChat::CMT_SYSTEM, ZChat::CL_STAGE);        }    }
CleanSource:


Example of Usage:
PHP:
void ZMyCharacter::OnDamaged(ZObject* pAttacker, rvector srcPos, ZDAMAGETYPE damageType, MMatchWeaponType weaponType, float fDamage, float fPiercingRatio, int nMeleeType){    if (ZApplication::GetInstance()->GetTagScanner()->Find(ZTN_DMG3, TRUE) == true)        ZCharacter::OnDamaged(pAttacker, srcPos, damageType, weaponType, (fDamage*3.f), fPiercingRatio, nMeleeType);    if (ZApplication::GetInstance()->GetTagScanner()->Find(ZTN_DMG2, TRUE) == true)        ZCharacter::OnDamaged(pAttacker, srcPos, damageType, weaponType, (fDamage*2.f), fPiercingRatio, nMeleeType);    else    ZCharacter::OnDamaged(pAttacker, srcPos, damageType, weaponType, fDamage, fPiercingRatio, nMeleeType);
Clean Source:


Note 1: You must declare your own GetTagScanner function / inline void.
Note 2: Use this only if you have many room tags in ur gunz to make sure each in game name would be enabled.

Special Thanks:
To Delpa that wrote the awesome Room Tag String.
To Imback for his awesome support at source coding.
To this community that still is active I really glad to see that.

Cheers,
HeroBanana
 
Last edited:
Newbie Spellweaver
Joined
Oct 22, 2013
Messages
63
Reaction score
2
can you please release somting useful?.... (like some mode..)
 
Skilled Illusionist
Joined
Dec 24, 2011
Messages
356
Reaction score
35
It's Like.
Create Room : [R][IA][V]
Room Modifier[3] : Reload , Infinite Ammo , Vanilla Mode
 

Lib

Experienced Elementalist
Joined
Oct 22, 2013
Messages
241
Reaction score
80
It's Like.
Create Room : [R][IA][V]
Room Modifier[3] : Reload , Infinite Ammo , Vanilla Mode
This true, but most important thing is it install one time each room tag, it's not scanning 100x each second like the most people use at the moment.
 
Junior Spellweaver
Joined
Dec 22, 2012
Messages
171
Reaction score
9
nice i want to try it later but now i cant mAYbe someday
 
Status
Not open for further replies.
Back
Top