Jump to content

Random-effect potion?


DaisukeKamina

Recommended Posts

I'm sorry, scratch that... sorry to dissappoint you Hickory :D but it seems we're wrong on this one :P

 

http://cs.elderscrolls.com/constwiki/index.php/AddSpell

Addspell works only with spell types listed in the Spells section of the object window. It cannot be used to add leveled spells to an actor via script. To dynamically add a spell to the player based on their level use the following script as a guide

 

My earlier mentioned script, with your (DaisukeKamina) GetRandom list. You will indeed need that.

 

So, what you'll need is this;

scn 000PotionRandEffectA

short Button
short ButtonPressed
short kanpai

begin OnEquip
messagebox "Daisuke's Magicka Liqueurs. Here's to your magicka, but be warned- anything can happen! Don't be a goblin- consume Daisuke's Magicka Liqueurs responsibly.", "Down the hatch!", "Ummm..."
set ButtonPressed to 1
end

begin MenuMode
if ButtonPressed == 1
	set Button to GetButtonPressed
	if Button == -1
		return
	elseif Button == 0
		set kanpai to GetRandomPercent
		if kanpai < 10
			player.addspell DaisukeMagickaLiqueur1
		elseif kanpai >=10 && kanpai < 20
			player.addspell DaisukeMagickaLiqueur2
		elseif kanpai >=20 && kanpai < 30
			player.addspell DaisukeMagickaLiqueur3
		elseif kanpai >=30 && kanpai < 40
			player.addspell DaisukeMagickaLiqueur4
		elseif kanpai >=40 && kanpai < 50
			player.addspell DaisukeMagickaLiqueur5
		elseif kanpai >=50 && kanpai < 60
			player.addspell DaisukeMagickaLiqueur6
		elseif kanpai >=60 && kanpai < 70
			player.addspell DaisukeMagickaLiqueur7
		elseif kanpai >=70 && kanpai < 80
			player.addspell DaisukeMagickaLiqueur8
		elseif kanpai >=80 && kanpai < 90
			player.addspell DaisukeMagickaLiqueur9
		elseif kanpai >=90 && kanpai < 100
			player.addspell DaisukeMagickaLiqueur10
		endif
		messagebox "The flavors of ectoplasm, moon-sugar and daedra venin dissolved in alcohol are subtle and the fine flecks of Welkynd Stone suspended in the liquid crackle in your mouth as they dissolve. The effect is something like a punch to the brain, but you are suffused with energy and you can feel sparks behind your eyes."
		player.removeitem DaisukeMagickaLiqueur 1
		set ButtonPressed to 0
	elseif Button == 1
		messageBox "They say discretion is the better part of valor. They also say you're a wuss."
		set ButtonPressed to 0
	endif
endif
end

 

My bad :D

 

 

Lucifer

 

 

EDIT;

By the way, if you wish to make it spamless, just add two (!) empty messages before the addspell commands (or additem, works whenever).

 

As in;

message " "

message " "

 

Note: not a messagebox, but a message. And note the space as well, otherwise it won't compile. Use this trick to de-spam just about anything.

Edited by GreatLucifer
Link to comment
Share on other sites

I'm sorry, scratch that... sorry to dissappoint you Hickory :D but it seems we're wrong on this one :P

 

;)

Link to comment
Share on other sites

I know, hence the second post, the link and the new script :P

 

The problem can only be the spells I've chosen, then... most of them are fairly normal, like Fortifys and Restores and such, but some of them have Summon effects. Is that an issue when adding it as an ability? (A 'no' answer would probably confuse me more, I'll be honest.)

Link to comment
Share on other sites

It's gonna be the confusing one :D

 

Just to be sure, I just tested it. My posted script, only with one ability that summons a bear....

 

It worked just fine. Better than expected even, as the ability seemed to auto-remove itself when the bear died.

 

So not sure what to tell you man, I tested it, with the script I gave you and a bear-summoning-ability, and it works like a charm.

 

If it won't for you, it's probably going wrong elsewhere.... :blink:

 

 

Lucifer

Link to comment
Share on other sites

  • Recently Browsing   0 members

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