Loading...   


#::: Akkadius
#::: Balancing example, this script is an invisible controller NPC that is constantly checking two NPC's to make sure
#::: they are within the specified balancing_range

sub EVENT_SPAWN{
	quest::settimer("check_hps", 1);
}

sub EVENT_TIMER{
	my $balancing_range = 2; #::: How many HP's out of range we check for
	if($timer eq "check_hps"){
		my $boss1 = $entity_list->GetNPCByNPCTypeID(2701117);
		my $boss2 = $entity_list->GetNPCByNPCTypeID(2701118);
		#quest::shout("Boss 1: " . int($boss1->GetHPRatio()) . " Boss 2: " . int($boss2->GetHPRatio()));
		if(abs(int($boss1->GetHPRatio()) - int($boss2->GetHPRatio())) > $balancing_range){
			quest::shout("OUT OF BALANCING RANGE " . "Boss 1: " . int($boss1->GetHPRatio()) . " Boss 2: " . int($boss2->GetHPRatio()));
		}
		else{
			quest::shout("BALANCED " . "Boss 1: " . int($boss1->GetHPRatio()) . " Boss 2: " . int($boss2->GetHPRatio()));
		}
	}
}

Raw Paste Data