Jump to content
Rpg²S Forum

Valentino

Utenti
  • Posts

    463
  • Joined

  • Last visited

Posts posted by Valentino

  1. Salve a tutti! Avrei bisogno di un aiuto con lo script di Atoa che permette di rubare ai nemici... Praticamente lo script collega ruba a una skill ma io vorrei poterla mettere come comando nella lista principale.

    Per adesso sono riuscito a creare il comando nuovo per il personaggio che deve avere ruba ma non riesco a collegare lo script con il comando... C'è qualcuno che è in grado di aiutarmi?

    Lo script Ruba:

     

    #======================================================================

    ========

    # Add-On: Skill Steal

    # by Atoa

    #==============================================================================

    # This script was modified to work with SBS XP, it allows you to create

    # skill that steal items/gold from enemies

    #

    # To add the steal effect to an skill, go to the skill extension and add

    # the extensio "STEAL".

    #

    # To add itens to enemies, go to the "module Atoa"

    # Enemy_Steal[iD] = {"ITEM" => RATE}

    #

    # ID = enemy ID

    # ITEM = Type and Item ID. must be always show as "xY"

    # where:

    # x = type of the item

    # Y = item ID/amount of money

    # x must be "a" for armors, "w" for weapons, "i" for items, "g" for money

    # PORCENTAGEM = % of getting the item, an value bettwen 0 and 100, can be decimal

    # Ex.: 5.4 = 5,4% rate

    #

    # Ex.: Enemy_Steal[15] = {"w6" => 22.5, "g900" => 12}

    # That means the Enemy ID 15 (Enemy_Drops[15])

    # Have 22,5% of droping the Weapon ID 6 ("w6" => 22.5)

    # and have 12% of droping 900 Gold ("g900" => 12)

    #

    # You can only steal one item per steal attempt.

    #

    # You can add as many items you want to an enemy

    #

    #==============================================================================

     

     

    module Atoa

    Enemy_Steal = [] # don't remove/change this line

     

    # Enemies can be stolen more than one time?

    Multi_Steal = false

    # If false, you can steal an enemy only once per battle, even if it

    # have more items (like the old FF's)

     

    # Base Success Rate

    Steal_Rate = 50

    # Even if the rate is 100%, that dont't grants 100% of chance of getting an item

    # this value changes with the difference bettwen, the user and target's AGI, and

    # it still necessary to verify the drop rate of each item

     

    # Message if the target has no items

    No_Item = "Non possiede niente!"

     

    # Message if the steal attempt fail

    Steal_Fail = "Mancato!"

     

    # Message of Item steal sucess. {item} is the name of the item, you must add it

    # to the message, or the item name won't be shown

    Steal_Item = "Hai rubato {item}!"

    # E.g:

    # "Stole {item}" - Stole Potion

    # "{item} gained" - Potion gained

     

    # Message of gold steal sucess. {gold} is the amount of gold, you must add it

    # to the message, or the amount stole won't be shown

    # {unit} the money unit, use it only if you want

    Steal_Gold = "Hai rubato {gold}{unit}!"

    # Exemplos:

    # "Stole {gold}{unit}" - Stole 500G

    # "Stole {gold} coins" - Stole 500 coins

     

    # Add here the enemies ID and the items they have

    # Enemy_Steal[Enemy_ID] = {"ITEM" => RATE}

    Enemy_Steal[1] = {"g15" => 50}

    Enemy_Steal[2] = {"i1" => 22.5, "g9" => 40, "g23" => 20}

    Enemy_Steal[3] = {"g21" => 22.5, "g25" => 22.5, "i1" => 12}

    Enemy_Steal[4] = {"g83" => 33.2, "g42" => 22.5, "i79" => 12}

    Enemy_Steal[5] = {"g75" => 33.2, "g27" => 22.5, "i80" => 21}

    Enemy_Steal[6] = {"g120" => 33.2, "g89" => 22.5, "i81" => 19}

    Enemy_Steal[7] = {}

    Enemy_Steal[8] = {}

    Enemy_Steal[9] = {}

    Enemy_Steal[10] = {"g352" => 32.2, "g465" => 22.5, "a17" => 34}

    Enemy_Steal[11] = {"g352" => 32.2, "g465" => 22.5, "a17" => 12}

    Enemy_Steal[12] = {"g212" => 45.2, "g6" => 9, "i82" => 4}

     

    end

     

     

    #==============================================================================

    # RPG::Skill

    #==============================================================================

    class RPG::Skill

    alias atoa_steal_extension extension

    def extension

    case @id

    when 187

    return ["STEAL"]

    # Add here the skills IDs and the extension of them

    end

    atoa_steal_extension

    end

    end

     

    #==============================================================================

    # Game_Battler

    #==============================================================================

    class Game_Battler

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    def stole_item_set(user)

    @steal_flag = true

    steal_success = rand(100) < (Steal_Rate + self.steal_attempt) * user.agi / self.agi

    self.steal_attempt += 1

    return false unless steal_success

    return nil if self.steal_items == nil or self.steal_items == []

    item_stole = []

    self.steal_items.each do |item, steal_rate|

    item = item.split('')

    if item[0] == "i"

    item = item.join

    item.slice!("i")

    item_stole.push($data_items[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "a"

    item = item.join

    item.slice!("a")

    item_stole.push($data_armors[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "w"

    item = item.join

    item.slice!("w")

    item_stole.push($data_weapons[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "g"

    item = item.join

    item.slice!("g")

    item_stole.push(item.to_i) if rand(1000) < (steal_rate * 10).to_i

    end

    end

    return false if item_stole == []

    self.steal_attempt = 0

    stole_item_index = rand(item_stole.size)

    item_to_steal = [item_stole[stole_item_index]]

    self.steal_items.delete_at(stole_item_index) if Multi_Steal

    self.steal_items = [] unless Multi_Steal

    return item_to_steal

    end

    end

     

    #==============================================================================

    # Game_Enemy

    #==============================================================================

    class Game_Enemy < Game_Battler

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    attr_accessor :steal_items

    attr_accessor :steal_flag

    attr_accessor :stole_item

    attr_accessor :steal_attempt

    #--------------------------------------------------------------------------

    alias initialize_atoa_steal_enemy initialize

    #--------------------------------------------------------------------------

    def initialize(troop_id, member_index)

    initialize_atoa_steal_enemy(troop_id, member_index)

    @steal_items = Enemy_Steal[@enemy_id].to_a

    @stole_item = nil

    @steal_flag = false

    @steal_attempt = 0

    end

    end

     

    #==============================================================================

    # Scene_Battle

    #==============================================================================

    class Scene_Battle

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    def pop_steal_help(obj)

    @help_window.set_text(obj, 1)

    count = 0

    loop do

    update_basic

    count += 1

    break @help_window.visible = false if (Input.trigger?(Input::C) and count > 30) or count == 80

    end

    end

    #--------------------------------------------------------------------------

    alias atoa_steal_pop_damage pop_damage

    def pop_damage(target, obj, action)

    if obj.is_a?(RPG::Skill) && obj.extension.include?("STEAL") && ((obj.atk_f == 0 &&

    obj.str_f == 0 && obj.dex_f == 0 && obj.agi_f == 0 && obj.int_f == 0) or obj.power == 0)

    target.missed = target.evaded = false

    target.damage = ""

    end

    atoa_steal_pop_damage(target, obj, action)

    end

    #--------------------------------------------------------------------------

    alias atoa_steal_action_end action_end

    def action_end

    if @active_battler.current_action.kind == 1

    obj = $data_skills[@active_battler.current_action.skill_id]

    if obj.extension.include?("STEAL")

    @target_battlers.each do |battler|

    stole_item = battler.stole_item_set(@active_battler) and battler.is_a?(Game_Enemy)

    if battler.is_a?(Game_Enemy) && battler.steal_flag

    item_stole = stole_item[0] unless stole_item == false or stole_item == nil

    item_stole = nil if stole_item == nil

    item_stole = false if stole_item == false or battler.damage == "Errou!"

    case item_stole

    when nil

    text = No_Item

    when false

    text = Steal_Fail

    when Numeric

    $game_party.gain_gold(item_stole)

    text = Steal_Gold.dup

    text.gsub!(/{gold}/i) {"#{item_stole}"}

    text.gsub!(/{unit}/i) {"#{$data_system.words.gold}"}

    else

    case item_stole

    when RPG::Item

    $game_party.gain_item(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    when RPG::Weapon

    $game_party.gain_weapon(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    when RPG::Armor

    $game_party.gain_armor(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    end

    end

    pop_steal_help(text)

    battler.steal_flag = false

    wait(3)

    end

    end

    end

    end

    atoa_steal_action_end

    end

    end

     

     

    Lo script per il comando di un solo personaggio (nel caso avesse bisogno di modifiche)

     

    #======================================================================

    ========

    # Add-On: Individual Battle Commands

    # by Charlie Lee

    # Modified by Atoa, to work with SBS XP

    #==============================================================================

    # This script was modified to work with SBS XP, but it configuration

    # didn't change

    #

    # Create an new attribute named "CMD *command*", where *command* is the

    # name of the command, then add this attribute to an skill.

    # EG.:

    # "CMD White Magic" will create the command "White Magic"

    #

    # Remember to add only one command attribute to an skill, and add an

    # command attribute to *ALL* skills, or actors won't be able to use it in

    # battle.

    #

    # IMPORTANTE: If you using the Add-On "AABS (ATB System)", put this script

    # *bellow* the ATB Add-On.

    #==============================================================================

     

    #==============================================================================

    # Game_Actor

    #==============================================================================

    class Game_Actor

    #--------------------------------------------------------------------------

    attr_accessor :individual_commands

    #--------------------------------------------------------------------------

    alias ibc_setup_n01 setup

    #--------------------------------------------------------------------------

    def setup(actor_id)

    ibc_setup_n01(actor_id)

    @individual_commands=[]

    end

    #--------------------------------------------------------------------------

    def refresh_commands

    @individual_commands=[]

    for i in 0...@skills.size

    skill = $data_skills[@skills]

    if skill != nil

    for elem_id in skill.element_set

    if $data_system.elements[elem_id][0,3]=="CMD"

    if !@individual_commands.include?($data_system.elements[elem_id])

    @individual_commands.

    push(String.new($data_system.elements[elem_id]))

    end

    end

    end

    end

    end

    for c in @individual_commands

    c[0,4]=""

    end

    end

    end

     

    #==============================================================================

    # Game_Party

    #==============================================================================

    class Game_Party

    #--------------------------------------------------------------------------

    alias ibc_add_actor_n01 add_actor

    #--------------------------------------------------------------------------

    def add_actor(actor_id)

    ibc_add_actor_n01(actor_id)

    actor = $game_actors[actor_id]

    actor.refresh_commands

    end

    end

     

    #==============================================================================

    # Scene_Battle (Parte 3)

    #==============================================================================

    class Scene_Battle

    #--------------------------------------------------------------------------

    include N01

    #--------------------------------------------------------------------------

    alias ibc_phase3_setup_command_window_n01 phase3_setup_command_window

    alias ibc_start_skill_select_n01 start_skill_select

    #--------------------------------------------------------------------------

    def phase3_setup_command_window

    ibc_phase3_setup_command_window_n01

    @update_skills_commands = Window_Skill2.new(@active_battler)

    @update_skills_commands.refresh

    @update_skills_commands.update

    @update_skills_commands.dispose

    @active_battler.refresh_commands

    s1 = $data_system.words.attack

    s2 = $data_system.words.skill

    s3 = $data_system.words.guard

    s4 = $data_system.words.item

    s5 = @escape_name if @escape_type == 0

    if @active_battler.id == 4

    s6 = "Ruba"

    else

    end

    if @active_battler.id == 4

    @individual_battle_commands=[s1, s6]+@active_battler.individual_commands+[s3, s4]

    else

    @individual_battle_commands=[s1]+@active_battler.individual_commands+[s3, s4]

    end

    @individual_battle_commands=[s1]+@active_battler.individual_commands+[s3, s4, s5] if @escape_type == 0

    @actor_command_window.dispose

    @actor_command_window = Window_Command_IBC.new(160, @individual_battle_commands)

    comand_size = (@individual_battle_commands.size >= 5 ? 5 : @individual_battle_commands.size)

    @actor_command_window.x = 470

    @actor_command_window.opacity = 200

    @actor_command_window.y = 247 - 24 * comand_size

    @actor_command_window.z = 2001

    @actor_command_window.back_opacity = COMMAND_OPACITY

    @actor_command_window.index = 0

    @actor_command_window.active = true

    @actor_command_window.visible = true

    @active_battler_window.refresh(@active_battler)

    @active_battler_window.y = 184 - 24 * comand_size

    @active_battler_window.z = 2002

    @active_battler_window.visible = true

    end

    #--------------------------------------------------------------------------

    def update_phase3_basic_command

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    phase3_prior_actor

    return

    end

    if Input.trigger?(Input::C)

    case @actor_command_window.commands[@actor_command_window.index]

    when $data_system.words.attack

    $game_system.se_play($data_system.decision_se)

    @active_battler.current_action.kind = 0

    @active_battler.current_action.basic = 0

    start_enemy_select

    when $data_system.words.guard

    $game_system.se_play($data_system.decision_se)

    @active_battler.current_action.kind = 0

    @active_battler.current_action.basic = 1

    phase3_next_actor

    when $data_system.words.item

    $game_system.se_play($data_system.decision_se)

    @active_battler.current_action.kind = 2

    start_item_select

    when "Ruba"

    $game_system.se_play($data_system.decision_se)

    start_enemy_select

    when @escape_name

    if $game_temp.battle_can_escape == false

    $game_system.se_play($data_system.buzzer_se)

    return

    end

    @active_battler_window.visible = false

    @actor_command_window.visible = false

    for actor in $game_party.actors

    actor.atb = 0

    actor.cast_action = nil

    end

    wait(3)

    $game_system.se_play($data_system.decision_se)

    update_phase2_escape

    end

    if @active_battler != nil and @active_battler.individual_commands.

    include?(@actor_command_window.commands[@actor_command_window.index])

    $game_system.se_play($data_system.decision_se)

    @active_battler.current_action.kind = 1

    @individual_battle_commands_skill_category=@actor_command_window.commands[@actor

    _command_window.index]

    start_skill_select

    end

    end

    end

    #--------------------------------------------------------------------------

    def start_skill_select

    ibc_start_skill_select_n01

    @skill_window.dispose

    @skill_window = Window_Skill2.new(@active_battler,@individual_battle_commands_skill_category)

    @skill_window.help_window = @help_window

    end

    end

     

    #==============================================================================

    # * Window_Skill

    #==============================================================================

    class Window_Skill2 < Window_Selectable

    #--------------------------------------------------------------------------

    def initialize(actor, skill_command_type = "")

    if skill_command_type != ""

    @skill_command_element_id = $data_system.elements.

    index("CMD " + skill_command_type)

    else

    @skill_command_element_id = -1

    end

    super(0, 128, 640, 352)

    @actor = actor

    @column_max = 2

    refresh

    self.index = 0

    if $game_temp.in_battle

    self.windowskin = RPG::Cache.windowskin("gameover")

    self.y = 320

    self.height = 160

    self.z = 2000

    self.back_opacity = 160

    end

    end

    #--------------------------------------------------------------------------

    def refresh

    if self.contents != nil

    self.contents.dispose

    self.contents = nil

    end

    @data = []

    for i in 0...@actor.skills.size

    skill = $data_skills[@actor.skills]

    if skill != nil

    if @skill_command_element_id == -1 or skill.element_set.include?(

    @skill_command_element_id)

    @data.push(skill)

    end

    end

    end

    @item_max = @data.size

    if @item_max > 0

    self.contents = Bitmap.new(width - 32, row_max * 32)

    for i in 0...@item_max

    draw_item(i)

    end

    end

    end

    end

     

     

    #==============================================================================

    # Window_Command

    #==============================================================================

    class Window_Command_IBC < Window_Selectable

    #--------------------------------------------------------------------------

    attr_accessor :commands

    #--------------------------------------------------------------------------

    def initialize(width, commands)

    comand_size = (commands.size >= 5 ? 192 : commands.size * 32 + 32)

    super(0, 0, width, comand_size)

    @item_max = commands.size

    @commands = commands

    self.contents = Bitmap.new(width - 32, @item_max * 32)

    refresh

    self.index = 0

    end

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

    for i in 0...@item_max

    draw_item(i, normal_color)

    end

    end

    #--------------------------------------------------------------------------

    def draw_item(index, color)

    self.contents.font.color = color

    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    self.contents.draw_text(rect, @commands[index])

    end

    #--------------------------------------------------------------------------

    def disable_item(index)

    draw_item(index, disabled_color)

    end

    end

     

    Grazie davvero a chiunque mi aiuti! :sisi:

  2. Buon giorno a tutti. Ho un grosso problema! Mi sono accorto che mettendo delle opzioni da scegliere nelle window selectable se vengono scelte non si vedono graficamente. ho provato in tutti i modi a colorare solo l'oggetto selezionato ma proprio non ci riesco ç_ç qualcuno sa aiutarmi?

    Ok sono riuscito a risolvere dopo molti tentativi... Se a qualcuno interessa mi chieda che glielo spiego :sisi:

  3.  

    class Game_System

     

    alias init_tons_of_addons_later initialize

    def initialize

    init_tons_of_addons_later

    @QUICK_PASSABILITY_TEST = true

    @MINIMAP = true

    end

    attr_accessor :QUICK_PASSABILITY_TEST

    attr_accessor :MINIMAP

    end

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

    # Quick Passability Test by Blizzard

    # Version: 1.0b

    # Type: Debug Utility

    # Date: 7.2.2007

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

    #

    # Important:

    #

    # This add-ons ONLY works in Debug mode/Testplay mode and is mainly

    # considered for debugging maps faster.

    #

    #

    # Instructions:

    #

    # This will put a mask on your map that shows the passability. Trigger on/off

    # the mask by pressing F6. You can define the color the passable part should

    # have by changing the TILE_COLOR constant. Use this template:

    #

    # TILE_COLOR = Color.new(R, G, B, A)

    #

    # R - red

    # G - green

    # B - blue

    # A - alpha (opacity)

    #

    # Every value needs to be set to a number between 0~255. Alpha over 128 is

    # not recommended. This will only work with the map, events are not

    # considered. This add-on will not work if the map's width * maps's height is

    # bigger than 19200, because the sprite would take up too much RAM and your

    # operating system would freeze and crash the game.

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

     

    TILE_COLOR = Color.new(255, 64, 0, 96)

     

    #==============================================================================

    # Game_Map

    #==============================================================================

     

    $quick_pass = true

     

    class Game_Map

     

    attr_reader :passables

     

    alias setup_minimap_later setup

    def setup(map_id)

    setup_minimap_later(map_id)

    setup_passability_net(true)

    end

     

    def setup_passability_net(force_flag = false)

    if @passables == nil || @passables == [] || force_flag

    @passables = []

    s1 = $game_system.minimap_w / $game_map.width

    s2 = $game_system.minimap_h / $game_map.height

    if $DEBUG && $game_system.QUICK_PASSABILITY_TEST &&

    width * height <= 19200 || $game_system.MINIMAP && s1 != 0 && s2 != 0

    (0...$game_map.height).each {|i|

    Graphics.update if $game_map.width * $game_map.height >= 19200

    (0...$game_map.width).each {|j|

    if $game_map.virtual_passable?(j, i, 2) ||

    $game_map.virtual_passable?(j, i, 4) ||

    $game_map.virtual_passable?(j, i, 6) ||

    $game_map.virtual_passable?(j, i, 8)

    @passables.push([j, i])

    end}}

    end

    end

    end

     

    def virtual_passable?(x, y, d)

    return false unless valid?(x, y)

    bit = (1 << (d / 2 - 1)) & 0x0f

    [2, 1, 0].each {|i|

    if data[x, y, i] == nil then return false

    elsif @passages[data[x, y, i]] & bit != 0 then return false

    elsif @passages[data[x, y, i]] & 0x0f == 0x0f then return false

    elsif @priorities[data[x, y, i]] == 0 then return true

    end}

    return true

    end

     

    end

     

    #==============================================================================

    # Scene_Map

    #==============================================================================

     

    class Scene_Map

     

    alias main_quick_passability_later main

    def main

    main_quick_passability_later

    @passable.dispose if @passable != nil

    end

     

    alias upd_quick_passability_later update

    def update

    upd_quick_passability_later

    if $DEBUG && $game_system.QUICK_PASSABILITY_TEST

    if @passable != nil

    if Input.trigger?(Input::F6)

    @passable.dispose

    @passable = nil

    else

    @passable.x = -$game_map.display_x/4

    @passable.y = -$game_map.display_y/4

    end

    elsif Input.trigger?(Input::F6)

    @passable = create_passable_help

    unless @passable == nil

    @passable.x = -$game_map.display_x/4

    @passable.y = -$game_map.display_y/4

    end

    end

    end

    end

     

    def create_passable_help

    coos = $game_map.passables

    if coos != [] && $game_map.width * $game_map.height <= 19200

    passable = RPG::Sprite.new

    passable.bitmap = Bitmap.new($game_map.width*32, $game_map.height*32)

    coos.each_index {|i|

    passable.bitmap.fill_rect(coos[0]*32, coos[1]*32, 32, 32, TILE_COLOR)}

    passable.z = 10000

    return passable

    end

    end

     

    end

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

    # Dynamic Passability Minimap by Blizzard

    # Version: 1.01b

    # Type: Game Playability Improvement

    # Date: 7.2.2007

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

    #

    # Compatibility:

    #

    # 95% compatible with SDK v1.x. 60% compatible with SDK v2.x. This add-on

    # NEEDS "Quick Passability Test" by Blizzard. WILL corrupt your old

    # savegames. Might not work with special map add-ons. Does NOT work with

    # pixel-movement without changing the code.

    #

    #

    # Why this minimap script better is than any other (aka features):

    #

    # - simple display to avoid lag

    # - custom size, position and opacity, changeable even during the game

    # - no bitmaps, no pictures to import, only plain script

    #

    #

    # Explanation:

    #

    # This add-on will draw a real-time minimap on the specified X and Y

    # coordinate on your screen. It will show the player, events that do NOT have

    # a comment in their code that says "no_minimap", that are not parallel

    # process and that are not auto-start and that are not erased yet. Events

    # with a teleport/transfer player command will be shown in a different color.

    # Any event with and comment with "special" in their code will be also

    # displayed differently. Blizz-ABS disables this add-on automatically and

    # uses the more enhanced built-in Blizz-ABS Minimap.

    #

    #

    # Instructions:

    #

    # You can trigger the minimap visible/invisible with F5 during the game.

    # Set up the starting configuration below. The colors follow a template of:

    #

    # WHAT_COLOR = Color.new(R, G, B)

    #

    # R - red

    # G - green

    # B - blue

    #

    # Change the colors of the dots on the map as you prefer it.

    #

    # PLAYER_COLOR - the player on the minimap

    # EVENT_COLOR - any event on the minimap that is not erased, is not

    # auto-start, is not parallel process and does not have a

    # comment in its code with the word "no_minimap"

    # TELEPORT_COLOR - any event like the one above, but that has a teleport/

    # transfer_player command

    # SPECIAL_COLOR - any event with a comment with the word "special"

    # MINIMAP_X - default X of the minimap on the screen

    # MINIMAP_Y - default Y of the minimap on the screen

    # MINIMAP_WIDTH - default maximal allowed width of the minimap

    # MINIMAP_HEIGHT - default maximal allowed height of the minimap

    # MINIMAP_OPACITY - default opacity of the minimap on the screen

    #

    # You have the possibility to change the minimap's size, coordinates and

    # opacity during the game process. The command you need to type in into a

    # "Call Script" command window are:

    #

    # $game_system.mini_coos(X, Y)

    # $game_system.mini_size(W, H)

    # $game_system.mini_opaq(A)

    #

    # X - new X

    # Y - new Y

    # W - new width

    # H - new height

    # A - new opacity

    #

    # Any changes will be applied instantly. Note that you don't need to use ALL

    # commands.

    #

    #

    # Note:

    #

    # Changing X, Y and opacity during the game will result in just moving the

    # sprite. The minimap will not work if the maximal allowed size is smaller

    # than the map size. (i.e. if your minimap is 160x120, maps like 170x130,

    # 180x15 or 20x140 will not work.)

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

     

    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    # Start Configuration

    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

     

    PLAYER_COLOR = Color.new(0, 255, 0)

    EVENT_COLOR = Color.new(0, 128, 255)

    TELEPORT_COLOR = Color.new(255, 255, 0)

    SPECIAL_COLOR = Color.new(255, 0, 0)

    MINIMAP_X = 0

    MINIMAP_Y = 0

    MINIMAP_WIDTH = 160

    MINIMAP_HEIGHT = 160

    MINIMAP_OPACITY = 160

     

    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    # End Configuration

    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

     

    if $quick_pass != true

    p 'Attention! Minimap is missing a vital add-on! Application will now close!'

    exit

    end

     

    #==============================================================================

    # Game_System

    #==============================================================================

     

    class Game_System

     

    attr_reader :minimap_x

    attr_reader :minimap_y

    attr_reader :minimap_w

    attr_reader :minimap_h

    attr_reader :minimap_a

    attr_accessor :minimap_visible

     

    alias init_minimap_later initialize

    def initialize

    init_minimap_later

    @minimap_visible = false

    @minimap_x = [[MINIMAP_X, 0].max, 640].min

    @minimap_y = [[MINIMAP_Y, 0].max, 480].min

    @minimap_w = [[MINIMAP_WIDTH, 0].max, 640].min

    @minimap_h = [[MINIMAP_HEIGHT, 0].max, 480].min

    @minimap_a = [[MINIMAP_OPACITY, 0].max, 255].min

    end

     

    def mini_coos(x, y)

    @minimap_x, @minimap_y = [[x, 0].max, 640].min, [[y, 0].max, 480].min

    end

     

    def mini_size(w, h)

    @minimap_w, @minimap_h = [[w, 0].max, 640].min, [[h, 0].max, 480].min

    $game_map.setup_passability_net

    end

     

    def mini_opaq(a)

    @minimap_a = [[a, 0].max, 255].min

    end

     

    end

     

    #==============================================================================

    # Game_Event

    #==============================================================================

     

    class Game_Event < Game_Character

     

    attr_reader :erased

     

    def conditions

    @event.pages.reverse.each {|page|

    c = page.condition

    next if c.switch1_valid && !$game_switches[c.switch1_id]

    next if c.switch2_valid && !$game_switches[c.switch2_id]

    if c.variable_valid

    next if $game_variables[c.variable_id] < c.variable_value

    end

    if c.self_switch_valid

    key = [@map_id, @event.id, c.self_switch_ch]

    next if $game_self_switches[key] != true

    end

    return true}

    return false

    end

     

    end

     

    #==============================================================================

    # Mini_Map

    #==============================================================================

     

    class Mini_Map < RPG::Sprite

     

    def initialize(viewport = nil)

    super

    self.z = 10100

    create_minimap

    end

     

    def create_minimap

    coos = $game_map.passables

    @w, @h = $game_system.minimap_w, $game_system.minimap_h

    s = [@w / $game_map.width, @h / $game_map.height]

    @size = (s[0] > s[1] ? s[1] : s[0])

    if @size > 0

    self.bitmap = Bitmap.new(@size*$game_map.width, @size*$game_map.height)

    self.bitmap.fill_rect(0, 0, @w, @h, Color.new(0, 0, 0))

    color = Color.new(128, 128, 128)

    coos.each {|coo|

    self.bitmap.fill_rect(coo[0]*@size, coo[1]*@size, @size, @size, color)}

    @events = get_events

    create_sevents

    update

    else

    self.dispose

    end

    end

     

    def update

    super

    ev = get_events

    if ev != @events

    @events = ev

    destroy_sevents

    create_sevents

    end

    self.x, self.y = $game_system.minimap_x, $game_system.minimap_y

    self.opacity = $game_system.minimap_a

    @sevents.each_index {|i|

    @sevents.x = @events.x * @size + self.x

    @sevents.y = @events.y * @size + self.y

    @sevents.opacity = $game_system.minimap_a}

    if @w != $game_system.minimap_w || @h != $game_system.minimap_h

    self.bitmap.dispose

    destroy_sevents

    create_minimap

    end

    end

     

    def create_sevents

    @sevents = []

    @events.each_index {|i|

    sprite = RPG::Sprite.new

    sprite.bitmap = Bitmap.new(@size, @size)

    if @events.is_a?(Game_Player)

    color = PLAYER_COLOR

    elsif event_comment(@events, 'special')

    color = SPECIAL_COLOR

    elsif @events.list != nil && @events.list.any? {|j| j.code == 201}

    color = TELEPORT_COLOR

    else

    color = EVENT_COLOR

    end

    sprite.bitmap.fill_rect(0, 0, @size, @size, color)

    sprite.z = 10200

    @sevents.push(sprite)}

    end

     

    def destroy_sevents

    @sevents.each {|i| i.dispose}

    @sevents = nil

    end

     

    def get_events

    events = [$game_player]

    $game_map.events.each_value {|event|

    if !event.erased && ![3, 4].include?(event.trigger) &&

    !event_comment(event, 'no_minimap') && event.conditions

    events.push(event)

    end}

    return events

    end

     

    def event_comment(event, comment)

    return false unless event.list.is_a?(Array)

    return (event.list.any? {|c| c.code == 108 && c.parameters[0] == comment})

    end

     

    def dispose

    destroy_sevents if @sevents != nil

    super

    end

     

    end

     

    #==============================================================================

    # Scene_Map

    #==============================================================================

     

    class Scene_Map

     

    alias main_minimap_later main

    def main

    @minimap = Mini_Map.new if $game_system.minimap_visible

    main_minimap_later

    @minimap.dispose if @minimap != nil

    end

     

    alias upd_minimap_later update

    def update

    upd_minimap_later

    return if $BlizzABS && BlizzABS::VERSION >= 1.030

    if $game_system.MINIMAP

    if @minimap != nil

    if Input.trigger?(Input::F5)

    @minimap.dispose

    @minimap = nil

    $game_system.minimap_visible = false

    else

    @minimap.update

    end

    elsif Input.trigger?(Input::F5)

    @minimap = Mini_Map.new

    if @minimap.disposed?

    $game_system.minimap_visible = false

    @minimap = nil

    else

    $game_system.minimap_visible = true

    end

    end

    end

    end

     

    alias transfer_player_minimap_later transfer_player

    def transfer_player

    if $game_system.minimap_visible

    @minimap.dispose

    @minimap = nil

    end

    transfer_player_minimap_later

    @minimap = Mini_Map.new if $game_system.minimap_visible

    if @minimap != nil && @minimap.disposed?

    @minimap = nil

    $game_system.minimap_visible = false

    end

    end

     

    end

     

     

     

     

    Così dovrebbe funzionarti. Però se entri nel menu da errore.

    Premi F6 e lo script tingerà di rosso tutti i tile passabili!

    Con F5 verrà visualizzata una minimappa che ti fa vedere gli eventi sulla mappa. :wink:

  4. Penso che lo script di SephirothSpawn faccia al caso tuo..

    #======================================================================

    # ** Skills Use Items

    #------------------------------------------------------------------------------

    # SephirothSpawn

    # Version 1

    # 2006-10-15

    #------------------------------------------------------------------------------

    # * Description :

    #

    # This script was designed to make skill using consume items.

    #------------------------------------------------------------------------------

    # * Instructions :

    #

    # Place The Script Below the SDK and Above Main.

    # To customize skill item usage, refer to customization.

    #------------------------------------------------------------------------------

    # * Customization :

    #

    # Settings Skills That Use Items

    # - Item_Cost = { skill_id => <item_cost>, ... }

    #

    # Replace <item_cost> with

    # - { item_type => { id => n, ... }, ... }

    #

    # Item Types : 0 - Item, 1 - Weapons, 2 - Armors

    #==============================================================================

     

    #------------------------------------------------------------------------------

    # * SDK Log Script

    #------------------------------------------------------------------------------

    SDK.log('Skills Use Items', 'SephirothSpawn', 1, '2006-10-15')

     

    #------------------------------------------------------------------------------

    # * Begin SDK Enable Test

    #------------------------------------------------------------------------------

    if SDK.state('Skills Use Items')

     

    #==============================================================================

    # ** RPG::Skill

    #==============================================================================

     

    class RPG::Skill

    #--------------------------------------------------------------------------

    # * Skills That Use Items

    #

    # ~ skill_id => { item_type => { id => n, ... }, ...}

    #

    # Item_Types = 0 : Items, 1 : Weapons, 2 : Armors

    #--------------------------------------------------------------------------

    Item_Cost = {

    57 => { 0 => { 1 => 2 } }

    }

    #--------------------------------------------------------------------------

    # * Item Cost

    #--------------------------------------------------------------------------

    def item_cost

    return ( Item_Cost.has_key?(@id) ? Item_Cost[@id] : {} )

    end

    end

     

    #==============================================================================

    # ** Game_Battler

    #==============================================================================

     

    class Game_Battler

    alias seph_skillsuseitems_gmbtlr_skc? skill_can_use?

    alias seph_skillsuseitems_gmbtlr_se skill_effect

    #--------------------------------------------------------------------------

    # * Determine if Skill can be Used

    #--------------------------------------------------------------------------

    def skill_can_use?(skill_id)

    # If Actor

    if self.is_a?(Game_Actor)

    # Checks All Skill Requirements

    $data_skills[skill_id].item_cost.each do |item_type, ids|

    # Items

    if item_type == 0

    ids.each do |id, n|

    return false if $game_party.item_number(id) < n

    end

    # Weapons

    elsif item_type == 1

    ids.each do |id, n|

    return false if $game_party.weapon_number(id) < n

    end

    # Armors

    elsif item_type == 2

    ids.each do |id, n|

    return false if $game_party.armor_number(id) < n

    end

    end

    end

    end

    # Return Original Test

    return seph_skillsuseitems_gmbtlr_skc?(skill_id)

    end

    #--------------------------------------------------------------------------

    # * Apply Skill Effects

    #--------------------------------------------------------------------------

    def skill_effect(user, skill)

    # If Original Effect

    if self.seph_skillsuseitems_gmbtlr_se(user, skill)

    # If User is an Actor

    if user.is_a?(Game_Actor)

    # Lose Item Cost

    skill.item_cost.each do |item_type, ids|

    # Items

    if item_type == 0

    ids.each { |id, n| $game_party.lose_item(id, n) }

    # Weapons

    elsif item_type == 1

    ids.each { |id, n| $game_party.lose_weapon(id, n) }

    # Armors

    elsif item_type == 2

    # Lose All Armors

    ids.each { |id, n| $game_party.lose_armor(id, n) }

    end

    end

    end

    end

    end

    end

     

    #--------------------------------------------------------------------------

    # * End SDK Enable Test

    #--------------------------------------------------------------------------

    end

     

  5. poi usare lo script di SephirothSpawn (necessità dell'SDK)

     

    #======================================================================

    ========

    # ** Additional Enemy Drops

    #------------------------------------------------------------------------------

    # SephirothSpawn

    # Version 2.1

    # 2006-12-13

    #------------------------------------------------------------------------------

    # * Version History :

    #

    # Version 1 ---------------------------------------------------- (2006-07-09)

    # Version 2 ---------------------------------------------------- (2006-09-20)

    # - Update : Re-scripted Much of the System

    # Version 2.1 ------------------------------------------------- (2006-12-13)

    # - Addition : Added Max Number of Drops Feature

    #------------------------------------------------------------------------------

    # * Description :

    #

    # This script was designed to let you control multiple item, weapon & armor

    # drops for each enemy. You can also control the drop percentages as well.

    #

    # As a bonus, you can limit the number of items, weapons, armors or total

    # items dropped by a monster.

    #------------------------------------------------------------------------------

    # * Instructions :

    #

    # Place The Script Below the SDK and Above Main.

    # To Customize your drops, refer to the customization instructions.

    #------------------------------------------------------------------------------

    # * Customization :

    #

    # Max_Item_Drops

    # - Description : Limits Number of Random Drops

    # - Key : Monster ID

    # - Value : Max Drops

    #

    # <drop_type> = { monster_id => { key => percent, ... }

    #

    # Enemy_Item_Drops

    # - Description : List Of Items Dropped By Monster

    # - Key : Item ID

    #

    # Enemy_Weapon_Drops

    # - Description : List Of Weapons Dropped By Monster

    # - Key : Weapon ID

    #

    # Enemy_Armor_Drops

    # - Description : List Of Armors Dropped By Monster

    # - Key : Armor ID

    #------------------------------------------------------------------------------

    # * Syntax :

    #

    # Collect Random Drop List of Items, Weapons or Armors. These methods will

    # return a random list of dropped items.

    # - <game_enemy>.multi_item_drops

    # - <game_enemy>.multi_weapon_drops

    # - <game_enemy>.multi_armor_drops

    #

    # Force Enemy to Drop Items, Weapons & Armors. All items will be

    # automatically gained, and a list of RPG::Items, RPG::Weapons & RPG::Armors

    # will be returned.

    # - <game_enemy>.drop_multi_items

    #==============================================================================

     

    #------------------------------------------------------------------------------

    # * SDK Log Script

    #------------------------------------------------------------------------------

    SDK.log('Additional Enemy Drops', 'SephirothSpawn', 2.1, '2006-12-13')

     

    #------------------------------------------------------------------------------

    # * Begin SDK Enable Test

    #------------------------------------------------------------------------------

    if SDK.state('Additional Enemy Drops')

     

    #==============================================================================

    # ** Game_Enemy

    #==============================================================================

     

    class Game_Enemy < Game_Battler

    #--------------------------------------------------------------------------

    # * Max Item, Weapon & Armor Drops

    # ~ enemy_id => max_items

    #--------------------------------------------------------------------------

    Max_Item_Drops = {}

    Max_Weapon_Drops = {}

    Max_Armor_Drops = {}

    Max_Overall_Drops = {}

    #--------------------------------------------------------------------------

    # * Enemy Item Drops

    # ~ enemy_id => { item_id => drop_percent, ... }

    #--------------------------------------------------------------------------

    Enemy_Item_Drops = {

    35 => {4 => 100, 4 => 100}

    }

    #--------------------------------------------------------------------------

    # * Enemy Weapon Drops

    # ~ enemy_id => { weapon_id => drop_percent, ... }

    #--------------------------------------------------------------------------

    Enemy_Weapon_Drops = {

    }

     

    #--------------------------------------------------------------------------

    # * Enemy Item Drops

    # ~ enemy_id => { item_id => drop_percent, ... }

    #--------------------------------------------------------------------------

    Enemy_Armor_Drops = {

    }

    #--------------------------------------------------------------------------

    # * Multiple Item Drops

    #--------------------------------------------------------------------------

    def multi_item_drops

    items = []

    # Item Lists

    if Enemy_Item_Drops.has_key?(@enemy_id)

    # Passes Each Item

    Enemy_Item_Drops[@enemy_id].each do |item_id, drop_percent|

    # Adds items If Randomly Dropped

    if rand(100) < drop_percent

    items << $data_items[item_id]

    end

    end

    end

    # If List Larger than Max Items

    if Max_Item_Drops.has_key?(@enemy_id)

    # Until List Size is Smaller

    until items.size <= Max_Item_Drops[@enemy_id]

    # Delete Random items

    items.delete(items[rand(items.size)])

    end

    end

    # Return list

    return items

    end

    #--------------------------------------------------------------------------

    # * Multiple Weapon Drops

    #--------------------------------------------------------------------------

    def multi_weapon_drops

    items = []

    # Item Lists

    if Enemy_Weapon_Drops.has_key?(@enemy_id)

    # Passes Each Weapon

    Enemy_Weapon_Drops[@enemy_id].each do |weapon_id, drop_percent|

    # Adds items If Randomly Dropped

    if rand(100) < drop_percent

    items << $data_weapons[weapon_id]

    end

    end

    end

    # If List Larger than Max Items

    if Max_Weapon_Drops.has_key?(@enemy_id)

    # Until List Size is Smaller

    until items.size <= Max_Weapon_Drops[@enemy_id]

    # Delete Random items

    items.delete(items[rand(items.size)])

    end

    end

    # Return list

    return items

    end

    #--------------------------------------------------------------------------

    # * Multiple Armor Drops

    #--------------------------------------------------------------------------

    def multi_armor_drops

    items = []

    if Enemy_Armor_Drops.has_key?(@enemy_id)

    # Passes Each Armor

    Enemy_Armor_Drops[@enemy_id].each do |armor_id, drop_percent|

    # Adds items If Randomly Dropped

    if rand(100) < drop_percent

    items << $data_armors[armor_id]

    end

    end

    end

    # If List Larger than Max Items

    if Max_Armor_Drops.has_key?(@enemy_id)

    # Until List Size is Smaller

    until items.size <= Max_Armor_Drops[@enemy_id]

    # Delete Random items

    items.delete(items[rand(items.size)])

    end

    end

    # Return list

    return items

    end

    #--------------------------------------------------------------------------

    # * Drop Multi Items

    #--------------------------------------------------------------------------

    def drop_multi_items

    # Starts Item List

    items = []

    items << multi_item_drops

    items << multi_weapon_drops

    items << multi_armor_drops

    items.flatten!

    # If List Larger than Max Items

    if Max_Overall_Drops.has_key?(@enemy_id)

    # Until List Size is Smaller

    until items.size <= Max_Overall_Drops[@enemy_id]

    # Delete Random items

    items.delete(items[rand(items.size)])

    end

    end

    # Passes Through Item Drop List

    for item in items

    case item

    when RPG::Item

    $game_party.gain_item(item.id, 1)

    when RPG::Weapon

    $game_party.gain_weapon(item.id, 1)

    when RPG::Armor

    $game_party.gain_armor(item.id, 1)

    end

    end

    # Returns Drop List

    return items

    end

    end

     

    #==============================================================================

    # ** Window_BattleResult

    #==============================================================================

     

    class Window_BattleResult < Window_Base

    #--------------------------------------------------------------------------

    # * Add Multiple Drops

    #--------------------------------------------------------------------------

    def add_multi_drops

    # Collects Extra Droppings

    for enemy in $game_troop.enemies

    # Adds Extra Treasures

    @treasures << enemy.drop_multi_items

    end

    # Flatten Array

    @treasures.flatten!

    # Sort Treasures By ID

    @treasures.sort! {|a, b| a.id <=> b.id}

    # Sort Treasures By Type

    @treasures.sort! do |a, b|

    a_class = a.is_a?(RPG::Item) ? 0 : a.is_a?(RPG::Weapon) ? 1 : 2

    b_class = b.is_a?(RPG::Item) ? 0 : b.is_a?(RPG::Weapon) ? 1 : 2

    a_class <=> b_class

    end

    # Adjust Height & Window Contents

    self.height = [@treasures.size * 32 + 64, 256].min

    self.contents = Bitmap.new(width - 32, @treasures.size * 32 + 32)

    # Adjust Y

    self.y = 160 - height / 2

    # Refresh Window

    refresh

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    super

    if Input.press?(Input::UP)

    self.oy -= 4 if self.oy > 0

    elsif Input.press?(Input::DOWN)

    self.oy += 4 if self.oy < self.contents.height - 64

    end

    end

    end

     

    #==============================================================================

    # ** Scene_Battle

    #==============================================================================

     

    class Scene_Battle

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias seph_enemydrops_scnbtl_sp5 start_phase5

    #--------------------------------------------------------------------------

    # * Start After Battle Phase

    #--------------------------------------------------------------------------

    def start_phase5

    # Original Start Phase 5

    seph_enemydrops_scnbtl_sp5

    # Add Extra Item Drops

    @result_window.add_multi_drops

    end

    end

     

    #--------------------------------------------------------------------------

    # * End SDK Enable Test

    #--------------------------------------------------------------------------

    end

     

  6. Per settarlo con il terrian tag, basta che vai in tileset e a destra ci sono varie opzioni (passaggio, priorità....)

    clicca su terrain tag e metti un numero a il pezzo di mappa che ti serve, poi in un evento metti una variabile che prende il terrain tag del player e metti una condizione if se il terrain tag è = a.... allora succede questo... altrimenti....qualcosaltro.

  7. Ecco lo script per rubare. Le istruzioni sono all'interno!

     

    #======================================================================

    ========

    # Add-On: Skill Steal

    # by Atoa

    #==============================================================================

    # This script was modified to work with SBS XP, it allows you to create

    # skill that steal items/gold from enemies

    #

    # To add the steal effect to an skill, go to the skill extension and add

    # the extensio "STEAL".

    #

    # To add itens to enemies, go to the "module Atoa"

    # Enemy_Steal[iD] = {"ITEM" => RATE}

    #

    # ID = enemy ID

    # ITEM = Type and Item ID. must be always show as "xY"

    # where:

    # x = type of the item

    # Y = item ID/amount of money

    # x must be "a" for armors, "w" for weapons, "i" for items, "g" for money

    # PORCENTAGEM = % of getting the item, an value bettwen 0 and 100, can be decimal

    # Ex.: 5.4 = 5,4% rate

    #

    # Ex.: Enemy_Steal[15] = {"w6" => 22.5, "g900" => 12}

    # That means the Enemy ID 15 (Enemy_Drops[15])

    # Have 22,5% of droping the Weapon ID 6 ("w6" => 22.5)

    # and have 12% of droping 900 Gold ("g900" => 12)

    #

    # You can only steal one item per steal attempt.

    #

    # You can add as many items you want to an enemy

    #

    #==============================================================================

     

     

    module Atoa

    Enemy_Steal = [] # don't remove/change this line

     

    # Enemies can be stolen more than one time?

    Multi_Steal = false

    # If false, you can steal an enemy only once per battle, even if it

    # have more items (like the old FF's)

     

    # Base Success Rate

    Steal_Rate = 50

    # Even if the rate is 100%, that dont't grants 100% of chance of getting an item

    # this value changes with the difference bettwen, the user and target's AGI, and

    # it still necessary to verify the drop rate of each item

     

    # Message if the target has no items

    No_Item = "Non possiede niente!"

     

    # Message if the steal attempt fail

    Steal_Fail = "Mancato!"

     

    # Message of Item steal sucess. {item} is the name of the item, you must add it

    # to the message, or the item name won't be shown

    Steal_Item = "Hai rubato {item}!"

    # E.g:

    # "Stole {item}" - Stole Potion

    # "{item} gained" - Potion gained

     

    # Message of gold steal sucess. {gold} is the amount of gold, you must add it

    # to the message, or the amount stole won't be shown

    # {unit} the money unit, use it only if you want

    Steal_Gold = "Hai rubato {gold}{unit}!"

    # Exemplos:

    # "Stole {gold}{unit}" - Stole 500G

    # "Stole {gold} coins" - Stole 500 coins

     

    # Add here the enemies ID and the items they have

    # Enemy_Steal[Enemy_ID] = {"ITEM" => RATE}

    Enemy_Steal[1] = {"g15" => 50}

    Enemy_Steal[2] = {"i1" => 22.5, "g9" => 40, "g23" => 20}

    Enemy_Steal[3] = {"g21" => 22.5, "g25" => 22.5, "i1" => 12}

    Enemy_Steal[4] = {"g83" => 33.2, "g42" => 22.5, "i79" => 12}

    Enemy_Steal[5] = {"g75" => 33.2, "g27" => 22.5, "i80" => 21}

    Enemy_Steal[6] = {"g120" => 33.2, "g89" => 22.5, "i81" => 19}

    Enemy_Steal[7] = {}

    Enemy_Steal[8] = {}

    Enemy_Steal[9] = {}

    Enemy_Steal[10] = {"g352" => 32.2, "g465" => 22.5, "a17" => 34}

    Enemy_Steal[11] = {"g352" => 32.2, "g465" => 22.5, "a17" => 12}

    Enemy_Steal[12] = {"g212" => 45.2, "g6" => 9, "i82" => 4}

     

    end

     

     

    #==============================================================================

    # RPG::Skill

    #==============================================================================

    class RPG::Skill

    alias atoa_steal_extension extension

    def extension

    case @id

    when 187

    return ["STEAL"]

    # Add here the skills IDs and the extension of them

    end

    atoa_steal_extension

    end

    end

     

    #==============================================================================

    # Game_Battler

    #==============================================================================

    class Game_Battler

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    def stole_item_set(user)

    @steal_flag = true

    steal_success = rand(100) < (Steal_Rate + self.steal_attempt) * user.agi / self.agi

    self.steal_attempt += 1

    return false unless steal_success

    return nil if self.steal_items == nil or self.steal_items == []

    item_stole = []

    self.steal_items.each do |item, steal_rate|

    item = item.split('')

    if item[0] == "i"

    item = item.join

    item.slice!("i")

    item_stole.push($data_items[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "a"

    item = item.join

    item.slice!("a")

    item_stole.push($data_armors[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "w"

    item = item.join

    item.slice!("w")

    item_stole.push($data_weapons[item.to_i]) if rand(1000) < (steal_rate * 10).to_i

    elsif item[0] == "g"

    item = item.join

    item.slice!("g")

    item_stole.push(item.to_i) if rand(1000) < (steal_rate * 10).to_i

    end

    end

    return false if item_stole == []

    self.steal_attempt = 0

    stole_item_index = rand(item_stole.size)

    item_to_steal = [item_stole[stole_item_index]]

    self.steal_items.delete_at(stole_item_index) if Multi_Steal

    self.steal_items = [] unless Multi_Steal

    return item_to_steal

    end

    end

     

    #==============================================================================

    # Game_Enemy

    #==============================================================================

    class Game_Enemy < Game_Battler

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    attr_accessor :steal_items

    attr_accessor :steal_flag

    attr_accessor :stole_item

    attr_accessor :steal_attempt

    #--------------------------------------------------------------------------

    alias initialize_atoa_steal_enemy initialize

    #--------------------------------------------------------------------------

    def initialize(troop_id, member_index)

    initialize_atoa_steal_enemy(troop_id, member_index)

    @steal_items = Enemy_Steal[@enemy_id].to_a

    @stole_item = nil

    @steal_flag = false

    @steal_attempt = 0

    end

    end

     

    #==============================================================================

    # Scene_Battle

    #==============================================================================

    class Scene_Battle

    #--------------------------------------------------------------------------

    include Atoa

    #--------------------------------------------------------------------------

    def pop_steal_help(obj)

    @help_window.set_text(obj, 1)

    count = 0

    loop do

    update_basic

    count += 1

    break @help_window.visible = false if (Input.trigger?(Input::C) and count > 30) or count == 80

    end

    end

    #--------------------------------------------------------------------------

    alias atoa_steal_pop_damage pop_damage

    def pop_damage(target, obj, action)

    if obj.is_a?(RPG::Skill) && obj.extension.include?("STEAL") && ((obj.atk_f == 0 &&

    obj.str_f == 0 && obj.dex_f == 0 && obj.agi_f == 0 && obj.int_f == 0) or obj.power == 0)

    target.missed = target.evaded = false

    target.damage = ""

    end

    atoa_steal_pop_damage(target, obj, action)

    end

    #--------------------------------------------------------------------------

    alias atoa_steal_action_end action_end

    def action_end

    if @active_battler.current_action.kind == 1

    obj = $data_skills[@active_battler.current_action.skill_id]

    if obj.extension.include?("STEAL")

    @target_battlers.each do |battler|

    stole_item = battler.stole_item_set(@active_battler) and battler.is_a?(Game_Enemy)

    if battler.is_a?(Game_Enemy) && battler.steal_flag

    item_stole = stole_item[0] unless stole_item == false or stole_item == nil

    item_stole = nil if stole_item == nil

    item_stole = false if stole_item == false or battler.damage == "Errou!"

    case item_stole

    when nil

    text = No_Item

    when false

    text = Steal_Fail

    when Numeric

    $game_party.gain_gold(item_stole)

    text = Steal_Gold.dup

    text.gsub!(/{gold}/i) {"#{item_stole}"}

    text.gsub!(/{unit}/i) {"#{$data_system.words.gold}"}

    else

    case item_stole

    when RPG::Item

    $game_party.gain_item(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    when RPG::Weapon

    $game_party.gain_weapon(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    when RPG::Armor

    $game_party.gain_armor(item_stole.id, 1)

    text = Steal_Item.dup

    text.gsub!(/{item}/i) {"#{item_stole.name}"}

    end

    end

    pop_steal_help(text)

    battler.steal_flag = false

    wait(3)

    end

    end

    end

    end

    atoa_steal_action_end

    end

    end

     

     

  8. Ok la cosa funziona però mi vedo costretto a usare:

    - 2 skill per ogni mossa

    - 2 common event per ogni mossa più uno switch di attivazione

    -poi considerato che queste abilità le possono apprendere più di una persona diventa lunghissima la cosa...

    Spero di riuscire con gli script a trovare qualcosa senno posso fare pochissime skill. :(

×
×
  • Create New...