PDA

View Full Version : Random mob level.


jenco420
08-01-2009, 02:45 AM
i was reading the EQ Live furoms and my eye caught this Thread (http://forums.station.sony.com/eq/posts/list.m?topic_id=153897) (scroll down to where devs start replying)

So i got to thinking about leaning down my spawn tables, and was wondering if there was a feature that allowed for a random level of the mob on spawn?

e.g.

I create a lvl 10 npc, and everytime it repops it can be anywhere from lvl 8 - 12?

trevius
08-01-2009, 03:53 AM
Actually, I have thought about something like this quite a few times lately. Instead of having to make 5 different variations of the same NPC just to have some variety, it would be nice to have a feature that allowed for level ranges like that. It would certainly save time from having to make tons of spawn groups and NPCs. Maybe a scaling field in the npc_types table that would let you set how much you want the NPCs to be able to scale and it would scale their level, and most other important stats like min/max hit, resists, normal stats, etc. If the NPC is level 10 and you set it to scale 20%, it could create NPCs from level 8-12 and adjust stats accordingly.

Of course, it probably wouldn't be too hard to create a default.pl script to do this on normal NPCs that don't already have a script in place for them. You can set level easy enoug and setting other stats to scale would just mean using some Gets and the modifynpcstat quest command. But, it would be nice to have something built into the source for it if possible.

Secrets
08-01-2009, 09:09 PM
Some stuff like min/max dmg scale to a formula already if they are 0. It would just mean adding onto that formula (I think it's in npc.cpp) to include stats based off of level, and maybe add some rules for scaling? Set the stats for level 1 in the database and calculate it off of npclevel and the formula. That would save almost anyone a lot of time filling in the annoying NPC_Types table when creating new custom content.

It would be pretty trivial to do, and if no one else does it I will. All it takes is just changing a few things, adding a field here and there..

Secrets
08-01-2009, 10:11 PM
I added this to my local test server and it works fine. I had to add a default value for stats, though. Other than that, the NPC's level gets modified in real-time if you put all the stats, damage, etc, at 0. That way no existing NPCs get messed up. It also will fix NPCs that have stuff such as 0 str and set it accordingly. I'll post the diff in code submissions.

jenco420
08-05-2009, 03:56 PM
Thanks secrets! this will make my job a whole lot easier! kudos!