Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 KStatsRefill XP VX & ACE
#1
KStatsRefill XP VX & ACE

by Kyonides Arkanthes


Introduction

From now on you can make certain skills heal your heroes or monsters by a specific percent of their maximum HP or SP (aka MP). Shocked
Why!? Happy with a sweat Well, Confused that might be because your monsters are kind of resistant to magic!? Laughing Just go pick an excuse and make your game different from any other games uploaded to the net! Laughing + Tongue sticking out  

XP Script
Code:
# * KStatsRefill XP
#   Scripter : Kyonides Arkanthes
#   2019-11-06

# This scriptlet allows you to setup heroes or monsters that will earn some
# Life or Mana by getting hit by certain skills only.

module KStats
  REFILL_SKILL_IDS = {}# Do Not Edit This Line!
  # Type : :life or :mana
  # Actors' List:  ActorID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:actor] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
  # Enemies' List: EnemyID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:enemy] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
end

class Game_Battler
  alias :kyon_stats_refill_gm_battler_se :skill_effect
  def skill_effect(user, skill)
    result = kyon_stats_refill_gm_battler_se(user, skill)
    refill_stats(skill.id) if result
    result
  end

  def refill_stats(skill_id)
    data = KStats::REFILL_SKILL_IDS[self.kind] || {}
    data = data[self.id] || {}
    stype, percent = data[skill_id]
    return unless stype
    if stype == :life
      self.hp += total = maxhp * percent / 100
    elsif stype == :mana
      self.sp += total = maxsp * percent / 100
    end
    @damage = @damage - total rescue -total
  end
end

class Game_Actor
  def kind() :actor end
end

class Game_Enemy
  def kind() :enemy end
end

VX Script
Code:
# * KStatsRefill VX
#   Scripter : Kyonides Arkanthes
#   2019-11-06

# This scriptlet allows you to setup heroes or monsters that will earn some
# Life or Mana by getting hit by certain skills only.

module KStats
  REFILL_SKILL_IDS = {}# Do Not Edit This Line!
  # Type : :life or :mana
  # Actors' List:  ActorID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:actor] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
  # Enemies' List: EnemyID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:enemy] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
end

class Game_Battler
  alias :kyon_stats_refill_gm_battler_se :skill_effect
  def skill_effect(user, skill)
    result = kyon_stats_refill_gm_battler_se(user, skill)
    refill_stats(skill.id) if result
    result
  end

  def refill_stats(skill_id)
    data = KStats::REFILL_SKILL_IDS[self.kind] || {}
    data = data[self.id] || {}
    stype, percent = data[skill_id]
    if stype == :life
      self.hp += total = maxhp * percent / 100
      @hp_damage = @hp_damage - total rescue -total
    elsif stype == :mana
      self.mp += total = maxmp * percent / 100
      @mp_damage = @mp_damage - total rescue -total
    end
  end
end

class Game_Actor
  def kind() :actor end
end

class Game_Enemy
  def kind() :enemy end
end

VX ACE Script
Code:
# * KStatsRefill ACE
#   Scripter : Kyonides Arkanthes
#   2019-11-06

# This scriptlet allows you to setup heroes or monsters that will earn some
# Life or Mana by getting hit by certain skills only.

module KStats
  REFILL_SKILL_IDS = {}# Do Not Edit This Line!
  # Type : :life or :mana
  # Actors' List:  ActorID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:actor] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
  # Enemies' List: EnemyID => { SkillID => [Type, percent], etc. }, etc. }
  REFILL_SKILL_IDS[:enemy] = {
    1 => { 1 => [:life, 5], 2 => [:mana, 10] }
  }
end

class Game_ActionResult
  alias :kyon_stats_refill_gm_ar_md :make_damage
  def make_damage(value, item)
    kyon_stats_refill_gm_ar_md(value, item)
    return unless item.is_a?(RPG::Skill)
    data = KStats::REFILL_SKILL_IDS[@battler.kind] || {}

    data = data[@battler.id] || {}
    stype, percent = data[item.id]
    if stype == :life
      @hp_damage -= @battler.mhp * percent / 100
    elsif stype == :mana
      @mp_damage -= @battler.mmp * percent / 100
    end
  end
end

class Game_Actor
  def kind() :actor end
end

class Game_Enemy
  def kind() :enemy end
end

Terms & Conditions

You must include my nickname and the current website's URL in your game credits.
You are free to use it in non commercial games.
Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX
Reply
#2
Yeah, I've Got a Hidden ACE Under My Sleeve
Laughing

Well, I came back to make minor changes to the XP and VX versions of my script but guess what? Happy with a sweat I posted a version for VX Ace as well! Shocked

If there's any bug I might still need to smash to smithereens... Confused Send me a private message then! Laughing + Tongue sticking out

EDIT

I've just found two bugs in VX Ace version but I've fixed them immediately.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 2 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX
Reply




Users browsing this thread: