41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
|
Scriptname _00E_EPOnDeath extends ObjectReference
|
||
|
{Monster death: Experience points are given to the player}
|
||
|
|
||
|
Event OnDeath(Actor akKiller)
|
||
|
|
||
|
If akKiller == None || (akKiller.GetFactionRank(EPFaction) >= 0) || akKiller.HasEffectKeyword(BlameSpellKeyword) || HasBlameSpell
|
||
|
|
||
|
If RewardExp == 0
|
||
|
RewardExp = 50
|
||
|
EndIf
|
||
|
|
||
|
If PlayerREF == None
|
||
|
PlayerREF = Game.GetPlayer()
|
||
|
EndIf
|
||
|
|
||
|
If (PlayerREF as _00E_EPUpdateFunctions).receiveEP(RewardExp)
|
||
|
; Player receives EXP
|
||
|
EndIf
|
||
|
|
||
|
EndIf
|
||
|
|
||
|
endEvent
|
||
|
|
||
|
Event OnDying(Actor akKiller)
|
||
|
|
||
|
; needs to be conditioned because of other scripts, for example _00E_FrenzySC, setting this bool too, otherwise it's unclear which OnDying Event gets evaluated first
|
||
|
If self.HasEffectKeyword(BlameSpellKeyword)
|
||
|
HasBlameSpell = true
|
||
|
EndIf
|
||
|
|
||
|
EndEvent
|
||
|
|
||
|
bool Property HasBlameSpell Auto hidden ; Do not edit this. This bool is used to determine whether a spell triggered by a trap or another magic effect (which should give the player EP) killed this actor.
|
||
|
|
||
|
Keyword Property BlameSpellKeyword Auto
|
||
|
|
||
|
Faction Property EPFaction Auto
|
||
|
|
||
|
Actor Property PlayerREF Auto
|
||
|
|
||
|
Int Property RewardExp auto
|