Reduce experience from spell.

Discussion in 'RPG Maker MV' started by SnowHawk90, Jul 2, 2018.

  1. SnowHawk90

    SnowHawk90 Warper Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi. Got a question but can't find anything similar, so... (if I missed something, please let me know).

    I've got a spell that will kill its user, but does fairly stupid damage. The thing is, I don't want it usable free of charge, so to speak. I set up a separate state for the death caused by this spell - half the job done - now I'm trying to create a rez spell specifically for this state. The basic component (the rez) was easy to do, but I'm trying to find a way to reduce the recipient's EXP by 10% or so.

    Can anyone make any suggestions on how best to do this?

    Btw, I use some of Yanfly's plugins, so if it can be done with one of those, I'd appreciate it (assuming there isn't a way to do it
    in RMMV).

    Thanks,
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,026
    Likes Received:
    636
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    You should be able to do this using Yanfly's Buffs & States Core plugin, e.g. with a <Custom Remove Effect> notetag on your special death state:
    Code:
    <Custom Remove Effect>
    if (user.isActor()) {
      user.gainExp(-user.currentExp() / 10);
    }
    </Custom Remove Effect>
    This says: "when this state is removed, if the battler is an actor, reduce their exp by 1/10 of their current exp". ^_^

    Alternatively I think this code should work in various other types of notetag from Yanfly's plugins, e.g. <After Eval> from Skill Core. Haven't tested that, though. :kaoswt:
     
    Last edited: Jul 2, 2018
    #2
    SnowHawk90 likes this.
  3. SnowHawk90

    SnowHawk90 Warper Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you so much for this, especially the explanation.

    It works perfectly. Now I just need to decide if 10% is too generous...

    Keep it easy.
     
    #3
    caethyril likes this.

Share This Page