Views 1.3K3 Repiled0 Point
Google Translateผม Copy สคริปนี่ไป
http://2th.me/thread-930-1-1.htmlแล้วทำตามทั้งหมด ตั้งค่าสกิลแล้ว
แต่ตอนกด Test มันใช้ไม่ได้อะ
สคริปเกี่ยวกับ อาวุธ-เกราะมีสกิล
แก้ไขครั้งสุดท้ายโดย ken18324 เมื่อ 2010-12-3 23:48 แก้ไขครั้งสุดท้ายโดย ken18324 เมื่อ 2010-12-3 23:47
แก้ไขครั้งสุดท้ายโดย ken18324 เมื่อ 2010-12-3 23:46
มันขึ้นแบบนี้อะ
นี้คือในสคริปผม ดูให้หน่อยนะคับว่ามีตรงไหนผิดรึป่าว
#::Host by http://2th.me::#
class Game_Actor < Game_Battler
#==============================================================================
# * Hima's Equip gain skills.
#------------------------------------------------------------------------------
# This script will allow you to create any equipments that will add any skill
# to the character who equip them. All you have to do is to add "skill name"
# The skill name has to be CASE SENSITIVE! So, be careful or else you'd get an error.
# This script allow only one skill per one equipment only, though.
# contact : ninomiya_mako@hotmail.com
#==============================================================================
#--------------------------------------------------------------------------
# - Modification of equipment
# equip_type : Equipment type
# id : If weapon or guard ID (0 equipment cancellation)
# This is just a added version of method equip. If you know what you're doing
# , you can fix it yourself
#--------------------------------------------------------------------------
def equip(equip_type, id)
case equip_type
when 0 # Weapon
if id == 0 or $game_party.weapon_number(id) > 0
$game_party.gain_weapon(@weapon_id, 1)
check_weapon_lose_skill(@weapon_id)
@weapon_id = id
check_weapon_gain_skill(@weapon_id)
$game_party.lose_weapon(id, 1)
end
when 1 # Shield
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor1_id], $data_armors[id])
check_armor_lose_skill(@armor1_id)
$game_party.gain_armor(@armor1_id, 1)
@armor1_id = id
check_armor_gain_skill(@armor1_id)
$game_party.lose_armor(id, 1)
end
when 2 # Head
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor2_id], $data_armors[id])
check_armor_lose_skill(@armor2_id)
$game_party.gain_armor(@armor2_id, 1)
@armor2_id = id
check_armor_gain_skill(id)
$game_party.lose_armor(id, 1)
end
when 3 # Body
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor3_id], $data_armors[id])
check_armor_lose_skill(@armor3_id)
$game_party.gain_armor(@armor3_id, 1)
@armor3_id = id
check_armor_gain_skill(id)
$game_party.lose_armor(id, 1)
end
when 4 # Ornament
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor4_id], $data_armors[id])
check_armor_lose_skill(@armor4_id)
$game_party.gain_armor(@armor4_id, 1)
@armor4_id = id
check_armor_gain_skill(@armor4_id)
$game_party.lose_armor(id, 1)
end
end #case
end #method
#--------------------------------------------------------------------------
# - Check Weapon Gain Skill
# item_id : Guard equipment ID
# This is to check whether you'll gain a skill or not from equiping a weapon.
#--------------------------------------------------------------------------
def check_weapon_gain_skill(item_id)
unless $data_weapons[item_id] == nil
sentence = $data_weapons[item_id].description.clone
if sentence.include?('[')
open = sentence.index( '[' )
close = sentence.index( ']', open )
skill_name = sentence[open+1..close-1] if close
learn_skill(find_skill_name(skill_name)) unless skill_name == nil
end
end
end #method
#--------------------------------------------------------------------------
# - Check Weapon Lose Skill
# item_id : Guard equipment ID
# And when you unequip it, you'll lose that skill, of course.
#--------------------------------------------------------------------------
def check_weapon_lose_skill(item_id)
unless $data_weapons[item_id] == nil
sentence = $data_weapons[item_id].description.clone
if sentence.include?('[')
open = sentence.index( '[' )
close = sentence.index( ']', open )
skill_name = sentence[open+1..close-1] if close
forget_skill(find_skill_name(skill_name))
end
end
end #method
#--------------------------------------------------------------------------
# - Check Armor Gain Skill
# item_id : Guard equipment ID
# This is to check whether you'll gain a skill or not from equiping an armor.
#--------------------------------------------------------------------------
def check_armor_gain_skill(item_id)
unless $data_armors[item_id] == nil
sentence = $data_armors[item_id].description.clone
if sentence.include?('[')
open = sentence.index( '[' )
close = sentence.index( ']', open )
skill_name = sentence[open+1..close-1] if close
learn_skill(find_skill_name(skill_name)) unless skill_name == nil
end
end
end #method
#--------------------------------------------------------------------------
# - Check Armor Lose Skill
# item_id : Guard equipment ID
# And when you unequip it, you'll lose that skill, of course.
#--------------------------------------------------------------------------
def check_armor_lose_skill(item_id)
unless $data_armors[item_id] == nil
sentence = $data_armors[item_id].description.clone
if sentence.include?('[')
open = sentence.index( '[' )
close = sentence.index( ']', open )
skill_name = sentence[open+1..close-1] if close
forget_skill(find_skill_name(skill_name))
end
end
end #method
#--------------------------------------------------------------------------
# - Find Skill Name
# skill_name : Name of the skill.
# This is to find a skill that has the same name, and return its ID.
#--------------------------------------------------------------------------
def find_skill_name(skill_name)
for i in 1..$data_skills.size-1
if skill_name == $data_skills.name
return i
end
end
end
end #class