Mana-/HP-Draw bzw. Mana mit Skills heilen
Hallo,
ich habe folgendes Anliegen bzgl. der Skills im RPG-Maker XP:
Ich wollte einen Mana-Draw-Skill basteln, aber es ist noch nicht mal möglich, das eigene Mana (SP) mit Skils zu heilen. Heilfähigkeiten beziehen sich nur auf die HP. Ein einschlägiges Skript habe ich bisher nicht gefunden.
Ich schätze, dass es auch nur über das Rubyscript machbar ist. Könnte mir jemand ein taugliches "Rezept" für diese Art Fertigkeit posten?
Soweit würde es auch schon genügen, eines für einen Mana-Heilskill anzuzeigen.
Danke im voraus
ich habe folgendes Anliegen bzgl. der Skills im RPG-Maker XP:
Ich wollte einen Mana-Draw-Skill basteln, aber es ist noch nicht mal möglich, das eigene Mana (SP) mit Skils zu heilen. Heilfähigkeiten beziehen sich nur auf die HP. Ein einschlägiges Skript habe ich bisher nicht gefunden.
Ich schätze, dass es auch nur über das Rubyscript machbar ist. Könnte mir jemand ein taugliches "Rezept" für diese Art Fertigkeit posten?
Soweit würde es auch schon genügen, eines für einen Mana-Heilskill anzuzeigen.
Danke im voraus
Ein Script hab ich nicht zur Hand, aber Übergangslösung:
Viele Fähigkeiten kannst du dir aus Common-Events zusammenbauen, auch wenn es zugegebermaßen beizeiten recht komplex werden kann...
Beispiel für einen Mana-Entzug via Common-Event: (auch wenn es kompliziert aussieht, ist der Großteil nur Copy&Paste)
1. Den Zauber erstellen:

Zu beachten ist, dass das Common-Event nur auf einen Helden ausgelegt ist, du bräuchtest in diesem Fall also für jeden Held der diesen Entzug geherrscht einen eigenen Zauber + angepasstes Common-Event
2. Status-Effekt:

Der Statuseffekt dient dazu, das ausgewählte Ziel zu "kennzeichnen" und die "Miss"-Nachricht zu verhindern, da der Zauber keine direkte Wirkung hat.
3. Common-Event:

Beinhaltet die Berechnung der Wirkung und fragt die ersten 2 Ziele ab (für die anderen 6 einfach Copy&Paste und entsprechend die Zeilen anpassen)
Die Wirkung wurde (siehe erste Zeile) auf 75 festgesetzt, da es vorher doch recht unübersichtlich geworden war
Aber ich hoffe das Prinzip welches hinter diesem Event steht wird klar
Wenn jemand ein passendes Script findet kann er es gern posten, ansonsten ist eine Eventlösung eig. immer besser als keine
mfG
Irrlicht
ED: Wirkung vereinfacht (erste Version siehe Anhang)
Viele Fähigkeiten kannst du dir aus Common-Events zusammenbauen, auch wenn es zugegebermaßen beizeiten recht komplex werden kann...
Beispiel für einen Mana-Entzug via Common-Event: (auch wenn es kompliziert aussieht, ist der Großteil nur Copy&Paste)
1. Den Zauber erstellen:
Zu beachten ist, dass das Common-Event nur auf einen Helden ausgelegt ist, du bräuchtest in diesem Fall also für jeden Held der diesen Entzug geherrscht einen eigenen Zauber + angepasstes Common-Event
2. Status-Effekt:
Der Statuseffekt dient dazu, das ausgewählte Ziel zu "kennzeichnen" und die "Miss"-Nachricht zu verhindern, da der Zauber keine direkte Wirkung hat.
3. Common-Event:
Beinhaltet die Berechnung der Wirkung und fragt die ersten 2 Ziele ab (für die anderen 6 einfach Copy&Paste und entsprechend die Zeilen anpassen)
Die Wirkung wurde (siehe erste Zeile) auf 75 festgesetzt, da es vorher doch recht unübersichtlich geworden war
Aber ich hoffe das Prinzip welches hinter diesem Event steht wird klar

Wenn jemand ein passendes Script findet kann er es gern posten, ansonsten ist eine Eventlösung eig. immer besser als keine

mfG
Irrlicht
ED: Wirkung vereinfacht (erste Version siehe Anhang)
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »Irrlicht« (12. Juli 2010, 10:06)
Script
unter anderem kannst du damit folgendes bewirken:
-HP/SP Crush (weapons consume HP/SP when attacking)
-Absorb HP/SP Skill (with considering undead enemies)
-SP Damage Skill (skills that damage / heal SP instead of HP)
Dieses Monsterscript hat noch viele viele weitere schöne Sachen die man einstellen kann aber für dich ist das Grün makierte wohl das was du suchst. Damit erstellst du Skills die entweder die SP verringern oder diese auffüllen. Es gibt in dem Script auch noch eine art Regenazauber wenn dir das ein Begriff ist, bloß statt regelmäßig HP kannstg du damit auch SP jede Runde ein wenig heilen lassen.
In der Scriptdatenbank steht eigentlic halles wichtige darüber, es sind 3 Scripts die aber alle zusammengehören, SDK ist damit kompatibel aber kein Muss und Credits gehen an
* 64 add-ons by Blizzard
* 2 add-ons by Fantasist
* 1 add-on by NAMKCOR
* 1 add-on by Zan
* 4 add-ons by game_guy
* 1 add-on by TerreAqua
Steht sonst auch nochmal in dem Link oben alles drinnen.
Hoffe ich konnte helfen!
unter anderem kannst du damit folgendes bewirken:
-HP/SP Crush (weapons consume HP/SP when attacking)
-Absorb HP/SP Skill (with considering undead enemies)
-SP Damage Skill (skills that damage / heal SP instead of HP)
Dieses Monsterscript hat noch viele viele weitere schöne Sachen die man einstellen kann aber für dich ist das Grün makierte wohl das was du suchst. Damit erstellst du Skills die entweder die SP verringern oder diese auffüllen. Es gibt in dem Script auch noch eine art Regenazauber wenn dir das ein Begriff ist, bloß statt regelmäßig HP kannstg du damit auch SP jede Runde ein wenig heilen lassen.
In der Scriptdatenbank steht eigentlic halles wichtige darüber, es sind 3 Scripts die aber alle zusammengehören, SDK ist damit kompatibel aber kein Muss und Credits gehen an
* 64 add-ons by Blizzard
* 2 add-ons by Fantasist
* 1 add-on by NAMKCOR
* 1 add-on by Zan
* 4 add-ons by game_guy
* 1 add-on by TerreAqua
Steht sonst auch nochmal in dem Link oben alles drinnen.
Hoffe ich konnte helfen!
Benutzerinformationen überspringen
Ankömmling
Motto: Geht nicht, funktioniert nicht, will nicht, kann nicht – gibt es hier nicht!
Hallöchen.
Der Thread ist zwar schon ein wenig älter, allerdings habe ich eine Frage zu dem geposteten Script.
In Teil 3 von Tons of Addons gibt es den "HP-Drain-Skill". Soweit sogut, nur stelle ich mir die Frage, wie ich diesen aufgrund eines Scriptes denn nun als Skill benutzen kann? Ich finde keine hinterlegte Variable oder Sonstiges. Hat da jemand eine Ahnung, wie ich das anstellen kann? Gleiches beim "Master Thief"-Teil, über dem HP-Drain.
Wäre super, wenn mir da jemand auf die Sprünge helfen könnte.
Liebe Grüße
Selania
Edit: Um die Sucherei mal zu erleichtern, hab ich hier mal die Ausschnitte:
HP-Drain:
#==============================================================================
# HP Consuming Skill
# Author: game_guy
# Type: Custom Skill
# Version: 1.1
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# - code reviewed, optimized, integrated into Tons of Add-ons, freed from
# potential bugs and beta tested by Blizzard
# - this add-on is part of Tons of Add-ons with full permission of the original
# author(s)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
=begin
Intro:
Skills that consume HP instead of SP. Or even both HP and SP.
Instructions:
If you want skills that only consume HP simply set the skill's SP cost to 0.
Then go to CONFIG HP COST and follow the instructions there.
=end
#==============================================================================
# RPG::Skill
#==============================================================================
class RPG::Skill
def hp_cost
return 0 if !$game_system.HP_SKILL
case @id
#===================================
# CONFIG HP COST
# when SKILL_ID then return HP_COST
#===================================
when 57 then return 50
#===================================
end
return 0
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias skill_can_use_hp_consuming_skills_later? skill_can_use?
def skill_can_use?(id)
if $data_skills[id].hp_cost > 0 && self.hp <= $data_skills[id].hp_cost
return false
end
return skill_can_use_hp_consuming_skills_later?(id)
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias make_skill_action_result_hp_consuming_skills_later make_skill_action_result
def make_skill_action_result(battler = nil)
if battler != nil
make_skill_action_result_hp_consuming_skills_later(battler)
else
make_skill_action_result_hp_consuming_skills_later
battler = @active_battler
end
battler.hp -= @skill.hp_cost if @phase != 1 && @skill.hp_cost > 0
end
end
#==============================================================================
# Scene_Skill
#==============================================================================
class Scene_Skill
alias update_skill_hp_consuming_skills_later update_skill
def update_skill
update_skill_hp_consuming_skills_later
if Input.trigger?(Input::C)
return if @skill == nil || !@actor.skill_can_use?(@skill.id)
if @skill.scope < 3 && @skill.common_event_id > 0
@actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
end
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
elsif Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
used = false
if @target_window.index == -1
$game_party.actors.each {|actor|
used |= actor.skill_effect(@actor, @skill)}
elsif @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
elsif @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
### START EDIT
@actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
### END EDIT
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
elsif @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
end
Thief-Addon:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Master Thief Skill by Blizzard
# Version: 1.0b
# Type: Enhanced Skill
# Date: 19.10.2008
# Date v1.0b: 6.10.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This skill allows stealing items or gold from enemies or vice versa. The
# skill success probability is multiplied with the enemy success probability
# which makes it possible to make different skills and enemy combinations.
# Success rates of skills higher than 100% will make it easier to steal from
# enemies.
#
# Gold and item loot are slightly different. While only one item can be
# stolen at the time, gold can be stolen all at once. The loot with a higher
# success rate has priority over loot with lower success priority.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
def self.steal_skill_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Steal Database
#
# Use following template to create Stealing Skills:
#
# when ID then return RATE
#
# ID - ID of the skill in the database
# RATE - success multiplier rate in percents
#
# Example:
#
# when 23 then return 200
# when 24 then return 100
#
# Skill with ID 23 will be twice as successful when stealing things than
# skill with ID 24.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 23 then return 200
when 24 then return 100
when 25 then return 50
when 57 then return 100
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Demi Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 0
end
def self.weapon_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Weapon Loot Database
#
# Use following template to create weapon loot for enemies:
#
# when ID then return [[WEAPON_ID1, AMOUNT1, RATE1], ...]
#
# WEAPON_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 weapons of ID 1 and the success rate to steal
# one is 50% and 1 weapon of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [[1, 2, 50], [2, 1, 10]]
when 2 then return [[2, 1, 80]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.armor_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor Loot Database
#
# Use following template to create armor loot for enemies:
#
# when ID then return [[ARMOR_ID1, AMOUNT1, RATE1], ...]
#
# ARMOR_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 armors of ID 1 and the success rate to steal
# one is 50% and 1 armor of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 3 then return [[1, 1, 20], [2, 1, 30]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.item_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Item Loot Database
#
# Use following template to create item loot for enemies:
#
# when ID then return [[ITEM_ID1, AMOUNT1, RATE1], ...]
#
# ITEM_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 items of ID 1 and the success rate to steal one
# is 50% and 1 item of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 4 then return [[4, 1, 100]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.gold_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Gold Loot Database
#
# Use following template to create gold loot for enemies:
#
# when ID then return [AMOUNT, BASE, RATE]
#
# AMOUNT - how many can be stolen
# BASE - probability calculation base
# RATE - success rate in percents
#
# Example:
#
# when 3 then return [300, 100, 90]
#
# Enemy with ID 1 possesses 300 gold and the success rate to steal each 100
# pieces of gold is 90%. Since the enemy has 300 gold, the success chance to
# steal all 300 at once is 90% * 90% * 90% = 72.9%. If at first 100 gold was
# stolen, the enemy is still in possession of 200 more gold hence the
# success rate to steal the remaining 200 gold is 90% * 90% = 81%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [500, 50, 90]
when 3 then return [1000, 200, 70]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Gold Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return nil
end
end
#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :loot_data
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias skill_effect_master_thief_later skill_effect
def skill_effect(user, skill)
result = skill_effect_master_thief_later(user, skill)
if $game_system.MASTER_THIEF && self.is_a?(Game_Enemy)
rate = BlizzCFG.steal_skill_database(skill.id)
self.set_loot(rate) if rate != 0
end
return result
end
end
#==============================================================================
# Game_Enemy
#==============================================================================
class Game_Enemy
alias init_master_thief_later initialize
def initialize(troop_id, member_index)
init_master_thief_later(troop_id, member_index)
@loot = []
BlizzCFG.weapon_loot_database(self.id).each {|w| @loot.push([0] + w)}
BlizzCFG.armor_loot_database(self.id).each {|a| @loot.push([1] + a)}
BlizzCFG.item_loot_database(self.id).each {|i| @loot.push([2] + i)}
gold = BlizzCFG.gold_loot_database(self.id)
@loot.push([3] + gold) if gold != nil
end
def set_loot(rate)
possible_loot = self.get_possible_loot(rate)
if possible_loot == nil
$game_temp.loot_data = [false]
elsif possible_loot.size == 0
$game_temp.loot_data = [true]
else
$game_temp.loot_data = possible_loot.max {|a, b| a[2] <=> b[2]}
if $game_temp.loot_data[0] == 3
@loot.each_index {|i|
if @loot[0] == 3
@loot[i][1] -= $game_temp.loot_data[1]
@loot[i] = nil if @loot[i][1] <= 0
end}
@loot.compact!
else
$game_temp.loot_data[2] -= 1
@loot.delete($game_temp.loot_data) if $game_temp.loot_data[2] == 0
end
end
end
def get_possible_loot(rate)
return nil if @loot.size == 0
possible_loot = []
@loot.each {|loot|
if loot[0] == 3
gold, rates = 0, 1.0
(loot[1].to_f / loot[2]).ceil.times {
if rand(100) < loot[3] * rate / 100
rates *= loot[3].to_f / 100
gold += loot[2]
end}
possible_loot.push([3, gold, 0, (rates * 100).to_i]) if gold != 0
else
possible_loot.push(loot) if rand(100) < loot[3] * rate / 100
end}
return possible_loot
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias update_phase4_step5_master_thief_later update_phase4_step5
def update_phase4_step5(battler = nil)
if battler != nil
update_phase4_step5_master_thief_later(battler)
else
update_phase4_step5_master_thief_later
end
if $game_temp.loot_data != nil
loot = nil
case $game_temp.loot_data[0]
when 0
$game_party.gain_weapon($game_temp.loot_data[1], 1)
loot = "#{$data_weapons[$game_temp.loot_data[1]].name} stolen"
when 1
$game_party.gain_armor($game_temp.loot_data[1], 1)
loot = "#{$data_armors[$game_temp.loot_data[1]].name} stolen"
when 2
$game_party.gain_item($game_temp.loot_data[1], 1)
loot = "#{$data_items[$game_temp.loot_data[1]].name} stolen"
when 3
$game_party.gain_gold($game_temp.loot_data[1])
loot = "#{$game_temp.loot_data[1]} #{$data_system.words.gold} stolen"
when true
loot = 'Stealing failed'
when false
loot = 'Nothing left'
end
@help_window.set_text(loot, 1) if loot != nil
end
end
alias update_phase4_step6_master_thief_later update_phase4_step6
def update_phase4_step6(battler = nil)
if $game_temp.loot_data != nil
@help_window.visible, $game_temp.loot_data = false, nil
end
if battler != nil
update_phase4_step6_master_thief_later(battler)
else
update_phase4_step6_master_thief_later
end
end
end
[/i][/i][/i]
Der Thread ist zwar schon ein wenig älter, allerdings habe ich eine Frage zu dem geposteten Script.
In Teil 3 von Tons of Addons gibt es den "HP-Drain-Skill". Soweit sogut, nur stelle ich mir die Frage, wie ich diesen aufgrund eines Scriptes denn nun als Skill benutzen kann? Ich finde keine hinterlegte Variable oder Sonstiges. Hat da jemand eine Ahnung, wie ich das anstellen kann? Gleiches beim "Master Thief"-Teil, über dem HP-Drain.
Wäre super, wenn mir da jemand auf die Sprünge helfen könnte.
Liebe Grüße
Selania
Edit: Um die Sucherei mal zu erleichtern, hab ich hier mal die Ausschnitte:
HP-Drain:
#==============================================================================
# HP Consuming Skill
# Author: game_guy
# Type: Custom Skill
# Version: 1.1
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# - code reviewed, optimized, integrated into Tons of Add-ons, freed from
# potential bugs and beta tested by Blizzard
# - this add-on is part of Tons of Add-ons with full permission of the original
# author(s)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
=begin
Intro:
Skills that consume HP instead of SP. Or even both HP and SP.
Instructions:
If you want skills that only consume HP simply set the skill's SP cost to 0.
Then go to CONFIG HP COST and follow the instructions there.
=end
#==============================================================================
# RPG::Skill
#==============================================================================
class RPG::Skill
def hp_cost
return 0 if !$game_system.HP_SKILL
case @id
#===================================
# CONFIG HP COST
# when SKILL_ID then return HP_COST
#===================================
when 57 then return 50
#===================================
end
return 0
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias skill_can_use_hp_consuming_skills_later? skill_can_use?
def skill_can_use?(id)
if $data_skills[id].hp_cost > 0 && self.hp <= $data_skills[id].hp_cost
return false
end
return skill_can_use_hp_consuming_skills_later?(id)
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias make_skill_action_result_hp_consuming_skills_later make_skill_action_result
def make_skill_action_result(battler = nil)
if battler != nil
make_skill_action_result_hp_consuming_skills_later(battler)
else
make_skill_action_result_hp_consuming_skills_later
battler = @active_battler
end
battler.hp -= @skill.hp_cost if @phase != 1 && @skill.hp_cost > 0
end
end
#==============================================================================
# Scene_Skill
#==============================================================================
class Scene_Skill
alias update_skill_hp_consuming_skills_later update_skill
def update_skill
update_skill_hp_consuming_skills_later
if Input.trigger?(Input::C)
return if @skill == nil || !@actor.skill_can_use?(@skill.id)
if @skill.scope < 3 && @skill.common_event_id > 0
@actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
end
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
elsif Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
used = false
if @target_window.index == -1
$game_party.actors.each {|actor|
used |= actor.skill_effect(@actor, @skill)}
elsif @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
elsif @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
### START EDIT
@actor.hp -= @skill.hp_cost if @skill.hp_cost > 0
### END EDIT
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
elsif @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
end
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
end
zum Lesen den Text mit der Maus markieren
Thief-Addon:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Master Thief Skill by Blizzard
# Version: 1.0b
# Type: Enhanced Skill
# Date: 19.10.2008
# Date v1.0b: 6.10.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This skill allows stealing items or gold from enemies or vice versa. The
# skill success probability is multiplied with the enemy success probability
# which makes it possible to make different skills and enemy combinations.
# Success rates of skills higher than 100% will make it easier to steal from
# enemies.
#
# Gold and item loot are slightly different. While only one item can be
# stolen at the time, gold can be stolen all at once. The loot with a higher
# success rate has priority over loot with lower success priority.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
def self.steal_skill_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Steal Database
#
# Use following template to create Stealing Skills:
#
# when ID then return RATE
#
# ID - ID of the skill in the database
# RATE - success multiplier rate in percents
#
# Example:
#
# when 23 then return 200
# when 24 then return 100
#
# Skill with ID 23 will be twice as successful when stealing things than
# skill with ID 24.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 23 then return 200
when 24 then return 100
when 25 then return 50
when 57 then return 100
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Demi Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 0
end
def self.weapon_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Weapon Loot Database
#
# Use following template to create weapon loot for enemies:
#
# when ID then return [[WEAPON_ID1, AMOUNT1, RATE1], ...]
#
# WEAPON_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 weapons of ID 1 and the success rate to steal
# one is 50% and 1 weapon of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [[1, 2, 50], [2, 1, 10]]
when 2 then return [[2, 1, 80]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.armor_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor Loot Database
#
# Use following template to create armor loot for enemies:
#
# when ID then return [[ARMOR_ID1, AMOUNT1, RATE1], ...]
#
# ARMOR_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 armors of ID 1 and the success rate to steal
# one is 50% and 1 armor of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 3 then return [[1, 1, 20], [2, 1, 30]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.item_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Item Loot Database
#
# Use following template to create item loot for enemies:
#
# when ID then return [[ITEM_ID1, AMOUNT1, RATE1], ...]
#
# ITEM_ID - ID of the item in the database
# AMOUNT - how many can be stolen
# RATE - success rate in percents
#
# Example:
#
# when 1 then return [[1, 2, 50], [4, 1, 10]]
#
# Enemy with ID 1 possesses 2 items of ID 1 and the success rate to steal one
# is 50% and 1 item of ID 4 with a success rate of 10%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 4 then return [[4, 1, 100]]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Item Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return []
end
def self.gold_loot_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Gold Loot Database
#
# Use following template to create gold loot for enemies:
#
# when ID then return [AMOUNT, BASE, RATE]
#
# AMOUNT - how many can be stolen
# BASE - probability calculation base
# RATE - success rate in percents
#
# Example:
#
# when 3 then return [300, 100, 90]
#
# Enemy with ID 1 possesses 300 gold and the success rate to steal each 100
# pieces of gold is 90%. Since the enemy has 300 gold, the success chance to
# steal all 300 at once is 90% * 90% * 90% = 72.9%. If at first 100 gold was
# stolen, the enemy is still in possession of 200 more gold hence the
# success rate to steal the remaining 200 gold is 90% * 90% = 81%.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [500, 50, 90]
when 3 then return [1000, 200, 70]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Gold Loot Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return nil
end
end
#==============================================================================
# Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :loot_data
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias skill_effect_master_thief_later skill_effect
def skill_effect(user, skill)
result = skill_effect_master_thief_later(user, skill)
if $game_system.MASTER_THIEF && self.is_a?(Game_Enemy)
rate = BlizzCFG.steal_skill_database(skill.id)
self.set_loot(rate) if rate != 0
end
return result
end
end
#==============================================================================
# Game_Enemy
#==============================================================================
class Game_Enemy
alias init_master_thief_later initialize
def initialize(troop_id, member_index)
init_master_thief_later(troop_id, member_index)
@loot = []
BlizzCFG.weapon_loot_database(self.id).each {|w| @loot.push([0] + w)}
BlizzCFG.armor_loot_database(self.id).each {|a| @loot.push([1] + a)}
BlizzCFG.item_loot_database(self.id).each {|i| @loot.push([2] + i)}
gold = BlizzCFG.gold_loot_database(self.id)
@loot.push([3] + gold) if gold != nil
end
def set_loot(rate)
possible_loot = self.get_possible_loot(rate)
if possible_loot == nil
$game_temp.loot_data = [false]
elsif possible_loot.size == 0
$game_temp.loot_data = [true]
else
$game_temp.loot_data = possible_loot.max {|a, b| a[2] <=> b[2]}
if $game_temp.loot_data[0] == 3
@loot.each_index {|i|
if @loot[0] == 3
@loot[i][1] -= $game_temp.loot_data[1]
@loot[i] = nil if @loot[i][1] <= 0
end}
@loot.compact!
else
$game_temp.loot_data[2] -= 1
@loot.delete($game_temp.loot_data) if $game_temp.loot_data[2] == 0
end
end
end
def get_possible_loot(rate)
return nil if @loot.size == 0
possible_loot = []
@loot.each {|loot|
if loot[0] == 3
gold, rates = 0, 1.0
(loot[1].to_f / loot[2]).ceil.times {
if rand(100) < loot[3] * rate / 100
rates *= loot[3].to_f / 100
gold += loot[2]
end}
possible_loot.push([3, gold, 0, (rates * 100).to_i]) if gold != 0
else
possible_loot.push(loot) if rand(100) < loot[3] * rate / 100
end}
return possible_loot
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias update_phase4_step5_master_thief_later update_phase4_step5
def update_phase4_step5(battler = nil)
if battler != nil
update_phase4_step5_master_thief_later(battler)
else
update_phase4_step5_master_thief_later
end
if $game_temp.loot_data != nil
loot = nil
case $game_temp.loot_data[0]
when 0
$game_party.gain_weapon($game_temp.loot_data[1], 1)
loot = "#{$data_weapons[$game_temp.loot_data[1]].name} stolen"
when 1
$game_party.gain_armor($game_temp.loot_data[1], 1)
loot = "#{$data_armors[$game_temp.loot_data[1]].name} stolen"
when 2
$game_party.gain_item($game_temp.loot_data[1], 1)
loot = "#{$data_items[$game_temp.loot_data[1]].name} stolen"
when 3
$game_party.gain_gold($game_temp.loot_data[1])
loot = "#{$game_temp.loot_data[1]} #{$data_system.words.gold} stolen"
when true
loot = 'Stealing failed'
when false
loot = 'Nothing left'
end
@help_window.set_text(loot, 1) if loot != nil
end
end
alias update_phase4_step6_master_thief_later update_phase4_step6
def update_phase4_step6(battler = nil)
if $game_temp.loot_data != nil
@help_window.visible, $game_temp.loot_data = false, nil
end
if battler != nil
update_phase4_step6_master_thief_later(battler)
else
update_phase4_step6_master_thief_later
end
end
end
zum Lesen den Text mit der Maus markieren
Du bist dir unsicher wie man den 'HP Consuming Skill' -Teil nutzt?
Es ist eigentlich ganz gut dokumentiert
der wichtige Teil für die Einstellungen ist der hier:
Du stellst hier die SKILL_ID ein, und wieviel HP der Skill kostet.
Wenn ich jetzt möchte das mein Skill "Leg Sweep" (Skill#61) 7 HP kostet, weil ich mir dabei weh tu, oder so - dann geh ich in den ScriptEditor und schreib diese Zeile
when 61 then return 7
unter die andere Einstellungszeile, welche dafür sorgt das mein CrossCut(#57) 50HP kostet.
Fertig.
Nebenbei: Jedes Script auf Itzamná, hat seinen eigenen Forenthread, wo man Fragen zum Script stellen kann
Es ist eigentlich ganz gut dokumentiert
der wichtige Teil für die Einstellungen ist der hier:
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
class RPG::Skill def hp_cost return 0 if !$game_system.HP_SKILL case @id #=================================== # CONFIG HP COST # when SKILL_ID then return HP_COST #=================================== when 57 then return 50 #=================================== end return 0 end end |
Wenn ich jetzt möchte das mein Skill "Leg Sweep" (Skill#61) 7 HP kostet, weil ich mir dabei weh tu, oder so - dann geh ich in den ScriptEditor und schreib diese Zeile
when 61 then return 7
unter die andere Einstellungszeile, welche dafür sorgt das mein CrossCut(#57) 50HP kostet.
Fertig.
Nebenbei: Jedes Script auf Itzamná, hat seinen eigenen Forenthread, wo man Fragen zum Script stellen kann
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.Benutzerinformationen überspringen
Ankömmling
Motto: Geht nicht, funktioniert nicht, will nicht, kann nicht – gibt es hier nicht!
Zitat
Du stellst hier die SKILL_ID ein, und wieviel HP der Skill kostet.
Wenn ich jetzt möchte das mein Skill "Leg Sweep" (Skill#61) 7 HP kostet, weil ich mir dabei weh tu, oder so - dann geh ich in den ScriptEditor und schreib diese Zeile
when 61 then return 7
Achso... Die Skill-ID ist quasi die Nummer des Skills. Okay. Danke, für die Hilfe.
Zitat
Nebenbei: Jedes Script auf Itzamná, hat seinen eigenen Forenthread, wo man Fragen zum Script stellen kann
Hjaaah... Weiß ich doch. Aber der Thread zu dem Script ist gut 4 Jahre alt. Da dacht ich mir, lieber einen auszugraben, der ein paar Monate alt ist, anstatt ein paar Jahre. Tut mir Leid.
Liebe Grüße
Selania.
Ähnliche Themen
-
Events & Technik »-
Fliegen
(1. August 2005, 10:33)
-
(Alt) Smalltalk »-
Secret of Mana (Reihe)
(7. September 2004, 15:14)
-
Archiv Spielvorstellungen »-
Terra Loona Vorstellung
(13. Oktober 2004, 18:47)
