Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 07-18-2011, 08:35 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

You don't need an int64 to hold a color, they are 24 bits and fit just fine in an int.

Try something like this. I didn't compile it, but you should be able to get the idea from it.
Code:
	if(!strcasecmp(sep->arg[1], "armorcolor")) {
		if(c->GetTarget() && c->GetTarget()->IsBot() && (c->GetTarget()->CastToBot()->GetBotOwner() == c)) {
			if(sep->argnum < 6) {
				c->Message(0, "Usage: #bot armorcolor [slot] [red] [green] [blue] - use #bot help armorcolor for info");
				return;
			}

			int setslot = atoi(sep->arg[2]);
			uint8 red = atoi(sep->arg[3];
			uint8 green = atoi(sep->arg[4];
			uint8 blue = atoi(sep->arg[5];
			uint32 setcolor = (red << 16) | (green << 8) || blue;
			//You may not need this, but I believe if a color is set that the top bits must be 0xff
			if(setcolor) {
				setcolor &= (0xff << 24);
			}
		}
A few of other things...

1) Change Bot::GetID to be const, don't make a new function that does exactly the same thing.

2) You don't need to use Bot::GetEquipmentColor() to call your function, just GetEquipmetColor() will call it.

3) You don't need Bot::SendWearChange at all. It's just a copy of Mob::SendWearChange.
Reply With Quote
 


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 04:06 AM.


 

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