This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Step one: Copy this script above main as usual.
Step two: Make two skills in your database, one for steal and one for mug (you don't have to use one or the other if you dont wish but you need to make two skills and if you are making a game with the Steal command, why wouldn't you want Mug?)
Step three: ????
Step four: Profit.
Seriously though, step three is make sure you modify the values as necessary within the top of the script in the sections that tell you to modify.
Teh Script:
Teh Script
Code:
#------------------------------------------------------------------------------
# * Steal and Mug Script v1.1
# * Originally created by GubiD for RPG Maker VX
# * Modified to be used for Steal and Mug as well as
# * converted to RPG Maker XP by Lethrface
# * Corrected some bugs related to success rate and also some
# * Wait time issues (Thank GubiD for those corrections, folks!)
#------------------------------------------------------------------------------
# * Creation Asylum Exclusive. If this script was found anywhere else,
# * Please visit Creation Asylum and inform me.
# * http://www.creationasylum.net/
#------------------------------------------------------------------------------
# * When using this in
# * Your game, it would be nice to see some credit where credit is
# * due! Please credit GubiD and I for providing you with this script
# * and remember to credit all other script developers that you use
# * scripts from in your game!
# * Please do not use for commercial games without written consent of
# * GubiD or I.
#------------------------------------------------------------------------------
module Steal
# Modify these two values to tell the script which ones are steal and mug.
ID = 82
ID2 = 83
# Modify these two to message the player with the results.
SUCCESS = "You stole: "
FAILED = "Couldn't steal anything."
WAIT_FOR_MESSAGE = 60
def self.can_steal_from(enemy_id)
case enemy_id
# These are item and steal rate values based on steal level.
# Values are like this [a, b] where a is item ID and b is steal rate by percentage.
# When creating a new monster, just copy the line "when 1: [[1,1],[2,10]]" and
# paste it right below it and change the values. the 1 after "when" is the ID of
# the monster, so changing that to reflect the ID of the monster you wish to
# create a steal list for is a wise idea.
when 1: [[1,1],[2,10]]
else
return nil
end
end
end
class Game_Actor < Game_Battler
attr_accessor :steal_lv
alias gm_act_setup_steal setup
def setup(*args)
gm_act_setup_steal(*args)
@steal_lv = 1
end
end
class Game_Enemy < Game_Battler
def steal_from_me(lv)
if @stolen_from != nil
return nil
end
can_steal = Steal.can_steal_from(@enemy_id)
if can_steal != nil
for item in can_steal
item_id = item[0]
steal_rate = item[1]
adjusted_rate = [steal_rate * lv,100].min
if rand(100) < adjusted_rate
@stolen_from = true
return item_id
end
end
end
return nil
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
alias exe_action_skill_scn_bat_steal_script update_phase4_step5
def update_phase4_step5
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
if $data_skills[Steal::ID] == @skill or $data_skills[Steal::ID2] == @skill
# Hide help window
@help_window.visible = false
if item_id != nil
item = item_id
$game_party.gain_item(item_id, 1)
@help_window.set_text(Steal::SUCCESS + $data_items[item].name, 1)
else
@help_window.set_text(Steal::FAILED, 1)
end
@wait_count = Steal::WAIT_FOR_MESSAGE
# Refresh status window
@status_window.refresh
# Shift to step 6
@phase4_step = 6
return if $data_skills[Steal::ID] == @skill
# Display damage
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
else
exe_action_skill_scn_bat_steal_script
end
end
end
Info: This script is based on GubiD's steal tutorial. It has been modified by me to work with RMXP and add the ability to check for two skills rather than just Steal. I am unsure of any incompatibility issues.
Bugs:
As of now, GubiD has fixed the bugs with my version of the script and should be fully functioning with no error!
Notes:
PLEASE do not re-distribute this script on any other website. This is a script made from scratch by GubiD and ported to RMXP by myself with GubiD's assistance with bug fixes and as such, I would much appreciate it if you kept this Creation Asylum exclusive. If you find this script on any other websites, please let me know. If you would like to show others this script, please link directly to this post when showing people the script.