Page 1 of 2

Style order in npctemplate?

PostPosted: Fri Mar 03, 2017 8:08 pm
by tegstewart
G'day!

Does the order of styles in npctemplate have any impact on how mobs select which styles to use? For instance, is it more likely to use the first style in the list than the second? If not, could I enter the same style multiple times to increase the odds of it being used?

I'm doing some somewhat elaborate custom pets with high style usage rates, and I'm looking for an easy way to make some styles fire more frequent than others.

Thanks!

Re: Style order in npctemplate?

PostPosted: Sat Mar 04, 2017 1:49 am
by PlanarChaosRvrtwo
What about create same style twice with diffrent ids?

Re: Style order in npctemplate?

PostPosted: Sat Mar 04, 2017 7:40 am
by Leodagan
GameNPC Styles List is an "ArrayList", it should support duplicate Objects and I didn't find any code that try to reduce the List to only Unique Objects, so you could try to add some Style multiple time for increased odds ;)

The way GameNPC use styles is pretty easy, each time he attack he will roll a Random against Server Property "GAMENPC_CHANCES_TO_STYLE" with some more odds depending on the size of the Styles List (so a mob with a lot of Styles will use Styles more often), if the Random roll decide there will be a Style used this attack round it will trigger a second Random roll to pick up a Style in the List, if this style can be used (pre-requisite Style successfully executed, position match opening constraint etc...) then it is performed normally, if the Style can't be used right now you need to wait another attack round for Random Style triggering to kick in again...

Re: Style order in npctemplate?

PostPosted: Sat Mar 04, 2017 5:12 pm
by tegstewart
Ah, OK. I was hoping style selection was a little more advanced and checked for chains, responses, and positionals before picking an anytime style. Oh, well.

I have a pet with a taunt and a block response style. I thought the taunt was being intelligently selected, but it was actually just that when the pet was much more likely to miss when incorrectly doing the block response. When I put the block response in three times, the pet did a normal attack 75% of the time. So that definitely matches what you've described.

Thanks!

Re: Style order in npctemplate?

PostPosted: Sat Mar 04, 2017 6:10 pm
by ontheDOL
check this out
http://www.dolserver.net/viewtopic.php? ... eleestyler

could be of some use

Re: Style order in npctemplate?

PostPosted: Sat Mar 04, 2017 9:09 pm
by Leodagan
I had a more intelligent method in use once...

But it was deadly :P

All Styles were ordered in the list to have the ones that stun or snare with higher chance, if they needed a pre-requisite style they tried to execute them before trying the higher ranked ones (it was easy, the follow-up style are mostly the deadly ranked one being executed next round), and after that positional/block/parry were checked before using anytime...

It was really not live-like and mobs with 2 or 3 different styles could be awesome opponents, so I reverted to Randoms because summons from pet classes use the same code and I wasn't ready to bring such a balance change in DOL Core :P

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 12:26 am
by tegstewart
I think what I'll end up doing is making custom styles for pets anyway. In it's cosmetic form, my tank pet will have multiple copies of the same taunt, but with different animations so how the pet swings will vary.

If I want to do something like a melee dps pet, I'll do custom styles that mimic positional and chains without actually having the requirements. No biggie.


On a related note, it looks like order of spells does matter. If you have multiple spells from the same line, the pet will cast the first one on the list that it's high enough level to cast. Putting the smallest spell first means the pet will only cast the smallest spell. Which isn't a problem, just a thing to be aware of.

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 1:22 am
by tegstewart
Also on a related note, it looks like there's no stylexspell for savage styles that hit multiple targets. Does that use a custom handler in the code, or can I get the same effect from a style I create myself?

Thanks again!

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 1:39 am
by PlanarChaosRvrtwo
i hope our face to face talk solved most of issues

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 7:32 am
by Leodagan
The Savage Multi-Hit are only triggered on Styles ?

They can't Multi-Hit with regular attack ?

It's probably somewhere else in the code, in the huge "WeaponAttack" Logic in GameLiving I think... (most of close-combat rules are in these methods anyway...)

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 4:17 pm
by tegstewart
Here's another oddity.

I wanted to make pets with only one style have varied attack animations, so I created multiple copies of the same style with the same ID but different classids that aren't valid combinations for players: ie scythe styles with ID 385 and claassids 1-5. Each one has a different TwoHandAnimation, but the pets always use the same animation anyway, and changing TwoHandAnimation doesn't appear to have any impact regardless of whether the pet uses a one or two handed weapon model.

It also looks like pet styles damage growth rate doesn't do anything, or at least the bonus damage isn't displayed in the combat log. I'm pretty sure bonus to hit had an impact since unstyled hits have much higher miss rates, and I have no idea about bonus to defense.

Re: Style order in npctemplate?

PostPosted: Sun Mar 05, 2017 8:30 pm
by PlanarChaosRvrtwo
Why you dont do Clienteffect Id;Id2;id3?

Re: Style order in npctemplate?

PostPosted: Mon Mar 06, 2017 3:55 am
by tegstewart
The Savage Multi-Hit are only triggered on Styles ?

They can't Multi-Hit with regular attack ?
Kinda both. They can multi hit a single target on regular attacks, but they have three styles that also hit other nearby targets. That's what I'm after, and it isn't handled by a styllxspell entry, so it must be hard-coded.

Re: Style order in npctemplate?

PostPosted: Mon Mar 06, 2017 4:30 am
by tegstewart
I've done some more testing.

Since having 148|1;148|2;148|3;148|4;148|5 with different twohandanimations didn't work, I thought maybe the client is using the style id to generate the animation. So I tried 148|1;149|1;150|1;151|1;152|1. I had to put in stylexspell entries for them, but whatever. I also named them Draw Out 1, Draw Out 2, etc so I could see which was used in the combat log.

I still got the same attack animation each time, but Draw Out 5 is applying a bleed. That's 152, which is Aurora. Stylexspell has classid as 0 for Aurora, so I'm getting a bleed for Draw Out 5, either as a additional effect or as a substitute for the taunt effect. Very interesting.

I ended up creating duplicates of the taunt styles from axe, sword, and hammer using the same same style ids. I modified them to have the stats I wanted, and that did the trick. Three different named styles, three different animations, all behaving identically otherwise. I didn't need any stylexspell entries since all three used classid 0 so it's already covered.

Re: Style order in npctemplate?

PostPosted: Mon Mar 06, 2017 4:31 pm
by tegstewart
One last real oddity.

If I make a custom style based off windmill, and assign the windmill spell to it in stylexspell, it works fine. If I make a custom spell based off the windmill spell, and assign it to the custom style, it doesn't work, even if only difference is spellid.

Interesting.

Also, when a player casts a group spell, it effects the player. When a pet casts a group spell, it doesn't. The easy fix is to make custom versions of the spell with high radius and target set to realm.

These aren't problems at this point. I'm finding workarounds, but I'm putting them here that if somebody else is having problems with custom pets or npcs they will hopefully find this and benefit from it.