03-15-2009, 05:38 AM
In the script page Enhanced Weapons, change the gain_weapon method with this one:
then, to add a weapon with slots filled use a script command like this one:
$game_party.gain_weapon(153,1,[146,...])
153 is the ID of the weapon
1 is the quantity
[146,...] is an array containing the IDs of the enhancements. You can also fill, say, only one slot in a 4-slots weapon, in this case just use [146].
Finally, equipped weapons do show up in the enhance scene (the name of the actor that's using the weapon appears next to the weapon's name).
Code:
def gain_weapon(weapon_id, n, slots=nil)
#print("gain weapon("+weapon_id.to_s+","+n.to_s+")")
# arma e non nessun arma
if weapon_id > 0
# l'arma appartiene al database
if weapon_id < @max_database_weapon_id + 1
# l'arma è di tipo enhanceable
if $data_weapons[weapon_id].element_set.include?($ew_element_id)
if n>0
for i in 1..n
new_weapon=Enhanced_Weapon.new(weapon_id)
if slots!=nil
for i in 0...[new_weapon.slots,slots.length].min
new_weapon.add_accessory(i,$data_weapons[slots[i]])
end
end
@enhanced_weapons[new_weapon.id]=new_weapon
$data_weapons[new_weapon.id]=new_weapon
@weapons[new_weapon.id] = 1
# Patch for GUILLAUME777's Multi-Slot
if MULTI_SLOT_PATCH
RPG.initialized_item_types=false
RPG.set_new_item_types
end
end
return
else
# print("non si può togliere un'arma enhanced perchè non se ne entra mai in possesso")
return
end
end
# l'arma è di tipo enhanced
else
@weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
return
end
end
ew_gain_weapon(weapon_id, n)
end
then, to add a weapon with slots filled use a script command like this one:
$game_party.gain_weapon(153,1,[146,...])
153 is the ID of the weapon
1 is the quantity
[146,...] is an array containing the IDs of the enhancements. You can also fill, say, only one slot in a 4-slots weapon, in this case just use [146].
Finally, equipped weapons do show up in the enhance scene (the name of the actor that's using the weapon appears next to the weapon's name).