Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 09-26-2009, 01:29 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default Fish out of water? No longer! I think!

Code:
sub EVENT_COMBAT {
	if ($Combat_State == 1) {
	quest::settimer("Water",1);
	}
	
	if ($Combat_State == 0) {
	quest::stoptimer("Water");
	}
}

sub EVENT_TIMER {
	my $z = $npc->GetZ();
		if ($z>=VARBYZONE) {
		$npc->WipeHateList();
		$mob->sethp($mob->GetMaxHP());
		quest::stoptimer("Water");
                $
		}
}
I haven't tested this as of yet, I just finished the code, but this should work and also have a minimal impact on server performance. Basically, when a fish is aggro'd it will start a timer. As that timer ticks away it will continually check it's Z, once that Z breaks the plane of the water in a zone it will wipe the mobs hate list, sending it home and full heal it. Change the VARBYZONE to match the Z water line in the zone you are working with.

If anyone can offer some improvements to the code, feel free.
__________________
Retired EMarr
Project1999 Developer
Reply With Quote
  #2  
Old 09-26-2009, 01:49 PM
ojamajoe
Fire Beetle
 
Join Date: Jan 2009
Location: Central USA
Posts: 8
Default

This is a great idea!
Reply With Quote
  #3  
Old 09-26-2009, 02:08 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

There's an inwater flag on mobs, used for the ruleset of Watermaps, not sure those are mapped out but there's essentially a bunch of checks to verify this, but I think until pathing is done on the zone it doesn't quite work right? Could be wrong.. but assuming this check is properly done it'd be as easy as adding to mob.h some form of inline bool InWater() const { return inWater; } and then you should be able to call $mob->InWater() to get a TRUE/FALSE Return of it being there or not.

Also with your code the mob i don't think would immediately return to his home point? He may stand there out of water, and then eventually decide to return... better than chasing you out!
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #4  
Old 09-26-2009, 06:27 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

I'd tried the $mob function with InWater() before and didn't have much luck with it. I assumed it might have been an incomplete function in the source or a mis-communication between the server source, water file and DB. Again, just theorizing...
__________________
Retired EMarr
Project1999 Developer
Reply With Quote
  #5  
Old 09-26-2009, 06:31 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 502
Default

well that function doesn't exist. It's actually a mob property, which I don't think you can call with a quest object as is. That above line would have to be added for $mob->InWater() to work. But regardless, yeah, it's likely work in progress that will be part of getting all the paths repaired for mobs to route with.
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #6  
Old 09-26-2009, 08:24 PM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Code:
sub EVENT_COMBAT {
	if ($combat_state == 1) {
	quest::settimer("Water",1);
	}
	
	if ($combat_state == 0) {
	quest::stoptimer("Water");
	}
}

sub EVENT_TIMER {
#quest::shout("Water, water, water");
	my $z = $npc->GetZ();
		if ($z>=XX) {
		$npc->WipeHateList();
		$mob->sethp($mob->GetMaxHP());
		quest::stoptimer("Water");
		}
}
Ok fixed, update the XX in red to the Z coords and you'll be good to go till the pathing stuff gets implemented =).
__________________
Retired EMarr
Project1999 Developer
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 04:08 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