Aller au contenu

Photo

Smite damage helper script?


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Axe_Edge

Axe_Edge
  • Members
  • 278 messages
Hi.  I'm trying to get "Smite Good" to work with a custom class.  When the new class has the feat Smite Good, the charisma modifier seems to be added to the attack roll correctly.  The hardcoded smite does roll the weapon damage correctly.  The hardcoded script is looking for levels of Blackguard (of course) and does not add any levels of the new class to the damage roll.

Is there a way to piggy back a script which fires when a hardcoded smite successfully hits?  This piggy back script would add additional damage.  It would be fine if the hardcoded smite would complete, including doing the weapon damage, then, the additional script would add the additional level damage.  A message would be sent to notify the player of this additional smite damage.

Just brainstorming.  Is there a way to temporarily tell the engine that a character has "so many blackguard levels", even if the character doesn't?

(Fake the engine out by telling it the character has blackguard levels, complete the hardcoded smite, then take away the fake blackguard levels.)

Modifié par Axe_Edge, 01 septembre 2011 - 12:03 .


#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
You can script events on hit, via a function in the CSL that makes the ondamaged event usable via some work arounds.

That is about all you can do. ( And it is not something you want to use willy nilly, as a character can easily outpace any heartbeat with their multiple attacks and bring things to a crawl, not even looking at what happens with multiple players at the same time, generally you should remove this at the first successful hit )

Modifié par painofdungeoneternal, 01 septembre 2011 - 12:50 .


#3
Axe_Edge

Axe_Edge
  • Members
  • 278 messages
Ah, yes. I know there have been many discussions over the years about troublesome smites.

How about the toolbar. Can several (let's say 3) scripts (including the game's smite script) be run in sequence from a single press of a toolbar button? Or maybe something similar to a Rod of Preparation?

click on a toolbar button, which runs:
First script runs to identify the oTarget and to return the oTarget's hit points
Second script is simply the command to run the default run smite command (which correctly utilizes the Charisma modifier and all other modifiers for the attack roll, and calculates weapon, environmental, etc... damage
Third script runs to return if the the oTarget was damaged (thus hit) and calculates the damage caused by the smiter's level, and deals the extra damage to the oTarget.

I think it would be acceptable if the PC was going to smite during a flury. The first attack would be the smite, the game figures out the other flurry strikes, then you deal the smiter's level damage, if the smite was determined to be a hit (obviously not using the oTarget's hit points for determination).

Actually, I should research smite a little more. I can't remember if after the smite is used, if the rest of the PCs attacks for the round are run immediately. I know the smite symbol appears in the current action of the action queue, followed by the attack symbol directly behind it.

Just throwing it out there as I try to wrap my head around NWScript, gui, etc...

Modifié par Axe_Edge, 01 septembre 2011 - 02:52 .


#4
The Fred

The Fred
  • Members
  • 2 516 messages
You can use the Hideous Blow mechanic for stuff like this. I've been meaning to check if the effect is removed before or after the script fires, because if it's the latter it'd be easy to do a lot of cool stuff for it. Otherwise you have to use a specific metamagic value which would work, but is messier, because you knock up against the actual Warlock HBs.

#5
Axe_Edge

Axe_Edge
  • Members
  • 278 messages
The fred, thanks for the insight. I'll look into HB, too.

Edit:  After taking a look, I think you might be on to something :)   Still not sure if it is removed immediately.  I do see the line that removes it, but not sure when it occurs. 

Modifié par Axe_Edge, 01 septembre 2011 - 11:28 .


#6
MasterChanger

MasterChanger
  • Members
  • 686 messages
 I think you would have much better luck using an entirely custom feat rather than cobbling something on top of a hardcoded feat. The Tome of Battle already has code for how to handle custom strikes, including bonuses to attack, damage, and IIRC also critical-hit confirm rolls (maybe also crit chance).

It's slightly more complicated to create a custom attack as part of a regular attack schedule, but far from impossible. You would just determine the total number of attacks per round the PC has at the time (there a few steps for this) and then use custom attacks for that particular round. The first attack would have the bonus to attack and damage from Smite.

#7
Axe_Edge

Axe_Edge
  • Members
  • 278 messages
Hi, MasterChanger.
Yeah, I've been going over the Tome of Battle since you pointed me that way a few weeks ago. The Tome of Battle looks sweet, and I found the smite stuff. The ToB is kind of complicated and I wouldn't know where to start. I'd like the custom class to be easily adopted without making significant combat changes. I've been trying to figure out how to whittle down the ToB so that it would only change combat when a smite goes. Problem is, I'm a rusty coder. The going is a little slow, but going over the ToB and other scripts is bringing back up to speed. Do you have a link to a guide for the ToB? I've read "Drammel's Notes" site and have found plenty of his code. Just not sure how to implement it with Smite Good, at this time.

I've looked for script to determine the number of attacks a PC has in a round, but haven't found it yet. Adding that would make the Smite Good a script "good to go". I'll look for this on Drammel's site tonight. No luck at the lexicon.

Modifié par Axe_Edge, 02 septembre 2011 - 01:12 .


#8
MasterChanger

MasterChanger
  • Members
  • 686 messages
 I'm not sure that Drammel's code specifically addresses the attacks per round issue, but that's relatively easily addressed. It does address rebuilding the attack roll, which is really the hard part. That stuff is in one of the #include files; I'll look for it a bit later on.

As far as calculating attacks per round, here's the strategy I'd take. First, use GetTRUEBaseAttackBonus. Dividing that by 5 (integer) and adding 1 will give you the base number of attacks per round. Then check for haste effects. I'd say you should check for increased attacks by EffectModifyAttacks but there's no EFFECT_TYPE constant for that unfortunately (Frenzy uses this effect, for example). You could check for whether flurry mode is active (although apparently not all combat modes seem to report being on). If you're allowing Smite to be used from range then check for the rapid shot mode. Add these up and you should have the total attacks per round in most cases. 

#9
mogromon

mogromon
  • Members
  • 41 messages
I always wondered what the difference between GetTRUEBaseAttackBonus and GetBaseAttackBonus, i remember doing a couple of tests and the same value appeared.

If the character has a BAB of 5, divided by 5 = 1, +1 = 2. I've used the following formula: (BAB +4) / 5. Doesnt work for BAB = 0 but a simple if should fix that.

#10
MasterChanger

MasterChanger
  • Members
  • 686 messages

mogromon wrote...

I always wondered what the difference between GetTRUEBaseAttackBonus and GetBaseAttackBonus, i remember doing a couple of tests and the same value appeared.


I believe the distinction is there because there are effects which do increase BAB, such as Divine Power and Legionnaire's March (IIRC?). In those cases, theoretically at least, GetBAB would return the modified value, while GetTRUEBAB would give you the original value. So in your case, I suppose you'd want to use the not-true (but not necessarily false either!) version.

If the character has a BAB of 5, divided by 5 = 1, +1 = 2. I've used the following formula: (BAB +4) / 5. Doesnt work for BAB = 0 but a simple if should fix that.


Yeah, my formula was off. I believe you could also do (BAB-1) / 5 + 1. Test that with 5: 5-1=4; 4/5=0; 0+1=1. Test with 6: 6-1=5; 5/5=1; 1+1=2. Test with 0: 0-1=-1; -1/5=0; 0+1=1.

Modifié par MasterChanger, 04 septembre 2011 - 06:52 .


#11
The Fred

The Fred
  • Members
  • 2 516 messages
Basically, a character gets extra attacks at a cumulative 5 points lower than his BAB so long as the bonus is still >0. So when you hit a BAB of +6 you get a second attack at +1. At +11 you get +11/+6/+1, then +16/+11/+6/+1, etc.

#12
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
kaedrin has a glaive implemented for warlocks, it uses a custom progression, prolly want to look at that.