XP 스크립트

http://www.dubealex.com/asylum/index.php?showtopic=10291

방어구에 물리공격이나 마법공격 대미지 경감을 붙일 수 있게 합니다. 대미지 경감의 유형과 사용법은 스크립트 서두의 주석을 참조하세요.



#==============================================================================
# ** Damage Reductions
#==============================================================================
# SephirothSpawn
# Version 1
# 2006-07-29
#------------------------------------------------------------------------------
# * Descript-xion:
#
# ~ Allows You to Assign Physical and Magical Damage Reductions to Armors
#
# ~ Reduction A : If the Final Damage is less than the damage reduction, the
# damage is reduced to 0
# ~ Reduction B : Takes the Final Damage and subracts the damage reduction
#
#------------------------------------------------------------------------------
# * Installation:
#
# ~ Place below the RMXP SDK and above Main
#------------------------------------------------------------------------------
# * Customization:
#
# ~ A-Type Reductions
#
# Phy_Dmg_Red_A = { armor_id => reduction, ... }
# Mag_Dmg_Red_A = { armor_id => reduction, ... }
#
# ~ B-Type Reductions
#
# Phy_Dmg_Red_B = { armor_id => reduction, ... }
# Mag_Dmg_Red_B = { armor_id => reduction, ... }
#------------------------------------------------------------------------------
# * Syntax:
#
# ~ A-Type Reductions
# Armor Physical Reduction : .phy_dmg_red_a
# Armor Magical Reduction : .mag_dmg_red_a
#
# ~ B-Type Reductions
# Armor Physical Reduction : .phy_dmg_red_b
# Armor Magical Reduction : .mag_dmg_red_b
#
# ~ Actor Total A-Type Reductions
# .phy_dmg_red_a
# .mag_dmg_red_b
#
# ~ Actor Total B-Type Reductions
# .phy_dmg_red_b
# .mag_dmg_red_b
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script-x
#------------------------------------------------------------------------------
SDK.log('Damage Reductions', 'SephirothSpawn', 1, '2006-07-29')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Damage Reductions')

#==============================================================================
# ** RPG::Armor
#==============================================================================

class RPG::Armor
#--------------------------------------------------------------------------
# * Physical And Magical Damage Reductions
# ~ armor_id => reduction_value
#--------------------------------------------------------------------------
Phy_Dmg_Red_A = {}
Mag_Dmg_Red_A = {}
Phy_Dmg_Red_B = {}
Mag_Dmg_Red_B = {}
#--------------------------------------------------------------------------
# * Physical Damage Reductions (Type A)
#--------------------------------------------------------------------------
def phy_dmg_red_a
return Phy_Dmg_Red_A.has_key?(@id) ? Phy_Dmg_Red_A[@id] : 0
end
#--------------------------------------------------------------------------
# * Magical Damage Reductions (Type A)
#--------------------------------------------------------------------------
def mag_dmg_red_a
return Mag_Dmg_Red_A.has_key?(@id) ? Mag_Dmg_Red_A[@id] : 0
end
#--------------------------------------------------------------------------
# * Physical Damage Reductions (Type B)
#--------------------------------------------------------------------------
def phy_dmg_red_b
return Phy_Dmg_Red_B.has_key?(@id) ? Phy_Dmg_Red_B[@id] : 0
end
#--------------------------------------------------------------------------
# * Magical Damage Reductions (Type B)
#--------------------------------------------------------------------------
def mag_dmg_red_b
return Mag_Dmg_Red_B.has_key?(@id) ? Mag_Dmg_Red_B[@id] : 0
end
end

#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# * Lias Listings
#--------------------------------------------------------------------------
alias seph_dmgred_gmbtlr_ae attack_effect
alias seph_dmgred_gmbtlr_se skill_effect
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Original Attack Effect
seph_dmgred_gmbtlr_ae(attacker)
# If Self is an Actor
if self.is_a?(Game_Actor)
# Unless Missed
if self.damage.is_a?(Fixnum)
# If Damage was dealt
if self.damage > 0
# If Damage is Less than Physical Damage Reduction
unless self.damage > self.phy_dmg_red_a
self.hp += damage
self.damage = 0
self.critical = false
else
self.hp += self.phy_dmg_red_b
self.damage -= self.phy_dmg_red_b
end
end
end
end
return true
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# Original Skill Effect
effective = seph_dmgred_gmbtlr_se(user, skill)
# If Self is an Actor
if self.is_a?(Game_Actor)
# Unless Missed
if self.damage.is_a?(Fixnum)
# If Damage was dealt
if self.damage > 0
# Gets Damage Reduction Value
reduction = skill.atk_f > 0 ? self.phy_dmg_red_a :
self.mag_dmg_red_a
# If Damage is Less than Damage Reduction
unless self.damage > reduction
self.hp += damage
self.damage = 0
self.critical = false
else
# Gets Damage Reduction Value
reduction = skill.atk_f > 0 ? self.phy_dmg_red_b :
self.mag_dmg_red_b
self.hp += reduction
self.damage -= reduction
end
end
end
end
# End Method
return effective
end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Physical Damage Reduction (Type A)
#--------------------------------------------------------------------------
def phy_dmg_red_a
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].phy_dmg_red_a"
end
end
return n
end
#--------------------------------------------------------------------------
# * Magical Damage Reduction (Type A)
#--------------------------------------------------------------------------
def mag_dmg_red_a
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].mag_dmg_red_a"
end
end
return n
end
#--------------------------------------------------------------------------
# * Physical Damage Reduction (Type B)
#--------------------------------------------------------------------------
def phy_dmg_red_b
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].phy_dmg_red_b"
end
end
return n
end
#--------------------------------------------------------------------------
# * Magical Damage Reduction (Type B)
#--------------------------------------------------------------------------
def mag_dmg_red_b
n = 0
for i in 1..4
unless (eval "$data_armors[@armor#{i}_id].nil?")
n += eval "$data_armors[@armor#{i}_id].mag_dmg_red_b"
end
end
return n
end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '1'
  • ?
    내로미 2010.05.07 15:56

    아.. 쓸데없는건데... 제목이 영어라서 낚인..;;;

    내 포인트.. 아까운..;;


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1001 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
1000 이름입력 한글 이름 입력 15 ok하승헌 2010.02.18 4487
999 기타 한계 돌파스크립트 8 G MAX 2009.09.03 2205
998 이동 및 탈것 하이 대쉬 시스템 ver.1.0 15 백호 2009.02.22 2365
997 기타 하나더올립니다....하암........이건...렙제라네요 7 벨☆ 2010.01.23 1754
996 기타 필요 경험치 직접 정하기 9 백호 2009.02.21 1408
995 기타 필드에서 체력을 출력합니다. 4 백호 2009.02.22 1737
994 기타 필드에서 마력을 출력합니다. 백호 2009.02.22 983
993 기타 필드에서 경험치%를 표시합니다. 4 file 백호 2009.02.22 1448
992 이동 및 탈것 플레이어 텔레포트 시키기 1 백호 2009.02.22 1375
991 기타 플레이어 발소리 스크립트 20 백호 2009.02.22 3107
990 메뉴 플레이 시간 윈도우 개조 file 백호 2009.02.21 1328
989 영상 플래시 파일 재생 스크립트. 4 Bera 2010.10.16 2097
988 영상 플래시 동영상 재생 스크립트 사용법 및 다운로드 8 아방스 2010.11.02 3919
987 기타 프리 윈도우 스크립트 (상입오두막 출처) 6 백호 2009.02.21 1449
986 기타 프레임 적용 스크립트 1 file 백호 2009.02.21 1007
985 기타 풀스크린 스크립트 2 백호 2009.02.22 1407
984 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
983 기타 포커(Blackjack) 게임을 도입하는 스크립트 5 file 백호 2009.02.21 1674
982 펫시스탬 예제 첨부 11 WMN 2008.03.17 2065
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52