57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
|
Scriptname Tsc_ThrowingWeapons_ArmorDamage extends activemagiceffect
|
||
|
|
||
|
Event OnEffectStart(Actor akTarget, Actor akCaster)
|
||
|
if (!akTarget.IsDead())
|
||
|
float damage = 700 - akTarget.GetActorValue("DamageResist")
|
||
|
if (damage > 0)
|
||
|
float skillModifier = akCaster.GetActorValue("OneHanded") / 100 * baseDamage
|
||
|
damage = damage / 700 * skillModifier
|
||
|
if (akCaster.IsSneaking() && !akCaster.IsDetectedBy(akTarget))
|
||
|
if (isKnife)
|
||
|
damage *= 3
|
||
|
if (akCaster == Game.GetPlayer())
|
||
|
sneakAttackSound.Play(akCaster)
|
||
|
Debug.Notification("Sneak attack for 3.0X damage!")
|
||
|
Game.AdvanceSkill("Sneak", 15.0)
|
||
|
endIf
|
||
|
else
|
||
|
damage *= 2
|
||
|
if (akCaster == Game.GetPlayer())
|
||
|
sneakAttackSound.Play(akCaster)
|
||
|
Debug.Notification("Sneak attack for 2.0X damage!")
|
||
|
Game.AdvanceSkill("Sneak", 15.0)
|
||
|
endIf
|
||
|
endIf
|
||
|
endIf
|
||
|
|
||
|
if (akCaster == Game.GetPlayer())
|
||
|
float currentStamina = akCaster.GetActorValue("Stamina") + 20.00
|
||
|
float lowStamina = akCaster.GetBaseActorValue("Stamina") / 3
|
||
|
if (currentStamina >= akCaster.GetBaseActorValue("Stamina"))
|
||
|
damage *= 2
|
||
|
Debug.Notification("High stamina throw for double damage!")
|
||
|
elseif (currentStamina < lowStamina)
|
||
|
damage /= 2
|
||
|
Debug.Notification("Low stamina throw for half damage.")
|
||
|
endIf
|
||
|
endIf
|
||
|
|
||
|
akTarget.DamageActorValue("Health", damage)
|
||
|
if (akCaster == Game.GetPlayer())
|
||
|
Game.AdvanceSkill("OneHanded", skillModifier)
|
||
|
endIf
|
||
|
endIf
|
||
|
endIf
|
||
|
|
||
|
int random = Utility.RandomInt(0, 99)
|
||
|
if (random < 75)
|
||
|
if (!akTarget.IsPlayerTeammate() && akTarget != Game.GetPlayer())
|
||
|
akTarget.AddItem(dummyObject, 1, true)
|
||
|
endIf
|
||
|
endIf
|
||
|
endEvent
|
||
|
|
||
|
Int Property baseDamage Auto
|
||
|
Sound Property sneakAttackSound Auto
|
||
|
Bool Property isKnife Auto
|
||
|
MiscObject Property dummyObject Auto
|