enderalse/scripts/source/_00e_eponmagicalsymboldis.psc

64 lines
1.9 KiB
Plaintext

Scriptname _00E_EPOnMagicalSymbolDis extends ObjectReference
{To be put onto a magical symbol and its light}
import math
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnActivate(ObjectReference akActionRef)
if DoOnce == False
Self.Disable()
Self.DisableLinkChain()
DoOnce = True
EndIf
if akActionRef == Game.GetPlayer()
_00E_MagicalSymbolsGlobalCollected.SetValue(_00E_MagicalSymbolsGlobalCollected.GetValueInt() + 1)
_00E_Levelsystem_MagicalSymbolCollected.Show(_00E_MagicalSymbolsGlobalCollected.GetValueInt(), 100)
_00E_MagicalSymbolSound.Play(Game.GetPlayer())
Self.GetLinkedRef().disable()
self.disable()
int EXPBonus = (_00E_MagicalSymbolsGlobalCollected.GetValueInt() * 2)
Levelsystem.GiveEp(RewardExp+EXPBonus)
If _00E_MagicalSymbolsGlobalCollected.GetValueInt() == 100 && _00E_AchievementsEnabled.GetValueInt() == 1
Game.UnlockAchievement("END_FETCHQUEST_01")
EndIf
endIf
endEvent
event OnLoad()
_00E_MagicLigthShader.play(self as objectReference)
endEvent
event OnUnload()
_00E_MagicLigthShader.stop(self as objectReference)
endEvent
;=====================================================================================
; PROPERTIES
;=====================================================================================
Int Property RewardExp auto
Bool DoOnce = false
_00E_QuestFunctions Property Levelsystem Auto
GlobalVariable Property _00E_MagicalSymbolsGlobalCollected Auto
GlobalVariable Property _00E_AchievementsEnabled Auto
Sound Property _00E_MagicalSymbolSound Auto
Message Property _00E_Levelsystem_MagicalSymbolCollected Auto
EffectShader Property _00E_MagicLigthShader Auto