enderalse/scripts/source/_00e_a1_shadowtongueoilsc.psc

96 lines
3.4 KiB
Plaintext

Scriptname _00E_A1_ShadowtongueOilSC extends ObjectReference
Import Utility
Import _00E_TalentLibrary
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnInit()
Self.PlaceAtMe(_00E_A2_ShadowtongueOilBottleExplosion, 1)
float fPosX = Self.GetPositionX()
float fPosY = Self.GetPositionY()
iSpellindex = GetPlayerTalentLevel(_00E_Class_Vagabond_P05_Talent_ShadowtongueOil, _00E_Class_Vagabond_P05_Talent_ShadowtongueOil2, _00E_Class_Vagabond_P05_Talent_ShadowtongueOil3)
AdjustHazardSpell()
AdjustOilFireSpell()
; actor snaps to navmesh in order for the oil pool not be placed below the landscape
Actor akOilPlacerRef = Self.PlaceAtMe(_00E_A1_ShadowtongueoilPlaceNPC, 1) as Actor
iOilVisuals = akOilPlacerRef.PlaceAtMe(_00E_A1_ShadowtongueoilPool)
iOilVisuals.SetPosition(fPosX, fPosY, iOilVisuals.GetPositionZ())
akOilPlacerRef.Delete()
OilPoolDuration = _00E_A1_ShadowtongueOilSP.GetNthEffectDuration(iSpellindex)
iOilVisuals.PlayAnimation("playAnim01")
iOilHazard = iOilVisuals.PlaceAtMe(_00E_A1_ShadowtongueOilHazard, 1)
RegisterForSingleUpdate(OilPoolDuration)
Wait(0.1) ; wait for the 3D of the oil pool to be loaded in completely, so that the sound can be played
_00E_MAGShadowOilOoze.Play(iOilVisuals)
EndEvent
Event OnUpdate()
iOilVisuals.playanimationandwait("stopeffect", "end")
Wait(1)
iOilHazard.Delete()
iOilVisuals.Delete()
Self.Delete()
EndEvent
Function AdjustHazardSpell()
float iSlowAmount = _00E_A1_ShadowtongueOilSP.GetNthEffectMagnitude(iSpellindex)
iSlowDuration = _00E_A1_ShadowtongueOilSP.GetNthEffectDuration(iSpellindex)
_00E_A1_ShadowtongueOilHazardSP.SetNthEffectMagnitude(0, iSlowAmount)
_00E_A1_ShadowtongueOilHazardSP.SetNthEffectDuration(0, iSlowDuration)
_00E_A1_ShadowtongueOilHazardSlowSP.SetNthEffectMagnitude(0, iSlowAmount)
_00E_A1_ShadowtongueOilHazardSlowSP.SetNthEffectDuration(0, iSlowDuration)
EndFunction
Function AdjustOilFireSpell()
float iOilFireDamage = _00E_A1_ShadowtongueOilSP.GetNthEffectMagnitude(iSpellindex + 3)
int iOilFireDuration = _00E_A1_ShadowtongueOilSP.GetNthEffectDuration(iSpellindex + 3) as Int
_00E_A1_ShadowtongueOilFireSP.SetNthEffectMagnitude(0, iOilFireDamage)
_00E_A1_ShadowtongueOilFireSP.SetNthEffectDuration(0, iOilFireDuration)
EndFunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
int iSpellIndex
int iSlowDuration
Float OilPoolDuration
ObjectReference iOilHazard
ObjectReference iOilVisuals
ActorBase Property _00E_A1_ShadowtongueoilPlaceNPC Auto
Hazard Property _00E_A1_ShadowtongueOilHazard Auto
Sound Property _00E_MAGShadowOilOoze Auto
Activator Property _00E_A1_ShadowtongueoilPool Auto
Spell Property _00E_A1_ShadowtongueOilSP Auto
Spell Property _00E_A1_ShadowtongueOilHazardSP Auto
Spell Property _00E_A1_ShadowtongueOilFireSP Auto
Spell Property _00E_A1_ShadowtongueOilHazardSlowSP Auto
Explosion Property _00E_A2_ShadowtongueOilBottleExplosion Auto
Perk Property _00E_Class_Vagabond_P05_Talent_ShadowtongueOil Auto
Perk Property _00E_Class_Vagabond_P05_Talent_ShadowtongueOil2 Auto
Perk Property _00E_Class_Vagabond_P05_Talent_ShadowtongueOil3 Auto
Static Property XMarker Auto