Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-14-2004, 11:03 AM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default Target Variables

I wanted people to have a change to test these before i put them in the code. Heres some more Variables!

$hpp - Returns the HitPoints Numerical Perecent of the Mob
$engaged - Returns 1 if the mob is Engaged (Attacking)
$hastarget - Returns 1 if the mob has a Target
$target[isclient] - Returns 1 if our target IS a Client (Player)
$target[accountid] - Returns Account Id if mob's target is a Client
$target[accountname] - Returns Account Name if mob's target is a client
$target[charid] - Returns CharacterID if mob's target is a client
$target[userid] - Returns UserID if mob's target is a client
$target[guildrank] - Returns Guild Rank if mob's target is a client
$target[status] - Returns Status if mob's target is a client
$target[isnpc] - Returns 1 if mob's target is an NPC
$target[name] - Returns the Name of the mob's target
$target[race] - Returns the Race of the mob's target
$target[class] - Returns the Class of the mob's target
$target[level] - Returns the Level of the mob's target
$target[hpp] - Returns the HitPoint Percent of the mob's target

Here is the Code:

Code:
EmbParser.cpp in PerlembParser::Event Under packagename = GetPkgPrefix(npcid); Add:

	ExportVar(packagename.c_str(), "hpp", itoa(npcmob->GetHPRatio()));
	if (npcmob->IsEngaged()) ExportVar(packagename.c_str(), "engaged", "1");
	if (npcmob->GetTarget()) {
		ExportVar(packagename.c_str(), "hastarget", "1");
		Mob* target = npcmob->GetTarget();
		if (target->IsClient()) {
			ExportVar(packagename.c_str(), "target[isclient]", "1");
			ExportVar(packagename.c_str(), "target[accountid]", itoa(target->CastToClient()->AccountID()));
			ExportVar(packagename.c_str(), "target[accountname]", target->CastToClient()->AccountName());
			ExportVar(packagename.c_str(), "target[charid]", itoa(target->CastToClient()->CharacterID()));
			ExportVar(packagename.c_str(), "target[userid]", itoa(target->GetID()));
			ExportVar(packagename.c_str(), "target[guildrank]", itoa(target->CastToClient()->GuildRank()));
			ExportVar(packagename.c_str(), "target[status]", itoa(target->CastToClient()->Admin())); 

		} else ExportVar(packagename.c_str(), "target[isnpc]", "1");

		ExportVar(packagename.c_str(), "target[name]", target->GetName());
		ExportVar(packagename.c_str(), "target[race]", GetRaceName(target->GetRace()));
		ExportVar(packagename.c_str(), "target[class]", GetEQClassName(target->GetClass()));
		ExportVar(packagename.c_str(), "target[level]", itoa(target->GetLevel()));
		ExportVar(packagename.c_str(), "taget[hpp]", itoa(target->GetHPRatio()));
	}
Thats it! Compile and have fun. Heres an example Death Touch script that will cause the mob to DT His Target every 5 minutes:

Code:
sub EVENT_SPAWN
{
	quest::settimer(1,300);

sub EVENT_ATTACK
{
	if (!$hastouched){
		quest::castspell($userid,982);
		quest::setglobal("hastouched","1","7","M5");
	}
}

sub EVENT_TIMER
{
	if (!$hastouched && $hastarget && $engaged){
		quest::castspell($userid,982);
		quest::setglobal("hastouched","1","7","M5");
	}
}
Go test and post how it works =)
__________________
EQEmulator Developer / Administrator
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 08:20 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