View Single Post
  #7  
Old 06-30-2008, 05:44 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

I think I tried to bodytype adjustment before with no luck. So, you'll pretty much have to use a different npc that is untargetable.

Your best bet is to have the npc spawn the adds via his quest script and add top player on hate list to their hate list. With them, also spawn a non-targetable version of your encounter npc. Then, run a perl script on untargetable npc. Set a time when he spawns. Have it check for their npc ids in the timer. And if they are not there(thus all dead), he triggers a targetable version of himself. Then use a:

Code:
sub EVENT_SPAWN {
$npc->SetHP($npc->GetMaxHP()*75);
}
You could accomplish this with two versions of the npc, but I'd use 3 to keep things cleaner.

As far as the adjustments mid fight, I've used spells and special abilities to do similar when I was hoping to be able to run my project full time. While this script admittedly rough around the edges and could use work, here goes:

Code:
sub EVENT_SPAWN {
  	my $x;
	my $y;
	my $z;
	my $h;
	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	$h = $npc->GetHeading();
	$stancetype = undef;
	$stancetimer = 0;
	$raid = 0;
	quest::stoptimer("stance");
	$stancetimer = int(rand(10 - 5)) + 5;
	}

sub EVENT_AGGRO {
	if ($raid == 0) {
	$clientencounter = $client->GetName();
	quest::shout("You stupid fools!");
	quest::settimer("stance",$stancetimer);
	quest::settimer("checkengaged",2);
	$raid = 1;
	}
}

sub EVENT_ATTACK {
	if ($raid == 0) {
	$clientencounter = $client->GetName();
	quest::shout("You stupid fools!");
	quest::settimer("stance",$stancetimer);
	quest::settimer("checkengaged",2);
	$raid = 1;
	}
}

sub EVENT_DEATH {
	quest::shout("How could a myrmidon fall to you?!");
}

sub EVENT_TIMER {
	my $check = undef;
	if ($timer eq "checkengaged") {
	if (!$npc->IsEngaged()) {
	$raid = 0;
	$npc->SetHP($npc->GetMaxHP());
	$stancetype = undef;
	$stancetimer = 0;
	quest::stoptimer("stance");
	$stancetimer = int(rand(5 - 1)) + 1;
	quest::stoptimer("checkengaged");
	}
	}
	elsif ($timer eq "stance") {
	$npc->NPCSpecialAttacks(0, 0);
	$stancetype = undef;
	$stancetimer = 0;
	$stancetimer = int(rand(70 - 50)) + 50;
	quest::settimer("stance",$stancetimer);
	$stancetype = quest::ChooseRandom("MyrmidonStance","MeleeInvul","SpellInvul","MyrmidonStance","SpellInvul","MyrmidonStance","MeleeInvul","Strong","MyrmidonStance","Combat","Defense","Riposte");
	if ($stancetype eq "MeleeInvul") {
	$npc->NPCSpecialAttacks(A, 0);	#Removes Current Special Attacks and adds A, spell invul.
	quest::ze(4, "Arhiles has developed affinity for melee and is no longer able to be harmed by melee");
	}
	elsif ($stancetype eq "SpellInvul") {
	$npc->NPCSpecialAttacks(B, 0);	#Removes Current Special Attacks and adds B, spell invul.
	quest::ze(4, "Arhiles develops affinity for all magic.");	#quick reference for ze-zone emote.  Not available in current build
	}
	elsif ($stancetype eq "MyrmidonStance") {
   	$entid1 = quest::spawn2(58084,0,0,$x+30,$y+30,$z,$h);
   	$entid2 = quest::spawn2(58085,0,0,$x+30,$y-30,$z,$h);
   	$entid3 = quest::spawn2(58086,0,0,$x-30,$y-30,$z,$h);
   	$entid4 = quest::spawn2(58087,0,0,$x-30,$y+30,$z,$h);
   	$entid5 = quest::spawn2(58088,0,0,$x-10,$y+10,$z,$h);
   	$mob1 = $entity_list->GetMobID($entid1);
   	$mob2 = $entity_list->GetMobID($entid2);
   	$mob3 = $entity_list->GetMobID($entid3);
   	$mob4 = $entity_list->GetMobID($entid4);
   	$mob5 = $entity_list->GetMobID($entid5);
    	$mobnpc1 = $mob1->CastToNPC();
    	$mobnpc2 = $mob2->CastToNPC();
    	$mobnpc3 = $mob3->CastToNPC();
    	$mobnpc4 = $mob4->CastToNPC();
    	$mobnpc5 = $mob5->CastToNPC();
    	$mobnpc1->AddToHateList($npc->GetHateTop(),1);
    	$mobnpc2->AddToHateList($npc->GetHateTop(),1);
    	$mobnpc3->AddToHateList($npc->GetHateTop(),1);
    	$mobnpc4->AddToHateList($npc->GetHateTop(),1);
    	$mobnpc5->AddToHateList($npc->GetHateTop(),1);
	quest::ze(4, "Arhiles has received shielding from fellow myrmidons.");
	$npc->NPCSpecialAttacks(AB, 0);	#Melee and spell invulnerability until adds dead.
	quest::settimer("myrmidoncheck",1);
	quest::stoptimer("stance");
	}
	elsif ($stancetype eq "Strong") {
	$npc->CastSpell(8755,$mobid);	#selfcasts str buff
	$npc->NPCSpecialAttacks(U, 0);
	quest::ze(4, "Arhiles develops affinity for your frailness becomes immune to combat slowing!");
	}
	elsif ($stancetype eq "Combat") {
	$npc->NPCSpecialAttacks(QRF, 0);
	$npc->CastSpell(8752,$mobid);		#selfcasts combat boosts
	quest::ze(4, "Arhiles has developed combat focus and swings with great speed and accuracy!");
	}
	elsif ($stancetype eq "Defense") {
	$npc->CastSpell(8753,$mobid);	#selfcasts AC buffs
	quest::ze(4, "Arhiles has crouched into a defensive stance!");
	}
	elsif ($stancetype eq "Riposte") {
	$npc->CastSpell(8754,$mobid);	#selfcats riposte buff
	quest::ze(4, "Arhiles has mastered your melee technique and is able to predict each attack!");
	}
	}
elsif ($timer eq "myrmidoncheck") {
	$check = 0;
	#quest::shout("Check!");
	my $first_mob = $entity_list->GetMobByNpcTypeID(58084);
	my $second_mob = $entity_list->GetMobByNpcTypeID(58085);
	my $third_mob = $entity_list->GetMobByNpcTypeID(58086);
	my $fourth_mob = $entity_list->GetMobByNpcTypeID(58087);
	my $fifth_mob = $entity_list->GetMobByNpcTypeID(58088);

  		if ($first_mob) {     
		$check++;
 		 }
		if ($second_mob) {     
		$check++;
  		}
  		if ($third_mob) {     
		$check++;
 		 }
		if ($fourth_mob) {     
		$check++;
  		}
  		if ($fifth_mob) {     
		$check++;
 		 }
		if (!$check) {     
		quest::stoptimer("myrmidoncheck");
		$npc->NPCSpecialAttacks(0, 0);
		quest::settimer("stance",$stancetimer);
	  	}
	}


}
That is most of the code. Several different "stances". Spawning adds and becoming invulnerable. Switching to defensive mode, offensive mode, and switching immunities.

I have 10-20 of these scripts I was running on my raid encounters on my server. Similar atleast! However, just have not been able to find a stable host/project manager to take over:/
Reply With Quote