This spell is a cloak with 192 foot radius constant effect ability with the associated value as another spell. This second spell is a concentration aimed spell that just adds yet a third spell to akTarget. This third spell is the following script, which basically handles all of combat under the d20 system:
Scriptname d20damaged extends ActorKeyword Property d2damager autoKeyword Property d4damager autoKeyword Property d6damager autoKeyword Property d8damager autoKeyword Property d10damager autoKeyword Property d12damager autoKeyword Property CrescentAxeKey autoFaction Property DnDLinearDamageAdjuster autoFaction Property DnDTHAC0 autoFaction Property DnDArmorClass autoFaction Property DnDBonusWithSlash autoFaction Property DnDBonusWithBash autoFaction Property DnDBonusWithPierce autoFaction Property DnDBonusAgainstSlash autoFaction Property DnDBonusAgainstBash autoFaction Property DnDBonusAgainstPierce autoFaction Property DnDSlashResist autoFaction Property DnDPierceResist autoFaction Property DnDBashResist autoKeyword Property DnDSlashingWeap autoKeyword Property DnDPiercingWeap autoKeyword Property DnDBashingWeap autoKeyword Property DnDWeapon autoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) int damagetype = 0 float damagetotal = 0 if akSource.HasKeyword(DnDSlashingWeap)==1 damagetype = 1 endIf if akSource.HasKeyword(DnDPiercingWeap)==1 damagetype = 2 endIf if akSource.HasKeyword(DnDBashingWeap)==1 damagetype = 3 endIf int d20roll = Utility.randomint(1,20) Actor attacker = akAggressor as actorif akSource.HasKeyword(DnDWeapon)==1 if akSource.HasKeyword(d2damager) ==1 int d2random = Utility.randomint(1,2) int ModdedD2 = d2random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal + Moddedd2 endif if akSource.HasKeyword(d4damager) ==1 int d4random = Utility.randomint(1,4) int ModdedD4 = d4random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal + Moddedd4 endif if akSource.HasKeyword(d6damager) ==1 int d6random = Utility.randomint(1,6) int ModdedD6 = d6random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal +Moddedd6 endif if akSource.HasKeyword(d8damager) ==1 int d8random = Utility.randomint(1,8) int ModdedD8 = d8random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal +Moddedd8 endif if akSource.HasKeyword(d10damager) ==1 int d10random = Utility.randomint(1,10) int ModdedD10 = d10random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal + Moddedd10 endif if akSource.HasKeyword(d12damager) ==1 int d12random = Utility.randomint(1,12) int ModdedD12 = d12random + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal +Moddedd12 endif if akSource.HasKeyword(CrescentAxeKey) ==1 int Crescentrandom = Utility.randomint(2,7) int Moddedcrescent = crescentrandom + (attacker.GetFactionRank(DnDLinearDamageAdjuster) as int) damagetotal = damagetotal + ModdedCrescent endifelse ;debug.notification("Attack Missed") if d20roll==1 debug.notification("Critical Miss!") attacker.DamageAV("Health", 4) endIfendIFint hitchance = 0hitchance = hitchance +d20roll + attacker.GetFactionRank(DnDTHAC0) as int +- (self as actor).GetFactionRank(DnDArmorClass) as intif damagetype==1 hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithSlash) as int +- (self as actor).GetFactionRank(DnDBonusAgainstSlash) as int damagetotal = damagetotal * (100-(5*(self as actor).GetFactionRank(DnDSlashResist)))/100endIfif damagetype==2 hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithPierce) as int +- (self as actor).GetFactionRank(DnDBonusAgainstPierce) as int damagetotal = damagetotal * (100-(5*(self as actor).GetFactionRank(DnDPierceResist)))/100endIfif damagetype==3 hitchance = hitchance + attacker.GetFactionRank(DnDBonusWithBash) as int +- (self as actor).GetFactionRank(DnDBonusAgainstBash) as int damagetotal = damagetotal * (100-(5*(self as actor).GetFactionRank(DnDBashResist)))/100endIfif hitchance >= 0(self as actor).DamageAV("health", damageTotal)endIfEndEventAnyhow, this doesn't seem to be working properly. I can walk up to actors to whom I've manually added this script, and combat works appropriately. However, dynamically attaching it doesn't seem to want to work. Any hints?
