RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Elemental...Stuffs!

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 83
Spoiler for:
Code: [Select]
#==============================================================================
# * Hima's Elemental Reflector v. 1.3
#------------------------------------------------------------------------------
#     This script will allow you to set your character or enemies to reflect any element
#    you want. You can also create armors or skills that create elemental reflector.
#
#    Version History
#    ---------------------------------------------------------
#    1.0    -    First Released
#    1.1    -    Fixed infinite reflect problem
#    1.2    -    More features added
#                a.) You can now choose to reflect any physical or magical skill.
#                b.) Physical reflect will also reflect any basic attack.
#                c.) Basic attack with element will also be reflected from elemental reflector.
#    1.3    -    Fixed some bugs that occur when you don't put all the ELEMENTS you defined into the database.
# ---------------------------------------------------------
# contact : ninomiya_mako@hotmail.com
#==============================================================================
module HIMA_REFLECT
    #--------------------------------------------------------------------------
  # - Customize Point -
    # ELEMENTS     - This is where you create the name of element you want to reflect. This is how it works
    #           {Name => Reflected Element ID, Name => Reflected Element ID, ...}
    #           The name can be anything, and ID is ID of the element that this will reflect. You have to
    #           create a new element that match what you input here.
    #           Special Element ID are as follows :
    #
    #            "Physical" -> For any physical skill, with atk_f greater than 0
    #            "Magic"    -> For any magic skill, with int_f (mind_f) greater than 0
    #
    #    WORD             - Message that will pop up when reflection occurs.
  #--------------------------------------------------------------------------
    ELEMENTS = {"Reflect Physical" => "Physical",
                "Reflect Heat" => 2,
                "Reflect Cold" => 3,
                "Reflect Thunder" => 4,
                "Reflect Liquid" => 5,
                "Reflect Ground" => 6,
                "Reflect Air" => 7,
                "Reflect Energy" => 8,
                "Reflect Void" => 9,
                "Reflect Magic" => "Magical"}
    WORD = "Reflect"

end

module RPG
    class Skill
        def type_of_skill
            if @int_f > 0
                return "Magical"
            elsif @atk_f > 0
                return "Physical"
            else
                return nil
            end
        end
    end
end

class Game_Battler
  attr_accessor :reflect                   # Reflect Flag
    alias hima_reflect_init initialize
    def initialize
        @reflect = 0    #0 = no reflect, 1 = basic_attack, 2 = skill_effect
    hima_reflect_init
    end
   
    alias hima_reflect_attack_effect attack_effect
    def attack_effect(attacker)
        # Check for reflect basic attack
        element_to_reflect = HIMA_REFLECT::ELEMENTS.index("Physical")
        reflect_id = $data_system.elements.index(element_to_reflect)
        if reflect_id != nil
            if self.element_reflect(reflect_id) == 1
                if attacker.element_reflect(reflect_id) == 1
                    self.damage = "Block"
                    self.reflect = 0
                else
                    self.damage = HIMA_REFLECT::WORD
                    self.reflect = 1
                end
                return false
            end
        end
        # End of reflect basic attack
       
        # Check for reflect element of basic attack
        for q in 0...attacker.element_set.size
            element_id = attacker.element_set[q]
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if self.element_reflect(reflect_id) == 1
          if attacker.element_reflect(reflect_id) == 1
              self.damage = "Block"
              self.reflect = 0
          else
              self.damage = HIMA_REFLECT::WORD
              self.reflect = 1
          end
          return false
                end
            end
        end #end for       
        # End of reflect element of basic attack
        hima_reflect_attack_effect(attacker)
    end
   
    alias hima_reflect_skill_effect skill_effect
  def skill_effect(user, skill)
        # Reflect physical or magic skill
        if skill.type_of_skill != nil
            element_id = skill.type_of_skill
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if reflect_id != nil
                    if self.element_reflect(reflect_id) == 1
                        if user.element_reflect(reflect_id) == 1
                                self.damage = "Block"
                                self.reflect = 0
                        else
                                self.damage = HIMA_REFLECT::WORD
                                self.reflect = 2
                        end
                        return false
                    end
                end
            end
        end
       
        # Reflect specific element
        for q in 0...skill.element_set.size
            element_id = skill.element_set[q]
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if reflect_id != nil
                    if self.element_reflect(reflect_id) == 1
                        if user.element_reflect(reflect_id) == 1
                                self.damage = "Block"
                                self.reflect = 0
                        else
                                self.damage = HIMA_REFLECT::WORD
                                self.reflect = 2
                        end
                        return false
                    end
                end
            end
        end #end for
        hima_reflect_skill_effect(user,skill)
  end
   
    def element_reflect(element_id)
        if self.is_a?(Game_Actor)
        result = $data_classes[self.class_id].element_ranks[element_id]

            for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
                armor = $data_armors[i]
                if armor != nil and armor.guard_element_set.include?(element_id)
                    result = 1
                end
            end
   
            for i in @states
                if $data_states[i].guard_element_set.include?(element_id)
                    result = 1
                end
            end
        else
            result = $data_enemies[self.enemy_id].element_ranks[element_id]
            for i in @states
                if $data_states[i].guard_element_set.include?(element_id)
                    result = 1
                end
            end
        end
    # Method end
    return result
  end
end

class Game_Enemy < Game_Battler
    attr_accessor        :enemy_id
end

class Scene_Battle
    alias hima_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
        hima_update_phase4_step5
    reflect = 0
        for target in @target_battlers
          if target.reflect != 0
                reflect = target.reflect
                target.reflect = 0
      end
    end
        if reflect > 0
      @target_battlers = []
            @target_battlers.push(@active_battler)
            case reflect
                when 1
                    @active_battler.attack_effect(@active_battler)
                when 2
                    @active_battler.skill_effect(@active_battler,@skill)
            end #case
            @phase4_step = 4
        else
      @phase4_step = 6
    end
  end
end

I found this on a thai scripting site. Its for RPG maker XP.
Its a script that allows reflection by element, rather than by INT_F > 0.
I was thinking and thinking of ways to convert this to be compatible with VX,
and even tried a hand at it and came up with this:
Spoiler for:
Code: [Select]
#==============================================================================
# * Hima's Elemental Reflector v. 1.3
#------------------------------------------------------------------------------
#     This script will allow you to set your character or enemies to reflect any element
#    you want. You can also create armors or skills that create elemental reflector.
#
#    Version History
#    ---------------------------------------------------------
#    1.0    -    First Released
#    1.1    -    Fixed infinite reflect problem
#    1.2    -    More features added
#                a.) You can now choose to reflect any physical or magical skill.
#                b.) Physical reflect will also reflect any basic attack.
#                c.) Basic attack with element will also be reflected from elemental reflector.
#    1.3    -    Fixed some bugs that occur when you don't put all the ELEMENTS you defined into the database.
# ---------------------------------------------------------
# contact : ninomiya_mako@hotmail.com
#==============================================================================
module HIMA_REFLECT
    #--------------------------------------------------------------------------
  # - Customize Point -
    # ELEMENTS     - This is where you create the name of element you want to reflect. This is how it works
    #           {Name => Reflected Element ID, Name => Reflected Element ID, ...}
    #           The name can be anything, and ID is ID of the element that this will reflect. You have to
    #           create a new element that match what you input here.
    #           Special Element ID are as follows :
    #
    #            "Physical" -> For any physical skill, with atk_f greater than 0
    #            "Magic"    -> For any magic skill, with int_f (mind_f) greater than 0
    #
    #    WORD             - Message that will pop up when reflection occurs.
  #--------------------------------------------------------------------------
    ELEMENTS = {"Reflect Physical" => "Physical",
                "Reflect Heat" => 2,
                "Reflect Cold" => 3,
                "Reflect Thunder" => 4,
                "Reflect Liquid" => 5,
                "Reflect Ground" => 6,
                "Reflect Air" => 7,
                "Reflect Energy" => 8,
                "Reflect Void" => 9,
                "Reflect Magic" => "Magical"}
    WORD = "Reflect"

end

module RPG
    class Skill
        def type_of_skill
            if @spi_f > 0
                return "Magical"
            elsif @atk_f > 0
                return "Physical"
            else
                return nil
            end
        end
    end
end

class Game_Battler
  attr_accessor :reflect                   # Reflect Flag
    alias hima_reflect_init initialize
    def initialize
        @reflect = 0    #0 = no reflect, 1 = basic_attack, 2 = skill_effect
    hima_reflect_init
    end
   
    alias hima_reflect_attack_effect attack_effect
    def attack_effect(attacker)
        # Check for reflect basic attack
        element_to_reflect = HIMA_REFLECT::ELEMENTS.index("Physical")
        reflect_id = $data_system.elements.index(element_to_reflect)
        if reflect_id != nil
            if self.element_reflect(reflect_id) == 1
                if attacker.element_reflect(reflect_id) == 1
                    self.damage = "Block"
                    self.reflect = 0
                else
                    self.damage = HIMA_REFLECT::WORD
                    self.reflect = 1
                end
                return false
            end
        end
        # End of reflect basic attack
       
        # Check for reflect element of basic attack
        for q in 0...attacker.element_set.size
            element_id = attacker.element_set[q]
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if self.element_reflect(reflect_id) == 1
          if attacker.element_reflect(reflect_id) == 1
              self.damage = "Block"
              self.reflect = 0
          else
              self.damage = HIMA_REFLECT::WORD
              self.reflect = 1
          end
          return false
                end
            end
        end #end for       
        # End of reflect element of basic attack
        hima_reflect_attack_effect(attacker)
    end
   
    alias hima_reflect_skill_effect skill_effect
  def skill_effect(user, skill)
        # Reflect physical or magic skill
        if skill.type_of_skill != nil
            element_id = skill.type_of_skill
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if reflect_id != nil
                    if self.element_reflect(reflect_id) == 1
                        if user.element_reflect(reflect_id) == 1
                                self.damage = "Block"
                                self.reflect = 0
                        else
                                self.damage = HIMA_REFLECT::WORD
                                self.reflect = 2
                        end
                        return false
                    end
                end
            end
        end
       
        # Reflect specific element
        for q in 0...skill.element_set.size
            element_id = skill.element_set[q]
            element_to_reflect = HIMA_REFLECT::ELEMENTS.index(element_id)
            if element_to_reflect != nil
                reflect_id = $data_system.elements.index(element_to_reflect)
                if reflect_id != nil
                    if self.element_reflect(reflect_id) == 1
                        if user.element_reflect(reflect_id) == 1
                                self.damage = "Block"
                                self.reflect = 0
                        else
                                self.damage = HIMA_REFLECT::WORD
                                self.reflect = 2
                        end
                        return false
                    end
                end
            end
        end #end for
        hima_reflect_skill_effect(user,skill)
  end
   
    def element_reflect(element_id)
        if self.is_a?(Game_Actor)
        result = $data_classes[self.class_id].element_ranks[element_id]

            for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
                armor = $data_armors[i]
                if armor != nil and armor.element_set.include?(element_id)
                    result = 1
                end
            end
   
            for i in @states
                if $data_states[i].element_set.include?(element_id)
                    result = 1
                end
            end
        else
            result = $data_enemies[self.enemy_id].element_ranks[element_id]
            for i in @states
                if $data_states[i].element_set.include?(element_id)
                    result = 1
                end
            end
        end
    # Method end
    return result
  end
end

class Game_Enemy < Game_Battler
    attr_accessor        :enemy_id
end

class Scene_Battle
# Displaying the damage of the skill
    alias hima_display_action_effects display_action_effects
  def display_action_effects(target, obj = nil)
        hima_display_action_effects(target, obj)
    reflect = 0
        for target in @target_battlers
          if target.reflect != 0
                reflect = target.reflect
                target.reflect = 0
      end
    end
        if reflect > 0
      @target_battlers = []
            @target_battlers.push(@active_battler)
            case reflect
                when 1
                    @active_battler.attack_effect(@active_battler)
                when 2
                    @active_battler.skill_effect(@active_battler,@skill)
            end #case
            @battle_main_phase = false
        else
      @battle_main_phase = false
    end
  end
end

But it fails.
Effectively, this script functions as such:
If a thing [monster, armor, weapon, accessory, state, skill] is marked as -A- element rank/checkmark in database of setup element, then they reflect its corresponding element.
monster: reflects element.
armor: reflects element.
weapon: reflects element.
accessory: reflects element.
state: checkmarked with setup element, reflects corresponding element.
skill: checkmarked with setup element, reflects corresponding element.

ie:
Big slime has an -A- rank element to -Reflect Fire- (setup in the script & database)
Therefore, if you cast anything marked with the element of 'Fire' (or corresponding element)
or hit him with a 'Fire' elemental weapon, it will just reflect back on the attacker.

If an actor is afflicted with a state that is checkmarked in database with element -Reflect Fire-,
then all 'Fire' element skills will be reflected back to their attackers.

Does this make sense? If it doesn't, but your curious as to its workings, I insist you give it a go on rmxp to see what im talking about.

It works on xp, but i want it to work on vx.

On that same note, by the same author i have another script id like to have converted,  that I believe shuld go hand in hand with the one above:

Spoiler for:
Code: [Select]
#==============================================================================
# * Hima's Passive Skill Special
#------------------------------------------------------------------------------
# This script will allow you to create various special passive skills, such as
# elemental damage booster, bad status accuracy booster, healing booster or even
# normal attack booster.
# To use this, please see an instruction that I posted with the script
# contact : ninomiya_mako@hotmail.com
=begin
First, add this line in 'Game_Battler 3' at around line 120.

      hit *= (check_element_booster(user,skill)+100)/100

So it looks like this:

117    # First hit detection
118    hit = skill.hit
119    if skill.atk_f > 0
120      hit *= user.hit / 100
121      hit *= (check_element_booster(user,skill)+100)/100
122    end

Then, add this line in 'Game_Battler 3' at around line 140.

      rate += (check_element_booster (user, skill)) / 5

So It looks like this:

140      rate += (user.int * skill.int_f / 100)
141      rate += (check_element_booster (user, skill)) / 5
142      # Calculate basic damage
143      self.damage = power * rate / 20

Estimated lines of course, dependent on other scriptings yu have about there.
And in order to activate the script, you have to enter your database and
make an entry in System, to your elements.

ie: (Element name) DMG (+ or -) (adjusting ## and %)

So the end result will look something like this:

    FireDMG+50%
   
Where Fire of FireDMG is the also the name of the element you plan on boosting
the damage of by 50%.
=end
#==============================================================================
class Game_Battler
  def check_element_booster(user,skill)
     boost = 0
   unless user.is_a?(Game_Enemy)
        # Check for each element in the using skill
    for q in 0..skill.element_set.size-1
      element_to_boost = $data_system.elements[skill.element_set[q]]
        # Check if the user have any booster skill that its element match the using skill.
        for j in 0..user.skills.size-1
          skill_check = $data_skills[user.skills[j]]
            for i in 0..skill_check.element_set.size-1
              name = $data_system.elements[skill_check.element_set[i]]
        # If there's a booster skill, the boost variable will be raised.
              if name =~ /^#{element_to_boost}Eff([+-]?[0-9]+)(%)/
                boost += $1.to_i
              end
            end
        end
      end
        # return the boost variable in order to add with hit or rate in the future.
    end
    return boost
  end
end

This also uses elements' names to determine passive elemental boosts...
ie:
have a skill marked with the element named FireDMG+50%
will cause all skills with the element of 'Fire' to 50% more effective in regards to both
accuracy and power.
Again, an XP script, but wouldn't these scripts be helpful to the VX community as well?


I'd do this myself, but I just don't understand the difference in terms etc required. -.-

Thanks ahead of time.




**
Rep: +0/-0Level 83
No one has anything to say about this? Goodness :(

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It's an interesting request. Under other circumstances, I would take it. However, there are a number of requests I've taken that I haven't finished yet, and I'd like to finish them before I take any new ones. Sorry.

**
Rep: +0/-0Level 83
It is a system that is primarily utilized in the Shin Megami Tensei games, and thus...well...
Its a strategy thing. I think the idea is really cool, and could be useful to the community in general...

So if its waiting that needs to be done, then I'll just bump this up in a week or two and see if anyone is able then. :]