Name: Steal
Description: Depending upon the stats of the spell may
1) Steal gold according to the effect rating
2) Steal an item (the item you get and amount depends on effect rating and variance and evasion)
3) Steal gold according to the enemy's drop gold
4) Steal an item according to the enemy's drop item the amount depends on evasion
Name: Mug
Description: Does the above and attacks
Alot of steps in this one so don't get confused
Create two spells steal gold and steal item don't set anything on them yet
two status effects (stolen gold and stolen item make their rating 0 so it won't show up these status effects are here so you can't steal from the same enemy twice and since the rating is zero it won't show up) Create a common event with this in it (If you did X Attack make a copy and edit it so that it is like this)
if [Variable THREE] == 1
Force an action of attack executing now on first hero on last target chosen
end
if [Variable THREE] == 2
Force an action of attack executing now on second hero on last target chosen
end
if [Variable THREE] == 3
Force an action of attack executing now on third hero on last target chosen
end
if [Variable THREE] == 4
Force an action of attack executing now on fourth hero on last target chosen
end
REMEMBER ALL ID'S OF THE THINGS YOU CREATED
Onto the script editor
You should know where to add these two (Scene_Battle 3)
when "Steal"
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 16
start_enemy_select
when "Mug"
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 17
start_enemy_select
Now goto Scene_Battle 4
if @active_battler.current_action.basic == 16
@skill = $data_skills[???] #<-- to steal gold or steal items id here
@status_window.refresh
@help_window.set_text("Steal", 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
for target in @target_battlers
target.steal_effect(@active_battler, @skill, @skill.int_f, false)
end
end
if @active_battler.current_action.basic == 17
@skill = $data_skills[???] #Steal gold or steal item goes here
if @active_battler == $game_party.actors[0]
$game_variables[??] = 1 #The variable in the common event goes here
end
if @active_battler == $game_party.actors[1]
$game_variables[??] = 2
end
if @active_battler == $game_party.actors[2]
$game_variables[??] = 3
end
if @active_battler == $game_party.actors[3]
$game_variables[??] = 4
end
@status_window.refresh
@help_window.set_text("Steal", 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = ??? #Common event id
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
for target in @target_battlers
target.steal_effect(@active_battler, @skill, @skill.int_f, true)
end
Add this new method to game_battler 3 and now edit the skills to your desire
, that is after you read the commented section on how to edit it!
#--------------------------------------------------------------------------
# ? steal_effect (my first major method :) ) version 1
# the skill effects
# accurary determines the chance to steal modifier
# elements aren't used so you don't have to check them
# the agi(30%), dex(20%), and int(50%) stats determine how much more gold you get and chance
# magic defense (theft defense) is the enemies steal defense (DON'T SET TOO HIGH)
# status effects are used
# effect rating determines the item you get or the gold you get
# the evasion then determines the number of that item you get
# If "MAGIC" equals any of these (if it doen't nothing will be stolen) then either of the following will happen
# tosteal = 1 steals gold according to effect rating
# tosteal = 2 steals an item the item id is the effect rating
# tosteal = 3 steals gold according to the enemies drop gold
# tosteal = 4 steals an item the item is the enemies drop item
# variance tells the variance, but if tosteal = 2 then It determines
# the type of item 1 for weapon 2 for armor 3 for item
#
#Pointers
#I wouldn't set the agility and dexerity ratings too high or else you'll have some rich players
# set agility to (10-50) and dex to (5-30) for best results
# if MAGIC = 2 then you can ONLY steal the item the effect rating and variance is pointing to
# remember the enemies drop probability you can set it to 0%!!!
# If a enemy doesn't drop a (item,weapon,armor) then the steal automatically fails (I made it say NO ITEM)
# Example of a good steal
# effect rating 100
# dexerity 25
# agility 50
# MAGIC 1
# Magic defense 20
# variance 20
#--------------------------------------------------------------------------
def steal_effect(attacker, skill, tosteal, mug)
self.steal = true
self.damage = 0
self.critical = false
hit_result = (rand(100) > self.dex / attacker.agi * attacker.int / self.int * skill.hit / 100)
#need to fix hit result because the chance of success is too high
if hit_result == true
case tosteal
when 1
unless self.states.include?(STOLE GOLD ID)
add_state(STOLE GOLD ID)
power = skill.power + attacker.dex * skill.dex_f / 100
power += attacker.int * 100 / self.int + attacker.agi * skill.agi_f / 67
if power > 0
power -= self.int * skill.mdef_f / 100 + self.dex * skill.mdef_f / 200 + self.agi * skill.mdef_f / 133
power = [power, 0].max
end
self.damage = power
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
$game_party.gain_gold(self.damage)
if mug == true
self.steal = false
self.second_steal = true
self.second_damage = 0
self.second_damage += self.damage
self.second_damage_pop = true
self.damage = 0
mug
end
else
self.steal = false
self.damage = "Failed"
end
when 2
unless self.states.include?(STOLE ITEM ID)
add_state(STOLE ITEM ID)
case skill.variance
when 1
$game_party.gain_weapon(skill.power, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_weapons[skill.power].name
when 2
$game_party.gain_armor(skill.power, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_armors[skill.power].name
when 3
$game_party.gain_item(skill.power, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_items[skill.power].name
end
if mug == true
self.steal = false
self.second_steal = true
self.second_damage = 0
self.second_damage += self.damage
self.second_damage_pop = true
self.damage = 0
mug
end
else
self.steal = false
self.damage = "Failed"
end
when 3
unless self.states.include?(STOLE GOLD ID)
add_state(STOLE GOLD ID)
power = self.gold + attacker.dex * skill.dex_f / 100
power += attacker.int * skill.int_f / 50 + attacker.agi * skill.agi_f / 67
if power > 0
power -= self.int * skill.mdef_f / 100 + self.dex * skill.mdef_f / 200 + self.agi * skill.mdef_f / 133
power = [power, 0].max
end
self.damage = power
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
$game_party.gain_gold(self.damage)
if mug == true
self.steal = false
self.second_steal = true
self.second_damage = 0
self.second_damage += self.damage
self.second_damage_pop = true
self.damage = 0
mug
end
else
self.steal = false
self.damage = "Failed"
end
when 4
unless self.states.include?(STOLE ITEM ID)
add_state(STOLE ITEM ID)
if self.weapon_id != 0
$game_party.gain_weapon(self.weapon_id, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_weapons[skill.power].name
elsif self.armor_id != 0
$game_party.gain_armor(self.armor_id, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_armors[skill.power].name
elsif self.item_id != 0
$game_party.gain_item(self.item_id, skill.eva_f)
self.damage = skill.eva_f.to_s + " " +$data_items[skill.power].name
else
self.damage = "No Item"
end
if mug == true
self.steal = false
self.second_steal = true
self.second_damage = 0
self.second_damage += self.damage
self.second_damage_pop = true
self.damage = 0
mug
end
else
self.steal = false
self.damage = "Failed"
end
end #ends the first case statement
else
self.steal = false
self.damage = "Failed"
end
return true
end
some screenshots of the steal command in action
STEAL SUCCESS enemy with a 0% chance get item prying that item of its hands if you want the damage to display stolen blah blah like mine then do the following (If you don't then delete all instances of self.steal and self.second_steal) goto Color Fix (if you don't have this class get it)
edit the damage method's name to def damage(damage, critical, restorative, steal)
change this
if damage.is_a?(Numeric) and damage < 0
bitmap.font.color.set(176, 255, 144)
elsif restorative
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
to
if damage.is_a?(Numeric) and damage < 0
bitmap.font.color.set(176, 255, 144)
elsif restorative
bitmap.font.color.set(176, 255, 144)
elsif steal
bitmap.font.color.set(255, 215, 0) #A Golden color
else
bitmap.font.color.set(255, 255, 255)
end
add this after the if critical block
if steal
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 36, "STOLEN", 1)
bitmap.draw_text(+1, -1, 160, 36, "STOLEN", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "STOLEN", 1)
end
add these variables in Color fix ignore the second_(name) variables and delete them from my method (from Game_Battler 3) if you don't have the second_damage_pop if block
attr_accessor :steal
attr_accessor :second_steal
@steal = false
@second_steal = false
change the damage_pop if block to this
if @battler.damage_pop
damage(@battler.damage, @battler.critical, @battler.restorative, @battler.steal)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
@battler.restorative = false
@battler.steal = false
end
if you have my second_damage_pop block then change it to this
if @battler.second_damage_pop
damage(@battler.second_damage, @battler.second_critical, @battler.second_restorative, @battler.second_steal)
@battler.second_damage = nil
@battler.second_critical = false
@battler.second_damage_pop = false
@battler.second_restorative = false
@battler.second_steal = false
end
If this doesn't work post that it doesn't work and your email and I'll send a project file with the code in it