|  |  | 
 
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  |  |  |  
  |  | 
	
		
   
   
      | Quests::Q&A This is the quest support section |  
	
	
		
	
	
	| 
			
			 
			
				01-01-2013, 07:05 AM
			
			
			
		 |  
	| 
		
			
			| Sarnak |  | 
					Join Date: Apr 2012 
						Posts: 55
					      |  |  
	| 
				 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 ");
	}
} |  
	
		
	
	
	| 
			
			 
			
				01-01-2013, 07:13 AM
			
			
			
		 |  
	| 
		
			
			| Demi-God |  | 
					Join Date: Aug 2010 
						Posts: 1,742
					      |  |  
	| 
 Show us what you tried.  There are GetMana() and GetHP() functions exported to perl. |  
	
		
	
	
	| 
			
			 
			
				01-01-2013, 07:24 AM
			
			
			
		 |  
	| 
		
			
			| Sarnak |  | 
					Join Date: Apr 2012 
						Posts: 55
					      |  |  
	| 
 I tried $client->GetMaxHP and $client->GetMP. 
	Code: $hp = $client->GetMaxHP();
$mana = $client->GetMP(); |  
	
		
	
	
	| 
			
			 
			
				01-01-2013, 07:40 AM
			
			
			
		 |  
	| 
		
			
			| Sarnak |  | 
					Join Date: Apr 2012 
						Posts: 55
					      |  |  
	| 
 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. |  
	
		
	
	
	| 
			
			 
			
				01-01-2013, 01:08 PM
			
			
			
		 |  
	| 
		
			
			| Dragon |  | 
					Join Date: May 2010 
						Posts: 965
					      |  |  
	| 
 Is this just for display? You can give everyone access to #mystats |  
	
		
	
	
	| 
			
			 
			
				01-01-2013, 01:12 PM
			
			
			
		 |  
	| 
		
			
			| Sarnak |  | 
					Join Date: Apr 2012 
						Posts: 55
					      |  |  
	| 
 I know, just for display. It's an optional stat checker, incase they don't want to use #mystats or don't know how. |  
	
		
	
	
 
  |  |  |  |  
	| 
			
			 
			
				01-06-2013, 02:25 AM
			
			
			
		 |  
	| 
		
			
			| Sarnak |  | 
					Join Date: Apr 2012 
						Posts: 55
					      |  |  
	| 
				  
 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);
}
			
			
			
			
				  |  
 
  |  |  |  |  
	
		
	
	
	| 
			
			 
			
				04-19-2013, 03:44 AM
			
			
			
		 |  
	| 
		
			
			| Discordant |  | 
					Join Date: Aug 2007 
						Posts: 307
					      |  |  
	| 
 Any way via perl to get players Resist and Heroic Resist? |  
	
		
	
	
	| 
			
			 
			
				04-19-2013, 04:54 AM
			
			
			
		 |  
	| 
		
			
			| Discordant |  | 
					Join Date: Aug 2007 
						Posts: 307
					      |  |  
	| 
 Never mind, did GetMR() GetFR() get and seems to work.
 Wasn't listed on the object client page for quest.
 |  
	
		
	
	
	| 
			
			 
			
				04-19-2013, 04:56 AM
			
			
			
		 |  
	| 
		
			|  | Developer |  | 
					Join Date: Dec 2012 
						Posts: 515
					      |  |  
	| 
 
	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 |  
	
		
	
	
	
	
	| Thread Tools |  
	|  |  
	| Display Modes |  
	
	| 
		 Linear Mode |  
	| 
	|  Posting Rules |  
	| 
		
		You may not post new threads You may not post replies You may not post attachments You may not edit your posts 
 HTML code is Off 
 |  |  |  All times are GMT -4. The time now is 02:42 AM.
 
 |  |  
    |  |  |  |  
    |  |  |  |  
     |  |  |  |  
 |  |