Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2013, 06:08 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default #Lastname Change.

I changed my #lastname so it has almost the full functionality of #title.

Change this in command.cpp (Lines 4203 - 4215):
Code:
void command_lastname(Client *c, const Seperator *sep)
{
        Client *t=c;

        if(c->GetTarget() && c->GetTarget()->IsClient())
                t=c->GetTarget()->CastToClient();
        LogFile->write(EQEMuLog::Normal,"#lastname request from %s for %s", c->GetName(), t->GetName());

        if(strlen(sep->arg[1]) <= 70)
                t->ChangeLastName(sep->arg[1]);
        else
                c->Message(0, "Usage: #lastname <lastname> where <lastname> is less than 70 chars long");
}
To this:
Code:
void command_lastname(Client *c, const Seperator *sep)
{
	Client *t=c;
	if(sep->arg[1][0] == 0)
		c->Message(0, "Usage: #lastname [remove|text] - remove or set lastname to 'text'");
	else
	{
		if(c->GetTarget() && c->GetTarget()->IsClient())
			t=c->GetTarget()->CastToClient();
		else if(c->GetTarget() && !c->GetTarget()->IsClient())
		{
			c->Message(13, "#lastname only works on players.");
			return;
		}
		else if(!c->GetTarget())
		{
			t = c;
		}
		LogFile->write(EQEMuLog::Normal,"#lastname request from %s for %s", c->GetName(), t->GetName());

		if(strlen(sep->arg[1]) <= 70)
			t->ChangeLastName(sep->arg[1]);
		else
			c->Message(0, "Lastname must be 70 characters or less.");
			
		bool removed = false;
		if(!strcasecmp(sep->arg[1], "remove"))
		{
			t->ChangeLastName("");
			removed = true;
		}
		else
		{
			for(unsigned int i = 0; i < strlen(sep->arg[1]); i++)
				if(sep->arg[1][i] == '_')
					sep->arg[1][i] = ' ';
			t->ChangeLastName(sep->arg[1]);
		}
		
		
		if(removed)
		{
			c->Message(13, "%s's lastname has been removed.", t->GetName(), sep->arg[1]);
			if(t != c)
				t->Message(13, "Your lastname has been removed.", sep->arg[1]);
		}
		else
		{
			c->Message(13, "%s's lastname has been changed to '%s'.", t->GetName(), sep->arg[1]);
			if(t != c)
				t->Message(13, "Your lastname has been changed to '%s'.", sep->arg[1]);
		}
	}	
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:00 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3