KSummon XP Kiwi Version
# * KSummon XP - Kiwi aka the Weapon and Armor Edition
# Scripter : Kyonides-Arkanthes
# 2018-10-12
# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or armor summon bypassing the database limitations that should prevent
# you from doing so.
# Please notice that the default return values for WEAPONS and ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.
module KSummon
# Use a pop up sprite to tell the player it was a successful summon
USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL
WEAPONS = {} # You Can't Touch This!
WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
WEAPONS = (33..38).to_a # Add Sword ID's for Aluxes
WEAPONS = (39..44).to_a # Add Spear ID's for Basil
BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
BODY_ARMORS = {} # You Can't Touch This!
BODY_ARMORS.default = 0 # This value should be set to 0 or any existing Armor ID
BODY_ARMORS = (33..38).to_a # Add Body Armor ID's for Aluxes
BODY_ARMORS = (39..44).to_a # Add Body Armor ID's for Basil
# End of Configuration Section #
module_function
def clear_equipment
@weapons.clear
@body_armors.clear
end
def weapons() @weapons end
def body_armors() @body_armors end
@weapons = {}
@body_armors = {}
end
class Game_Battler
alias gm_b_skill_effect skill_effect
def skill_effect(user, skill)
result = gm_b_skill_effect(user, skill)
case skill.id
when KSummon::WEAPON_SKILL
force_change_equip(:weapon, true)
if KSummon::USE_POP_UP_LABEL and @weapon_id != 0
self.damage = $data_weapons.name
end
when KSummon::BODY_ARMOR_SKILL
force_change_equip(:body, true)
if KSummon::USE_POP_UP_LABEL and @armor3_id != 0
self.damage = $data_armors.name
end
end
return result
end
end
class Game_Actor
def force_change_equip(kind, set_equipment)
case kind
when :weapon
if set_equipment
KSummon.weapons = @weapon_id
ary = KSummon::WEAPONS
return @weapon_id = ary
else
weapons = KSummon.weapons
return unless weapons.keys.include?(@actor_id)
@weapon_id = weapons
return KSummon.weapons.delete(@actor_id)
end
when :body
if set_equipment
KSummon.body_armors = @armor3_id
ary = KSummon::BODY_ARMORS
return @armor3_id = ary
else
armors = KSummon.body_armors
return unless armors.keys.include?(@actor_id)
@armor3_id = KSummon.body_armors
return KSummon.body_armors.delete(@actor_id)
end
end
end
end
class Scene_Battle
alias kyon_ksummon_scn_battle_end battle_end
def battle_end(result)
$game_party.actors.each do |actor|
actor.force_change_equip(:weapon, nil)
actor.force_change_equip(:body, nil)
end
KSummon.clear_equipment
kyon_ksummon_scn_battle_end(result)
end
end
KSummon XP Mango Version
# * KSummon XP - Mango Version
# aka the Weapon and Armor and Accessory Edition
# Scripter : Kyonides-Arkanthes
# 2018-10-12
# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or body armor or accessory summon bypassing the database limitations
# that should prevent you from doing so.
# Please notice that the default return values for WEAPONS and ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.
# * How does the Mango Exclusive DONT_LOSE_EQUIP_RATE feature actually work?
# RN : Random Number - between 0 and 100
# DLER : DONT_LOSE_EQUIP_RATE
# ML : Mage's Level * MAGE_LVL_MULTIPLIER
# The script makes the following check if the summon fails:
# Checks if RN is greater than DLER + ML
# Possible Outcomes:
# It's Greater than... Yeah, forget all about that piece of equipment pal!
# It's Equal to or Less than... You keep your darn piece of equipment. Yeah...
module KSummon
# Use a pop up sprite to tell the player it was a successful summon
USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
# Keep the equipment the mage has summoned for you till the battle ends?
KEEP_EQUIPMENT_TILL_BATTLE_ENDS = nil # Values: true - keep it, nil - no way!
MAGE_LVL_MULTIPLIER = 1 # Mage's Level * Multiplier
# Equiment Loss Prevention Rates for Weapons, Body Armors and Accessories
# between 1 and 100 (Percent) not including Mage Level Multiplier
DONT_LOSE_EQUIP_RATE = { :weapon => 50, :body => 65, :accessory => 75 }
# Turns for Weapons, Body Armors and Accessories between 1 and 1000
TURNS = { :weapon => 5, :body => 7, :accessory => 10 }
WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL or ACCESSORY_SKILL
WEAPONS = {} # You Can't Touch This!
WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
WEAPONS = (33..38).to_a # Add Sword ID's for Aluxes
WEAPONS = (39..44).to_a # Add Spear ID's for Basil
BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
BODY_ARMORS = {} # You Can't Touch This!
BODY_ARMORS.default = 0 # Value should be set to 0 or any existing Armor ID
BODY_ARMORS = (33..38).to_a # Add Body Armor ID's for Aluxes
BODY_ARMORS = (39..44).to_a # Add Body Armor ID's for Basil
ACCESSORY_SKILL = 83 # Cannot be the same as WEAPON_SKILL
ACCESSORIES = {} # You Can't Touch This!
ACCESSORIES.default = 0 # Value should be set to 0 or any existing Armor ID
ACCESSORIES = (33..38).to_a # Add Body Armor ID's for Aluxes
ACCESSORIES = (39..44).to_a # Add Body Armor ID's for Basil
# End of Configuration Section #
class Equip
attr_reader :id, :kind
def initialize(equip_id, kind)
@id = equip_id
@kind = kind
@turns = TURNS
end
def no_turns() @turns == 0 end
def decrease_turn() @turns -= 1 end
end
module_function
def decrease_turn
return if KEEP_EQUIPMENT_TILL_BATTLE_ENDS
@weapons.each do |k, e|
e.decrease_turn
reset_equip(:weapon, k) if e.no_turns
end
@body_armors.each do |k, e|
e.decrease_turn
reset_equip(:body, k) if e.no_turns
end
@accessor.each do |k, e|
e.decrease_turn
reset_equip(:accessory, k) if e.no_turns
end
end
def reset_equip(kind, key)
$game_actors.force_reset_equip(kind) rescue nil
case kind
when :weapon then @weapons.delete(key)
when :body then @body_armors.delete(key)
when :accessory then @accessor.delete(key)
end
end
def clear_equipment
@weapons.clear
@body_armors.clear
@accessor.clear
end
def equip_lost?(kind)
rand(100) > DONT_LOSE_EQUIP_RATE + @mage_lvl * MAGE_LVL_MULTIPLIER
end
def store_weapon(hid, wid) @weapons = Equip.new(wid, :weapon) end
def store_body_armor(hid, bid) @body_armors = Equip.new(bid, :body) end
def store_accessory(hid, aid) @accessor = Equip.new(aid, :accessory) end
def weapons() @weapons end
def body_armors() @body_armors end
def accessories() @accessor end
def mage_lvl=(level) @mage_lvl = level end
@weapons = Hash.new{ Equip.new(0, :weapon) }
@body_armors = Hash.new{ Equip.new(0, :body) }
@accessor = Hash.new{ Equip.new(0, :accessory) }
end
class Game_Battler
alias gm_b_skill_effect skill_effect
def skill_effect(user, skill)
result = gm_b_skill_effect(user, skill)
case skill.id
when KSummon::WEAPON_SKILL
force_set_equip(:weapon, result, user.level)
if KSummon::USE_POP_UP_LABEL and @weapon_id != 0
self.damage = $data_weapons.name
end
when KSummon::BODY_ARMOR_SKILL
force_set_equip(:body, result, user.level)
if KSummon::USE_POP_UP_LABEL and @armor3_id != 0
self.damage = $data_armors.name
end
when KSummon::ACCESSORY_SKILL
force_set_equip(:accessory, result, user.level)
if KSummon::USE_POP_UP_LABEL and @armor4_id != 0
self.damage = $data_armors.name
end
end
return result
end
end
class Game_Actor
def force_set_equip(kind, success, mage_level)
KSummon.mage_lvl = mage_level
case kind
when :weapon
if success
KSummon.store_weapon(@actor_id, @weapon_id)
ary = KSummon::WEAPONS
return @weapon_id = ary
else
@weapon_id = 0 if KSummon.equip_lost?(kind)
return 0
end
when :body
if success
KSummon.store_body_armor(@actor_id, @armor3_id)
ary = KSummon::BODY_ARMORS
return @armor3_id = ary
else
@armor3_id = 0 if KSummon.equip_lost?(kind)
return 0
end
when :accessory
if success
KSummon.store_accessory(@actor_id, @armor4_id)
ary = KSummon::ACCESSORIES
return @armor4_id = ary
else
@armor4_id = 0 if KSummon.equip_lost?(kind)
return 0
end
end
end
def force_reset_equip(*kinds)
kinds.each do |kind|
case kind
when :weapon
weapons = KSummon.weapons
next unless weapons.keys.include?(@actor_id)
@weapon_id = weapons.id
next
when :body
armors = KSummon.body_armors
next unless armors.keys.include?(@actor_id)
@armor3_id = armors.id
next
when :accessory
accessories = KSummon.accessories
next unless accessories.keys.include?(@actor_id)
@armor4_id = accessories.id
end
end
end
end
class Scene_Battle
alias kyon_ksummon_scn_battle_sp4 start_phase4
alias kyon_ksummon_scn_battle_end battle_end
def start_phase4
KSummon.decrease_turn
kyon_ksummon_scn_battle_sp4
end
def battle_end(result)
if KSummon::KEEP_EQUIPMENT_TILL_BATTLE_ENDS
team = $game_party.actors
team.each {|actor| actor.force_reset_equip(:weapon, :body, :accessory) }
KSummon.clear_equipment
end
kyon_ksummon_scn_battle_end(result)
end
end
KSummon XP Maracuya Version
# * KSummon XP - Maracuya Version
# aka the Weapon and Armor and Accessory Edition
# Scripter : Kyonides-Arkanthes
# 2018-12-06
# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or body armor or accessory summon bypassing the database limitations
# that should prevent you from doing so.
# Please notice that the default return values for WEAPONS & ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.
# Now Monsters can also change your heroes' equipment if they use any of the
# skills set here! All of the DEMOTE_ constants are used by Monsters!
# You can also set Recoil to true if you want to... *Insert Evil Laugh Here*
# * How does the Mango Exclusive DONT_LOSE_EQUIP_RATE feature actually work?
# RN : Random Number - between 0 and 100
# DLER : DONT_LOSE_EQUIP_RATE
# ML : Mage's Level * MAGE_LVL_MULTIPLIER
# The script makes the following check if the summon fails:
# Checks if RN is greater than DLER + ML
# Possible Outcomes:
# It's Greater than... Yeah, forget all about that piece of equipment pal!
# It's Equal to or Less than... You keep your darn piece of equipment. Yeah...
module KSummon
# Use a pop up sprite to tell the player it was a successful summon
USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
ALLOW_HAUNTED_ACTOR_RECOIL = true # true - Friends get hurt!
# Keep the equipment the mage has summoned for you till the battle ends?
KEEP_EQUIPMENT_TILL_BATTLE_ENDS = nil # Values: true - keep it, nil - no way!
MAGE_LVL_MULTIPLIER = 1 # Mage's Level * Multiplier
MONSTER_LVL_MULTIPLIER = 1 # Monster's Level * Multiplier
HAUNTED_ACTOR_RECOIL_PERCENT = 25 # Between 0 and 1000%!?
# Equiment Loss Prevention Rates for Weapons, Body Armors and Accessories
# between 1 and 100 (Percent) not including Mage Level Multiplier
DONT_LOSE_EQUIP_RATE = { :weapon => 50, :body => 65, :accessory => 75 }
# Turns for Weapons, Body Armors and Accessories between 1 and 1000
TURNS = { :weapon => 5, :body => 7, :accessory => 10 }
WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL or ACCESSORY_SKILL
BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
ACCESSORY_SKILL = 83 # Cannot be the same as WEAPON_SKILL
DEMOTE_WEAPON_SKILL = 84 # Used by Monsters!
DEMOTE_ARMOR_SKILL = 85
DEMOTE_ACCESS_SKILL = 86
HAUNTED_ACTOR_STATE = 17
WEAPONS = {} # You Can't Touch This!
WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
DEMOTE_WEAPONS = {} # You Can't Touch This!
DEMOTE_WEAPONS.default = 0 # Set to 0 or any existing Weapon ID
WEAPONS = (33..38).to_a # Add Sword ID's for Aluxes
WEAPONS = (39..44).to_a # Add Spear ID's for Basil
DEMOTE_WEAPONS = (33..38).to_a # Add Sword ID's for Aluxes
DEMOTE_WEAPONS = (39..44).to_a # Add Spear ID's for Basil
BODY_ARMORS = {} # You Can't Touch This!
BODY_ARMORS.default = 0 # Value should be set to 0 or any existing Armor ID
DEMOTE_BODY_ARMORS = {} # You Can't Touch This!
DEMOTE_BODY_ARMORS.default = 0 # Set to 0 or any existing Armor ID
BODY_ARMORS = (33..38).to_a # Add Body Armor ID's for Aluxes
BODY_ARMORS = (39..44).to_a # Add Body Armor ID's for Basil
DEMOTE_BODY_ARMORS = (33..38).to_a # Add Body Armor ID's for Aluxes
DEMOTE_BODY_ARMORS = (39..44).to_a # Add Body Armor ID's for Basil
ACCESSORIES = {} # You Can't Touch This!
ACCESSORIES.default = 0 # Value should be set to 0 or any existing Armor ID
DEMOTE_ACCESSORIES = {} # You Can't Touch This!
DEMOTE_ACCESSORIES.default = 0 # Set to 0 or any existing Armor ID
ACCESSORIES = (33..38).to_a # Add Body Armor ID's for Aluxes
ACCESSORIES = (39..44).to_a # Add Body Armor ID's for Basil
DEMOTE_ACCESSORIES = (33..38).to_a # Add Body Armor ID's for Aluxes
DEMOTE_ACCESSORIES = (39..44).to_a # Add Body Armor ID's for Basil
MONSTER_LEVELS = { 1 => 5, 2 => 10 }
MONSTER_LEVELS.default = 1 # Default Value for excluded monsters
# Do Not Edit This Array!
POSITIVE_SKILLS =
# End of Configuration Section #
class Equip
attr_reader :id, :kind
def initialize(equip_id, kind)
@id = equip_id
@kind = kind
@turns = TURNS
end
def no_turns() @turns == 0 end
def decrease_turn() @turns -= 1 end
end
module_function
def decrease_turn
return if KEEP_EQUIPMENT_TILL_BATTLE_ENDS
@weapons.each do |k, e|
e.decrease_turn
reset_equip(:weapon, k) if e.no_turns
end
@body_armors.each do |k, e|
e.decrease_turn
reset_equip(:body, k) if e.no_turns
end
@accessor.each do |k, e|
e.decrease_turn
reset_equip(:accessory, k) if e.no_turns
end
@monster_weapons.each do |k, e|
e.decrease_turn
monster_reset_equip(:weapon, k) if e.no_turns
end
@monster_body_armors.each do |k, e|
e.decrease_turn
monster_reset_equip(:body, k) if e.no_turns
end
@monster_accessor.each do |k, e|
e.decrease_turn
monster_reset_equip(:accessory, k) if e.no_turns
end
end
def clear_equipment
@weapons.clear
@body_armors.clear
@accessor.clear
@monster_weapons.clear
@monster_body_armors.clear
@monster_accessor.clear
end
def equip_lost?(kind)
rand(100) > DONT_LOSE_EQUIP_RATE + @mage_lvl * MAGE_LVL_MULTIPLIER
end
def monster_equip_lost?(kind)
lvl = @monster_lvl * MONSTER_LVL_MULTIPLIER
rand(100) > DONT_LOSE_EQUIP_RATE + lvl
end
def store_monster_weapon(hid, wid)
@monster_weapons = Equip.new(wid, :weapon)
end
def store_monster_body_armor(hid, bid)
@monster_body_armors = Equip.new(bid, :body)
end
def store_monster_accessory(hid, aid)
@monster_accessor = Equip.new(aid, :accessory)
end
def store_weapon(hid, wid) @weapons = Equip.new(wid, :weapon) end
def store_body_armor(hid, bid) @body_armors = Equip.new(bid, :body) end
def store_accessory(hid, aid) @accessor = Equip.new(aid, :accessory) end
def weapons() @weapons end
def body_armors() @body_armors end
def accessories() @accessor end
def monster_weapons() @monster_weapons end
def monster_body_armors() @monster_body_armors end
def monster_accessories() @monster_accessor end
def mage_lvl=(level) @mage_lvl = level end
def monster_lvl=(level) @monster_lvl = level end
@weapons = Hash.new{ Equip.new(0, :weapon) }
@body_armors = Hash.new{ Equip.new(0, :body) }
@accessor = Hash.new{ Equip.new(0, :accessory) }
@monster_weapons = Hash.new{ Equip.new(0, :weapon) }
@monster_body_armors = Hash.new{ Equip.new(0, :body) }
@monster_accessor = Hash.new{ Equip.new(0, :accessory) }
@mage_lvl = 0
@monster_lvl = 0
end
class Game_Battler
alias gm_b_attack_effect attack_effect
alias gm_b_skill_effect skill_effect
def attack_effect(atker)
result = gm_b_attack_effect(atker)
if atker.is_a?(Game_Actor) and @damage > 0
if @states.include?(KSummon::HAUNTED_ACTOR_RECOIL_STATE)
return result unless KSummon::ALLOW_HAUNTED_ACTOR_RECOIL
pos = rand($game_party.actors.size)
hero = $game_party.smooth_target_actor(pos)
hero.damage = @damage * KSummon::HAUNTED_ACTOR_RECOIL_PERCENT / 100
end
end
result
end
def skill_effect(user, skill)
result = gm_b_skill_effect(user, skill)
case skill.id
when KSummon::WEAPON_SKILL
force_set_equip(:weapon, result, user.level)
keeps_equipment = @weapon_id > 0
when KSummon::BODY_ARMOR_SKILL
force_set_equip(:body, result, user.level)
keeps_equipment = @armor3_id > 0
when KSummon::ACCESSORY_SKILL
force_set_equip(:accessory, result, user.level)
keeps_equipment = @armor4_id > 0
when KSummon::DEMOTE_WEAPON_SKILL
lvl = KSummon::MONSTER_LEVELS
monster_set_equip(:weapon, result, lvl)
keeps_equipment = @weapon_id > 0
when KSummon::DEMOTE_ARMOR_SKILL
lvl = KSummon::MONSTER_LEVELS
monster_set_equip(:body, result, lvl)
keeps_equipment = @armor3_id > 0
when KSummon::DEMOTE_ACCESS_SKILL
lvl = KSummon::MONSTER_LEVELS
monster_set_equip(:accessory, result, lvl)
keeps_equipment = @armor4_id > 0
end
if KSummon::USE_POP_UP_LABEL and keeps_equipment
self.damage = $data_weapons.name
end
return result
end
end
class Game_Actor
def force_set_equip(kind, success, mage_level)
KSummon.mage_lvl = mage_level
case kind
when :weapon
if success
KSummon.store_weapon(@actor_id, @weapon_id)
ary = KSummon::WEAPONS
return @weapon_id = ary
else
@weapon_id = 0 if KSummon.equip_lost?(kind)
return 0
end
when :body
if success
KSummon.store_body_armor(@actor_id, @armor3_id)
ary = KSummon::BODY_ARMORS
return @armor3_id = ary
else
@armor3_id = 0 if KSummon.equip_lost?(kind)
return 0
end
when :accessory
if success
KSummon.store_accessory(@actor_id, @armor4_id)
ary = KSummon::ACCESSORIES
return @armor4_id = ary
else
@armor4_id = 0 if KSummon.equip_lost?(kind)
return 0
end
end
end
def force_reset_equip(*kinds)
kinds.each do |kind|
case kind
when :weapon
weapons = KSummon.weapons
next unless weapons.keys.include?(@actor_id)
@weapon_id = weapons.id
next
when :body
armors = KSummon.body_armors
next unless armors.keys.include?(@actor_id)
@armor3_id = armors.id
next
when :accessory
accessories = KSummon.accessories
next unless accessories.keys.include?(@actor_id)
@armor4_id = accessories.id
end
end
end
def monster_set_equip(kind, success, mage_level)
KSummon.monster_lvl = mage_level
case kind
when :weapon
if success
KSummon.monster_store_weapon(@actor_id, @weapon_id)
ary = KSummon::DEMOTE_WEAPONS
return @weapon_id = ary
else
@weapon_id = 0 if KSummon.monster_equip_lost?(kind)
return 0
end
when :body
if success
KSummon.monster_store_body_armor(@actor_id, @armor3_id)
ary = KSummon::DEMOTE_BODY_ARMORS
return @armor3_id = ary
else
@armor3_id = 0 if KSummon.monster_equip_lost?(kind)
return 0
end
when :accessory
if success
KSummon.monster_store_accessory(@actor_id, @armor4_id)
ary = KSummon::DEMOTE_ACCESSORIES
return @armor4_id = ary
else
@armor4_id = 0 if KSummon.monster_equip_lost?(kind)
return 0
end
end
end
def monster_reset_equip(*kinds)
kinds.each do |kind|
case kind
when :weapon
weapons = KSummon.monster_weapons
next unless weapons.keys.include?(@actor_id)
@weapon_id = weapons.id
next
when :body
armors = KSummon.monster_body_armors
next unless armors.keys.include?(@actor_id)
@armor3_id = armors.id
next
when :accessory
accessories = KSummon.monster_accessories
next unless accessories.keys.include?(@actor_id)
@armor4_id = accessories.id
end
end
end
alias kyon_ksummon_gm_actor_scu? skill_can_use?
def skill_can_use?(sid)
skill = (KSummon::POSITIVE_SKILLS.include?(sid) and @skills.include?(skid))
has_state = @states.include?(KSummon::HAUNTED_ACTOR_RECOIL_STATE)
return false if skill and has_state
kyon_ksummon_gm_actor_scu?(sid)
end
end
class Scene_Battle
alias kyon_ksummon_scn_battle_sp4 start_phase4
alias kyon_ksummon_scn_battle_end battle_end
def start_phase4
KSummon.decrease_turn
kyon_ksummon_scn_battle_sp4
end
def battle_end(result)
if KSummon::KEEP_EQUIPMENT_TILL_BATTLE_ENDS
team = $game_party.actors
team.each do |actor|
actor.force_reset_equip(:weapon, :body, :accessory)
actor.monster_set_equip(:weapon, :body, :accessory)
end
KSummon.clear_equipment
end
kyon_ksummon_scn_battle_end(result)
end
end