Jump to content
Rpg²S Forum
  • 0

Bottino multiplo dai nemici & Nemici volanti


Goofy !
 Share

Question

Mi era sembrato di vedere uno script che permettesse di assegnare ai nemici più di un oggetto rilasciabile con relativa percentuale.

Esiste vero? Non per tutti i nemici (oppure se proprio devo darne più di uno a tutti per evitare bug va pure bene).

 

 

 

 

 

Ho usato il tasto cerca ma deve avere un po' di problemi visto che non mi da risultati neppure se cerco parole comuni come 'oggetti', 'bottino', e addirittura 'script'!!

 

 

 

 

L'altra richiesta, che non so se è nel posto giusto... come faccio a settare un nemico in modo che sia del tipo "volatile" e quindi che manchi sempre i colpi di armi a corto raggio (fattibile con gli attributi, solo che lì non si può settare il colpo mancato, al limite lo si rende debole o lo si fa assorbire!).

 

 

 

 

EDIT: Per lo script del bottino multiplo me ne servono 3 per nemico.

Edited by Goofy !
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Uppeggio, e do un suggerimento se qualche pazzoide lo vuole creare...

 

A me serve che i nemici possano dare fino a 3 oggetti, se viene più facile ai fini dello script, va benissimo che tutti ne diano 3 obbligatoriamente (intendo dire che non serve creare particolarità per nemici che ne danno 2 o uno).

 

E le probabilità fisse:

Oggetto 1 si ottiene al 30%

Oggetto 2 si ottiene al 10%

Oggetto 3 si ottiene al 5%

 

La percentuale non unica per tutti e 3 gli oggetti- fanno parte di "ballottaggi diversi"

Link to comment
Share on other sites

  • 0

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

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...