Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub EVENT_SPAWN {
- quest::settimer("freezingcheck", 6); #Start the time, every 6 seconds it triggers
- }
- sub EVENT_TIMER {
- if ($timer eq "freezingcheck") { #If the event's timer name is freezingcheck
- my $spellid = 2885; #spell to cast
- my $zoneid = 22; #change to zone it should exist
- my @clientlist = $entity_list->GetClientList(); #get all clients
- foreach $ent (@clientlist) { #iterate each client
- if (!$ent->IsClient()) { #Sanity check, are they a client?
- next;
- }
- my $curClient = $ent->CastToClient(); #turn the entity to a client, so you can get access to cooler methods
- if ($curClient->GetZoneID() != $zoneid) { #Sanity check, if they're in another zone
- next;
- }
- if ($curClient->GetCR() < 50 && #if their CR is < 100
- !$curClient->FindBuff($spellid) #They don't have the buff on
- ) {
- $curClient->Message(13, "You are freezing to death!"); #give emote
- $curClient->SpellFinished($spellid, $curClient); #start the spell
- }
- if ($curClient->GetCR() > 50 && #if their CR is > 100
- $curClient->FindBuff($spellid) #they have the buff on
- ) {
- $curClient->BuffFadeBySpellID($spellid); #stop the spell
- $curClient->Message (13, "You stop freezing."); #give emote
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement