OnPcEquip for Potions?

Post » Thu Jun 23, 2011 2:06 pm

I was reading through Morrowind Scripting for Dummies, and I found out that OnPcEquip doesn't work for potions or books/scrolls, and that you have to use PcSkipEquip. I'm confused. I wrote this script to attatch to a potion. It is supposed to allow "inifnite" uses.
begin stc_elixiroflifesshort OnPcEquipif ( menumode == 0 )	returnelseif ( menumode == 1 )	if ( OnPCEquip == 0 )		return	elseif ( OnPcEquip == 1 )		Messagebox, "You drink some of the Elixir. It appears after inspection that you drank none."		player->additem, "stc_elixiroflife" 1		return	endifendifend

How do I implement the PcSkipEquip function and still drink the potion? It's jarring my mind.
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Thu Jun 23, 2011 7:11 am

First, I've seen oddities with not using proper case with the variable functions. So ensure you're using OnPCEquip instead of OnPcEquip.

So to use PCSkipEquip, just set it to 1 before you call OnPCEquip:

begin stc_elixiroflifesshort OnPCEquipshort PCSkipEquipset PCSkipEquip to 1if ( menumode == 0 )        returnelse        if ( OnPCEquip == 1 )                set OnPCEquip to 0                Messagebox, "You drink some of the Elixir. It appears after inspection that you drank none."                player->additem, "stc_elixiroflife" 1                return        endifendifend

User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Thu Jun 23, 2011 8:00 am

First, I've seen oddities with not using proper case with the variable functions. So ensure you're using OnPCEquip instead of OnPcEquip.

So to use PCSkipEquip, just set it to 1 before you call OnPCEquip:

begin stc_elixiroflifesshort OnPCEquipshort PCSkipEquipset PCSkipEquip to 1if ( menumode == 0 )        returnelse        if ( OnPCEquip == 1 )                set OnPCEquip to 0                Messagebox, "You drink some of the Elixir. It appears after inspection that you drank none."                player->additem, "stc_elixiroflife" 1                return        endifendifend


Well that makes alot more since, Thanks!
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am


Return to III - Morrowind