• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Scripting Spell weapon

DeltaMasterMind

Well-known member
Ok I have been looking around the forums and having a troubling time figuring how to do this: script in class BAB + Key casting modifier = Melee Attack Bonus render on Animated Tattoo, which is a magic weapon reference in my user file. Looking for how to build this script as it will come in handy later on.:D
 
Well I found it simpler to make it a weapon instead of a magic weapon...should have done that from the beginning...no matter. Still having trouble getting the weapon to use the BAB + Class Key Ability Modifier = Weapon attack bonus for Animate Tattoo. Point is to represent the spell as cast on that player since it is a permanent duration spell. Been trying this:
hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + hero.child[aINT].field[aModBonus].value
At all sorts of different timings between Pre levels to Final and all in between around 11000 - 61000 depending on where I saw some values representing the standard melee attack bonus scripts. Getting nothing to show for it.
 
So, this Animated Tatoo is a weapon you made? Then you'll want to assign the tag which says "use this attribute for attacks" either when you define the item (if it's always the same attribute) or via a script if the attribute varies based on what class adds the weapon or whatever. The tag group is MelAttOver.WHATEVERATTR.

For the BAB, are you saying the weapon only gets the BAB from one class and no others? If so, then you'll need to overwrite the wAttBAB field after that is set.
 
Ok will try to see if I can get that tag setup since the spell does allow for whichever is the highest casting stat.
The way I am reading the BAB sentience is that its possible I don't need to worry about altering the BAB? I guess if I tell it to use that tag it should work out the details. Hmm well I definitely don't intend to let the weapon only benefit from one class's BAB, I think my mind is elsewhere today. Thanks for the reply.
 
So if it's a highest casting stat, have the script set a variable, foreach through all classes on the hero who are spellcasters, and then set a focus to the current class' attribute if when transitioning to the attribute it is a higher modifier than the last one in the foreach. Kinda complex. I'll bash out a rough start for you in a minute.
 
PostAttr 5000
Code:
var highmod as number

~ Go through all casting classes.
foreach pick in hero from BaseClHelp where "CasterSrc.?"
  ~ transition through the attribute linkage, is it higher than our current
  ~ variable? If so, set the variable to this and set the focus to the linked
  ~ attribute.
  if (eachpick.linkage[spellattr].field[aModBonus].value > highmod) then
    perform eachpick.linkage[spellattr].setfocus
    highmod = eachpick.linkage[spellattr].field[aModBonus].value

  ~ Otherwise, do nothing, we'll check the next class
  else
    ~ Nothing
    endif
  nexteach

~ It's possible that we're added to a character with no casting classes. In that
~ case, we don't have a focus and should stop now.
doneif (state.isfocus = 0)

~ Finally, pull the appropriate tag from the focus attribute to ourselves, which
~ will override our melee attack attribute.
perform focus.pulltags[MelAttOver.?]

As usual, code not tested, tweak as necessary.
 
Well that wasn't as easy as I hoped. It's apparent to me that the script fits perfectly but I should have asked for the damage tag as well since I tried what I thought mine work perform focus.pulltags[MelDamOver.?] and perform focus.pulltags[MelDmgOver.?]
but neither worked. Is there a list for these tags?
 
Ok I am wrong about the formula on damage instead its doing the Stat plus 2 and I have no idea where that 2 is coming from, so there's that. Hmm.
 
Damn even running this at Post Attrib user 22000 hero.child[Damage].field[tDamStr].value = hero.child[aCHA].field[aModBonus].value
I am still getting additional +2 somewhere. Under Fields Damage steps it states the dice plus the bonus at +6 when it should be +4...very strange.
 
The damage version is global, it's not split between a ranged and melee tag group. Here is how you can find out the appropriate tag group yourself. Go to Develop -> Enable Data File Debugging. Then switch to the Abilities tab, and right click one of the attributes. Choose "Show Debug Tags" and look at the list. Which of those looks like it's the right tag group for this function, based on the ID and name of the group?
 
Ok I am wrong about the formula on damage instead its doing the Stat plus 2 and I have no idea where that 2 is coming from, so there's that. Hmm.

Did you create this weapon as a 2 handed weapon? If so, it is probably dealing 1.5x the attribute mod, which if your attribute mod is +4 would be an additional 2.
 
If that is the issue, be aware that there are 3 helper tags which can override normal damage behaviors. Note that though they mention strength, I believe they should function for whatever attribute you are using for an override.

Helper.NoDblStr <!-- Weapon doesn't get 1.5x strength bonus for being held in both hands (Weapon). -->
Helper.NoHalfStr <!-- Weapon doesn't get .5x strength penalty for being used in the off hand (Weapon). -->
Helper.NoStr <!-- Weapon never gets a strength modifier (used for blowguns) -->
 
I applied the no double str as that was acting on the value as well as simply added these to a second eval script at Post attrib user 10000
hero.child[Damage].field[tDamStr].value = hero.child[aCHA].field[aModBonus].value
hero.child[Damage].field[tDamStr].value = hero.child[aINT].field[aModBonus].value
hero.child[Damage].field[tDamStr].value = hero.child[aWIS].field[aModBonus].value

and as I swap between my characters with it enabled, they are adjusting accordingly now. I am 99% sure its in the bag now. I am sure there is a cleaner way, but at this point I am just happy it works at all. Aaron your a saint!
 
Back
Top