06-10-2022, 06:52 AM
(This post was last modified: 06-19-2022, 06:38 AM by kyonides.
Edit Reason: Slightly Improved
)
KFrozenSkill XP
by Kyonides Arkanthes
Introduction
I guess there could be such moments where you would love to freeze a given hero's skill





Note: Instructions are already embedded in my script!
The Script
Code:
# * KFrozenSkill XP
# Scripter : Kyonides Arkanthes
# v 1.0.0 - 2022-06-09
# Have you ever wanted to freeze a hero's given skill?
# Now you can!
# * Script Calls * #
# actor = $game_actors[ID]
# OR...
# actor = $game_party.actors[Index]
# actor.freeze_skill(SkillID, Options)
# - Options - They got to be separated by commas!
# - Actor with a given ID has got to be dead:
# :actor => 1
# :hp => 1500 (as minimum)
# :sp => 275 (as minimum)
# :gold => 1500
# :item => [ItemID, Quantity]
# Example:
# actor.freeze_skill(1, :actor => 3, :hp => 1200)
# * Optional Script Calls * #
# actor.frozen_skill?(skill_id)
# actor.thawed_skill?(skill_id)
# * Warnings * #
# Skills can only be frozen once!
# The script call will fail if the hero has not learned the chosen skill!
class Game_Actor
alias :kyon_frozen_skill_gm_actor_init :initialize
alias :kyon_frozen_skill_gm_actor_skill_use? :skill_can_use?
def initialize(actor_id)
kyon_frozen_skill_gm_actor_init(actor_id)
@frozen_skills = {}
@thawed_skills = []
end
def freeze_skill(skill_id, options={})
return if !@skills.include?(skill_id) or @thawed_skills.include?(skill_id)
return if options.empty?
@frozen_skills[skill_id] = options
end
def thaw_skill(skill_id)
req = @frozen_skills[skill_id]
return unless req
gold = req[:gold]
if gold and $game_party.gold >= gold
$game_party.lose_gold(gold)
req.delete(:gold)
end
item = req[:item]
if item and $game_party.item_number(item[0]) >= item[1]
$game_party.lose_item(item[0], item[1])
req.delete(:item)
end
var = req[:actor]
req.delete(:actor) if var and $game_actors[var].dead?
var = req[:hp]
req.delete(:hp) if var and var <= maxhp
var = req[:sp]
req.delete(:sp) if var and var <= maxsp
return if req.keys.size > 0
@frozen_skills.delete(skill_id)
@thawed_skills << skill_id
@thawed_skills = @thawed_skills.sort.uniq
true
end
def skill_can_use?(skill_id)
return false if frozen_skill?(skill_id)
kyon_frozen_skill_gm_actor_skill_use?(skill_id)
end
def frozen_skill?(skill_id) @frozen_skills.keys.include?(skill_id) end
def thawed_skill?(skill_id) @thawed_skills.include?(skill_id) end
def frozen_skill_ids() @frozen_skills.keys.sort end
attr_reader :frozen_skills, :thawed_skills
end
Terms & Conditions
Free as in


Don't worry pals! I know it's a scriptlet so it'll be quite inexpensive. Guaranteed.

For other conditions, please take a look at my signature.

"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]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/SP1-Reporter.png)
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
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, OpenChest XP VX & ACE
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]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/SP1-Reporter.png)
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!

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, OpenChest XP VX & ACE