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.
[RESOLVED] A script to change the attack power stat?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
Yeah, the weapons you can make in RMXP have attack power. Thing is, it causes some... problems...

You see, in my game, you start out with stats that are, at most, in the fifties. So, your first weapon is a weak sword with an attack power of 12. The first boss has defence that is too high FOR THE WEAPON!

Could I have a script that will make it so that the weapons attack power is not so important? As in, it makes it so your char does base damage based on their strength, and the attack power  of a weapon will add damage equal to the strength of the char (weapons and armour included) multiplied by the attack power (turned into a percentage)?

Something like this, for example: (Some sort of formula involving strength and defence to calculate base power of attack) + (strength x (attack power / 100)),

So, an example, lets say the base power (damage without a weapon, if you will) is 12.

12 + (23 x (7 / 100) = 12 + (23 x 0.07) = 12 + 1.61 = 13.61 = 14 (rounded up)?

And yes, I looked MANUALLY to ensure there was no such thing already
« Last Edit: November 24, 2007, 01:12:51 AM by Shadow Phoenix »

*
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
Well, I'll point you to the damage calculation in RGSS. Though, you can always lower the defense of the boss <(''<)

Anyway, go into Game_Battler 3 and find this method:

Code: [Select]
#--------------------------------------------------------------------------
  # * 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
      self.hp -= self.damage
      # 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

As you can see, damage calculations are in there. Everything that modifies self.damage is part of the calculation.

**
Rep:
Level 88

*
Rep: +0/-0Level 86
maybe im just not getting it but why not just lower the bosses def (suggustivly not higher attack because then other monsters will be owned)