Thread: Anti Train Code
View Single Post
  #3  
Old 07-21-2009, 06:10 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I am sure that it could be done fairly easily with scripts, but I don't know if I would do it that way exactly. Mainly because monks might aggro many different NPCs without pulling and killing them, so their count might go too high and get them booted when they shouldn't be. You could probably do something simple like using EVENT_ATTACK and EVENT_KILLED_MERIT to add and remove points using a temp qglobal system.

You might also be able to use the IsOnHatelist(p) quest object for this, but I haven't ever used it, so I don't know how useful it would be in this situation.

To use the EVENT_ATTACK, you might be able to do something like this:

Code:
sub EVENT_ATTACK {

  if (!defined($qglobals{train_stopper})){
    quest::setglobal("train_stopper", 1, 5, "S30");
  }
  else
  {
    quest::setglobal("train_stopper", ($qglobals{train_stopper} + 1), 5, "S30");
    if ($qglobals{train_stopper} > 30){
       quest::movepc(152, 0, 0, -30); #Nexus port for offenders
    }
  }
}

sub EVENT_KILLED_MERIT {
  if (defined($qglobals{train_stopper})){
    if ($qglobals{train_stopper} > 1){
      quest::setglobal("train_stopper", ($qglobals{train_stopper} - 1), 5, "S30");
    }
  }
}
Then just make sure that all of the NPCs in the zone have the global flag set for them in the npc_types table. You can always tweak this script to work smoother for your needs. I haven't tested it, but it should work. Might need minor adjustments incase I made a typo or something though.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 07-22-2009 at 06:23 AM..
Reply With Quote