View Single Post
  #1  
Old 01-26-2014, 05:22 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default plugin::ScaleTrash

This is a very simple plugin used to set a mobs level within a range. Using this combined with Akka's scaling system can save so much time when making a zone. You can get his scaling system here.

This is an example from a default.pl I've been working on. This will set every mob in the zone that has "snake" in its name to 40-50 with a variance of 3. Akka's scaling system then takes over and scales that mob to its level. I hope this saves some of you a bit of time!

Example:

Code:
sub EVENT_SPAWN {
	$nn = $npc->GetCleanName();
	$nid = $npc->GetNPCTypeID();
	if($nn=~/snake/i) { 																
		plugin::ScaleTrash(40, 50, 3);
	}
}
Plugin:

Code:
#::: Usage: plugin::ScaleTrash(min_level, max_level, variance); 
sub ScaleTrash { 
     $npc = plugin::val('$npc'); 
     $npc->SetLevel(plugin::RandomRange($_[0] + plugin::RandomRange(0 - $_[2], $_[2]), $_[1] + plugin::RandomRange(0 - $_[2], $_[2])));
}
Reply With Quote