Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Can only be killed by one character.

So I want to know if this is possible. There is this monster who is well immortal rather only one person can kill him. Is it possible for a fight to go on and on and can only end if a certain party member brings the final blow to the monster?
 
Hmm.... If the player that can kill the enemy can have some sort of special weapon or something.... I might be able to help you do this with a combination of eventing and simple scripting...
 
Here ya go...

Paste above main*

Change the 2 constants at the top (ENEMY_ID, HERO_ID) to match the enemy & actor in your
database. (For example, I used Hilda(8), and Seraphim(32)).

Code:
#==============================================================================
# ** Game_Battler (part 3)
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#  Modified to allow 1 specific enemy to only be killed by one specific hero
#  Enter the Enemy & Hero ID number from the database here.
#  It is assumed that the enemy has a unique ID (higher than the highest hero)

ENEMY_ID = 32
HERO_ID = 8

#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Applying Normal Attack Effects
  #     attacker : battler
  #--------------------------------------------------------------------------
  def attack_effect(attacker)
    # Clear critical flag
    self.critical = false
    # First hit detection
    hit_result = (rand(100) < attacker.hit)
    # If hit occurs
    if hit_result == true
      # Calculate basic damage
      atk = [attacker.atk - self.pdef / 2, 0].max
      self.damage = atk * (20 + attacker.str) / 20
      # Element correction
      self.damage *= elements_correct(attacker.element_set)
      self.damage /= 100
      # If damage value is strictly positive
      if self.damage > 0
        # Critical correction
        if rand(100) < 4 * attacker.dex / self.agi
          self.damage *= 2
          self.critical = true
        end
        # Guard correction
        if self.guarding?
          self.damage /= 2
        end
      end
      # Dispersion
      if self.damage.abs > 0
        amp = [self.damage.abs * 15 / 100, 1].max
        self.damage += rand(amp+1) + rand(amp+1) - amp
      end
      # Second hit detection
      eva = 8 * self.agi / attacker.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
    end
    # If hit occurs
    if hit_result == true
      # State Removed by Shock
      remove_states_shock
      # Substract damage from HP
      if self.id == ENEMY_ID
        if attacker.id == HERO_ID
          self.hp -= self.damage
        else
          if self.damage >= self.hp
            self.hp = 10
          else
            self.hp -= self.damage            
          end
        end
      else
        self.hp -= self.damage
      end
      # State change
      @state_changed = false
      states_plus(attacker.plus_state_set)
      states_minus(attacker.minus_state_set)
    # When missing
    else
      # Set damage to "Miss"
      self.damage = "Miss"
      # Clear critical flag
      self.critical = false
    end
    # End Method
    return true
  end
end

*Open the script editor
Right-Click on Main (at the bottom)
Select "Insert"
Enter a Name (i.e.  Game_Battler_Mod)
Paste the script on the right side

Be Well

Ref: Junk123
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top