PDA

View Full Version : NPC default pl


nightsta69
09-22-2009, 01:17 PM
again was looking around to see if thier was a default npc.pl, kinda like player.pl in templates, and didn't really see anything of the sort. and was wondering if there was a way to add to the source a way to read a default npc.pl from the templates folder. i'm trying to make a system that tracks how many kills a player does in his life time, so I can reward titles, and other such things. I know I could go through and make a pl for each and every npc in every zone and add an event_death script to each adding to the global value made for each specific person, but that just seems a bit much. anyways, just was curious on how much of an endeavor this would be. thanks.

Davood
09-22-2009, 01:54 PM
that would be an excellent addition to any custom server!

you could do this by adding some code to the experience module for the server; however perl might be preferable for easy mass distribution of said content, and would might be easier to maintain and test, since you can reset the perl cache while the server is running.

I think the experience method might be best, so that way you can "tag along" on the kills, and you won't necessarily have to make all the killing blows yourself

unless of course there is a way to inject something into the "on gain xp" with perl for all npcs...

joligario
09-22-2009, 04:08 PM
There is. I believe it is called default.pl

So_1337
09-22-2009, 04:29 PM
I believe that default.pl is only brought into play when there is no quest file for an NPC. If there is a quest file in place, the server will use it.

So what you'd wind up doing is wiping all the normal PEQ quest files, modifying your default.pl file, and then going through each zone's folder and deciding which quest files you can bring back in entirely (for NPCs that wouldn't be killed [quest-givers, merchants, GMs of each class, etc.) and then figuring out which ones are for NPCs that will be killed and to modify their scripts accordingly.

It's going to be very painful and tedious if you do it that way, but it would make it possible with the existing tools available to you.