EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   PVP Toggler (https://www.eqemulator.org/forums/showthread.php?t=25874)

trevius 08-05-2008 04:53 AM

PVP Toggler
 
This quest is pretty straight forward and simple. But, I figured some people might like to have it if they ever run PVP events on their server. I know it is a pain for players that accidentally get left in PVP mode, so this quest takes care of that.

Code:

#pvp Toggler

sub EVENT_SAY {

 if($text=~/hail/i) {
      quest::say("I can change your Player vs. Player status if you wish.  Just ask if you would like it set to [on] or [off].  I will fill out all of the formal paperwork for you to change your registration in the PVP events."); }

  if ($text =~/^on$/i) {
    quest::say ("You are now set for Player vs. Player combat!  Beware of anyone who may like to see you dead!");
    quest::pvp(on);
$client->Message(15, "Your PVP Flag has been enabled!"); }

  if ($text =~/^off$/i) {
    quest::say ("You are no longer set for Player vs. Player combat.  You can let your guard down.");
$client->SetPVP(0);
$client->Message(15, "Your PVP Flag has been disabled."); }

}


Neiv 08-09-2008 06:45 PM

Thanks Trevius,

I will actually use this in a modified form on my own server. Any particular reason you used quest::pvp to turn it on but $client->SetPVP to turn it off?

trevius 08-09-2008 08:55 PM

Because quest::PVP(off) doesn't work lol. Though, it could be set to use the other way for both.

Neiv 08-09-2008 11:07 PM

Lol; well that explains why my script breaks at that point. I will change it to the object instead.


All times are GMT -4. The time now is 06:56 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.