Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-01-2013, 07:05 AM
kmra247
Sarnak
 
Join Date: Apr 2012
Posts: 55
Default Stats Calculator.

All right, so I'm wanting to set up a stats calculator, but my only issue you is it won't calculate Mana or Health, all the other things work, when I put this two in it refuses to tell you anything, will post current code below that works.

Code:
sub EVENT_SAY 
{

	my $stats = quest::saylink("stats", 1);

		
    if($text=~/hail/i) 
    {
	quest::say("Hey there $name, I'm really good at guessing your $stats. Go on, try me!");
    } 
    elsif($text=~/stats/i) 
	{
		$str = $client->GetSTR();
		$sta = $client->GetSTA();
		$agi = $client->GetAGI();
		$dex = $client->GetDEX();
		$wis = $client->GetWIS();
		$intel = $client->GetINT();
		$cha = $client->GetCHA();
		$ac = $client->GetAC();
		$atk = $client->GetATK();;
		quest::say("$name: AC: $ac ATK: $atk");
		quest::say("$name: Str: $str Sta: $sta Agi: $agi");
		quest::say("$name: Dex: $dex Wis: $wis Int: $intel Cha: $cha ");
	}
}
Reply With Quote
  #2  
Old 01-01-2013, 07:13 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Show us what you tried. There are GetMana() and GetHP() functions exported to perl.
Reply With Quote
  #3  
Old 01-01-2013, 07:24 AM
kmra247
Sarnak
 
Join Date: Apr 2012
Posts: 55
Default

I tried $client->GetMaxHP and $client->GetMP.

Code:
$hp = $client->GetMaxHP();
$mana = $client->GetMP();
Reply With Quote
  #4  
Old 01-01-2013, 07:40 AM
kmra247
Sarnak
 
Join Date: Apr 2012
Posts: 55
Default

Would there happen to be a list of the things for "$client->" anywhere?

Edit: Found a list I believe, http://www.eqemulator.net/wiki/wikka...a=QuestObjects.

Edit 2: In that url it lists GetHP();,GetMana();, GetMaxHP();, GetMaxMana();, so I don't understand why it wouldn't work, will test and see if it works.

Edit 3: Works.
Reply With Quote
  #5  
Old 01-01-2013, 01:08 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 966
Default

Is this just for display? You can give everyone access to #mystats
Reply With Quote
  #6  
Old 01-01-2013, 01:12 PM
kmra247
Sarnak
 
Join Date: Apr 2012
Posts: 55
Default

I know, just for display. It's an optional stat checker, incase they don't want to use #mystats or don't know how.
Reply With Quote
  #7  
Old 01-06-2013, 02:25 AM
kmra247
Sarnak
 
Join Date: Apr 2012
Posts: 55
Default

Completed script below:

Code:
sub EVENT_SAY 
{

	my $stats = quest::saylink("stats", 1);
	my $NPCNAME = $npc->GetCleanName();

		
    if($text=~/hail/i) 
	{
		$client->Message(315, "$NPCNAME whispers to you, 'Hey there $name, I'm really good at guessing your $stats. Go on, try me!'");
    } 
    elsif($text=~/stats/i) 
	{
		$str = $client->GetSTR();
		$sta = $client->GetSTA();
		$agi = $client->GetAGI();
		$dex = $client->GetDEX();
		$wis = $client->GetWIS();
		$intel = $client->GetINT();
		$cha = $client->GetCHA();
		$ac = $client->GetAC();
		$atk = $client->GetATK();
		$hp = $client->GetHP();
		$hp2 = $client->GetMaxHP();
		$mana = $client->GetMana();
		$mana2 = $client->GetMaxMana();
		$end = $client->GetEndurance();
		$end2 = $client->GetMaxEndurance();
		$aa = $client->GetAAPoints();
		$aa2 = $client->GetSpentAA();
		
		$client->Message(314, "----------------------------------------------------------------");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Current Health: $hp Max Health: $hp2'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Current Endurance: $end Max Endurance: $end2'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Current Mana: $mana Max Mana: $mana2'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Total AA Points: $aa Spent AA Points: $aa2'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Armor Class: $ac Attack: $atk'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Strength: $str Stamina: $sta Agility: $agi'");
		$client->Message(315, "$NPCNAME whispers to you, '$name: Dexterity: $dex Wisdom: $wis Intelligence: $intel Charisma: $cha'");
		$client->Message(314, "----------------------------------------------------------------");
	}
}

sub EVENT_ITEM 
{
  quest::say("I do not need this.");
  quest::givecash($copper,$silver,$gold,$platinum);
  plugin::return_items(\%itemcount);
}
Reply With Quote
  #8  
Old 04-19-2013, 03:44 AM
thepoetwarrior
Discordant
 
Join Date: Aug 2007
Posts: 307
Question

Any way via perl to get players Resist and Heroic Resist?
Reply With Quote
  #9  
Old 04-19-2013, 04:54 AM
thepoetwarrior
Discordant
 
Join Date: Aug 2007
Posts: 307
Default

Never mind, did GetMR() GetFR() get and seems to work.

Wasn't listed on the object client page for quest.
Reply With Quote
  #10  
Old 04-19-2013, 04:56 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Code:
	
inline virtual int16	GetMR()	const { return MR; }
inline virtual int16	GetFR()	const { return FR; }
inline virtual int16	GetDR()	const { return DR; }
inline virtual int16	GetPR()	const { return PR; }
inline virtual int16	GetCR()	const { return CR; }
inline virtual int16	GetCorrup()	const { return Corrup; }


I just search the code on GITHub

https://github.com/search?q=%40EQEmu...=searchresults
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 07:05 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3