View Single Post
  #1  
Old 11-30-2013, 02:36 PM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default Simple but fun custom boss fight

Hey everyone.

This is just a simple boss I scripted. Every time I see a code submission from a more experienced person such as Kingly Krab, he seems to do it in the least amount of lines possible without defining most things that I would define. I tried to make this boss in the least amount of lines possible. Here it is. Constructive criticism, tips, etc are all welcomed.

The objective in this fight is to burn the boss and kill the "corpses" immediately. The corpses are non-aggro NPCs with low health so they're easy enough to keep down, but if you let them pile up you're dead pretty fast.

Boss:
Code:
sub EVENT_COMBAT {
  if($combat_state == 1) {
  quest::say("You won't be the first to desecrate the land of the unliving.");
  quest::settimer("dostuff",int(rand(24)) + 1);
  quest::settimer("spawncorpse",1);
  }
  elsif($combat_state == 0) {
  $npc->SetHP($npc->GetMaxHP());
  quest::depopall(999348);
  quest::stoptimer("dostuff"); 
  quest::stoptimer("spawncorpse"); 
  }  
}

sub EVENT_DEATH {
  quest::stoptimer("dostuff"); 
  quest::stoptimer("spawncorpse"); 
  quest::depopall(999348);
  quest::say("My ancestors will make you pay for this intrusion.");
 }
 
sub EVENT_TIMER {  
  if($timer == "dostuff") { 
   quest::stoptimer("dostuff"); 
   quest::emote("begins to draw power from his undead victims.");
   quest::signalwith(999348,1,0); #signal 1 to adventurercorpse for damage increase.. if alive they signal back signal 2
   quest::settimer("dostuff",int(rand(24)) + 1);
   }
   if($timer == "spawncorpse") {
   quest::stoptimer("spawncorpse");  
   quest::spawn2(999348,0,0,$x + int(rand(35)),$y + int(rand(35)),$z,0);
   quest::settimer("spawncorpse",int(rand(24)) + 1);
   }   
}

 
sub EVENT_SIGNAL {
  if($signal == 2) { #Players didn't kill corpses.. increase min/max damage by 10/25 respectively
   quest::modifynpcstat("min_hit", $npc->GetMinDMG() + 10);
   quest::modifynpcstat("max_hit", $npc->GetMaxDMG() + 25);
   }
  if($signal == 3) { #Player killed corpse reducing damage
   quest::modifynpcstat("min_hit", $npc->GetMinDMG() - 10);
   quest::modifynpcstat("max_hit", $npc->GetMaxDMG() - 25);
   quest::emote("has lost a portion of his stolen power.");
   }
}
Corpses
Code:
sub EVENT_SPAWN	{ 
	my $random_race = quest::ChooseRandom(1,4,6,7,);
	my $random_texture = quest::ChooseRandom(1,2);
	my $random_weapon = quest::ChooseRandom(1,2,3,7,8,14);
	my $random_gender = int(rand(2));
	
			$npc->SetAppearance(3);
	        quest::npcgender($random_gender);
	        quest::npcrace($random_race);
            quest::npctexture($random_texture);
            quest::wearchange(7, $random_weapon);
	}
	
sub EVENT_SIGNAL {
  if($signal == 1) { #signal from boss to increase damage if players have not killed corpses
   quest::signalwith(1620,2,int(rand(5)))
   }
}	

sub EVENT_DEATH {
   quest::signalwith(1620,3,int(rand(5))) #were signaling back that this corpse has been killed and it will reduce boss damage
}
Reply With Quote