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 02-25-2013, 06:23 AM
boo2
Fire Beetle
 
Join Date: May 2008
Location: Bahamas
Posts: 10
Default GetRace issue

Basically, I have some guards I'm messing with.

When they spawn I have them randomly set to choose between different textures (different guards from different zones.. Qeynos, Freeport, Kelethin, etc..)

The issue I'm having right now is that Qeynos guards are race 71, but texture 1.. so I'm trying to make it so that when they spawn my script checks to see if it is race 71, and if it is race 71 it will change the texture to 1.

What I have right now isn't working, and when I added a say event to see what the race was returning as I get nothing, can someone please tell me what I'm doing wrong?

Code:
sub EVENT_SPAWN {
	my $random_race = quest::ChooseRandom(71,44);
	my $random_weapon = quest::ChooseRandom(1,2,3,7,8,14);
	
    quest::npcrace($random_race);
    quest::wearchange(7, $random_weapon);		
    quest::wearchange(2, 1);
    quest::settimer("qeynosguardchange", 1);		
	
}


sub EVENT_TIMER {

    my $race = $mob->GetRace();
	
	if($timer eq "qeynosguardchange" && $race == 71) {
    quest::shout2("qeynos change yo");
    quest::npctexture(1);	
    quest::stoptimer("qeynosguardchange");	
	}
}

sub EVENT_SAY {

    if ($text =~/hail/i) 
   {
     my $race = $mob->GetRace();
     quest::say("$race");
   }
}
Reply With Quote
  #2  
Old 02-25-2013, 07:39 AM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default

I can not see anything wrong with what you have and I do not have time right now to test it. Here is what I do with my guards.

Code:
sub EVENT_SPAWN {
	@races = (1..12);
	@weapons = (10518, 10519, 10625, 10657, 10786);
	$racesNum = @races;
	$weaponsNum = @weapons;
	quest::npcrace($races[int(rand($racesNum))]);
	quest::npctexture(3);
	
	quest::wearchange(7, $weapons[int(rand($weaponsNum))]);
	quest::wearchange(8, $weapons[int(rand($weaponsNum))]);
}
__________________
Drajor regards you indifferently -- what would you like your tombstone to say?
Reply With Quote
  #3  
Old 02-25-2013, 08:12 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

There isn't a variable named $mob that is exported. You will want to use $npc instead and it should work fine.

Change both instances that you have of this:

Code:
$mob->GetRace();
to this:

Code:
$npc->GetRace();
The Mob quest objects just mean that you can use any classes under mob such as $npc or $client.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 02-25-2013, 08:15 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

your logs should tell you what the issue is. $mob is not defined anywhere in your script. you want to use $npc.

edit: what trevius said.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #5  
Old 02-25-2013, 02:28 PM
boo2
Fire Beetle
 
Join Date: May 2008
Location: Bahamas
Posts: 10
Default

It's working now, I guess I got a bit confused when it said "Mob" in the wiki page.. Thanks guys!
Reply With Quote
  #6  
Old 02-25-2013, 04:09 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

those are interfaces to functions which are defined for mob objects in C++. both npcs and clients are derived from the mob class, so they are listed there instead of in each individual category. functions that are listed specifically for the client or npc objects are generally unique to the type of object they are listed in.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
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:59 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