View Single Post
  #2  
Old 06-08-2008, 06:56 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I added this into my source updates and it works great so far. I left it as-is, because after I looked it over further, it seemed great as it was. It might be nice to have them all in 1 command, but this list of commands is simple to remember and use.

I even wrote a little quest for an NPC I made at the spawn point in Nexus where everyone gates to and where all new players pop into. It sets all players that zone in to have a random illusion from the entire global race lists minus player races. It also changes textures sometimes if the race has the texture it selects randomly. Mainly just a fun little quest.

I know this isn't the quest section, but here it is if anyone is interested:

Code:
sub EVENT_SPAWN {

  my $x = $npc->GetX();

  my $y = $npc->GetY();

  quest::set_proximity($x - 500, $x + 500, $y - 500, $y + 500);
  quest::settimer("despawn",1200);
  
}

sub EVENT_SAY {

if ($text =~/hail/i) {
quest::say ("Would you like me to [return] you to your natural form?  Or would you like me to [stop] changing your illusion when you enter the Nexus?"); }

if ($text =~/return/i) {
quest::say ("There, you are now back to your natural appearance.");
quest::playerrace(0); } 

if ($text =~/stop/i) {
quest::say ("Ok, I won't change it from now on.  Unless you change your mind and wish for me to [start] changing it again next time.");
quest::setglobal("illusion", 1, 1, "F"); } 

if ($text =~/start/i) {
quest::say ("Sure, I will be happy to start changing your illusion again next time!");
quest::setglobal("illusion", 1, 1, "M10"); } 

}

sub EVENT_ENTER {

  if (defined($qglobals{illusion})) {
  }
  else {
  		quest::playerrace(quest::ChooseRandom(14,27,42,43,46,58,60,62,63,66,75,82,85,89,95,108,120,123,141,150,151,153,161,209,210,211,212,240,356,367,433,436,454,455,456,458,464,469,470,472,473));
  		quest::playertexture(quest::ChooseRandom(1,2,3,4,5));
        quest::setglobal("illusion", 1, 1, "M10");
  }

}

sub EVENT_TIMER {

if ($timer eq "despawn") {
quest::say ("I am off to gather more materials to cast my illusions.  See you all soon!");
quest::depop(); }

}
I figured I would post this as an example of the quest actually working. I can imagine quite a few cool uses for these quest commands. I can't wait to start playing with them for advanced events hehe.

I am going to update my source files that I posted in another section for anyone to download if they so wish. It will include all of the previous updates plus this new feature.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote