Jump to content

Casting spell on player without object refrence


WildWitch

Recommended Posts

Hiya Im writing a script that applies a blessing to a player when they release a soul from a soulgem via a spell. I want to make it so that greater, common, lesser, petty soulgems cause the player to recieve a blessing. Heres what I have so far

 

Scriptname zzz_ReleaseWhiteSoulScript extends activemagiceffect

SoulGem Property SoulGemGrand Auto
SoulGem Property SoulGemGreater Auto
SoulGem Property SoulGemCommon Auto
SoulGem Property SoulGemLesser Auto
SoulGem Property SoulGemPetty Auto
MiscObject Property SoulGemShards Auto
Sound Property FailureSFX Auto
message property failureMSG auto
message property SuccedGrandMSG auto
message property SuccedGreaterMSG auto
message property SuccedCommonMSG auto
message property SuccedLesserMSG auto
message property SuccedPettyMSG auto
Spell property BlessingGreater auto
Spell property BlessingCommon auto
Spell property BlessingLesser auto
Spell property BlessingPetty auto

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
objectReference caster = akCaster
if caster.getItemCount(SoulGemGrand) >= 1
caster.removeItem(SoulGemGrand, 1, TRUE)
Game.GetPlayer().ModActorValue("magicka", 2)
caster.addItem(SoulGemShards, 2, FALSE)
SuccedGrandMSG.show()
elseif caster.getItemCount(SoulGemGreter) >= 1
caster.removeItem(SoulGemGreater, 1, TRUE)

-->
caster.addItem(SoulGemShards, 2, FALSE)
SuccedGreaterMSG.show()
elseif caster.getItemCount(SoulGemCommon) >= 1
caster.removeItem(SoulGemCommon, 1, TRUE)
--->
caster.addItem(SoulGemShards, 2, FALSE)
SuccedCommonMSG.show()
elseif caster.getItemCount(SoulGemLesser) >= 1
caster.removeItem(SoulGemLesser, 1, TRUE)
--->
caster.addItem(SoulGemShards, 2, FALSE)
SuccedLesserMSG.show()
elseif caster.getItemCount(SoulGemPetty) >= 1
caster.removeItem(SoulGemPetty, 1, TRUE)
--->
caster.addItem(SoulGemShards, 2, FALSE)
SuccedPettyMSG.show()
else
FailureSFX.play(caster)
failureMSG.show()
endif
endEVENT

 

As you can see there are gaps where the spell cast function should be as I have no idea how to do it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...