Files
Leviathan/Client/Game/resource/FX_Script.lua
T
2026-06-01 12:46:52 +02:00

346 lines
14 KiB
Lua

-- *******************************************************************************************
-- ****** 뛰는 발소리 & 먼지 처리 ************************************************************
-- *******************************************************************************************
function call_fx_ch_run_step( handle )
-- 뛸때 "탁" or "쿵" 하는 발소리. 범용 발소리의 경우에만 동작함.
local FX_ID, Monster_Size
FX_ID = 15004
Monster_Size = 1
local Self_Ground_Material_Type = getGroundMaterial( handle )
-- 지면의 재질을 읽어옴
-- 1:초원, 2:흙, 3:진흙, 4:모래, 5:돌, 6:철판, 7:목재, 8:자갈, 9:초원+흙, 10:초원+진흙, 11:흙+자갈
-- 아바타일경우 보행타입을 1=중형&2족...으로 설정
-- (몬스터일경우) 보행타입을 읽어옴
-- 0:2족소형, 1:2족중형, 2:2족대형, 3:2족초대형, 4:4족소형, 5:4족중형, 6:4족대형, 7:4족초대형, 30이후 기타
Moving_Type = getMovingType( handle )
-- CB3에선 소형 사운드도 없음. 일단 출력 안함. (차후 전용으로 처리하거나, 소형 사운드를 따로 만들거나...)
if Moving_Type == 1 or Moving_Type == 5 then
-- 표준 사이즈인 경우의 처리
if Self_Ground_Material_Type == 1 then -- 1:초원
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
elseif Self_Ground_Material_Type == 2 then -- 2:흙
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
elseif Self_Ground_Material_Type == 3 then -- 3:진흙
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
elseif Self_Ground_Material_Type == 4 then -- 4:모래
FX_ID = 15007 -- run_middle_sand1.wav,run_middle_sand2.wav,run_middle_sand3.wav
elseif Self_Ground_Material_Type == 5 then -- 5:돌
FX_ID = 15010 -- run_middle_rock1.wav,run_middle_rock2.wav,run_middle_rock3.wav
elseif Self_Ground_Material_Type == 6 then -- 6:철판
FX_ID = 15013 -- run_middle_plate1.wav,run_middle_plate2.wav,run_middle_plate3.wav
elseif Self_Ground_Material_Type == 7 then -- 7:목재
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
elseif Self_Ground_Material_Type == 8 then -- 8:자갈
FX_ID = 15016 -- run_middle_gravel1.wav,run_middle_gravel2.wav,run_middle_gravel3.wav
elseif Self_Ground_Material_Type == 9 then -- 9:초원+흙
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
else
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
end
elseif Self_Ground_Material_Type == 10 then -- 10:초원+진흙
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
else
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
end
elseif Self_Ground_Material_Type == 11 then -- 11:흙+자갈
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15001 -- run_middle_hard1.wav,run_middle_hard2.wav,run_middle_hard3.wav
else
FX_ID = 15016 -- run_middle_gravel1.wav,run_middle_gravel2.wav,run_middle_gravel3.wav
end
end
end
if Moving_Type == 2 or Moving_Type == 6 then
-- 좀 무거운 사이즈인 경우의 처리
if Self_Ground_Material_Type == 1 then -- 1:초원
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
elseif Self_Ground_Material_Type == 2 then -- 2:흙
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
elseif Self_Ground_Material_Type == 3 then -- 3:진흙
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
elseif Self_Ground_Material_Type == 4 then -- 4:모래
FX_ID = 15002 -- run_heavy_sand1.wav,run_heavy_sand2.wav,run_heavy_sand3.wav
elseif Self_Ground_Material_Type == 5 then -- 5:돌
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
elseif Self_Ground_Material_Type == 6 then -- 6:철판
FX_ID = 15025 -- run_heavy_plate1.wav,run_heavy_plate2.wav,run_heavy_plate3.wav
elseif Self_Ground_Material_Type == 7 then -- 7:목재
FX_ID = 15025 -- run_heavy_plate1.wav,run_heavy_plate2.wav,run_heavy_plate3.wav
elseif Self_Ground_Material_Type == 8 then -- 8:자갈
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
elseif Self_Ground_Material_Type == 9 then -- 9:초원+흙
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
else
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
end
elseif Self_Ground_Material_Type == 10 then -- 10:초원+진흙
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15004 -- run_middle_grass1.wav,run_middle_grass2.wav,run_middle_grass3.wav
else
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
end
elseif Self_Ground_Material_Type == 11 then -- 11:흙+자갈
if math.random(0,1) == 0 then -- 혼합지면의 랜덤처리
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
else
FX_ID = 15019 -- run_heavy_hard1.wav,run_heavy_hard2.wav,run_heavy_hard3.wav
end
end
end
if Moving_Type == 3 or Moving_Type == 7 then
-- 매우 무거운 초대형 사이즈인 경우의 처리 (1종류의 사운드만 존재함)
FX_ID = 15028 -- run_ultra_heavy1.wav,run_ultra_heavy2.wav,run_ultra_heavy3.wav
end
FX_ID = FX_ID + math.random(0,2)
-- 패턴 다양화를 위한 랜덤처리
playFX( handle, handle, handle, FX_ID, 3, 0 )
-- PlayFX(FX_ID, 재생대상, 재생위치, 재생시간)
-- ▶ 재생대상의 종류 -> 0:self, 1:target
-- ▶ 재생위치의 종류 -> 0:머리 1:중앙 2:데미지 3:바닥 5:왼손 6:오른손 7:양손
-- ▶ 재생시간 -> 0:순간, -1:무한, 0초과:지정시간(초)
end
-- *******************************************************************************************
-- ****** 걷는 발소리 & 먼지 처리 ************************************************************
-- *******************************************************************************************
function call_fx_ch_walking_step( handle )
-- 걸을때 "터벅" 하는 발소리
-- 3차CB에서는 뛰는 발소리와 똑같이 처리한다.
call_fx_ch_run_step( handle )
end
-- *******************************************************************************************
-- ****** 캐릭터 사망시 땅에 부딪치는 연출 ***************************************************
-- *******************************************************************************************
function call_fx_ch_death( handle )
-- 캐릭터 사망 애니메이션에 땅바닥에 부딪치는 처리가 존재할때만 출력
-- 3차CB에서는 사운드 의뢰가 안되어있으므로... 걍 뛰는 발소리가 나오게 한다 ( -_-)
call_fx_ch_run_step( handle )
end
-- *******************************************************************************************
-- ****** 무기 휘두르는 소리 *****************************************************************
-- *******************************************************************************************
function call_fx_ch_weapone_attack( attack_handle, target_handle )
-- 무기를 휘두를때 휙 소리가 나게하는 처리
local FX_ID
local Self_Weapone_Type = getItemClass( attack_handle )
-- Self_Weapone_Type : 공격자의 무기 종류 그룹ID
-- 100:기타무기, 101:한손검, 102:양손검, 103:단검, 104:양손창, 105:양손도끼, 106:한손메이스, 107:양손메이스
-- 108:라이트보우, 109:헤비보우, 110:석궁, 111:한손지팡이, 112:양손지팡이
if Self_Weapone_Type == 101 then -- 한손검
FX_ID = 16001 -- attack_sword_swing1.wav,attack_sword_swing2.wav
elseif Self_Weapone_Type == 102 then -- 양손검
FX_ID = 16003 -- attack_twohandsword_swing1.wav,attack_twohandsword_swing2.wav
elseif Self_Weapone_Type == 103 then -- 단검
FX_ID = 16005 -- attack_dagger_swing1.wav,attack_dagger_swing2.wav
elseif Self_Weapone_Type == 104 then -- 양손창
FX_ID = 16007 -- attack_twohandspear_swing1.wav,attack_twohandspear_swing2.wav
elseif Self_Weapone_Type == 105 then -- 양손도끼
FX_ID = 16009 -- attack_twohandaxe_swing1.wav,attack_twohandaxe_swing2.wav
elseif Self_Weapone_Type == 106 then -- 한손메이스
FX_ID = 16011 -- attack_mace_swing1.wav,attack_mace_swing2.wav
elseif Self_Weapone_Type == 107 then -- 양손메이스
FX_ID = 16013 -- attack_twohandmace_swing1.wav,attack_twohandmace_swing2.wav
elseif Self_Weapone_Type >= 111 then -- 한손, 양손지팡이
FX_ID = 16015 -- attack_staff_swing1.wav,attack_staff_swing2.wav
end
FX_ID = FX_ID + math.random(0,1)
-- 패턴 다양화를 위한 랜덤처리
playFX( attack_handle, attack_handle, target_handle, FX_ID, 1, 0 )
-- PlayFX(FX_ID, 재생대상, 재생위치, 재생시간)
-- ▶ 재생대상의 종류 -> 0:self, 1:target
-- ▶ 재생위치의 종류 -> 0:머리 1:중앙 2:데미지 3:바닥 5:왼손 6:오른손 7:양손
-- ▶ 재생시간 -> 0:순간, -1:무한, 0초과:지정시간(초)
end
-- *******************************************************************************************
-- ****** 데미지 히트 연출 *******************************************************************
-- *******************************************************************************************
function avatar_basic_hit( attack_handle, target_handle, critical, block )
-- 클라이언트에서 이 함수를 호출할때, 크리티컬 여부와 블러킹 여부를 알려줘야한다.
-- critical : 크리티컬 발생 여부. (0:크리아님, 1:크리)
-- block : 블러킹 발생 여부. (0:블럭아님, 1:블럭, 2:퍼펙트블럭)
local FX_ID = 0;
local Self_Weapone_Type = getItemClass( attack_handle )
-- 공격자의 무기 종류 그룹ID를 불러옴
-- 100:기타무기, 101:한손검, 102:양손검, 103:단검, 104:양손창, 105:양손도끼, 106:한손메이스, 107:양손메이스
-- 108:라이트보우, 109:헤비보우, 110:석궁, 111:한손지팡이, 112:양손지팡이
local Target_Body_Material_Type = getMaterial( target_handle )
-- 피격자 몸체의 재질을 불러옴 -> 0:피부, 1:가죽, 2:나무, 3:금속, 4:깃털, 5:돌, 6:뼈, 99:기타
if Self_Weapone_Type >= 101 and Self_Weapone_Type <= 103 then -- 한손검, 양손검, 단검
if Target_Body_Material_Type == 0 then -- 피부재질
FX_ID = 17013 -- beattack_sword_to_softskin1.wav,beattack_sword_to_softskin2.wav,beattack_sword_to_softskin3.wav,beattack_sword_to_softskin_critical.wav
elseif Target_Body_Material_Type == 1 or Target_Body_Material_Type > 6 then -- 가죽재질 & 기타재질
FX_ID = 17013 -- beattack_sword_to_softskin1.wav,beattack_sword_to_softskin2.wav,beattack_sword_to_softskin3.wav,beattack_sword_to_softskin_critical.wav
elseif Target_Body_Material_Type == 2 then -- 나무재질
FX_ID = 17005 -- beattack_sword_to_hardskin1.wav,beattack_sword_to_hardskin2.wav,beattack_sword_to_hardskin3.wav,beattack_sword_to_hardskin_critical.wav
elseif Target_Body_Material_Type == 3 then -- 금속재질
FX_ID = 17001 -- beattack_sword_to_steelskin1.wav,beattack_sword_to_steelskin2.wav,beattack_sword_to_steelskin3.wav,beattack_sword_to_steelskin_critical.wav
elseif Target_Body_Material_Type == 4 then -- 깃털재질
FX_ID = 17017 -- beattack_sword_to_featherskin1.wav,beattack_sword_to_featherskin2.wav,beattack_sword_to_featherskin3.wav,beattack_sword_to_featherskin_critical.wav
elseif Target_Body_Material_Type == 5 then -- 돌재질
FX_ID = 17009 -- beattack_sword_to_stoneskin1.wav,beattack_sword_to_stoneskin2.wav,beattack_sword_to_stoneskin3.wav,beattack_sword_to_stoneskin_critical.wav
elseif Target_Body_Material_Type == 6 then -- 뼈재질
FX_ID = 17021 -- beattack_sword_to_bone1.wav,beattack_sword_to_bone2.wav,beattack_sword_to_bone3.wav,beattack_sword_to_bone_critical.wav
end
elseif Self_Weapone_Type >= 111 then -- 한손, 양손지팡이
FX_ID = 000 -- 지팡으로 뚜등기는 소리는 한가지뿐.
else -- 나머지는 둔기계열 & 화살계열로 간주함
if Target_Body_Material_Type == 0 then -- 피부재질
FX_ID = 17037 -- beattack_blunt_to_softskin1.wav,beattack_blunt_to_softskin2.wav,beattack_blunt_to_softskin3.wav,beattack_blunt_to_softskin_critical.wav
elseif Target_Body_Material_Type == 1 or Target_Body_Material_Type > 6 then -- 가죽재질 & 기타재질
FX_ID = 17037 -- beattack_blunt_to_softskin1.wav,beattack_blunt_to_softskin2.wav,beattack_blunt_to_softskin3.wav,beattack_blunt_to_softskin_critical.wav
elseif Target_Body_Material_Type == 2 then -- 나무재질
FX_ID = 17029 -- beattack_blunt_to_hardskin1.wav,beattack_blunt_to_hardskin2.wav,beattack_blunt_to_hardskin3.wav,beattack_blunt_to_hardskin_critical.wav
elseif Target_Body_Material_Type == 3 then -- 금속재질
FX_ID = 17025 -- beattack_blunt_to_steelskin1.wav,beattack_blunt_to_steelskin2.wav,beattack_blunt_to_steelskin3.wav,beattack_blunt_to_steelskin_critical.wav
elseif Target_Body_Material_Type == 4 then -- 깃털재질
FX_ID = 17041 -- beattack_blunt_to_featherskin1.wav,beattack_blunt_to_featherskin2.wav,beattack_blunt_to_featherskin3.wav,beattack_blunt_to_featherskin_critical.wav
elseif Target_Body_Material_Type == 5 then -- 돌재질
FX_ID = 17033 -- beattack_blunt_to_stoneskin1.wav,beattack_blunt_to_stoneskin2.wav,beattack_blunt_to_stoneskin3.wav,beattack_blunt_to_stoneskin_critical.wav
elseif Target_Body_Material_Type == 6 then -- 뼈재질
FX_ID = 17045 -- beattack_blunt_to_bone1.wav,beattack_blunt_to_bone2.wav,beattack_blunt_to_bone3.wav,beattack_blunt_to_bone_critical.wav
end
end
if critical == 1 then
FX_ID = FX_ID + 3
-- 크리티컬 처리
elseif block >= 1 then
FX_ID = FX_ID + math.random(0,2)
-- 블럭처리... 3차CB에는 사운드가 없으므로 그냥 일반히트와 동일하게 처리함
else
FX_ID = FX_ID + math.random(0,2)
-- 패턴 다양화를 위한 랜덤처리
end
--_ALERT( FX_ID )
playFX( target_handle, attack_handle, target_handle, FX_ID, 2, 0 )
-- PlayFX(FX_ID, 재생대상, 재생위치, 재생시간)
-- ▶ 재생대상의 종류 -> 0:self, 1:target
-- ▶ 재생위치의 종류 -> 0:머리 1:중앙 2:데미지 3:바닥 5:왼손 6:오른손 7:양손
-- ▶ 재생시간 -> 0:순간, -1:무한, 0초과:지정시간(초)
end