Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName PDC1FollowerMagic Extends ReferenceAlias
- ;=================================================================================
- ;PROXiCide aka Taewon
- ;Steam: http://steamcommunity.com/id/PROXiCiDE
- ;Nexus: http://skyrim.nexusmods.com/users/3018315
- ;Bethesda: http://forums.bethsoft.com/user/425376-taewon/
- ;=================================================================================
- ;=================================================================================
- ; Properties
- ;=================================================================================
- FormList Property PDC1HealingSpells Auto
- {List of Healing Spells to be enabled}
- FormList Property PDC1SpellEffectKeywordDamage Auto
- {Contains Keywords for Damage Spells, such As MagicDamageFire, ....}
- ReferenceAlias[] Property pActorRefs Auto
- ReferenceAlias Property pSpellTargetRef Auto
- {Used by Packages, via Quest Alias Target for Spells}
- Float Property fSpellDistanceInterior = 750.0 Auto
- {Distance must match the AI Package}
- Float Property fSpellDistanceExterior = 1500.0 Auto
- {Distance must match the AI Package}
- GlobalVariable Property PDC1SpellTarget Auto
- {
- 1 : Self
- 2 : Player
- 3 : Follower
- 4+ : Array Refs
- }
- GlobalVariable Property PDC1SpellDaulCast Auto
- {
- 0 : Normal Cast
- 1 : Dual Cast
- }
- GlobalVariable Property PDC1SpellCastingType Auto
- {
- 0 : Concentration
- 1 : Constant
- 2 : Fire and Forget
- }
- GlobalVariable Property PDC1SpellTargetType Auto
- {
- 1 : Aimed
- 2 : Contact
- 3 : Self
- 4 : Target Actor
- 5 : Target Location
- 6 : Target Party Members
- }
- GlobalVariable Property PDC1SpellIsHeal Auto
- {Spell Type is a Heal}
- GlobalVariable Property PDC1SpellIsBuff Auto
- {Spell Type is a Buff}
- GlobalVariable Property PDC1SpellIsDebuff Auto
- {Spell Type is a Debuff}
- Bool bRangeCheckingEnabled = True
- ;=================================================================================
- ; Get/SetSpellRangeChecking
- ;=================================================================================
- Bool Function GetSpellRangeChecking()
- Return bRangeCheckingEnabled
- EndFunction
- Function SetSpellRangeChecking(Bool bEnabled = True)
- bRangeCheckingEnabled = True
- If !bEnabled
- bRangeCheckingEnabled = False
- EndIf
- EndFunction
- ;=================================================================================
- ; ResetSpellCasting
- ;=================================================================================
- Function ResetSpellCasting()
- PDC1SpellTarget.SetValue(0)
- PDC1SpellDaulCast.SetValue(0)
- PDC1SpellCastingType.SetValue(0)
- PDC1SpellTargetType.SetValue(0)
- PDC1SpellIsHeal.SetValue(0)
- PDC1SpellIsBuff.SetValue(0)
- PDC1SpellIsDebuff.SetValue(0)
- EndFunction
- ;=================================================================================
- ; GetSpellByID
- ;=================================================================================
- Spell Function GetSpellById(Int iSpellId)
- Spell pSpell = None
- Return pSpell
- EndFunction
- ;=================================================================================
- ; IsSpellCasting
- ;=================================================================================
- Bool Function IsCastingSpell()
- If PDC1SpellTarget.GetValue() >= 1
- Return True
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; IsCastingSpellHeal
- ;=================================================================================
- Bool Function IsCastingSpellHeal()
- If IsCastingSpell() && PDC1SpellIsHeal.GetValue() >= 1
- Return True
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; IsCastingSpellBuff
- ;=================================================================================
- Bool Function IsCastingSpellBuff()
- If IsCastingSpell() && PDC1SpellIsBuff.GetValue() >= 1
- Return True
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; IsCastingSpellDebuff
- ;=================================================================================
- Bool Function IsCastingSpellDebuff()
- If IsCastingSpell() && PDC1SpellIsDebuff.GetValue() >= 1
- Return True
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; CastSpellByType
- ; Cast a Spell
- ; Types
- ; Conc
- ; FF
- ; Actor
- ;=================================================================================
- Bool Function CastSpellByType(Actor akTarget, String sSpellName, String sType, Bool bDualCast)
- If !IsValidSpellTarget(akTarget,sSpellName)
- Return False
- EndIf
- Return True
- EndFunction
- ;=================================================================================
- ; CastSpellByName
- ; Cast a Spell
- ;=================================================================================
- Bool Function CastSpellByName(Actor akTarget, String sSpellName, Bool bDualCast)
- If !IsValidSpellTarget(akTarget,sSpellName)
- Return False
- EndIf
- Return True
- EndFunction
- ;=================================================================================
- ; IsHealthValidForHealing
- ;=================================================================================
- Float Property fHealthPercent75 = 0.75 Auto
- Float Property fHealthPercent50 = 0.5 Auto
- Float Property fHealthPercent25 = 0.25 Auto
- Bool Function IsHealthValidForHealing(Actor akTarget)
- If akTarget && !akTarget.IsDead()
- Float fCurHealthPercent = akTarget.GetActorValuePercentage("Health")
- If fCurHealthPercent <= fHealthPercent75
- Return True
- EndIf
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; IsValidSpellTarget
- ;=================================================================================
- Bool Function IsValidSpellTarget(Actor akTarget, string sSpellName)
- If !akTarget || IsCastingSpell()
- Return False
- EndIf
- If !pSpellTargetRef
- Return False
- EndIf
- If !IsSpellInRange(akTarget, sSpellName) && GetSpellRangeChecking() == True
- Return False
- EndIf
- Return True
- EndFunction
- ;=================================================================================
- ; IsSpellInRange
- ; Checks if in range of target
- ;=================================================================================
- Bool Function IsSpellInRange(Actor akTarget, String sSpellName)
- Actor pSelf = Self.GetActorRef()
- If !pSelf
- Return False
- EndIf
- If akTarget.GetDistance(pSelf) <= fSpellDistanceInterior && pSelf.IsInInterior()
- Return True
- EndIf
- If akTarget.GetDistance(pSelf) <= fSpellDistanceExterior && !pSelf.IsInInterior()
- Return True
- EndIf
- Return False
- EndFunction
- ;=================================================================================
- ; Get/Set CritChance
- ; Crit Chances
- ;=================================================================================
- Float Function GetSpellCritChance(String sSpellName)
- EndFunction
- Function SetSpellCritChance(String sSpellName, Float fCritChance)
- EndFunction
- ;=================================================================================
- ; GetNumSpells
- ; Number of Spells
- ;=================================================================================
- Int Function GetNumSpells()
- EndFunction
- ;=================================================================================
- ; IsAttackSpell
- ; Does Spell do harm?
- ;=================================================================================
- Bool Function IsAttackSpell(String sSpellName)
- EndFunction
- ;=================================================================================
- ; IsPassiveSpell
- ; Is Spell a Ability
- ; This will probably not be possible
- ;=================================================================================
- Bool Function IsPassiveSpell(String sSpellName)
- ;PDC1SpellCastingType == 1
- EndFunction
- ;=================================================================================
- ; Utilities
- ;=================================================================================
- Float Function MinFloat(Float x,Float y)
- If x < y
- Return x
- Else
- Return y
- EndIf
- EndFunction
- Float Function MaxFloat(Float x,Float y)
- If x > y
- Return x
- Else
- Return y
- EndIf
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment