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 11-10-2004, 10:37 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default Proximity quests example

Heres an example of how you might use the new proximity quests.
Proximity quests are quest events that are triggered by a player entering or leaving a defined area.
note: they do not behave properly if you log/zone into a proximity yet.

important functions:
quest::set_proximity(minx, maxx, miny, maxy); - enable a proximity
quest::clear_proximity(); - clear our proximity

for now, an NPC can only have 1 proximity, but it can be anywhere in the zone. It makes sense to set it up in the EVENT_SPAWN unless it is only triggered by certain events.

Another note: proximities use server resources... while it is not a lot, if you have 100+ proximities in a zone, your prolly going to be able to notice the increased load if theres many players in the zone.

This example employs the new proximity quest, as well as some XS classes stuff.

Race quest, kinda dumb, oh well:
Code:
sub EVENT_SPAWN {
        $x = $npc->GetX();
        $y = $npc->GetY();
        quest::set_proximity($x - 20, $x + 20, $y - 20, $y + 20);
}

sub EVENT_ENTER {
        my $n = $client->GetName();
        quest::say("Congratulations $n, you have won the race!");
        $winner = $client->GetID();
        quest::clear_proximity();
}

sub EVENT_EXIT {
        $n = $client->GetName();
        $client->Message(0, "Bye $n!");
}

sub EVENT_SAY {
        if($text=~/Hail/i) {
                if($winner == $client->GetID()) {
                        quest::say("Hello ".$client->GetName().", good work on winning the race.");
                        quest::summonitem(10037, 1);
                        $winner = -1;
                } else {
                        quest::say("You did not win the race, go away.");
                }
        } elsif($text =~ /reset/i) {
                $x = $npc->GetX();
                $y = $npc->GetY();
                quest::set_proximity($x - 20, $x + 20, $y - 20, $y + 20);
                quest::say("The race has been reset");
        }
}
Reply With Quote
  #2  
Old 11-11-2004, 04:07 AM
Scorpx725
Discordant
 
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
Default

Thanks alot for this, FNW. This opens up alot of new ideas.

Keep going with this new quest system, at first I didnt like it but now, it seems nice.
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
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 10:26 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