View Single Post
  #7  
Old 10-06-2015, 03:23 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Here is another one where a spell will cycle ranks to the max...

X boss casts a single target nuke.. every 30sec or so... and each time you get a stacking debuff.. where you take more damage.

This quest has test spell IDs but.. it works, the test spells are the GMHP buffs so you can test if it works :p

When this spell lands on the player the next spell in the @spells array will be cast on them.. stacking debuff.. or stacking buff.

This can be used for other ideas I am guessing as well.. I just used it for boss debuffs / player stacking self buffs :p


spellid.pl (example 11.pl in global\spells)
Code:
sub EVENT_SPELL_EFFECT_CLIENT {
	my $caster_ent = $entity_list->GetMobID($caster_id);  #who cast the spell
	my $target_id = $client->GetID(); #Client who got cast on
	my @spells = (6817, 6818, 6819, 6820, 6821, 6822, 6823, 6824); #Spells Can add more to array if you want
	
	if ( grep { $client->FindBuff($_) } @spells ) {
		for $x (0 .. $#spells) { 
			if( $client->FindBuff($spells[$x]) ) {
				$client->BuffFadeBySpellID($spells[$x]); #Remove current buff / debuff  (incase they STACK)
				if($spells[$x] == $spells[$#spells]) {
					$caster_ent->SpellFinished($spells[$x], $client, 0);	#Last Rank
					last;
				} else {
					$caster_ent->SpellFinished($spells[$x + 1], $client, 0);	#Cycle Ranks
					last;
				}
			}
		}
	} else {
		$caster_ent->SpellFinished($spells[0], $client, 0);	#Cast First Rank!
	}
}
Reply With Quote