📄 itemeffect.lua
字号:
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_GCYS( role , Item ) --[[甘草药水]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 33
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_XSHC( role , Item ) --[[醒神花茶]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 38
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_MZQYG( role , Item ) --[[秘制奇异膏]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 41
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_BYS( role , Item ) --[[冰芽酥]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 59
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_TMLGZ( role , Item ) --[[提马拉果子]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 100
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_SMG( role , Item ) --[[神秘果]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 111
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_TSJ( role , Item ) --[[提神剂]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 141
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_MHYS( role , Item ) --[[魔幻药水]]--
local sp = GetChaAttr(role, ATTR_SP)
--LG("Potion Usage", "Current SP= ", sp , "\n" )
sp_resume = 201
sp = sp + sp_resume
mxsp = GetChaAttr(role,ATTR_MXSP)
if sp > mxsp then --加超过最大sp时返回为最大sp
sp = mxsp
--LG("Potion Usage", "Reached Max SP cap", "\n" )
end
--LG("Potion Usage", "SP recovered to", sp ,"\n" )
SetCharaAttr(sp, role, ATTR_SP)
end
function ItemUse_TZCMB ( role , Item ) --[[特制草莓饼]]--
tempt_monster( role , 99 ) --招引巨兽
end
function hp_med_middle( role , Item ) --[[中型血瓶公式]]--
--LuaPrint("Enter function hp_med_small( role ) --[[medium HP potion formula]]--")
local hp = GetChaAttr(role, ATTR_HP)
--LG("Potion Usage", "Current HP= ", hp , "\n" )
if hp <= 0 then
--LuaPrint("Character dead or illegal HP value") return
--LG("Potion Usage", "Character dead or illegal HP value","\n" )
end
hp_resume = 800
hp = hp + hp_resume
mxhp = GetChaAttr(role,ATTR_MXHP)
if hp > mxhp then --加超过最大hp时返回为最大hp
hp = mxhp
--LG("Potion Usage", "Max HP cap reached", "\n" )
end
--LG("Potion Usage", "HP recovered to", hp ,"\n" )
SetCharaAttr(hp, role, ATTR_HP)
--LuaPrint("Out function hp_med_small( role ) --[[medium HP potion formula]]--")
end
function hp_med_large( role , Item ) --[[大型血瓶公式]]--
--LuaPrint("Enter function hp_med_small( role ) --[[Big HP potion formula]]--")
local hp = GetChaAttr(role, ATTR_HP)
--LG("Potion Usage", "Current HP= ", hp , "\n" )
if hp <= 0 then
--LuaPrint("Character dead or illegal HP value") return
--LG("Potion Usage", "Character dead or illegal HP value","\n" )
end
local mxhp = GetChaAttr(role, ATTR_MXHP)
hp_resume = 0.2 * mxhp
hp = hp + hp_resume
mxhp = GetChaAttr(role,ATTR_MXHP)
if hp > mxhp then --加超过最大hp时返回为最大hp
hp = mxhp
--LG("Potion Usage", "Max HP cap reached", "\n" )
end
--LG("Potion Usage", "HP recovered to", hp ,"\n" )
SetCharaAttr(hp, role, ATTR_HP)
--LuaPrint("Out function hp_med_small( role ) --[[big HP potion formula]]--")
end
function hp_med_super( role , Item ) --[[超级血瓶公式]]--
--LuaPrint("Enter function hp_med_small( role ) --[[super HP potion formula]]--")
local hp = GetChaAttr(role, ATTR_HP)
--LG("Potion Usage", "Current HP= ", hp , "\n" )
if hp <= 0 then
--LuaPrint("Character dead or illegal HP value") return
--LG("Potion Usage", "Character dead or illegal HP value","\n" )
end
local mxhp = GetChaAttr(role, ATTR_MXHP)
hp_resume = 0.8 * mxhp
hp = hp + hp_resume
mxhp = GetChaAttr(role,ATTR_MXHP)
if hp > mxhp then --加超过最大hp时返回为最大hp
hp = mxhp
--LG("Potion Usage", "Max HP cap reached", "\n" )
end
--LG("Potion Usage", "HP recovered to", hp ,"\n" )
SetCharaAttr(hp, role, ATTR_HP)
--LuaPrint("Out function hp_med_small( role ) --[[super HP potion formula]]--")
end
function Sk_Script_Dpsl ( role , Item ) --技能卷轴“盾牌熟练”的使用公式
local sk_add = SK_DPSL
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Lzj ( role , Item ) --技能卷轴“连珠箭”的使用公式
local sk_add = SK_LZJ
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Lxjy ( role , Item ) --技能卷轴“流星箭雨”的使用公式
local sk_add = SK_LXJY
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Lh ( role , Item ) --技能卷轴“狼嚎”的使用公式
local sk_add = SK_LH
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Ssd ( role , Item ) --技能卷轴“散射弹”的使用公式
local sk_add = SK_SSD
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Ctd ( role , Item ) --技能卷轴“穿透弹”的使用公式
local sk_add = SK_CTD
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Dzy ( role , Item ) --技能卷轴“大治愈”的使用公式
local sk_add = SK_DZY
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Hx ( role , Item )
local sk_add = SK_HX
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Rsd ( role , Item )
local sk_add =SK_RSD
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Jssl ( role , Item )
local sk_add = SK_JSSL
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Gtyz ( role , Item )
local sk_add = SK_GTYZ
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Qhtz ( role , Item )
local sk_add = SK_QHTZ
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Lqhb ( role , Item )
local sk_add = SK_LQHB
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Jdzz ( role , Item )
local sk_add = SK_JDZZ
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
-- end
if form_sklv ~= 0 then
UseItemFailed ( role )
return
end
a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )
if a== 0 then
UseItemFailed ( role )
return
end
end
function Sk_Script_Hyz ( role , Item )
local sk_add = SK_HYZ
local form_sklv = GetSkillLv( role , sk_add )
-- if form_sklv < 0 or form_sklv == nil then --技能等级合法性检查
-- return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -