How to make an item heal with a 25% chance to poison?

My game is called Death's Glance. It's set in a world of magic. So, guns and technology aren't needed. Thanks to magic, the development of technology is much slower, meaning 100 years after Medieval Times ended for us, the era of the sword and of the shield is still thriving. Monsters have many resources within their bodies, and only those so inclined take up alchemy. 

I'm thinking monsters could drop items (already know how to do that) that have a positive effect, bt may also inflict a negative one. 

For instance, Green Goo is dropped by a Slime, and you can eat it to heal yourself by 50 HP. OR, it might poison you. I have no idea how to make an item do that. 
Easiest way - make the item trigger a Common Event, and make the Common Event do the 50/50 roll, and subsequent consequences.
Unfortunately, I can't help with the custom formula for that item, but I would like to say that you should think again about whether you really want stuff like that. I imagine it being extremely frustrating when I'm so desperate that I use a consumable (you normally use skills, right? Because consumables are limited) and then not only does it not work, it even works AGAINST me.
Unfortunately, I can't help with the custom formula for that item, but I would like to say that you should think again about whether you really want stuff like that. I imagine it being extremely frustrating when I'm so desperate that I use a consumable (you normally use skills, right? Because consumables are limited) and then not only does it not work, it even works AGAINST me.
The game is meant to be pretty hard, and emphasize strategy and risk taking. Yes, it does make it hard, but hard in an interesting way. In a situation like that IRL, if you had a piece of raw meat (the Green Goo) and you're starving (or low on HP) and the raw meat (/Green Goo) can help or hurt you, but if you had access to a fire (or alchemy table) then it coudln't hurt you, but you might die before you find one. What to do? That'

s the kind of thing I want in this game. Although, it could seem like the game is cheating you, which is why I have a few testers telling me what they think.

Easiest way - make the item trigger a Common Event, 

and make the Common Event do the 50/50 roll, and subsequent consequences.
I can do what I put on the first line, but not the second. Might be sounding noobish now, but how would I do that?
You call the common event via the features. 🙂 Not via formula.
http://forums.rpgmakerweb.com/index.php?/topic/25063-conditional-effects/

This creates conditions for which effect is going to be applied when the item/skill is used. Just run a common event that sets a variable to a random number. So for instance, if you have a common event that sets Variable 001 to a random number between 1 and 3... Then your notetag for the item should look like this.

<effect condition: 1>v[1] == 1</effect condition><effect condition: 2>v[1] == 2</effect condition><effect condition: 3>v[1] == 3</effect condition>This way, each time the item is used, a random effect can occur. Just make sure that you run the common event at the beginning of each battle to be safe. I'm not exactly sure when the common event is processed. If could either be before, or after the effect takes place. Honestly not sure.
I'm pretty sure the common event runs after the skill has been used. 🙂
That's what I was thinking. I'd still have the event run at the beginning of the battle to keep the numbers circulating.
EDIT:Totally forgot to attach the screenshots and how. Posted them to my twitter (https://twitter.com/ThatWhovianDude), it's the tweet right below the pinned one that says " Let me be the Kirito to your Asuna... pizza." the one that says "Can't remeber how to attach a photo from my hard drive on the RPG Maker Forums. Derp." Agh, I really hope I'm not forgetting a forum rule here....

EDIT 2: Tried what's in the screenshots, no go. It did all of them at once, not one of them. >.<

http://forums.rpgmakerweb.com/index.php?/topic/25063-conditional-effects/

This creates conditions for which effect is going to be applied when the item/skill is used. Just run a common event that sets a variable to a random number. So for instance, if you have a common event that sets Variable 001 to a random number between 1 and 3... Then your notetag for the item should look like this.

<effect condition: 1>v[1] == 1</effect condition><effect condition: 2>v[1] == 2</effect condition><effect condition: 3>v[1] == 3</effect condition>This way, each time the item is used, a random effect can occur. Just make sure that you run the common event at the beginning of each battle to be safe. I'm not exactly sure when the common event is processed. If could either be before, or after the effect takes place. Honestly not sure.
Tried this check screenshots to see if I did what you meant. Just tested it, poisoned me.

I'm pretty sure the common event runs after the skill has been used. 🙂
That's what I was thinking. I'd still have the event run at the beginning of the battle to keep the numbers circulating.
I'm meaning to make an item that might poison. Not a skill. I'm assuming this applies to both? The item will either be usable at any time, or only on the field.
Your screenshot is wrong. What you did was set 3 different variables to 0. What you need to do is set the variable to a random number between 1-3.

When you open the control variables event, the following options should be chosen...

Variable: Single

Operation: Set

Operand: Random: 1~3
Your screenshot is wrong. What you did was set 3 different variables to 0. What you need to do is set the variable to a random number between 1-3.

When you open the control variables event, the following options should be chosen...

Variable: Single

Operation: Set

Operand: Random: 1~3
I must have been doing something else wrong. >.< It still didn't work. However, I may have found another way. I can make it have a 75% chance to heal, and a 25% chance to poison, but it can do both.Is there a way to maybe say "If heal fails, poison."?
Are you using Conditional Branches? If so, use the "Else" branch instead of a new Conditional Branch.
try running this

ctphelp.PNG

only changing the targets and hp count as needed
try running this

[IMG]http://forums.rpgmakerweb.com/public/style_images/RPGW_33_Images/attachicon.gif[/IMG]ctphelp.PNG

only changing the targets and hp count as needed
This is what I ended up with. Works perfectly, except I didn't see "Effect User" anywhere. I was thinking I'd have more characters than just Aain in the near future. Meaning it should effect the one specific person. The idea is that they ingest the Green Goo, so not all of them would be effected. I need it to be dependent on who it's used on.

capture-20150312-120951.png
your going to need to set a variable to the item user then set effect to variable but i am unable to help you with the variable part sorry
Under the Items tab of the Database, can you not just use 'Features', add the state "Poison", then set the odds to "25%" in the bit underneath? Or is there part of this scenario that I'm not grasping.
The easiest way to do it would be to have BOTH effects - a 50 HP heal (normal healing formula), and a 25% chance to poison (normal entry in the feature box).

If you insist on having it do one OR the other, it can still be done; just a bit more complicated:

  • Choose a single switch and a single variable to set aside for ONLY this skill.  Don't use that switch or variable for anything else in your game.
  • In the formula for the skill, use this: $game_variables[v] = b.id; if rand(100) < 75; $game_switches = false; dmg = 50; else; $game_switches[n] = true; dmg = 0; end; dmg    Note that v and s are the IDs of the variable and switch you just set aside.  dmg can be shortened to just d, and the spaces after the semicolons can be removed, if the formula is too long.
  • Add a Common Event to the features box for the skill.  Inside the common event, have a conditional branch that checks whether the Switch is True.  If so, do the following (and if false, do nothing at all): if the Variable is equal to 1, poison Eric; if the Variable is equal to 2, poison Natalie; and so on for each of the actors in your game.
Try putting this in the damage formula 

Code:
if rand(100)<75; 50; else; b.add_state(2); end;
Ah, yes.  I can't believe I didn't think to just put an add_state in the else block.  Use Eat's solution above.
Under the Items tab of the Database, can you not just use 'Features', add the state "Poison", then set the odds to "25%" in the bit underneath? Or is there part of this scenario that I'm not grasping.
I could, but the idea was that there was a 75% chance of it working, or it will backfire. That solution makes it more likely to do both. I ended up making a variable random 1-4, then a conditional branch meaning if the variable is equal to or less then 3, it heals Aain by fifty HP, else it posions, that common event is called when the item is used.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-item-heal-with-a-25-chance-to-poison.37638/