Jump to content

Scripting Question


RuaDragonheart

Recommended Posts

I'm trying to make a script where when the player picks up an item, namely a weapon, armor piece, or clothing, the PC sees a message and acquires a spell, but only once. I've managed to so far make it so it'll show the message and give the spell, but every time the item is picked up. I managed to figure out the scripting for it once a LONG time ago, but I no longer remember and Morrowind Scripting for Dummies is pretty much greek to me. Any suggestions on what the full script should look like?
Link to comment
Share on other sites

Box's script would mean that the PC could never delete the spell. Whenever the item is picked up and the spell is deleted, it would be re-added to the player's inventory since getspell would return unsuccessfully.

 

short doonce
short onpcadd

if ( doonce < 1 )
       if ( onpcadd )
               set doonce to 1
               set onpcadd to 0
               player->addspell "OMG LIEK ALL TEH SPALL EFFACTS LIEK A NEWCLEAR MUSSILE!!!11!"
               messagebox "As you grasp the OMG NUCLAR MUSSILE LANCHAR!!1, you feel a wrenching sensation.  As you snap out of it, some arcane phrase suddenly takes hold in your mind." "OK"
               ; The next ten lines are purely optional
               if ( player->getintelligence > 60 )
                       messagebox "You have learned a new spell."
               elseif ( player->getwillpower > 72 )
                       messagebox "You resist the urge to say the phrase, but recognize it as some sort of spell.  Aptly, you write it into your spellbook."
               else
                       messagebox "You copy the phrase into your spellbook, for use later.  Much later."
                       messagebox "Acting on instinct, you say the phrase.  Your voice booms and echoes, and power flows through your lips with each passing syllable.  A lot of power, actually...  You feel somewhat drained, and are unable to continue."
                       player->playsound "Spell Failure Destruction"
                       player->modcurrentmagicka -40
               endif
       endif
endif

endif

end

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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