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 08-27-2008, 05:15 PM
phinius
Fire Beetle
 
Join Date: Aug 2008
Location: norrath
Posts: 8
Default

Ok, I will try that.

Thanks again Trevius.
Reply With Quote
  #2  
Old 08-27-2008, 11:13 PM
phinius
Fire Beetle
 
Join Date: Aug 2008
Location: norrath
Posts: 8
Default

Tried this out, did have to use $npc instead of $mob. My mob relayed this message, and then it crashed zone.exe:

Code:
My hate target is Mob=SCALAR(0x218b6fc).
Any idea what that could mean?
Reply With Quote
  #3  
Old 08-27-2008, 11:31 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

You need to dereference your return value. You are getting a reference instead of a value. Looks like a mob object. So you need to dereference the object.
Reply With Quote
  #4  
Old 08-27-2008, 11:32 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I don't know exactly what the numbers and stuff mean, but that does mean that it was able to get at least some target, and probably it was the random hate target you wanted.

The zone crash could possibly have been caused by the leveling part of the quest. So, I would next try to remove the quest::level line and see if you can at least get the rest of it working without the zone crashes.

If that works, then you just need to keep messing around until you can figure out how to get the level part working. It may be that you will have to use level quest object command something like this instead:

Code:
$npc->SetLevel(1, false); #it might need to be $client instead of $npc
I am not sure I have the settings for that command set properly, but I imagine that the quest object might work better for the leveling part in this situation.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 08-27-2008, 11:44 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

The numbers are an internal memory address used by perl to track the object pointer.

$npc should work for most things. npc:: inherits from mob:: so you should be able to use just about anything mob from a npc object.
Reply With Quote
  #6  
Old 08-28-2008, 03:09 PM
phinius
Fire Beetle
 
Join Date: Aug 2008
Location: norrath
Posts: 8
Default

I dereferenced as Andrew said. I googled it and from what I found all you need to do is add an extra $. So here is my new code:

Code:
sub EVENT_ATTACK{

quest::shout("rawr");
quest::settimer(1, 10);


		}




sub EVENT_TIMER{

	if ($timer == 1){

			my $hate_target = $npc->GetHateRandom();  
			quest::shout("My hate target is $$hate_target"); 
			$npc->CastSpell(1588, $$hate_target);
			quest::level(1);
			quest::shout("k");
			}

		}
The npc now returns:

Code:
My hate target is 122026464
No zone crash, but the npc will not cast the spell on me, the number is not directing to me. The NPC casts the spell, but is then interrupted, I assume because it has no valid target. Is the GetHateRandom function not working?

Also, the only way the script will get to my "k" shout, is if the level(1) line is a quest::, it will not progress to the shout if it is a $client->level or $npc->level. It also does not actually level me to 1.
Reply With Quote
  #7  
Old 08-28-2008, 03:31 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Deref. does not give the id for CastSpell(spell_id, target_id)

$npc->CastSpell(spellid, $hate_target->GetID())

The member function for setting level on a specific PTR_OBJ is SetLevel()

$client->SetLevel(1, 0);

You can use
$hate_target->GetName() to actually have it say which target is the target by name instead of cryptic pointers
Reply With Quote
  #8  
Old 08-28-2008, 04:22 PM
phinius
Fire Beetle
 
Join Date: Aug 2008
Location: norrath
Posts: 8
Default

Awesome thanks KLS. The NPC can now actually pick me up as the random hate target, and cast a spell on me. The level function is still not working though, I don't think it knows who to cast it on.

Here's code:

Code:
sub EVENT_TIMER{

	if ($timer == 1){

			my $hate_target = $npc->GetHateRandom();
			my $hate_name = $hate_target->GetName();
			my $hate_id = $hate_target->GetID();  
			quest::shout("My hate target is $hate_name"); 
			$npc->CastSpell(1588, $hate_id);
			$client->SetLevel(1, 0);
			}
Anyone have any ideas? If not I may just make the NPC cast some spell that would produce the same sort of end result, but I'd really like it to actually delevel if possible.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:13 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3