Razakel Posted July 20, 2010 Share Posted July 20, 2010 I'm trying to write a script that will do the following: Upon activating a Shrine it will 1: Check for an item in inventory.2: If the player has the item then they'll be prompted to offer it or not.3: If not, nothing happens.4: If the player chooses to offer it a spell will be cast on the player and the item will be removed. Link to comment Share on other sites More sharing options...
InAComaDial999 Posted July 20, 2010 Share Posted July 20, 2010 I'm trying to write a script that will do the following: Upon activating a Shrine it will 1: Check for an item in inventory.2: If the player has the item then they'll be prompted to offer it or not.3: If not, nothing happens.4: If the player chooses to offer it a spell will be cast on the player and the item will be removed. Go to http://cs.elderscrolls.com/constwiki/index.php/Main_Page 1. see GetItemCount2. see MessageBox4. see RemoveItem and Cast Link to comment Share on other sites More sharing options...
Razakel Posted July 20, 2010 Author Share Posted July 20, 2010 This is what I've got so far..it's casting the spell and I'm getting the message for the spell but nothing else works. :sad: ScriptName 1aDarkLairMephalaShrine ref target Begin OnActivate if IsActionRef player == 1 if ( player.getitemcount Nightshade == 0 ) MessageBox "Nothing happens." elseif ( player.getitemcount Nightshade > 0 ) MessageBox "Do you wish to make an Offering?" "Yes" "No" endif MessageBox "Mephala accepts your offering!" Cast 1aDarkLairMephalaShrineSpell Player elseif ( Player.RemoveItem Nightshade 1 ) endif end Link to comment Share on other sites More sharing options...
InAComaDial999 Posted July 20, 2010 Share Posted July 20, 2010 The way you have this coded, it will cast the spell every time regardless. You need to check what the player selected using GetButtonPressed. Something like short Choice...MessageBox "Do you wish to make an Offering?" "Yes" "No"set Choice to GetButtonPressed...if Choice == 1 MessageBox "Mephala accepts your offering!" Cast 1aDarkLairMephalaShrineSpell Player Player.RemoveItem Nightshade 1endif Look at the examples in the MessageBox page. Link to comment Share on other sites More sharing options...
Razakel Posted July 20, 2010 Author Share Posted July 20, 2010 Alright with this script it will show the message "Nothing Happens" if no nightshade is on the player and will remove the nightshade, give the message "Mephala Accepts Your Offering" and cast the spell on the player if nightshade is on the player.It won't show the second message box for the option to make the offering or not...but I suppose this works! Thanks for your help. ScriptName 1aDarkLairMephalaShrine short Choice Begin OnActivate if IsActionRef player == 1 if ( player.getitemcount Nightshade == 0 ) MessageBox "Nothing happens." elseif ( player.getitemcount Nightshade > 0 ) MessageBox "Do you wish to make an Offering?" "Yes" "No" set Choice to GetButtonPressed if Choice == 1 elseif MessageBox "Mephala accepts your offering!" elseif Cast 1aDarkLairMephalaShrineSpell Player elseif ( Player.RemoveItem Nightshade 1 ) endif endifendifend Link to comment Share on other sites More sharing options...
Recommended Posts