Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.25 KB | None | 0 0
  1. sub EVENT_SPAWN {
  2.     quest::settimer("freezingcheck", 6); #Start the time, every 6 seconds it triggers
  3. }
  4.  
  5. sub EVENT_TIMER {
  6.     if ($timer eq "freezingcheck") { #If the event's timer name is freezingcheck
  7.         my $spellid = 2885; #spell to cast
  8.         my $zoneid = 22; #change to zone it should exist
  9.  
  10.         my @clientlist = $entity_list->GetClientList(); #get all clients
  11.         foreach $ent (@clientlist) { #iterate each client          
  12.             if (!$ent->IsClient()) { #Sanity check, are they a client?
  13.                 next;
  14.             }
  15.            
  16.             my $curClient = $ent->CastToClient(); #turn the entity to a client, so you can get access to cooler methods
  17.             if ($curClient->GetZoneID() != $zoneid) { #Sanity check, if they're in another zone
  18.                 next;
  19.             }
  20.            
  21.             if ($curClient->GetCR() < 50 && #if their CR is < 100
  22.                 !$curClient->FindBuff($spellid) #They don't have the buff on
  23.             ) {
  24.                 $curClient->Message(13, "You are freezing to death!"); #give emote
  25.                 $curClient->SpellFinished($spellid, $curClient); #start the spell
  26.             }
  27.  
  28.             if ($curClient->GetCR() > 50 && #if their CR is > 100
  29.                 $curClient->FindBuff($spellid) #they have the buff on
  30.                 ) {
  31.                 $curClient->BuffFadeBySpellID($spellid); #stop the spell
  32.                 $curClient->Message (13, "You stop freezing."); #give emote
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement