Thread: Random Race
View Single Post
  #1  
Old 12-26-2008, 11:16 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Here is an example of a quest that I currently use and know that it works:

Code:
#Explosive Storm

my $entity_id;

sub EVENT_SPAWN {

  quest::settimer("change_storm1",5);

}

sub EVENT_TIMER {

  if ($timer eq "change_storm1") {
    quest::stoptimer("change_storm1");
    quest::npctexture(2);
    quest::emote("gains more energy and becomes less stable.");
    quest::settimer("change_storm2",5); }

  if ($timer eq "change_storm2") {
    quest::stoptimer("change_storm2");
    quest::npctexture(1);
    quest::emote("gains even more energy and looks extremely dangerous.");
    quest::settimer("change_storm3",5); }
    
  if ($timer eq "change_storm3") {
    quest::stoptimer("change_storm3");
$npc->CastSpell(7758, $userid);
    quest::emote("explodes and disperses.");
    quest::depop(); }

}
I am not sure you can change multiple size/gender/race all at the same time without issues, but I imagine something like this might work:

Code:
my $randomrace = quest::ChooseRandom(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
my $randomgender = quest::ChooseRandom(0, 1);

sub EVENT_SPAWN {
   quest::settimer("RandRace", 1)
}

sub EVENT_TIMER {

my $raceset = $randomrace;

   if ($timer eq "RandRace") {
    quest::stoptimer("RandRace");
    quest::npcrace($raceset);
    quest::settimer("RandGender", 1)
  }

   if ($timer eq "RandGender") {
    quest::stoptimer("RandGender");
    quest::npcgender($randomgender);
    quest::settimer("SetRaceSize", 1)
  }

   if ($timer eq "SetRaceSize") {
    quest::stoptimer("SetRaceSize");
    if($raceset == 4){
      quest::npcsize(5);
    }
    if($raceset == 3){
      quest::npcsize(7);
    }
    if($raceset == 7){
      quest::npcsize(5);
    }
    if($raceset == 6){
      quest::npcsize(5);
    }
    if($raceset == 11){
      quest::npcsize(4);
    }
    if($raceset == 8){
      quest::npcsize(4);
    }
    if($raceset == 12){
      quest::npcsize(4);
    }
    if($raceset == 10){
      quest::npcsize(8);
    }
    if($raceset == 9){
      quest::npcsize(8);
    }
    if($raceset == 2){
      quest::npcsize(8);
    }

  }

}
I don't know if that will work or not, but maybe something like that.

Here is another example I use with random Race changing:

Code:
sub EVENT_ITEM {

  if($platinum == 100) {
    quest::say("H-h-h-happy Trick or T-t-treating!");
    quest::playerrace(quest::ChooseRandom(14,46,60,82,85)); }

  if($platinum == 500) {
    quest::say("Yar! H-h-h-happy Trick or T-t-treating!");
my $hgender = $client->GetBaseGender();
    quest::playerrace(quest::ChooseRandom(338,339,340,341,342));
    quest::playergender($hgender); }

}
You can also look at the Illusionist quest I have posted in the Custom section, but those are all for changing player race and genders.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote