เพิ่มอัตราการได้รับเงิน,Exp,ไอเทม - Muge9thD -  08-11-2012
 
 
เพิ่มอัตราการได้รับเงิน,Exp,ไอเทม  
 
สคริปต์เขียนโดย : thetitsueng 
ลิงค์ต้นฉบับ : Link 
 
 
รายละเอียด : 
นี่คือสคริปต์ที่เพิ่มฟังค์ชั่นพิเศษๆเข้าไป ทำให้เราสามารถตั้งค่าอัตราการได้รับเงิน,Exp,ไอเทม เองได้ สามารถนำไปต่อยอดเป็นระบบเจ๋งๆได้อีกหลากหลาย 
 
สกรีนช๊อต : 
ไม่มีน่อ 
 
วิธีการใช้งาน :  
อยู่ในตัวสคริปต์แล้วน่อ (แต่อาจเข้าใจยากนิดหน่อย ถ้าติดตรงไหนก็ถามได้นะ) 
 
ข้อตกลงการนำไปใช้งาน : 
อย่างน้อยๆก็ใส่ชื่อ thetitsueng ลงในเครดิตด้วยล่ะ 
 
 
 
โค๊ดสคริปต์ 
เพิ่มอัตราคูณเงิน  
Code: #:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มอัตราคูณเงิน 
# By thetitsueng[new] 
# Ver 1.00 [20/3/2553] 
# http://necz.net 
# [email protected]<script type="text/javascript"> 
#===================================================== 
=begin 
------------------------------------------------------ 
=> วิธีตั้งค่า :  
    - 1.นำสคริปต์นี้ไปวางไว้เหนือ Main และใต้ Scene_Debug 
    - 2.ไปที่สคริปต์ Scene_Battle 2 หาบรรทัดที่เขียนว่า  
    - treasures = treasures[0..5] 
    - เพิ่มโค้ดนี้ไว้ด้านบน 
    - gold = check_xgold(gold) 
=> วิธีใช้ : 
    - ใช้คำสั่งเรียกใช้สคริปต์ 
    - xgold(อัตราการคูณ,เวลา(วินาที)) เช่น  xgold(1.5,180) 
------------------------------------------------------ 
=end 
#===================================================== 
class Interpreter 
  def xgold(x,time) 
    $game_party.xgold(x,time+Graphics.frame_count/Graphics.frame_rate) 
  end 
end 
class Scene_Battle 
  def check_xgold(gold) 
    @xgold =  $game_party.xgold2 
    return @xgold[1] > Graphics.frame_count/Graphics.frame_rate ? gold *= @xgold[0]: gold 
  end 
end 
class Game_Party 
  def xgold(x,time) 
    @xgold = [x,time] 
  end 
  def xgold2 
    return @xgold != nil ? @xgold : [1,0] 
  end 
end 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มอัตราคูณเงิน 
# By thetitsueng[new] 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
เพิ่มอัตราคูณ exp 
Code: #:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มอัตราคูณ exp 
# By thetitsueng[new] 
# Ver 1.01 [19/3/2553] 
#+--------------------------+ 
# ||==changelog==|| 
# Ver 1.00 by thetitsueng[16/3/2553] 
# Ver 1.01 by thetitsueng[19/3/2553] 
#   - แก้ไขบัค 
#+--------------------------+ 
# http://necz.net 
# [email protected]<script type="text/javascript"> 
#===================================================== 
=begin 
------------------------------------------------------ 
=> วิธีตั้งค่า :  
    - 1.นำสคริปต์นี้ไปวางไว้เหนือ Main และใต้ Scene_Debug 
    - 2.ไปที่สคริปต์ Scene_Battle 2 หาบรรทัดที่เขียนว่า  
    - treasures = treasures[0..5] 
    - เพิ่มโค้ดนี้ไว้ด้านบน 
    - exp = check_xexp(exp) 
=> วิธีใช้ : 
    - ใช้คำสั่งเรียกใช้สคริปต์ 
    - xexp(อัตราการคูณ,เวลา(วินาที)) เช่น  xexp(1.5,180) 
------------------------------------------------------ 
=end 
#===================================================== 
class Interpreter 
  def xexp(x,time) 
    $game_party.xexp(x,time+Graphics.frame_count/Graphics.frame_rate) 
  end 
end 
class Scene_Battle 
  def check_xexp(exp) 
    @xexp =  $game_party.xexp2 
    return @xexp[1] > Graphics.frame_count/Graphics.frame_rate ? exp *= @xexp[0]: exp 
  end 
end 
class Game_Party 
  def xexp(x,time) 
    @xexp = [x,time] 
  end 
  def xexp2 
    return @xexp != nil ? @xexp : [1,0] 
  end 
end 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มอัตราคูณ exp 
# By thetitsueng[new] 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
เพิ่มโอกาสตกของไอเทม 
Code: #:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มโอกาสตกของไอเทม 
# By thetitsueng[new] 
# Ver 1.01 [19/3/2553] 
#+--------------------------+ 
# ||==changelog==|| 
# Ver 1.00 by thetitsueng[16/3/2553] 
# Ver 1.01 by thetitsueng[19/3/2553] 
#   - แก้ไขบัค 
#+--------------------------+ 
# http://necz.net 
# [email protected]<script type="text/javascript"> 
#===================================================== 
=begin 
------------------------------------------------------ 
=> วิธีตั้งค่า :  
    - 1.นำสคริปต์นี้ไปวางไว้เหนือ Main และใต้ Scene_Debug 
    - 2.ไปที่สคริปต์ Scene_Battle 2 หาบรรทัดที่เขียนว่า  
    - if rand(100) < enemy.treasure_prob  
    - เปลี่ยนเป็น   
    - if check_item(enemy) 
=> วิธีใช้ : 
    - ใช้คำสั่งเรียกใช้สคริปต์ 
    - xitem(อัตราการคูณ,เวลา(วินาที)) เช่น  xitem(1.5,60) 
------------------------------------------------------ 
=end 
#===================================================== 
class Interpreter 
  def xitem(x,time) 
    $game_party.xitem(x,time+Graphics.frame_count/Graphics.frame_rate) 
  end 
end 
class Scene_Battle 
  def check_item(enemy) 
    @xitem =  $game_party.xitem2 
    if @xitem[1] < Graphics.frame_count/Graphics.frame_rate && !enemy.hidden 
      return rand(100) < enemy.treasure_prob 
    elsif !enemy.hidden 
      return rand(100/@xitem[0]) < enemy.treasure_prob 
    end 
  end 
end 
class Game_Party 
  def xitem(x,time) 
    @xitem = [x,time] 
  end 
  def xitem2 
    return @xitem != nil ? @xitem : [0,0] 
  end 
end 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
# [XP]เพิ่มโอกาสตกของไอเทม 
# By thetitsueng[new] 
#:=:=:=:=:=:=:=:=:=:=:thetitsueng:=:=:=:=:=:=:=:=:=:=: 
 
 
 
 |