Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Debuff Script --- Cant use skills while in a state.

Save-Point

Full Version: Debuff Script --- Cant use skills while in a state.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically I am wanting to make a skill that gives a character back 50% of their SP. I do not want them to be able to do this at any time though since the skill is "free" (0SP).

The idea is to give them a state (debuff) when they cast the spell and not let them use the spell again (grayed out) until the state is gone.

I understand how to do this with a common event, condition branch and variable. The problem with this method is that if the character is in the debuff state, itll just say "you cant do this now" or whatever but they will also lose their turn. I just want the skill to be grayed out instead of letting them use it and just lose their turn for no reason.

I mentioned the specific way it can be used but I am hoping to use it in a number of ways so I am hoping for more of a system than a one shot, one skill only quick fix.

Thanks to anyone that can help. Will give you cookies or pudding. Happy
but you can make a common event that says, if the actor1 is in state "debuff", add skill "SP Recovery" (e.g.). I don't know how to make that with a greyed out one, sorry
andicesharks Wrote:I understand how to do this with a common event, condition branch and variable. The problem with this method is that if the character is in the debuff state, itll just say "you cant do this now" or whatever but they will also lose their turn. I just want the skill to be grayed out instead of letting them use it and just lose their turn for no reason.

Thank you for the reply though.
I believe I have figured out how to do this by modifying a great script I already had. I am not 100% sure my modifications are "bug free" or whatnot but I have tested it and it works like I wanted it to.

The following script is not my scrip and it is also not set up to do what I described above but I will explain how to mod it to work like I mentioned. It is very cool and simple in itself and you should check it out...

Code:
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
# State Requirement Skills                                                     #
# Author: [Faint]                                                              #
# Version: 1.0                                                                 #
# Date: 11/10/2009                                                             #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
#                                                                              #
#   This Add-on allows you to make skills require a specified state to be      #
#   inflicted upon the actor before they can use said skill.                   #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
module SRConfigs
  
  def self.req_state(id)
    case id
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
# Configs                                                                      #
#                                                                              #
#   when SKILL_ID then return REQUIRED_STATE_ID                                #
#   SKILL_ID            - ID of the Skill.                                     #
#   REQUIRED_STATE_ID   - ID of the State required to use the Skill.           #
#*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=#
      when 73 then return 38
      when 74 then return 38
      when 75 then return 39  
    end
    return
  end

end

#==============================================================================#
# Game_Battler                                                                 #
#==============================================================================#

class Game_Battler
  
  alias state_met? skill_can_use?
  def skill_can_use?(skill_id)
    data = SRConfigs.req_state(skill_id)
    return data != nil && !self.state?(data) ? false : state_met?(skill_id)
  end
  
end

The code above lets you gray out a skill until you are in a certain state. Well, I want to gray out the skill when I am in a state(debuff).

If you only want the debuffs to work as I am talking about without the original script, all you have to do is remove the ! in front of self.state?(data) in the third to last line. Pretty simple. This will make the 'when - then return' part above mean the skill number you want grayed out when you are in the state number.

To get this to work along with the original script like I am, you have to do a bit more. I am by no means a scripter but after these two not working together, I figured it had something to do with some of the references being the same name. To fix this, I changed them in the modded script.

First, change both instances of "SRConfigs" to something else. "SRConfigsDebuff" for example.

Second, change both instances of "req_state". "req_state_debuff" for example.

Third, change both instances of "state_met". "state_met_debuff" for example.

Last, remove the ! from in front of self.state?(data) as I mentioned above. This will lead to the two scripts working together. The original working like it says and the debuff working like I described it.

In the skill, if it is not targeting the caster, you just give them the state in a common event.



If anyone sees any mistakes to my changes, please say something. It works in my testing but I may have missed something.

Hopefully some people can find some good uses for this. It will definitely make skill decisions and battles more interesting. some concepts or ways to use this are:

- Skills have cooldowns. You may want to give characters skills with powerful effects but you dont want them to be based on having to do things first (such as building points in a gauge) and/or you do not want them to use that spell over and over since it is so powerful(game imbalance).

-Skill trees have cooldowns. You can make it where if you use a fire skill, all of your fire skills have a cooldown after that. This can also be used on an enemy player - sort of like a silence to a certain skill-set while the debuff is on them. It can also be used as a way to silence non magical attacks since the default way silence works is based on a skill having no "attack" parameters.

These two themes are common in WoW. Special skills with long cooldowns such as Ice Block or Sprint and short skill group cooldowns like a Shamans shock spells.

You give the debuff a 100% chance to end after 1 turn if you want them to be able to only use spells every other turn for instance or you can make it last 3 turns so you can use the ability again in battle but not for a while.

Another way that it can be used is as "Encounter" or "Daily" powers. This is common in D&D. You make a debuff last the whole battle and then remove it at the end of battle for "Encounter" powers. They can be used once per battle. You make it where the debuff is not released at the end of battle. The way to release it is by sleeping in an inn or using a camp item connected to events that will restore HP SP and remove all debuffs. In this way, it turns into a "Daily".