Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2009, 12:08 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default Variation for #showstats

As you know #showstats allows you to see exact server stats for player or npc. Some servers even allowed this command to be used by players in order to find out their own exact stats or their pets. (/pet report just doesn't give much info)

I do want players to be able to see own or exact pet stats, but I realy do not want them to use this command to look at mobs or other players.

Is it posible to make a minor version of this command which can ONLY be used on self or own pet? Like #mystats - give players stat when player targets self, or pet's stats if pet is targeted, but will not give any info if you target other players, other player's pets, or mobs.

What you think?
Reply With Quote
  #2  
Old 07-06-2009, 01:27 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Should be pretty easy to do. Just copy the #showstats command, but add 2 checks: 1 to see if the target is your pet, and another to see if your target is you. If not, it will default to you.

Here's the current #showstats command code from zone/command.cpp:
Code:
void command_showstats(Client *c, const Seperator *sep)
{
	if (c->GetTarget() != 0 )
		c->GetTarget()->ShowStats(c);
	else
		c->ShowStats(c);
}
You can change the first if statement to check if the target is your pet (not sure what the function is off the top of my head, something like IsPet()). The else should be able to stay the same.

Methinks this might be a good time to learn you some coding
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 07-06-2009, 01:43 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Hey you are the briliant coder, I am just the ideas generator =P
One day I will actualy sit down and start looking at the source... but it will be a while before I get there - I am desperatly trying to complite my custom DB content first.
Plus I am hoping to convince you guys to make this part of official code (not just a custom insert)
Reply With Quote
  #4  
Old 07-06-2009, 02:44 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
Hey you are the briliant coder
Now I dunno about all that...

But seriously, this is a pretty straightforward change (basically just need to dig through the code a bit, which is a heck of a lot easier to do with Visual Studio), so I think it would be a good chance to get your feet wet. Plus, it should help with learning how to do (at the least) some of the small tweaks.

That, and I'm feeling kinda lazy right now
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #5  
Old 07-06-2009, 05:22 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

I was thinking about this the other day for my server as well. I'm not a coder either but I figured I'd give something simple like this a shot. This is what I came up with, I'm not sure if I have the checks right...but I figure it should be in the ballpark. Let me know if it looks ok, I can't compile and test it just yet.


Code:
command_add("mystats","- Show details about you or your pet",50,command_mystats) ||
Code:
void command_mystats(Client *c, const Seperator *sep)
{
	if (c->GetTarget() != 0 )
		c->GetTarget()->IsPet()->IsClient()->ShowStats(c);
	else if (!c->GetTarget()->IsClient()->IsPet())
		c->Message(0, "This command only works on players and pets.");
	else
		c->ShowStats(c);
}
Reply With Quote
  #6  
Old 07-06-2009, 09:01 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

Yeah, so that definitely didn't work. I figured it out though. Not bad for my first attempt at doing anything with the code. However, as far as keeping it to your own stats I couldn't figure out how to do that. This atleast allows it to only work on clients and pets, which for me is the biggest thing.

SQL:

Code:
INSERT INTO commands VALUES ('mystats', '0', 'Allows player to view pet and client stats, but not npc');
File changes:

Code:
command.h
---------------

ADD

void command_mystats(Client *c, const Seperator *sep);

AFTER

void command_showstats(Client *c, const Seperator *sep);
Code:
command.cpp
----------------

ADD
		command_add("mystats","- Show details about you or your pet",50,command_mystats) ||

AFTER

		command_add("showstats","- Show details about you or your target",50,command_showstats) ||


ADD

void command_mystats(Client *c, const Seperator *sep)
{
	if (c->GetTarget() != 0 )
		if (c->GetTarget()->IsClient())
		c->GetTarget()->ShowStats(c);
	else if (c->GetTarget()->IsPet())
		c->GetTarget()->ShowStats(c);
	else
		c->ShowStats(c);
}


AFTER

void command_showstats(Client *c, const Seperator *sep)
{
	if (c->GetTarget() != 0 )
		c->GetTarget()->ShowStats(c);
	else
		c->ShowStats(c);
}
Reply With Quote
  #7  
Old 07-06-2009, 09:57 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

nice =)
I hope this will make it into the main source
Reply With Quote
  #8  
Old 07-10-2009, 06:36 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I added this into R762 on the SVN. I made a slight modification to it so that it only works on the client itself or on it's own pet and nothing else. Seems to work just fine now.

Code:
void command_mystats(Client *c, const Seperator *sep)
{
	if (c->GetTarget() && c->GetPet()) {
		if (c->GetTarget()->IsPet() && c->GetTarget() == c->GetPet())
			c->GetTarget()->ShowStats(c);
		else
			c->ShowStats(c);
	}
	else
		c->ShowStats(c);
}
Thanks for bringing this up, as it is something I have been meaning to add for a while, and just hadn't looked into adding yet. ChaosSlayer was bugging me about it, so I spent a couple minutes looking into it and it was quite simple and quick to do :P
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #9  
Old 07-10-2009, 09:40 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

hey, technicly I wasn't bugging you - I seduced you on the very fist atempt =P
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 10:23 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3