Ogłoszenie |
Administracja Forum
|
Zamknięty przez: Nhadala Pią 13 Lip, 2012 10:23 |
Multi atak |
Autor |
Wiadomość |
Helseth
Preferowany:
Pomógł: 3 razy Dołączył: 09 Kwi 2012 Posty: 63
|
Wysłany: Pią 13 Kwi, 2012 21:31
|
|
Multi atak
|
Witam
Poszukuję skrypt który umożliwiać będzie wielokrotne atakowanie za pomocą skillów (czarów, umiejętności itp) pod standardowy system walki w XP
np : losowy czar zadaje obrażenia od ognia,lodu i błyskawic ( trzy ataki jeden po drugim )
Znalazłem coś takiego : http://houseslasher.com/index.php?showtopic=51
ale ten skrypt robi masę zbędnych rzeczy które mi są niepotrzebne lub kolidowały by z moimi wcześniejszymi skryptami
Dlatego mam prośbę czy mógłby ktoś wyodrębnić z tych 4 skryptów ( w linku są 4 skrypty do ściągnięcia ) jeden który będzie odpowiadać tylko za multi-atak ?
Bo sam tego nie ogarniam.
----- znalazłem też taki skrypt Trickster's Multi-Attack : http://www.hbgames.org/fo...hp?f=12&t=11496
ale coś mi nie działa lub nie umiem go z edytować ;p
zależało by mi żeby można było przypisać do 4 ataków pod jedno ID skilla
Ewentualnie może ktoś posiada link do lepszego skryptu :P |
|
|
|
Helseth
Preferowany:
Pomógł: 3 razy Dołączył: 09 Kwi 2012 Posty: 63
|
Wysłany: Nie 15 Kwi, 2012 17:16
|
|
|
Znalazłem skrypt Blizzard multi-hit ale jest on częścią "Tons of add-ons" i nie wiem jak go wyodrębnić
tu link do całości : http://forum.chaos-projec...opic,105.0.html
a tu sama część skryptu multi-hit :
Kod: |
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Multi-Hit by Blizzard
# Version: 1.51b
# Type: Weapon/Skill/Enemy Enhancement
# Date: 12.8.2007
# Date 1.3b: 23.2.2008
# Date 1.4b: 23.7.2008
# Date 1.5b: 19.10.2008
# Date 1.51b: 6.10.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
# 95% compatible with SDK 1.x. 70% compatible with SDK 2.x. Might be
# incompatible with exotic skills and/or CBS-es. Compatible with CRLS 5.1b or
# higher.
#
#
# Explanation:
#
# This add-on will allow that skills, weapons and enemies attack more than
# once.
#
# new in v1.3b:
# - now you can define weapons/skills/enemies which's other attacks will
# target a random target instead of the originally chosen target
# - now beta
#
# new in v1.4b:
# - better compatibility with SP Cost Mod
# - improved coding
#
# new in v1.5b:
# - added Multi-Hit items
#
#
# Configuration:
#
# Set up the following constants to configure the script:
#
# WEAPON_RANDOM - add any weapon IDs here and separate them with commas to
# make those specific weapons attack another random target
# for each other hit than the first
# SKILL_RANDOM - add any skill IDs here and separate them with commas to
# make those specific skills attack another random target
# for each other hit than the first
# ITEM_RANDOM - add any item IDs here and separate them with commas to
# make those specific items attack another random target
# for each other hit than the first
# ENEMY_RANDOM - add any enemy IDs here and separate them with commas to
# make those specific enemies attack another random target
# for each other hit than the first
#
# Further there are 4 configurations. Configuration 1 is for weapons,
# Configuration 2 is for skills, Configuration 3 is for items and
# Configuration 3 is for normal enemy attacks. Use following template to set
# up how many hits should be done:
#
# when ID then return HITS
#
# ID - ID of weapon, skill, item or enemy, depending on the configuration
# number
# HITS - number of hits
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Basic Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
WEAPON_RANDOM = [1, 2]
SKILL_RANDOM = [57]
ITEM_RANDOM = [12]
ENEMY_RANDOM = []
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Basic Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
def self.weapon_hits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 1
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return 3
when 2 then return 4
when 3 then return 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 1
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 1
end
def self.skill_hits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 57 then return 3
when 58 then return 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 1
end
def self.item_hits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 3
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 12 then return 3
when 13 then return 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 3
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 1
end
def self.enemy_hits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 4
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 4
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 1
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias update_phase4_step1_multi_hit_later update_phase4_step1
def update_phase4_step1(battler = nil)
if battler != nil
update_phase4_step1_multi_hit_later(battler)
return
end
update_phase4_step1_multi_hit_later
@repeat = [1, 1, 0]
return unless @active_battler != nil && $game_system.MULTI_HIT
if @active_battler.current_action.kind == 0
if @active_battler.current_action.basic == 0
if @active_battler.is_a?(Game_Actor)
hits = BlizzCFG.weapon_hits(@active_battler.weapon_id)
elsif @active_battler.is_a?(Game_Enemy)
hits = BlizzCFG.enemy_hits(@active_battler.id)
end
@repeat = [hits, hits, 2]
end
elsif @active_battler.current_action.kind == 1
@repeat[2] = 3
elsif @active_battler.current_action.kind == 2
@repeat[2] = 4
end
end
alias update_phase4_step2_multi_hit_later update_phase4_step2
def update_phase4_step2(battler = nil)
if battler != nil
update_phase4_step2_multi_hit_later(battler)
return
end
update_phase4_step2_multi_hit_later
if $game_system.MULTI_HIT && @phase4_step != 1
if @repeat[2] == 3
hits = BlizzCFG.skill_hits(@skill.id)
@repeat = [hits, hits+1, 4]
elsif @repeat[2] == 4
hits = BlizzCFG.item_hits(@item.id)
@repeat = [hits, hits+1, 4]
end
end
end
alias update_phase4_step5_multi_hit_later update_phase4_step5
def update_phase4_step5(battler = nil)
if battler != nil
update_phase4_step5_multi_hit_later(battler)
return
end
update_phase4_step5_multi_hit_later
if $game_system.MULTI_HIT
if @active_battler.current_action.kind == 1
if BlizzCFG::SKILL_RANDOM.include?(@skill.id)
if @active_battler.is_a?(Game_Actor)
@active_battler.current_action.decide_random_target_for_actor
elsif @active_battler.is_a?(Game_Enemy)
@active_battler.current_action.decide_random_target_for_enemy
end
end
elsif @active_battler.current_action.kind == 2
if BlizzCFG::ITEM_RANDOM.include?(@item.id)
if @active_battler.is_a?(Game_Actor)
@active_battler.current_action.decide_random_target_for_actor
elsif @active_battler.is_a?(Game_Enemy)
@active_battler.current_action.decide_random_target_for_enemy
end
end
elsif @active_battler.is_a?(Game_Actor)
if BlizzCFG::WEAPON_RANDOM.include?(@active_battler.weapon_id)
@active_battler.current_action.decide_random_target_for_actor
end
elsif @active_battler.is_a?(Game_Enemy)
if BlizzCFG::ENEMY_RANDOM.include?(@active_battler.id)
@active_battler.current_action.decide_random_target_for_enemy
end
end
@phase4_step = 2 if @repeat[0] > 1 && @repeat[2] > 0
@repeat[0] -= 1
end
end
alias make_skill_action_result_multi_hit_later make_skill_action_result
def make_skill_action_result(battler = nil, plus_id = nil)
if battler != nil
if plus_id != nil
make_skill_action_result_multi_hit_later(battler, plus_id)
else
make_skill_action_result_multi_hit_later(battler)
end
return
end
make_skill_action_result_multi_hit_later
if @repeat[2] > 3
sp_cost = @skill.sp_cost
if $game_system.SP_COST_MOD
sp_cost = BlizzCFG.get_cost_mod(@active_battler.states, sp_cost)
end
@active_battler.sp += sp_cost
@status_window.refresh
end
end
end
|
Może ktoś rozszyfruje jak to przerobić/zmienić żeby działało :P bo nawet jeśli mam wklejoną całość (3 części skryptu) do projektu nic się nie dzieje. Problem może polega w konfiguracji która nie jest dla mnie zrozumiała :/
proszę o pomoc |
|
|
|
Ayene
Ranga RM:
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
|
Wysłany: Wto 17 Kwi, 2012 18:43
|
|
|
Konfiguracja nie jest skomplikowana. Jeśli chcesz, aby bohater wyekwipowany w broń o ID 15 miał 30 ataków w sekcji:
Kod: | def self.weapon_hits(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration 1
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return 3
when 2 then return 4
when 3 then return 2
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration 1
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 1
end |
pod linijką:
Kod: | when 3 then return 2 |
dodaj kolejną pozycję według wzoru:
Kod: | when ID then return LICZBA |
gdzie ID to id broni, a LICZBA to liczba ataków, czyli w naszym przypadku byłoby to:
Kod: | when 15 then return 30 |
Jeśli w tablicy:
Kod: | WEAPON_RANDOM = [1,2] |
dodasz po przecinku id tej broni, to wówczas cel będzie losowy, jeśli nie dodasz celem ataku będzie zawsze ten sam wybrany podczas walki przeciwnik.
Ten sam schemat obowiązuje w konfiguracji umiejętności:
Kod: | def self.skill_hits(id) |
przedmiotów:
Kod: | def self.item_hits(id) |
i bestii:
Kod: | def self.enemy_hits(id) |
Żeby skrypt działał bez potrzeby instalacji całości wystarczy dokleić do niego fragment:
Kod: | class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :MULTI_HIT
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias initialize_multi_hit_later initialize
def initialize
initialize_multi_hit_later
@MULTI_HIT = true
end
end |
|
________________________
|
|
|
|
|
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
|
|