|
| 1 | +Scriptname C00TrainerScript extends ReferenceAlias |
| 2 | + |
| 3 | +int numHits = 0 |
| 4 | + |
| 5 | +Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect) |
| 6 | +; Debug.Trace("C00: Vilkas hit by magic.") |
| 7 | + if (Game.GetPlayer() == akCaster) |
| 8 | + GetOwningQuest().SetStage(100) |
| 9 | + endif |
| 10 | +EndEvent |
| 11 | + |
| 12 | +Event OnEnterBleedout() |
| 13 | + BleedoutChecks() |
| 14 | +EndEvent |
| 15 | + |
| 16 | +Function BleedoutChecks() |
| 17 | + if (!GetOwningQuest().IsRunning()) |
| 18 | + return |
| 19 | + endif |
| 20 | +; Debug.Trace("C00: Vilkas reached bleedout.") |
| 21 | + int currStage = GetOwningQuest().GetStage() |
| 22 | + if (currStage != 100 && currStage != 110) ; don't let it through if he's trying to |
| 23 | + ; razz you about using magic, for instance |
| 24 | + GetOwningQuest().SetStage(125) |
| 25 | + endif |
| 26 | +EndFunction |
| 27 | + |
| 28 | +Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) |
| 29 | +; Debug.Trace("C00: Vilkas was hit.") |
| 30 | +; Debug.Trace("C00: Vilkas hit datums -- " + akAggressor + " " + akSource + " " + akProjectile + " " + abPowerAttack + " " + abSneakAttack + " " + abBashAttack + " " + abHitBlocked) |
| 31 | + if (akSource as Spell) |
| 32 | +; Debug.Trace("C00: Vilkas hit by spell; bailing out and handling it in the magic effect handler.") |
| 33 | + return |
| 34 | + elseif (akSource as Explosion) |
| 35 | +; Debug.Trace("C00: Vilkas hit by explosion; bailing out and handling it in the other handlers.") |
| 36 | + return |
| 37 | + endif |
| 38 | +; if (Game.GetPlayer() == akAggressor) ; The original script didn't account for remote STR bystanders not hitting |
| 39 | + if ((akSource as Spell) != None) |
| 40 | + GetOwningQuest().SetStage(100) |
| 41 | + return |
| 42 | + endif |
| 43 | + numHits += 1 |
| 44 | + if (numHits >= 3) |
| 45 | + GetOwningQuest().SetStage(150) |
| 46 | + endif |
| 47 | +; else; Removing this part lets STR remote or pacifist players get the same quest stage and stopcombat at 3 hits |
| 48 | +; ; someone else hit him, stop the quest and have him berate you |
| 49 | +; GetOwningQuest().SetStage(110) |
| 50 | +; endif; No STR methods needed to reach stopcombat solution suggested in tiltedphoques/TiltedEvolution/issues/598 |
| 51 | +EndEvent |
| 52 | + |
| 53 | +Function ResetHits() |
| 54 | + numHits = 0 |
| 55 | +EndFunction |
0 commit comments