[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,760
Reaction score
2,754
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
343
Reaction score
138
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,760
Reaction score
2,754
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
363
Reaction score
85
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

Testing out applying a stroke effect to things at player level to increase visibility. Thoughts?

...well...THAT'S...ODD
I wonder what cat meat tastes like.
Some call him... the wacky one.

Forum statistics

Threads
95,646
Messages
930,720
Members
125,977
Latest member
NewPhoneWhoDis
Top