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 - [Resolved] State Defense Script

Save-Point

Full Version: [Resolved] State Defense Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Heya!
I searched a state defense script, maybe someone has one or knows where to find. That means:

If your char were for example in the state 'Poison Immunity' the state 'poison' wouldn't have any effect to him.

Hope ya understand :cheery:
I hate answering technical posts at work. I don't have RMXP up and I'm just basing my answers on memory alone.

So rather than setting your character to have a default high-resistance to poison, you are hoping to have a system that has two states counteract one another. If... you can change the character's resistance to poison rather than use a second state, that may be better.
yeah I think that would be complicated, also I think there is no command to change the class based state defense, or is there? If so, this could be evented, but I rather like to have a script than do it with events. If there is no chance for a script I would event it (if possible)^^
Couldn't you just set the 'Poison Immunity' state to remove poison?
While I was mucking around with state handling, I think I remember seeing a check that prevents states from being added if the actor already had a state that removes it.
Of course, it would remove poison as well as prevent it, but it wouldn't require changing any code. Probably.
yeah you're right, seems to work :D ty so much^^
but another question: I searched to make a state change the elemental attack, so for example state beastslayer would make your elemental attack Anti-Beast. Is this also possible like that? Or is there a script?
Quote:#
# ???????????????
#??©2007 TYPE74RX-T
#
#==============================================================================
# ? ???????
#------------------------------------------------------------------------------
# class Game_Battler
# def add_state
#==============================================================================

module RPG
class State
alias rx_rgssb18_initialize initialize
def initialize
# ?????????
rx_rgssb18_initialize
# ? ??????????????????
@rx_resist_state = false
end
#--------------------------------------------------------------------------
# ? ??????????????????
#--------------------------------------------------------------------------
def rx_resist_state
if @name.include?("-s")
@rx_resist_state = true
return @rx_resist_state
end
return @rx_resist_state
end
#--------------------------------------------------------------------------
# ? ???????????????????
#--------------------------------------------------------------------------
def name
new_name = @name.split(/[\s\-]+/)
return new_name[0]
end
end
end

#==============================================================================
# ? Game_Battler
#------------------------------------------------------------------------------
# ???????????????????? Game_Actor ???? Game_Enemy ??
# ???????????????????
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias rx_rgssb18_initialize initialize
def initialize
# ?????????
rx_rgssb18_initialize
# ? ????????
@rx_resist_states = []
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def rx_resist_states
return @rx_resist_states
end
#--------------------------------------------------------------------------
# ? ???????
# state_id : ???? ID
# force : ??????? (?????????????)
#--------------------------------------------------------------------------
def add_state(state_id, force = false)
# ??????????
if $data_states[state_id] == nil
# ??????
return
end
# ??????????
unless force
# ???????????
for i in @states
# ?????????????????????? (-) ????????
# ????????????????????? (-) ?????????
# (ex : ????????????????????)
if $data_states[i].minus_state_set.include?(state_id) and
not $data_states[state_id].minus_state_set.include?(i)
# ??????
return
end
end
end
# ?????????????????
unless state?(state_id)
# ???? ID ? @states ?????
@states.push(state_id)
# ????? [HP 0 ???????] ??????
if $data_states[state_id].zero_hp
# HP ? 0 ???
@hp = 0
end
# ?????????
for i in 1...$data_states.size
# ?????? (+) ??
if $data_states[state_id].plus_state_set.include?(i)
#++++++++++++++++++++++++++++?????++++++++++++++++++++++++++++
# ??????????????
if $data_states[state_id].rx_resist_state
# ????????????????????
@rx_resist_states.push(i)
else
add_state(i)
end
end
# ?????? (-) ??
if $data_states[state_id].minus_state_set.include?(i)
# ??????????????
if $data_states[state_id].rx_resist_state
# ????????????????????
@rx_resist_states.push(i)
else
remove_state(i)
end
end
#++++++++++++++++++++++++++???????++++++++++++++++++++++++++
end
# ??????????? (????????????) ?????
@states.sort! do |a, b|
state_a = $data_states[a]
state_b = $data_states[b]
if state_a.rating > state_b.rating
-1
elsif state_a.rating < state_b.rating
+1
elsif state_a.restriction > state_b.restriction
-1
elsif state_a.restriction < state_b.restriction
+1
else
a <=> b
end
end
end
# ???????
if force
# ???????????? -1 (??) ???
@states_turn[state_id] = -1
end
# ??????????
unless @states_turn[state_id] == -1
# ??????????????
@states_turn[state_id] = $data_states[state_id].hold_turn
end
# ???????
unless movable?
# ?????????
@current_action.clear
end
# HP ??? SP ????????
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# ? ???????
# state_id : ???? ID
# force : ??????? (?????????????)
#--------------------------------------------------------------------------
alias rx_rgssb18_remove_state remove_state
def remove_state(state_id, force = false)
# ?????????
rx_rgssb18_remove_state(state_id, force)
# ? ???????????????????????
#??????????????
if $data_states[state_id].rx_resist_state
for i in $data_states[state_id].plus_state_set
@rx_resist_states.delete(i)
end
end
end
end

#==============================================================================
# ? Game_Actor
#------------------------------------------------------------------------------
# ???????????????????? Game_Actors ??? ($game_actors)
# ?????????Game_Party ??? ($game_party) ??????????
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ????????
# state_id : ???? ID
#--------------------------------------------------------------------------
alias rx_rgssb18_state_guard? state_guard?
def state_guard?(state_id)
# ? ???????????????? ID ????????
if @rx_resist_states.include?(state_id)
return true
end
# ?????????
rx_rgssb18_state_guard?(state_id)
end
end
Ty but I already got it :D now there is just this new request

==>

Zarox Wrote:I searched to make a state change the elemental attack, so for example state beastslayer would make your elemental attack Anti-Beast. Is this also possible like that? Or is there a script?
In a lazy way, I use multi slot script, then use a equipment that is considered a personal to a character i.e. cannot be removed, after that, around certain level or if a character has a passive, you can do a parallel check and it will add elemental check to it, but I dunno, that's how I'd work my way around it, you can try this script. However, you can probably make it null, but there's other ways, and there's always multiple solution around certain things on RPG Makers.

Quote:=begin
#=============================================================================
# Absorb, Null, and Weak Armors
#=============================================================================
# Bearcat
# Version 1.01
# 8.16.07
#=============================================================================
This script allows you to make armors and states that absorb, nullify, or
make the wearer weak to elemental damage. To set up an an armor or state,
put the armor id and the element id in the appropriate hash in Absorb_Setup.

There is no need to modify anything other than the hashes in Absorb_Setup.

Free use, modification, and distribution permitted (commercial projects
included) so long as credit is given to me, Bearcat.
==============================================================================
=end
module Absorb_Setup
#--------------------------------------------------------------------------
# * Absorb Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Absorb_Armors = {
33 => [1]
}
#--------------------------------------------------------------------------
# * Null Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Null_Armors = {
33 => [2]
}
#--------------------------------------------------------------------------
# * Weak Armors
# syntax armor_id => [element1, element2...]
#--------------------------------------------------------------------------
Weak_Armors = {
33 => [3]
}
#--------------------------------------------------------------------------
# * Absorb States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Absorb_States = {
17 => [1]
}
#--------------------------------------------------------------------------
# * Null States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Null_States = {
17 => [2]
}
#--------------------------------------------------------------------------
# * Weak States
# syntax state_id => [element1, element2...]
#--------------------------------------------------------------------------
Weak_States = {
17 => [3]
}
#--------------------------------------------------------------------------
# * Defaults DO NOT CHANGE
#--------------------------------------------------------------------------
Absorb_Armors.default = []
Null_Armors.default = []
Weak_Armors.default = []
Absorb_States.default = []
Null_States.default = []
Weak_States.default = []
end
Better yet, check this one out and tell me if it works for ya... I found it on the ol' test bed, and I don't recall ever posting it but there ya go!

The setup is explained in the FAQ, but I'll make an example just incase...

Example setup

Unfortunately, this is actor/enemy based, not class based, but it should help. Let me know if you have any questions or issues.
ok thy, this can be closed :D Maybe I will use it, try to implement it :D