daggerot Posted November 2, 2019 Share Posted November 2, 2019 This script is from the Spear of bittermercy from the Tamrielic lore Mod. scn zzSheoSpearEffect short str short weap short weap1 short weap2 short luck short armor short fat float dmg short chance float chance2 short pwr short resshock short wil float shock short down short magicka short fat2 ref self begin scripteffectstart set self to getself if self == player modav2 health 25 return endif set pwr to zzssquest.pwr set str to player.getav strength set luck to player.getav luck set weap1 to player.getav blade set weap2 to player.getav blunt if weap1 > weap2 set weap to weap1 else set weap to weap2 endif set fat to player.getfatiguepercentage set armor to getarmorrating set str to (str / 100 * 25) set luck to luck - 50 set luck to luck / 4 set weap to weap + luck set weap to (weap / 100 * 25) set dmg to weap + str set dmg to dmg / 2 set fat to fat * dmg set dmg to dmg + fat if armor > 100 set armor to 100 endif set armor to armor / 100 set dmg to dmg - (armor * dmg) set chance2 to (-.75 + getrandompercent * (-1.5 +.75) / 99) set dmg to dmg * chance2 set chance to rand 0 3 if getarmorratingupperbody <= 1 if chance <= 0 player.playsound3d zzspearflesh1 playgroup stagger, 1 if player.getav fatigue >= 25 player.modav2 fatigue -25 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif elseif chance <= 1 player.playsound3d zzspearflesh2 if player.getav fatigue >= 20 player.modav2 fatigue -20 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif else player.playsound3d zzspearflesh3 if player.getav fatigue >= 21 player.modav2 fatigue -21 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif endif set chance to rand 0 5 if chance <= 0 player.playgroup stagger, 1 endif else if chance <= 0 player.playsound3d zzspearsound1 playgroup stagger, 1 if player.getav fatigue >= 30 player.modav2 fatigue -30 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif elseif chance <= 1 player.playsound3d zzspearsound2 if player.getav fatigue >= 24 player.modav2 fatigue -24 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif else player.playsound3d zzspearsound3 if player.getav fatigue >= 22 player.modav2 fatigue -22 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif endif set chance to rand 0 3 if chance <= 0 player.playgroup stagger, 1 endif endif modav2 health dmg if zzssquest.toggle == 1 set zzssquest.toggle to 0 return elseif zzssquest.toggle == 2 return endif if pwr < 20 set zzssquest.pwr to 0 return else set zzssquest.pwr to pwr - 20 endif set weap1 to player.getbaseav blade set weap2 to player.getbaseav blunt if weap1 > weap2 set weap to weap1 else set weap to weap2 endif if weap < 25 return elseif weap < 50 set chance to getrandompercent + 1 if chance > 33 return endif set wil to player.getav willpower set magicka to player.getav magicka if wil == 0 || magicka < 25 return else playgroup stagger, 1 set shock to wil / 3 set resshock to getav resistshock set shock to shock - resshock*shock/100 set shock to shock * -1 pms effectshockdamage 1 playsound3d splshockhit modav2 health shock player.modav2 magicka -25 endif elseif weap < 75 set chance to getrandompercent + 1 if chance > 33 return endif if zzssquest.back > 0 set down to 1 playsound3d WPNBlunt1HandEquipEnchanted modav2 fatigue -1000 if player.getav fatigue >= 25 player.modav2 fatigue -25 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif else set wil to player.getav willpower set magicka to player.getav magicka if wil == 0 || magicka < 25 return else playgroup stagger, 1 set shock to wil / 3 set resshock to getav resistshock set shock to shock - resshock*shock/100 set shock to shock * -1 pms effectshockdamage 1 playsound3d splshockhit modav2 health shock player.modav2 magicka -25 endif endif elseif weap < 100 set chance to getrandompercent + 1 if chance > 33 return endif if zzssquest.fore > 0 modav2 health dmg playgroup stagger, 1 playsound3d WPNHitBladeFleshEnchanted if player.getav fatigue >= 35 player.modav2 fatigue -35 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif elseif zzssquest.back > 0 set down to 1 playsound3d WPNBlunt1HandEquipEnchanted modav2 fatigue -1000 if player.getav fatigue >= 25 player.modav2 fatigue -25 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif else set wil to player.getav willpower set magicka to player.getav magicka if wil == 0 || magicka < 25 return else playgroup stagger, 1 set shock to wil / 3 set resshock to getav resistshock set shock to shock - resshock*shock/100 set shock to shock * -1 pms effectshockdamage 1 playsound3d splshockhit modav2 health shock player.modav2 magicka -25 endif endif else set chance to getrandompercent + 1 if chance > 50 return endif if zzssquest.fore > 0 playgroup stagger, 1 set dmg to dmg * 2 modav2 health dmg playsound3d WPNHitBladeFleshEnchanted if player.getav fatigue >= 35 player.modav2 fatigue -35 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif elseif zzssquest.back > 0 set down to 1 playsound3d WPNBlunt1HandEquipEnchanted modav2 fatigue -1000 if player.getav fatigue >= 25 player.modav2 fatigue -25 else set fat2 to player.getav fatigue * -1 player.modav2 fatigue fat2 endif else set wil to player.getav willpower set magicka to player.getav magicka if wil == 0 || magicka < 25 return else playgroup stagger, 1 set shock to wil / 2 set resshock to getav resistshock set shock to shock - resshock*shock/100 set shock to shock * -1 pms effectshockdamage 1 playsound3d splshockhit modav2 health shock player.modav2 magicka -25 endif endif endif end begin scripteffectfinish if down == 1 set down to 0 modav2 fatigue 1000 endif end Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted November 3, 2019 Share Posted November 3, 2019 Hmm, it actually does quite a lot, but if this is like an on-strike script effect running on the target, then it basically applies stat-based randomized damage to the target and armor-dependent chance-based fatigue consumption to the player with different sounds and a skill-based chance for a shock damage special effect as bonus damage. Or that's what I'm reading out of it at least. Link to comment Share on other sites More sharing options...
Skyjesterus Posted November 3, 2019 Share Posted November 3, 2019 daggerot, it would be helpful to know why you're asking the question. Are you just learning in general, or do you have specific questions about the script? Drake is correct imo judging from the script name zzSheoSpearEffect. :) Link to comment Share on other sites More sharing options...
Recommended Posts