Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Levelowanie ekwpipunku
Autor Wiadomość
Loki 




Preferowany:
RPG Maker VX

Pomógł: 12 razy
Dołączył: 25 Kwi 2012
Posty: 162
Wysłany: Nie 10 Cze, 2012 11:49
Levelowanie ekwpipunku
~ Equipment Levels Up ~


Krótki opis:
Pozwala levelować ekwpipunek takie jak broń, tarcze, zbroje itd.

Autor:
Fomar0153

Kompatybilność:
RPG Maker VX Ace

Skrypt:
Spoiler:

Kod:
=begin
Equipment Levels Up
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
This script allows weapons to grow stronger and level up when they
gain exp or ap.
----------------------
Instructions
----------------------
Requires my individual equipment script. (Make sure it is version 1.1+)
Requires an AP script if leveling weapons using AP.
Customise the variables in the module below to set up the script to your
liking.

Notetags
<maxlevel x> - adds a non-default max level to the tagged equipment.
----------------------
Known bugs
----------------------
None
=end

module Fomar
 
  # If you only want to implement this for weapons or armours set
  # the following to false as you see fit
  WLU_WEAPONS_LEVEL_UP = true
  WLU_ARMOURS_LEVEL_UP = true
  # This script can be set up to use either EXP or AP
  # For AP you will also need an AP system.
  # true -> uses AP
  # false -> uses EXP
  WLU_USE_AP = false
  # Determines the order of the substitutions
  # true -> level, name
  # false -> name, level
  WLU_PREFIX = false
  # the %s are replaced by the level and name of the weapon
  WLU_VOCAB_WEAPON_NAME = "%s LV %s"
  # Default max level
  # set to 0 to only allow chosen weapons to level up
  WLU_DEF_MAX_LEVEL = 5
  # Default stat increase per level (percentage)
  WLU_DEF_PARAM_INC = 25
  # Set to false if you want the price of the item to be unaffected
  # by leveling up
  WLU_PRICE_LEVEL_UP = true
  # Default experience per level
  # I have provided two defaults, one designed for EXP and one for AP
  def self.WLU_EXP_FOR_LEVEL(item); return item.performance * 10; end
  def self.WLU_AP_FOR_LEVEL(item); return item.performance; end
 
end


class Game_CustomEquip < Game_BaseItem
 
  alias wlu_initialize initialize
  def initialize
    wlu_initialize
    @exp = 0
    @level = 1
  end
 
  def gain_exp(exp)
    return unless levels?
    @exp += exp
    last_level = @level
    unless Fomar::WLU_USE_AP
      while @exp >= @level * Fomar.WLU_EXP_FOR_LEVEL(object) and @level < object.max_level
        @level += 1
        $game_message.add(object.name + " levels up.")
      end
    else
      while @exp >= @level * Fomar.WLU_AP_FOR_LEVEL(object) and @level < object.max_level
        @level += 1
        $game_message.add(object.name + " levels up.")
      end
    end
  end
 
  def levels?
    return false if is_nil?
    return (((is_weapon? and Fomar::WLU_WEAPONS_LEVEL_UP) or
            (is_armor? and Fomar::WLU_ARMOURS_LEVEL_UP)) and
            object.max_level > 0)
  end
 
  alias wlu_name name
  def name
    return nil if is_nil?
    return wlu_name unless levels?
    return sprintf(Fomar::WLU_VOCAB_WEAPON_NAME,@level,wlu_name) if Fomar::WLU_PREFIX
    return sprintf(Fomar::WLU_VOCAB_WEAPON_NAME,wlu_name,@level)
  end
 
  alias wlu_price price
  def price
    return nil if is_nil?
    return wlu_price unless levels?
    return wlu_price unless Fomar::WLU_PRICE_LEVEL_UP
    return (100 + Fomar::WLU_DEF_PARAM_INC * @level + object.price)/100
  end
 
  def params
    return nil if is_nil?
    par = object.params.clone
    for i in 0..par.size - 1
      par[i] *= 100 + Fomar::WLU_DEF_PARAM_INC * (@level - 1)
      par[i] /= 100
    end
    return par
  end
 
  alias wlu_performance performance
  def performance
    return nil if is_nil?
    return wlu_performance unless levels?
    par = params
    p = 0
    for pa in par
      p += pa
    end
    if is_weapon?
      p += par[2] + par[4]
    else
      p += par[3] + par[5]
    end
    return p
  end
 
end

module RPG
  class EquipItem
    def max_level
      if self.note =~ /<maxlevel (.*)>/i
        return $1.to_i
      else
        return Fomar::WLU_DEF_MAX_LEVEL
      end
    end
  end
end

class Game_Actor < Game_Battler
 
  alias wlu_gain_exp gain_exp
  def gain_exp(exp)
    for equip in @equips
      equip.gain_exp(exp)
    end
    wlu_gain_exp(exp)
  end
 
  def gain_ap(ap)
    for equip in @equips
      equip.gain_exp(ap)
    end
  end
 
  def custom_equips
    return @equips
  end
 
  # rewrites param_plus
  def param_plus(param_id)
    p = super(param_id)
    for equip in @equips
      p += equip.params[param_id] unless equip.is_nil?
    end
    return p
  end
 
end


class Window_Base < Window
 
  alias wlu_draw_item_name draw_item_name
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    if item.is_a?(Game_CustomEquip)
      return if item.is_nil?
    end
    wlu_draw_item_name(item, x, y, enabled = true, width)
  end
 
end

class Window_EquipSlot < Window_Selectable
 
  # rewrites draw_item
  def draw_item(index)
    return unless @actor
    rect = item_rect_for_text(index)
    change_color(system_color, enable?(index))
    draw_text(rect.x, rect.y, 92, line_height, slot_name(index))
    draw_item_name(@actor.custom_equips[index], rect.x + 92, rect.y, enable?(index))
  end
 
end


Screeny:
Spoiler:



Dodatkowe informacje:
Do prawidłowego działania trzeba dodać 2 inne skrypty:
1. http://cobbtocs.co.uk/wp/?p=148
2. http://cobbtocs.co.uk/wp/?p=82
 
 
Valdali 




Preferowany:
RPG Maker VXAce

Ranga RM:
1 gra

Pomógł: 20 razy
Dołączył: 19 Mar 2010
Posty: 421
Skąd: Reykjavik
Wysłany: Sro 13 Cze, 2012 22:14
jak dodajesz skrypty to dla niektórych można by je tłumaczyć :->
tak czy siak dobre i użyteczne :-P
________________________
Moje anime w RPG Makerze. Zapraszam!
ZOBACZ :!: :!: :!:
Spoiler:

Moimi Mistrzami i Wielkimi Nauczycielami są: Melvin i Angius!

Dziennik Krejzolów:
Ayene
Angius
Melvin
Yoroiookami
CrasheR
Finwe

Moi ziomale :D

 
 
 
 
BBcode 



Preferowany:
RPG Maker VXAce

Dołączył: 24 Cze 2012
Posty: 8
Skąd: Kraków
Wysłany: Pon 25 Cze, 2012 21:19
A jest możliwość u jednego NPC zrobienia maksymalnego poziomu ulepszenia 5 a u innego 10?
Np. Że w dalszych etapach gry spotyka się NPC co mogą ulepszyć broń na wyższy + niż u NPC w pierwszym napotkany mieście.
________________________
Lube pociągi.
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Pon 25 Cze, 2012 21:41
BBcode, a jak w ogóle chcesz podnosić poziom broni u NPC?
________________________


 
 
 
BBcode 



Preferowany:
RPG Maker VXAce

Dołączył: 24 Cze 2012
Posty: 8
Skąd: Kraków
Wysłany: Sro 27 Cze, 2012 14:58
Myślałem, że się jakoś da wywołać komentarzami w zdarzeniu :/
________________________
Lube pociągi.
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sro 27 Cze, 2012 17:56
Z tego co widzę skrypt polega na tym, że wprowadza poziom dla broni, ale broń zdobywa doświadczenie w tym samym momencie co gracz, czyli musiałbyś podnieść również poziom gracza. Choć wydaje mi się, że da rady wyłączyć levelowanie bohatera za pomocą przełącznika, dzięki czemu podnoszenie poziomu w zdarzeniu będzie działało tylko na broń. Tylko czy taka modyfikacja byłaby przydatna?
________________________


 
 
 
isioxd 



Preferowany:
RPG Maker VXAce

Dołączył: 25 Paź 2012
Posty: 7
Skąd: Zambrów
Wysłany: Czw 25 Paź, 2012 22:59
Dodaje do Main czy jak?
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene