Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-10-2011, 06:01 PM
Ignorance
Fire Beetle
 
Join Date: Jun 2006
Location: baconland
Posts: 14
Default NPC unable to enter EVENT_TIMER

I am having trouble getting a spawned mob to enter into the EVENT_TIMER subroutine. The mob executes EVENT_SPAWN and sets timers to appropriate values, but does not ever enter into EVENT_TIMER. I would be grateful if someone could look over the code and give some advice.

Code:
####################################################################################################
# Document Notes...
# Author: Ignorance (thecerealkillers@gmail.com)
# Created:  2011 08 01  Last Modified: 2011 08 08
# Related Files: Template_RemoteController, Template_LocalController, Template_Herald, 
#   Template_Translocator
# General File Relationships
#   RemoteController  <-Global Variables->  LocalController
#     .                                       . --> Herald, Translocator
#     Loop                                    Loop    .       .
#                                                     X       X
# Translocator Description
#   Periodically announces when and where the in-zone translocatation will happen.
#   Executes translocation.
#   Despawns after translocation.
#   Despawns on errors.
####################################################################################################
@LocationNamesList  = ( "Freeport Arena" );
@LocationX1List     = ( -293 );
@LocationX2List     = ( -155 );
@LocationY1List     = ( -377 );
@LocationY2List     = ( -267 );
@LocationZ1List     = ( -39 );
@LocationZ2List     = ( -24 );
sub EVENT_SPAWN
{
  $timerNumber = 0;
  if( !defined $qglobals{FightClubfreportwLocationsInZone} )
  {
  # Set locations in zone
    quest::setglobal( "FightClubfreportwLocationsInZone", 1, 7, "F" );
  }
  if( defined $qglobals{FightClubFreeportPeriod} && defined $qglobals{FightClubTranslocateDuration} && defined $qglobals{FightClubTranslocatorAdPeriod} && defined $qglobals{FightClubfreportwLocationsInZone} )
  {
  # Randomize the in zone location chosen
    quest::setglobal( "FightClubfreportwActiveLocation", (int( rand( $qglobals{FightClubfreportwLocationsInZone} )) + 1), 7, "F" );
  # Set Advertizement Timers
    while( $timerNumber < $qglobals{FightClubFreeportPeriod})
    {
      quest::settimer( $timerNumber, $timerNumber );
      $timerNumber = $timerNumber + $qglobals{FightClubTranslocatorAdPeriod};
    }
  # Set Translocate Timer
    quest::settimer( $qglobals{FightClubFreeportPeriod}, $qglobals{FightClubFreeportPeriod} );
  # Set Translocation Close / Depop Timer
    quest::settimer( ($qglobals{FightClubFreeportPeriod} + $qglobals{FightClubTranslocateDuration}), ($qglobals{FightClubFreeportPeriod} + $qglobals{FightClubTranslocateDuration}) );
  }
  else
  {
  # Global Variables Undefined, Bad Execution
    quest::depop();
  }
}

sub EVENT_TIMER
{
  if( defined $qglobals{FightClubFreeportPeriod} && defined $qglobals{FightClubFreeportTranslocateDuration} && defined $qglobals{FightClubTranslocatorAdPeriod} && defined $qglobals{FightClubfreportwActiveLocation} )
  {
    $locationNumber = $qglobals{FightClubfreportwActiveLocation};
    if( $timer == $qglobals{FightClubFreeportPeriod} )
    {
      quest::shout("Executing ".$LocationNamesList[$locationNumber]." teleport.");
    # Execute Translocation
      quest::set_proximity($LocationX1List[$locationNumber], $LocationX2List[$locationNumber], $LocationY1List[$locationNumber], $LocationY2List[$locationNumber], $LocationZ1List[$locationNumber], $LocationZ2List[$locationNumber]);
    }
    else
    {
    # Prevents double advertizing upon translocate execution
      if( $timer % $qglobals{FightClubTranslocatorAdPeriod} )
      {
      # Advertize Location
        quest::shout("The ".$LocationNamesList[$locationNumber]." teleport executes in ".( $qglobals{FightClubFreeportPeriod} - $timer )." seconds.");
      }
    }
    if( $timer == ($qglobals{FightClubFreeportPeriod} + $qglobals{FightClubTranslocateDuration}) )
    {
    # Success, Despawn Mob
      quest::shout( $LocationNamesList[$locationNumber]." teleport executed.");
      quest::depop();
    }
  }
  else
  {
  # Global Variables Undefined, Bad Execution
    quest::depop();
  }
}

sub EVENT_ENTER
{
  quest::movepc( 96, 4366.94, -12256.9, -265 );
}
Reply With Quote
 

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