?? skilleffect.lua
字號:
function Skill_Wk_Begin ( role , sklv )
end
function Skill_Wk_End ( ATKER , DEFER , sklv )
local defer_lv = Lv ( DEFER )
if sklv < defer_lv then
SystemNotice ( role , "Skill level is too low" )
return
end
local hpdmg = 1
local UnNormal_KS_ID = 777
local KS_ID = GetChaTypeID( DEFER )
local KS_hp = Hp( DEFER )
local i = 0
if KS_ID == UnNormal_KS_ID then ----判斷是否是隕石
local Item_Use = GetChaItem ( ATKER , 1 , 9 ) ----取手上裝備的道具
local ItemID_Use = GetItemID ( Item_Use ) ----取ID
if ItemID_Use ~= 3908 and ItemID_Use ~= 3108 then ----如果不是合金礦鎬不能挖
SystemNotice( ATKER , "Only Alloy Pickaxe can be used to mine" )
return
end
local Item_URE = GetItemAttr ( Item_Use , ITEMATTR_URE ) ----取合金礦鎬耐久
local Take_Num = 0
local URE_Ran = Percentage_Random ( 0.35 )
if URE_Ran == 1 then
Take_Num = 1
end
if Item_URE < 50 then ----耐久為0不能挖
Take_Num = 0
hpdmg = 0
SystemNotice( ATKER , "Pickaxe is damaged. Unable to continue using" )
end
Item_URE = Item_URE - Take_Num
local i = SetItemAttr ( Item_Use , ITEMATTR_URE , Item_URE ) ----扣耐久
if i == 0 then
LG("Item_URE","Weapon imbue failed")
end
if Item_URE < 50 and Take_Num ~= 0 then
SetChaEquipValid ( role , 9 , 0 ) ----設置裝備無效
end
if KS_hp <= 800 then
hpdmg = 0
SystemNotice( ATKER , "Looks like the Metorite is exhausted. Let it have some rest" )
end
-- else local WaKuang_Check = 0
-- WaKuang_Check = Percentage_Random(0.01)
-- if WaKuang_Check == 1 then
-- GiveItem( ATKER , 0 , 433, 1, 4)
-- end
end
local hp = Hp(DEFER) - hpdmg
SetCharaAttr(hp , DEFER , ATTR_HP )
end
--技能捕魚——————————————————————————————————————————————————————————————————————————————————————————-
function SkillSp_By ( sklv )
return 0
end
function SkillCooldown_By( sklv )
local Cooldown = 1500
return Cooldown
end
function Skill_By_Begin ( role , sklv )
end
function Skill_By_End ( ATKER , DEFER , sklv )
-- SystemNotice ( ATKER , "Starts to Fish!" )
local defer_lv = Lv ( DEFER )
if sklv < defer_lv then
SystemNotice ( ATKER , "Skill level is too low" )
return
end
SystemNotice ( ATKER , "Fishing in progress..." )
local hpdmg = 1
local hp = Hp(DEFER) - hpdmg
-- LG ( "sk_by" , "fish_hp = " , Hp(DEFER) )
-- LG ( "sk_by" , "fish_nowhp = " , hp )
SetCharaAttr(hp , DEFER , ATTR_HP )
-- local hp = Hp(DEFER) - hpdmg
-- SetCharaAttr(hp , DEFER , ATTR_HP )
-- local BuYu_Check = 0
-- BuYu_Check = Percentage_Random(0.01)
-- if BuYu_Check == 1 then
-- GiveItem( ATKER , 0 , 434, 1, 4)
-- end
end
--技能打撈——————————————————————————————————————————————————————————————————————————————————————————-
function SkillSp_Dl ( sklv )
return 0
end
function SkillCooldown_Dl( sklv )
local Cooldown = 1500
return Cooldown
end
function Skill_Dl_Begin ( role , sklv )
end
function Skill_Dl_End ( ATKER , DEFER , sklv )
-- SystemNotice ( ATKER , "Starts to Salvage!" )
local defer_lv = Lv ( DEFER )
if sklv < defer_lv then
SystemNotice ( ATKER , "Skill level is too low" )
return
end
SystemNotice ( ATKER , "Salvage in progress…" )
local hpdmg = 1
local hp = Hp(DEFER) - hpdmg
SetCharaAttr(hp , DEFER , ATTR_HP )
-- local DaLao_Check = 0
-- SystemNotice ( ATKER , " 1" )
-- DaLao_Check = Percentage_Random(0.01)
--SystemNotice ( ATKER , DaLao_Check )
-- if DaLao_Check == 1 then
-- GiveItem( ATKER , 0 , 432, 1, 4)
-- end
end
--技能極速風暴——————————————————————————————————————————————————————————————
function SkillSp_Jsfb ( sklv )
local sp_reduce = 20
return sp_reduce
end
function SkillCooldown_Jsfb( sklv )
local Cooldown = 5000
return Cooldown
end
function Skill_Jsfb_Begin ( role , sklv )
local sp = Sp(role)
local sp_reduce = SkillSp_Jxwb (sklv)
if sp - sp_reduce < 0 then
SkillUnable(role)
return
end
Sp_Red (role , sp_reduce )
end
function Skill_Jsfb_End ( ATKER , DEFER , sklv )
local statelv = sklv
local statetime = 30 + sklv * 3
local map_name_ATKER = GetChaMapName ( ATKER )
local map_name_DEFER = GetChaMapName ( DEFER )
local str_atker = Str(ATKER)
local Can_Pk_Garner2 = Is_NormalMonster (DEFER)
if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then
if Can_Pk_Garner2 == 0 then
statetime =math.max(30,math.floor(str_atker/5))+sklv*3
-- Notice ( "statetime="..statetime)
end
end
--LG( "Jxwb", "Tornado Swirl Skill Level=" , sklv , "\n" )
AddState( ATKER , DEFER , STATE_JSFB, statelv , statetime )
--LG("skill_Jxwb", "function Skill_Oper_Jxwb: " , "add state Jxwb " , "\n" )
end
function State_Jsfb_Add ( role , statelv )
--LG("state_Jxwb" , "function State_Jxwb_Add : " , "role = " , role , "statelv = " , statelv, "\n" )
local crtsb_dif =5 + 1 * statelv
local crtsb = math.floor ( (CrtSb(role) + crtsb_dif ) )
SetCharaAttr( crtsb , role , ATTR_STATEV_CRT )
ALLExAttrSet(role)
end
function State_Jsfb_Rem ( role , statelv )
--LG("state_jxwb" , "function State_jxwb_Rem : " , "role = " , role , "statelv = " , statelv, "\n" )
local crtsb_dif =5 + 1 * statelv
local crtsb = math.floor ( (CrtSb(role) - crtsb_dif ) )
SetCharaAttr( crtsb , role , ATTR_STATEV_CRT )
ALLExAttrSet(role)
end
--技能賢者封印——————————————————————————————————————————————————————————————————————————————
function SkillSp_Xzfy ( sklv ) --技能"Seal of Elder"的sp消耗公式
local sp_reduce = 30 + sklv * 2
return sp_reduce
end
function SkillCooldown_Xzfy( sklv )
local Cooldown = 20000
return Cooldown
end
function Skill_Xzfy_Begin ( role , sklv )
local sp = Sp(role)
local sp_reduce = SkillSp_Xzfy ( sklv )
if sp - sp_reduce < 0 then
SkillUnable(role)
return
end
Sp_Red (role , sp_reduce )
end
function Skill_Xzfy_End ( ATKER , DEFER , sklv )
local statelv = sklv
local statetime = 10 + math.floor ( sklv* 0.5 )
local map_name_ATKER = GetChaMapName ( ATKER )
local map_name_DEFER = GetChaMapName ( DEFER )
local con_atker = Con(ATKER)
local Can_Pk_Garner2 = Is_NormalMonster (DEFER)
if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then
if Can_Pk_Garner2 == 0 then
statetime =math.max(10,math.floor(con_atker/15))+sklv* 0.5
-- Notice ( "statetime="..statetime)
end
end
local Check_Heilong = CheckItem_Heilong ( ATKER )
if Check_Heilong == 1 then
local Percentage = Percentage_Random ( 0.7)
if Percentage == 1 then
statetime = statetime*1.5
SystemNotice ( ATKER , "Obtain power from Black Dragon set. Skill effect enhanced")
end
end
local hp_defer = Hp ( DEFER )
if hp_defer >= 100000 then
local a = Percentage_Random (0.8)
if a == 1 then
statetime = 5 + math.floor ( sklv * 0.3 )
else
SetSus( DEFER , 0 )
SystemNotice ( ATKER , "Seal of Elder usage failed!!")
return
end
end
----boss使用技能處理
if GetChaTypeID( ATKER ) == 985 then
statetime = 15
statelv = 10
end
if GetChaAIType( DEFER ) >= 21 then --21以上為BossAI,如果是Boss根據boss不同,設定可以被加狀態的次數
if BOSSXZSJ[GetChaTypeID( DEFER )] == 0 then
Notice ("As a Boss, how can I be defeated by ths same skill. Beware warriors!")
return
else
BOSSXZSJ[GetChaTypeID( DEFER )] = BOSSXZSJ[GetChaTypeID( DEFER )] -1
end
end
----boss使用技能處理結束
AddState ( ATKER , DEFER ,STATE_JNJZ , statelv , statetime )
end
--技能暗影之章————————————————————————————————————————————————————————————————————————————————
function SkillSp_Ayzz ( sklv ) --技能"Shadow Insignia"的sp消耗公式
local sp_reduce = 30 + sklv * 3
return sp_reduce
end
function SkillCooldown_Ayzz( sklv )
local Cooldown = 30000
return Cooldown
end
function Skill_Ayzz_Begin ( role , sklv )
local sp = Sp(role)
local sp_reduce = SkillSp_Ayzz ( sklv )
if sp - sp_reduce < 0 then
SkillUnable(role)
return
end
Sp_Red (role , sp_reduce )
end
function Skill_Ayzz_End ( ATKER , DEFER , sklv )
local statelv = sklv
local statetime = 5 + sklv * 1
local map_name_ATKER = GetChaMapName ( ATKER )
local map_name_DEFER = GetChaMapName ( DEFER )
local con_atker = Con(ATKER)
local Can_Pk_Garner2 = Is_NormalMonster (DEFER)
if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then
if Can_Pk_Garner2 == 0 then
statetime =math.max(5,math.floor(con_atker/30))+sklv
-- Notice ( "statetime="..statetime)
end
end
local Check_Heilong = CheckItem_Heilong ( ATKER )
if Check_Heilong == 1 then
local Percentage = Percentage_Random ( 0.7)
if Percentage == 1 then
statetime = statetime*1.5
SystemNotice ( ATKER , "Obtain power from Black Dragon set. Skill effect enhanced")
end
end
local hp_defer = Mxhp ( DEFER )
if hp_defer >= 100000 and hp_defer < 1000000 then
local a = Percentage_Random (0.7)
if a == 1 then
statetime = 9
else
SetSus( DEFER , 0 )
return
end
elseif hp_defer >= 1000000 then
local a = Percentage_Random (0.7)
if a == 1 then
statetime = 4
else
SetSus( DEFER , 0 )
return
end
end
----boss使用技能處理
if GetChaTypeID( ATKER ) == 985 then
statetime = 15
statelv = 10
end
if GetChaAIType( DEFER ) >= 21 then --21以上為BossAI,如果是Boss根據boss不同,設定可以被加狀態的次數
if BOSSAYSJ[GetChaTypeID( DEFER )] == 0 then
Notice ("As a Boss, how can I be defeated by ths same skill. Beware warriors!")
return
else
BOSSAYSJ[GetChaTypeID( DEFER )] = BOSSAYSJ[GetChaTypeID( DEFER )] -1
end
end
----boss使用技能處理結束
AddState( ATKER , DEFER , STATE_GJJZ, statelv , statetime )
--LG( "Ayzz", "Shadow Insignia Skill Level=" , sklv , "Skill Damage= " , dmg , '\n" )
end
--技能鷹眼——————————————————————————————————————————————————————————————————————————————
function SkillSp_Yy ( sklv ) --技能"Eagle's Eye"的sp消耗公式
local sp_reduce = 10
return sp_reduce
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -