View Single Post
  #7  
Old 07-27-2013, 01:39 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Smile

Quote:
Originally Posted by jshows1 View Post
Wow Thanks Akkadius. This sounds like a powerful tool. Real quick, how do you actually implement this? Do I simply create a mob in the zone I want and then put his pl file in that zone folder to get it to work?
Well it's not a simple implementation, but as you can see in my notes, it is a NPC id of 50, it can be whatever you want it to be.

So how I achieve this automagically, is I insert it into the enterzone of the global_player.pl, if the NPC isn't in the zone when a player zones in, pop him. When he pops, he will go through the scaling routine.

If he isn't already a 'spawn' of the zone, I add him to a spawn regardless of instance version.

Code:
sub EVENT_ENTERZONE {
	if(!$entity_list->GetNPCByNPCTypeID(50)){ 
		quest::spawn2(50, 0, 0, 0, 0, 0, 0); 
		$client->NPCSpawn($entity_list->GetNPCByNPCTypeID(50), "add", 1); 
	} ### Automatic Scaling
}
Another question you might have. Yes, that's fine and dandy, but what about when a NPC spawns and needs to be scaled again?

Well, that's the main reason for me implementing global_npc.pl amongst other reasons.

Here is what I do, I send a signal to the zone controller, first with a unique signal telling the controller that 'HEY! I need to be scaled BEOTCH!' so the zone controller goes, ok yes I got it.

Once again, first he sends signal 21, then he sends the NPC Type ID. So the controller performs an iteration and only scales NPC's with that type ID.

Code:
sub EVENT_SPAWN {
	if($npc->GetEntityVariable("Scaled") != 1){ ### If not flagged as scaled, then scale the NPC
		quest::signalwith(50, 21, 0);
		quest::signalwith(50, $npc->GetNPCTypeID(), 0);
	}
}
The NPC recieves signal 21, sets a entity variable essentially 'flagging' itself for a split second like a catcher in a baseball game that he knows he is about to catch a NPCTypeID as a signal. As soon as he catches the NPCTypeID he releases the entity variable and gets ready for any other scaling requests.

So what did I achieve in the end with all of this?

TONS and TONS of time SAVED by having to scale my zones, I create generic 'ranges' that NPC's SHOULD be at based on their level AND type (Trash, named, raid). If I wanted to up the difficulty I had it set per zone with multipliers as you might be able to rip apart in my code.

All of the table pulls are custom, all of the framework needed to build a system like this is already there after implementing all of the source backend things. Through this thread I am revealing this for the first time.

Once I get my content release done, I will probably end up releasing a good chunk of my work including this one, but I've been so busy in the past years that is all variable.

If you have any questions regarding this type of implementation let me know.
Reply With Quote