Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 12-06-2018, 06:37 PM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

May as well kill the randomizing sub, some unneeded variable declarations and also utilize ones that are already passed in the parser (rather than pulling again):

Code:
sub EVENT_ENTERZONE {   
    if ($zoneid !~ [202, 344, 345]) {
        if ($ulevel == 70) {
            if ($qglobals{"Ultimate_Unrest_Complete"} and $qglobals{"has_gotten_charm_rank_nine"} and $qglobals{"has_gotten_oot_focus"} and $qglobals{"has_finished_ultimate_quest_line"}) {
                if ($class eq "Shadow Knight") {  ## Sure could remember every class number but why, also this is already passed
					$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 ($class eq "Shadow Knight") {
            if ($skill_id ~~ [0..1]) {
                if ($client->GetEntityVariable("sk_flurry_of_hatred")) {
                    if (quest::ChooseRandom(1..100) <= ($client->GetEntityVariable("sk_flurry_of_hatred") * 3)) {
						if ($client->GetTarget()->IsNPC()) { ## Slim change of client changing target before the SA's but just in case
							$client->DoSpecialAttackDamage($client->GetTarget(), $skill_id, 500, 1000, 0) for (1..3);
							$client->Message(14, "Your Flurry of Hatred talent triggered three additional attacks!");
						}
                    }
                }
            } elsif ($skill_id ~~ [2..3]) {
                if ($client->GetEntityVariable("sk_flurry_of_destruction")) {
					if (quest::ChooseRandom(1..100) <= ($client->GetEntityVariable("sk_flurry_of_destruction") * 4)) {
						if ($client->GetTarget()->IsNPC()) { ## Slim change of client changing target before the SA's but just in case
							$client->DoSpecialAttackDamage($client->GetTarget(), $skill_id, 500, 1000, 0) for (1..3);
							$client->Message(14, "Your Flurry of Destruction talent triggered three additional attacks!");
						}
					}
                }
            }
        }
    }
}
Also added a check (main reason for posting this) to ensure the target is an NPC, granted not checking if the one that was originally targeted, but a check just the same. At least this way should someone get really lucky (or unlucky I suppose) won't possibly kill themselves if they target self for a buff or such.
Reply With Quote
Reply

Tags
qglobals, spell quests, talents, ultimateeq

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:11 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3