[XP] Skill Self Inflicted State without Common Events

ItemNazo

YoRha Unit J6
Member
Joined
Apr 29, 2013
Messages
18
Reaction score
17
First Language
Engliese
Primarily Uses
RMXP
What I'm trying to get is when a character cast magic/skill The Caster get inflicted with a state let call it "Tired" this cannot be done with common event due to anyone able to equip any magic or skill in my game.
 

Jesse - PVGames

Game and Graphics Developer
Veteran
Joined
Jun 23, 2012
Messages
1,784
Reaction score
2,778
First Language
English
Primarily Uses
I opened up my project to see how I did that. It is pretty simple overall, you can add it through the damage formula box. Here is an example I found for myself:

dmg = a.atk * 5.8 - b.def * 2; a.addState(5); dmg;

You can probably move it around a bit, but the important part you are looking for is a.addState(5) - just be sure to replace the 5 with whatever number state you want to inflict on the user of the skill.
 

ItemNazo

YoRha Unit J6
Member
Joined
Apr 29, 2013
Messages
18
Reaction score
17
First Language
Engliese
Primarily Uses
RMXP
Thxs, I still havn't figure it out where to put it yet(might be due to the battle system I'm using) if it still giving me problem I'll ask again.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
421
Reaction score
165
First Language
english
Primarily Uses
RMMV

ItemNazo

YoRha Unit J6
Member
Joined
Apr 29, 2013
Messages
18
Reaction score
17
First Language
Engliese
Primarily Uses
RMXP
Isnt plugin are for MV?
 

Jesse - PVGames

Game and Graphics Developer
Veteran
Joined
Jun 23, 2012
Messages
1,784
Reaction score
2,778
First Language
English
Primarily Uses
My mistake, I did not see that this was for XP - my solution would not work for XP. My apologies!
 

ItemNazo

YoRha Unit J6
Member
Joined
Apr 29, 2013
Messages
18
Reaction score
17
First Language
Engliese
Primarily Uses
RMXP
Even if it by mistakes thxs for trying
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
378
Reaction score
89
First Language
English
Primarily Uses
@ItemNazo This script should do what you're looking for. Instructions are in the script, but it's pretty simple.

Code:
#===============================================================================
# Self State
# Author: Mobius XVI
# Version: 1.0
# Date: 18 MAY 2018
#===============================================================================
#
# Introduction:
#
#   The purpose of this script is to allow you to apply states to a skill user
#       even when the target of the skill is someone else.
#
# Instructions:
#
#  - Place this script below all the default scripts but above main
#
#  - Create a Common Event (CE) with a script call. In the script call place
#        the following snippet:
#
#        Mobius::Self_State.apply_state(State_ID)
#
#  - Tag your skill with the CE that you just made, and you're done!
#
# Issues/Bugs/Possible Bugs:
#
#   - None
#
#  Credits/Thanks:
#    - Mobius XVI, author
#    - ItemNazo, for requesting it
#
#  License
#    The MIT License (MIT)
#
#    Copyright (c) 2018 darmes
#
#     Permission is hereby granted, free of charge, to any person obtaining a copy
#     of this software and associated documentation files (the "Software"), to deal
#     in the Software without restriction, including without limitation the rights
#     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#     copies of the Software, and to permit persons to whom the Software is
#     furnished to do so, subject to the following conditions:
#
#     The above copyright notice and this permission notice shall be included in all
#     copies or substantial portions of the Software.
#
#     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#     SOFTWARE.
#   
#    Further, if you do decide to use this script in a commercial product,
#    I'd ask that you let me know via a forum post or a PM. Thanks.
#
#===============================================================================
# ** Self State - EDIT BELOW THIS LINE AT OWN RISK
#===============================================================================
module Mobius
  module Self_State
    
    def self.apply_state(state_ID)
      # get active battler
      if $scene.is_a?(Scene_Battle)
        active_battler = $scene.active_battler
      else
        return
      end
      active_battler.add_state(state_ID)
    end
    
  end
end
#--------------------------------------------------------------------------
# Changes to class Scene_Battle
#--------------------------------------------------------------------------
class Scene_Battle
    attr_reader :active_battler
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Before the full time job, I can make 1 MZ plugin per day, even though it's still hard; With the full time job, making 1 such plugin per week becomes just as hard lol
I have a new RPG Maker music pack announcement coming soon. I am really having good time composing this one!
taarna23 wrote on ImaginaryVillain's profile.
You know... When you wanted better visibility over there in Silent Hill, you weren't supposed to send it here.

Forum statistics

Threads
102,989
Messages
996,493
Members
134,456
Latest member
Diavolox
Top