View Single Post
  #7  
Old 12-05-2018, 11:41 AM
Kingly_Krab's Avatar
Kingly_Krab
Demi-God
 
Join Date: May 2013
Location: United States
Posts: 1,518
Default

Loops and minor optimization goes a long way.
Code:
sub EVENT_ENTERZONE {   
    if($zoneid !~ [202, 344, 345]) {
        if($client->GetLevel() == 70) {
            if($qglobals{"Ultimate_Unrest_Complete"} == 1 && $qglobals{"has_gotten_charm_rank_nine"} == 1 && $qglobals{"has_gotten_oot_focus"} == 1 && $qglobals{"has_finished_ultimate_quest_line"} == 1) {
                if($client->GetClass() == 5) {
                    $client->SetEntityVariable("sk_flurry_of_hatred", $qglobals{"sk_flurry_of_hatred"});
                    $client->SetEntityVariable("sk_flurry_of_destruction", $qglobals{"sk_flurry_of_destruction"});
                }
            }
        }
    }
}

sub EVENT_USE_SKILL {
    if($zoneid !~ [202, 344, 345]) {
        if($client->GetClass() == 5) {
            if($skill_id == 0 || $skill_id == 1) {
                my $flurryOfHatredRank = $client->GetEntityVariable("sk_flurry_of_hatred");
                if($flurryOfHatredRank > 0) {
                    my $flurryOfHatredPathSingleMultiplier = 3;
                    my $chanceRollBonusSingleFlurryOfHatred = GET_RANDOM_NUMBER();
                    my $target = $client->GetTarget();
                    if($chanceRollBonusSingleFlurryOfHatred <= ($flurryOfHatredRank * $flurryOfHatredPathSingleMultiplier)) {
			$client->DoSpecialAttackDamage($target, $skill_id, 500, 1000, 0) for (1..3);
			$client->Message(14, "Your Flurry of Hatred talent triggered three additional attacks!");
                    }
                }
            } elsif($skill_id == 2 || $skill_id == 3) {
                my $flurryOfDestructionRank = $client->GetEntityVariable("sk_flurry_of_destruction");
                if($flurryOfDestructionRank > 0) {
                    my $flurryOfDestructionPathSingleMultiplier = 4;
                    my $chanceRollBonusSingleFlurryOfDestruction = GET_RANDOM_NUMBER();
                    my $target = $client->GetTarget();
                    if($chanceRollBonusSingleFlurryOfDestruction <= ($flurryOfDestructionRank * $flurryOfDestructionPathSingleMultiplier)) {
                        $client->DoSpecialAttackDamage($target, $skill_id, 500, 1000, 0) for (1..3)
                        $client->Message(14, "Your Flurry of Destruction talent triggered three additional attacks!");
                    }
                }
            }
        }
    }
}
Reply With Quote