Ultimate eRose-EVO Code Changes

Status
Not open for further replies.
i need help here cus u not replying to my PMs so anyway it trys to compile when finished it got 22 errors and wont run so how i fix that u got msn and i send u my worldpackets.cpp and u see
 
@Caali

Just so that we don't have to go through the hastle of adding all that code for GM commands, think you can release your files and give a list of added commands?

And btw, nice work.
 
erm... those gm commands/fixes etc... i already give them you, only thing you need is to follow my commands... if you cant even do THIS, you are not worth using them (my opinion)... sry but... cmon...

btw, here's the list of my gm commands: tell me which you want, ill post it:

Code:
    bool pakGMHelp            ( CWorldClient* thisclient );  //Shows a list of all gm commands
    bool pakGMKick            ( CWorldClient* thisclient, char* name ); //kick a player
    bool pakGMBan            ( CWorldClient* thisclient, char* name ); //ban a player
    bool pakGMInfo            ( CWorldClient* thisclient, char* name ); //info about a player
    bool pakGMLevel            ( CWorldClient* thisclient, unsigned level ); //set your level to
    bool pakGMSetLevel        ( CWorldClient* thisclient, char* name, unsigned level ); //set any player's level to...
    bool pakGMTele            ( CWorldClient* thisclient, int map, float x, float y ); //tele to
    bool pakGMTeleToPlayer    ( CWorldClient* thisclient, char* teleto_name); //tele to any player
    bool pakGMTeleToMe        ( CWorldClient* thisclient, char* teletome_name); //tele any player to you
    bool pakGMMon            ( CWorldClient* thisclient, int montype, int moncount, int range ); //spawn a monster IN A SPECIFIC RANGE
    bool pakGMSetMonSpawn    ( CWorldClient* thisclient, int monid, int moncount, int monrespawntime );
//spawn mobs at your place, and put this into the list_spawnareas
    bool pakGMKillInRange   ( CWorldClient* thisclient, int range ); //lil gm aoe :P
    bool pakGMNpc            ( CWorldClient* thisclient, int npcid ); //spawn a NPC
    bool pakGMAnn            ( CWorldClient* thisclient, CPacket* P ); //make announcement
    bool pakGMClass            ( CWorldClient* thisclient, char* classid ); //change your job (relog needed)
    bool pakGMZuly            ( CWorldClient* thisclient, int zuly ); //set your zuly to...
    bool pakGMItem            ( CWorldClient* thisclient, unsigned itemid, unsigned itemtype, unsigned itemamount ); //add an item to you
    bool pakGMStat            ( CWorldClient* thisclient, char* statname, int statvalue ); //change stats
    bool pakGMWeapon        ( CWorldClient* thisclient, unsigned itemid, unsigned itemrefine, unsigned itemsocket ); //add a weapon
    bool pakGMShutdown        ( ); //save everything and then close the server
    bool pakGMFairy            ( CWorldClient* thisclient, int mode ); //give yourself a buffer fairy
 
Caali,

I am impressed. The following are ones I would like posted:


bool pakGMHelp ( CWorldClient* thisclient ); //Shows a list of all gm commands
bool pakGMInfo ( CWorldClient* thisclient, char* name ); //info about a player
bool pakGMTeleToPlayer ( CWorldClient* thisclient, char* teleto_name); //tele to any player
bool pakGMTeleToMe ( CWorldClient* thisclient, char* teletome_name); //tele any player to you
bool pakGMSetMonSpawn ( CWorldClient* thisclient, int monid, int moncount, int monrespawntime );
//spawn mobs at your place, and put this into the list_spawnareas
bool pakGMKillInRange ( CWorldClient* thisclient, int range ); //lil gm aoe :P
bool pakGMNpc ( CWorldClient* thisclient, int npcid ); //spawn a NPC
bool pakGMClass ( CWorldClient* thisclient, char* classid ); //change your job (relog needed)
bool pakGMShutdown ( ); //save everything and then close the server

I think these are all the ones you have not posted yet, if so, I am very interested in them


Thank you VERY much!!!!!
 
function IsMonInCircle (needed for some of my commands)

OPEN: extrafunctions.cpp

FIND:
Code:
// -----------------------------------------------------------------------------------------
// Get a random point inside a circle
// -----------------------------------------------------------------------------------------
fPoint CWorldServer::RandInCircle( fPoint center, float radius )
{
    fPoint thispoint;
    float angle = (float)(rand() * ( pi * 2 ) / RAND_MAX);
    float distance = (float)sqrt( rand() * 1.0 / RAND_MAX ) * radius;
    thispoint.x = cos(angle) * distance + center.x;
    thispoint.y = sin(angle) * distance + center.y;
    return thispoint;
}
AFTER, ADD:
Code:
// -----------------------------------------------------------------------------------------
// Check if a Monster is in a Circle around a Client with a specific range
// -----------------------------------------------------------------------------------------
bool CWorldServer::IsMonInCircle( CWorldClient* thisclient, CMonster* thismon, float radius )
{
    if ( thisclient->posMap!=thismon->posMap ) return false;

    float dx = ( thisclient->pos.x - thismon->pos.x );
    float dy = ( thisclient->pos.y - thismon->pos.y );

    if ( abs( dx * dx + dy * dy ) < radius * radius ) 
    {
        return true;
    }
    else
    {
        return false;
    }
}
CLOSE: extrafunctions.cpp

OPEN: worldsockets.h
FIND:
Code:
    float AreaOfTriangle(fPoint p1, fPoint p2, fPoint p3);

AFTER, ADD:
Code:
 bool IsMonInCircle(CWorldClient* thisclient, CMonster* thismon, float radius);

CLOSE: worldsockets.h

YOU'RE DONE !
 
/killinrange #radius Command for GMs

NOTE: THIS COMMAND NEEDS THE FUNCTION:
-
IsMonInCircle (ty to Caali)

NOTE: IF YOU TYPE
Code:
/killinrange -1
YOU WILL KILL ALL MOBS ON THE SERVER !

OPEN: gmcmds.cpp
FIND:
Code:
    else if (strcmp(command, "ann")==0) 
     {
          return pakGMAnn(thisclient, P);
     }

AFTER, ADD:
Code:
 else if (strcmp(command, "killinrange")==0)
    {
        if ((tmp = strtok_s(NULL, " ", &next_token))==NULL) return true; unsigned range=atoi(tmp);
        return pakGMKillInRange( thisclient, range );
    }
FIND:
Code:
// -----------------------------------------------------------------------------------------
 // GM: Announcment
 // -----------------------------------------------------------------------------------------
 bool CWorldServer::pakGMAnn( CWorldClient* thisclient, CPacket* P )
 {
     BEGINPACKET( pak, 0x702 );
     ADDSTRING( pak, thisclient->charname );
     ADDSTRING( pak, ": " );
     ADDSTRING( pak, (&P->Buffer[5]) );
     ADDBYTE( pak, 0 );
     SendToAll( &pak );
 
     return true;
 }
AFTER, ADD:
Code:
// -----------------------------------------------------------------------------------------
// GM: Kill all mobs in a range of x-Fields
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakGMKillInRange( CWorldClient* thisclient, int range )
{
    CMonster* thismon;
    for(unsigned j = 0; j < MonsterList . size(); j++) 
    {
        thismon = MonsterList . at(j);
        if ( IsMonInCircle( thisclient, thismon, (float)range ) || range == -1)
        {
            //Kill the mob    
            thismon->currenthp = -1;

            BEGINPACKET( pak, 0x799 );
            ADDWORD( pak, thisclient->clientid );
            ADDWORD( pak, thismon->clientid );
            ADDDWORD( pak, 9999 );
            ADDDWORD( pak, 16 );
            SendToVisible( &pak, thismon );

            // SPAWN A NEW MOBULATE :)
            if (thismon->spawnarea>=0) 
            {
                CSpawnArea* thisspawn = GetSpawnArea( thismon->spawnarea );
                CMonster* thisnewmon = new CMonster;
                    thisnewmon->clientid = GetNewClientID();
                    thisnewmon->currenthp = STB_NPC.rows[thismon->montype][7] * STB_NPC.rows[thismon->montype][8];
                    thisnewmon->nPos = RandInPoly( thisspawn->points, thisspawn->pcount );
                    thisnewmon->pos = thismon->nPos;
                    thisnewmon->montype = thisspawn->montype;
                    thisnewmon->posMap = thisspawn->map;
                    thisnewmon->spawnarea = thisspawn->id;
                    thisnewmon->targetid=0;
                MonsterList.push_back( thisnewmon );
            }

            // CLEAR THE MOB (DISABLED, for now we just assign it a new position)
            for(std::vector<CMonster*>::iterator itvdata = MonsterList.begin(); itvdata != MonsterList.end(); itvdata++) 
            {
                if( (*itvdata)==thismon ) { MonsterList.erase( itvdata ); break; }
            }
            ClearClientID( thismon->clientid );
            delete thismon;
        }
    }
    return true;
}
CLOSE FILE: gmcmds.cpp

OPEN FILE: worldsockets.h

FIND:
Code:
  bool pakGMAnn            ( CWorldClient* thisclient, CPacket* P );

AFTER, ADD:
Code:
    bool pakGMKillInRange   ( CWorldClient* thisclient, int range );
 
Last edited:
caali.. I know you're busy and dont wanna do all of this now but its ok.. if you just could do 1 at a time every now and then once you're bored.. even 1 a day would be good.. but I'd like these following commands:

Code:
    bool pakGMHelp            ( CWorldClient* thisclient );  //Shows a list of all gm commands
    bool pakGMInfo            ( CWorldClient* thisclient, char* name ); //info about a player
    bool pakGMSetLevel        ( CWorldClient* thisclient, char* name, unsigned level ); //set any player's level to...
    bool pakGMTeleToPlayer    ( CWorldClient* thisclient, char* teleto_name); //tele to any player
    bool pakGMTeleToMe        ( CWorldClient* thisclient, char* teletome_name); //tele any player to you
    bool pakGMSetMonSpawn    ( CWorldClient* thisclient, int monid, int moncount, int monrespawntime );
//spawn mobs at your place, and put this into the list_spawnareas
    bool pakGMNpc            ( CWorldClient* thisclient, int npcid ); //spawn a NPC
    bool pakGMClass            ( CWorldClient* thisclient, char* classid ); //change your job (relog needed)
    bool pakGMShutdown        ( ); //save everything and then close the server
    bool pakGMFairy            ( CWorldClient* thisclient, int mode ); //give yourself a buffer fairy

thx in advance.
 
With the killinrange, I copied everything and placed it where it was suppose to go, this MSG_GMACTION came up with an error saying undeclared identifier.

What is missing?
 
i wont give them all at once, lol... e.g. you can write the /gmhelp yourself, just make a 0x702 packet with the avaible commands...
packGMFairy was postet some time ago, use forum search...
ill make a /setnpcspawn #npcid #direction later, for npc place devs :)
tell me the one you want the most, ill post it :P

@rl2171 ops, sry, just remove the Log ( MSG_GMACTION ... line.
i added this to every gm command, so i see which gm uses which command at the server :)
 
Last edited:
lol well the one I want the most is the Class command.

btw: have you fixed the consumeables? and to be able to put gems in your sockets?
 
/class #classname command for GMs

NOTE: You need to relog after chaning your class ! (i didnt find the classchange packet yet >_<)
NOTE: You have to care about uppercase letters ! #classname must be the NAME of the class, for exact names check the code !

OPEN: gmcmds.cpp
FIND:
Code:
 else if (strcmp(command, "ann")==0) 
     {
          return pakGMAnn(thisclient, P);
     }

AFTER, ADD:
Code:
else if (strcmp(command, "class")==0)
    {
        if ((tmp = strtok_s(NULL, " ", &next_token))==NULL) return true; char* classid=(char*)tmp;
        return pakGMClass( thisclient, classid );
    }
FIND:
Code:
 // -----------------------------------------------------------------------------------------
 // GM: Announcment
 // -----------------------------------------------------------------------------------------
 bool CWorldServer::pakGMAnn( CWorldClient* thisclient, CPacket* P )
 {
     BEGINPACKET( pak, 0x702 );
     ADDSTRING( pak, thisclient->charname );
     ADDSTRING( pak, ": " );
     ADDSTRING( pak, (&P->Buffer[5]) );
     ADDBYTE( pak, 0 );
     SendToAll( &pak );
 
     return true;
 }
AFTER, ADD:
Code:
// -----------------------------------------------------------------------------------------
// GM: Change Class
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakGMClass( CWorldClient* thisclient, char* classid )
{
    int classid_new;

    if ( strcmp ( classid , "Visitor" ) == 0)
    {
        classid_new = 0;
    }
    else if ( strcmp ( classid , "Soldier" ) == 0)
    {
        classid_new = 111;
    }
    else if ( strcmp ( classid , "Knight" ) == 0)
    {
        classid_new = 121;
    }
    else if ( strcmp ( classid , "Champion" ) == 0)
    {
        classid_new = 122;
    }
    else if ( strcmp ( classid , "Muse" ) == 0)
    {
        classid_new = 211;
    }
    else if ( strcmp ( classid , "Mage" ) == 0)
    {
        classid_new = 221;
    }
    else if ( strcmp ( classid , "Cleric" ) == 0)
    {
        classid_new = 222;
    }
    else if ( strcmp ( classid , "Hawker" ) == 0)
    {
        classid_new = 311;
    }
    else if ( strcmp ( classid , "Raider" ) == 0)
    {
        classid_new = 321;
    }
    else if ( strcmp ( classid , "Scout" ) == 0)
    {
        classid_new = 322;
    }
    else if ( strcmp ( classid , "Dealer" ) == 0)
    {
        classid_new = 411;
    }
    else if ( strcmp ( classid , "Bourgeois" ) == 0)
    {
        classid_new = 421;
    }
    else if ( strcmp ( classid , "Artisan" ) == 0)
    {
        classid_new = 422;
    }
    else
    {
        return true;
    }
    thisclient->c_classid = classid_new;

    BEGINPACKET( pak, 0x702 );
    ADDSTRING( pak, "Class changed. Please re-login now !" );
    ADDBYTE( pak, 0 );
    thisclient->SendPacket( &pak );    

    return true;
}
CLOSE: gmcmds.cpp

OPEN: worldsockets.h
FIND:
Code:
  [LEFT]bool pakGMAnn            ( CWorldClient* thisclient, CPacket* P );[/LEFT]
AFTER, ADD:
Code:
    bool pakGMClass            ( CWorldClient* thisclient, char* classid );
CLOSE: worldsockets.h

YOU'RE DONE !
 
@rl2171 ops, sry, just remove the Log ( MSG_GMACTION ... line.
i added this to every gm command, so i see which gm uses which command at the server :)


I like that ability. Is there a way to log to a file? Just a thought.

If I want to see what is being used too, what else is needed for the log to work like your?
 
Status
Not open for further replies.
Back