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 6156
421 파티 메뉴커맨드로 파티 멤버들 순서 바꾸기 by Yargovish 1 백호 2009.02.22 1622
420 기타 Dynamic Stores by Astro_mech@rmxp.net 1 file 백호 2009.02.22 878
419 스킬 약간 수정한 심플액알(크리티컬,스킬) 10 백호 2009.02.22 3836
418 메뉴 Event Spawner 1 file 백호 2009.02.22 980
417 메뉴 새로운 cms 4 file 백호 2009.02.22 2118
416 기타 KGC - RMXP 스크립트 개발용 프로젝트 1.01 4 file 백호 2009.02.22 1515
415 기타 Random Character Generator by SephirothSpawn (SDK호환) 1 백호 2009.02.22 1040
414 전투 마법검 스크립트 1 백호 2009.02.22 1425
413 기타 Terrain Encounter Areas by SephirothSpawn 백호 2009.02.22 778
412 타이틀/게임오버 타이틀 아주 미묘한 효과 5 백호 2009.02.22 1857
411 메시지 1문자식 표시랑 따랑소리 나는 스크립트 8 백호 2009.02.22 2305
410 기타 Multiple Currencies(여러 개의 통화단위 사용) 2 백호 2009.02.22 1124
409 기타 Text Scroll by Dubealex (Release 3) 2 file 백호 2009.02.22 939
408 기타 Near Fantastica's SDK Test Bed 3 file 백호 2009.02.22 885
407 기타 멋진...제작자 정보를 그림으로 1 백호 2009.02.22 1233
406 전투 배틀 포인트 1 백호 2009.02.22 918
405 전투 배틀샵 스크립트 1 백호 2009.02.22 1126
404 온라인 멀티넷스크립트 => 채팅보완 스크립트 8 file 백호 2009.02.22 2931
403 저장 멀티넷스크립트 -> 아이피 세이브,로드 스크립트 9 file 백호 2009.02.22 2204
402 HUD Advanced HUD Script 3 file 백호 2009.02.22 1341
Board Pagination Prev 1 ... 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ... 52 Next
/ 52