local Exp_itemid = Exp_itemid or {}--经验增加道具
Exp_itemid[79780]=30--增加30%
Exp_itemid[91031]=10
local Activity_SkillExp = 0--活动经验倍率(例:提升20%就是写0.2)
local GM_Exp_set={}
GM_Exp_set[1]=0--战斗经验(例:提升20%就是写0.2,可在游戏内输入指令控制)
GM_Exp_set[2]=0--技能经验(例:提升20%就是写0.2,可在游戏内输入指令控制)
GM_Exp_set[3]=0--生产经验(例:提升20%就是写0.2,可在游戏内输入指令控制)
local BattleExpPlusList = {} --战斗经验设置
BattleExpPlusList[0] = {20,22,0.3}--BattleExpPlusList[星期(0-6)] = {开始时间,结束时间,经验增加 50%}
BattleExpPlusList[1] = {20,22,0.3}
BattleExpPlusList[2] = {20,22,0.3}
BattleExpPlusList[3] = {20,22,0.3}
BattleExpPlusList[4] = {20,22,0.3}
BattleExpPlusList[5] = {20,22,0.3}
BattleExpPlusList[6] = {20,22,0.3}
local SkillExpPlusList = {} --技能经验设置
SkillExpPlusList[0] = {20,22,0.3} --SkillExpPlusList[星期(0-6)] = {开始时间,结束时间,经验增加 50%}}
SkillExpPlusList[1] = {20,22,0.3}
SkillExpPlusList[2] = {20,22,0.3}
SkillExpPlusList[3] = {20,22,0.3}
SkillExpPlusList[4] = {20,22,0.3}
SkillExpPlusList[5] = {20,22,0.3}
SkillExpPlusList[6] = {20,22,0.3}
local ProductExpPlusList = {} --生产经验设置
--ProductExpPlusList[6] = {20,24,0.5} --ProductExpPlusList[星期(0-6)] = {开始时间,结束时间,经验增加 50%}}
local MapExpRate = {} --地图经验加成
MapExpRate[0] = {} --固定地图
MapExpRate[0][100] = 5 --芙蕾雅(3代表经验增加300%)
MapExpRate[0][11003] = 3.5 --哈洞(2.5代表经验增加250%)
MapExpRate[0][11004] = 3.5 --哈洞二楼
MapExpRate[0][15005] = 1.78 --海底
MapExpRate[0][38015] = 0.97 --雪山(1代表经验增加100%)
MapExpRate[0][33000] = 0.75 --坎村
MapExpRate[0][38016] = 0.27 --炎洞
MapExpRate[0][38017] = 0.23 --水洞
MapExpRate[0][38086] = 0.28 --龙城
MapExpRate[0][38019] = 0.12 --火山
MapExpRate[0][38020] = 1 --兰一
MapExpRate[0][62902] = 1.1 --山道
MapExpRate[0][38111] = 3 --迷宫之城初级
MapExpRate[0][38112] = 3 --迷宫之城中级
MapExpRate[1] = {} --随机地图
MapExpRate[1][3] = 3.5 --灵堂
--MapExpRate[1][1421] = 0.28 --龙城
--MapExpRate[1][?] = 2.85 --深绿
MapExpRate[1][1401] = 1.87 --迷宫之城
MapExpRate[1][1402] = 1.87 --迷宫之城
MapExpRate[1][1403] = 1.87 --迷宫之城
MapExpRate[1][1404] = 1.87 --迷宫之城
MapExpRate[1][1405] = 1.87 --迷宫之城
MapExpRate[1][1406] = 1.87 --迷宫之城
MapExpRate[1][1407] = 1.87 --迷宫之城
MapExpRate[1][1408] = 1.87 --迷宫之城
MapExpRate[1][1409] = 1.87 --迷宫之城
local BattleExpPlusGMTalk = "P|/expplus1" --战斗经验设置 /expplus1 1 表示增加100%经验
local SkillExpPlusGMTalk = "P|/expplus2" --技能经验设置 /expplus2 0.5 表示增加50%经验
local ProductExpPlusGMTalk = "P|/expplus3" --生成经验设置 /expplus3 3 表示增加300%经验
-----------------------------------------------
Global_Reg.RegCharGetExp("PlayerExpPlus");
Global_Reg.RegCharPetGetExp("PetExpPlus");
Global_Reg.RegBattleSkillExp("BattleSkillExpPlus");
Global_Reg.RegProductSkillExp("ProductSkillExpPlus");
Global_Reg.RegTalkEvent("ExpPlusTalkEvent");
function ExpPlusTalkEvent(player,msg,color,range,size)
if NLG.Get_Char_Date(player,145) > 0 then
if string.sub(msg,1,11) == BattleExpPlusGMTalk then
local plusvalue = tonumber(string.sub(msg,13,-1)) or 0
local bl=plusvalue*100
NLG.SystemMessage(-1,"[全服公告]全服战斗经验加成开启:增加"..bl.."%")
GM_Exp_set[1] = plusvalue
elseif string.sub(msg,1,11) == SkillExpPlusGMTalk then
local plusvalue = tonumber(string.sub(msg,13,-1)) or 0
local bl=plusvalue*100
NLG.SystemMessage(-1,"[全服公告]全服技能经验加成开启:增加"..bl.."%")
GM_Exp_set[2] = plusvalue
elseif string.sub(msg,1,11) == ProductExpPlusGMTalk then
local plusvalue = tonumber(string.sub(msg,13,-1)) or 0
local bl=plusvalue*100
NLG.SystemMessage(-1,"[全服公告]全服生产经验加成开启:增加"..bl.."%")
GM_Exp_set[3] = plusvalue
end
end
end
function PlayerExpPlus(player,baseexp)
--NLG.SystemMessage(player,"人物基础经验值是="..baseexp)
--需要:GM临时经验倍率,周常经验倍率,活动经验倍率,地图经验倍率
local job = Char.GetData(player,51)
if job==540 then--佣兵为4倍经验
baseexp = baseexp * 4
end
local pvevalup = 0
local pvevalbl = 0
if item_val_PVE[player] then
if item_val_PVE[player][1014] then
pvevalbl = pvevalbl + 0.05
end
if item_val_PVE[player][2011] then
pvevalbl = pvevalbl + 0.1
end
if item_val_PVE[player][3014] then
pvevalbl = pvevalbl + 0.15
end
if item_val_PVE[player][4014] then
pvevalbl = pvevalbl + 0.2
end
if item_val_PVE[player][5014] then
pvevalbl = pvevalbl + 0.25
end
if item_val_PVE[player][6003] then
pvevalbl = pvevalbl + 0.3
end
pvevalup = pvevalup + math.floor(baseexp * pvevalbl)
end
local itemexp1 = 0
local itemexp2 = 0
local shi1 = Char.GetItemIndex(player,5)
local shi2 = Char.GetItemIndex(player,6)
if shi1>=0 then
local itemid = Item.GetData(shi1,%道具_ID%);
if Exp_itemid[itemid] then
itemexp1 = math.floor((baseexp*Exp_itemid[itemid])/100)
end
end
if shi2>=0 then
local itemid = Item.GetData(shi2,%道具_ID%);
if Exp_itemid[itemid] then
itemexp2 = math.floor((baseexp*Exp_itemid[itemid])/100)
end
end
local weekday = tonumber(os.date("%w"))
local weekday_exp = 0
if BattleExpPlusList[weekday] then
local hours = tonumber(os.date("%H"))
if hours >= BattleExpPlusList[weekday][1] and hours < BattleExpPlusList[weekday][2] then
weekday_exp = BattleExpPlusList[weekday][3]*baseexp
end
end
local Maptype = Char.GetData(player,%对象_地图类型%)
local MapId = Char.GetData(player,%对象_地图%)
local mapexp = -1
if Maptype == 1 then
MapId = NLG.Get_Dungeonconf_Int(player,0)
--NLG.SystemMessage(player,"当前迷宫编号是="..MapId)
end
if MapExpRate[Maptype][MapId] then
mapexp=baseexp*MapExpRate[Maptype][MapId]
end
if mapexp==-1 then
baseexp=0
else
baseexp=baseexp+Activity_SkillExp*baseexp+GM_Exp_set[1]*baseexp+weekday_exp+mapexp+itemexp1+itemexp2+pvevalup
end
if baseexp<0 then
baseexp=0
end
return baseexp
end
function PetExpPlus(player,petindex,baseexp)
--NLG.SystemMessage(player,"宠物基础经验值是="..baseexp)
local job = Char.GetData(player,51)
if job==540 then
baseexp = baseexp * 4
end
local pvevalup = 0
local pvevalbl = 0
if item_val_PVE[player] then
if item_val_PVE[player][1014] then
pvevalbl = pvevalbl + 0.05
end
if item_val_PVE[player][2011] then
pvevalbl = pvevalbl + 0.1
end
if item_val_PVE[player][3014] then
pvevalbl = pvevalbl + 0.15
end
if item_val_PVE[player][4014] then
pvevalbl = pvevalbl + 0.2
end
if item_val_PVE[player][5014] then
pvevalbl = pvevalbl + 0.25
end
if item_val_PVE[player][6003] then
pvevalbl = pvevalbl + 0.3
end
pvevalup = pvevalup + math.floor(baseexp * pvevalbl)
end
local itemexp1 = 0
local itemexp2 = 0
local shi1 = Char.GetItemIndex(player,5)
local shi2 = Char.GetItemIndex(player,6)
if shi1>=0 then
local itemid = Item.GetData(shi1,%道具_ID%);
if Exp_itemid[itemid] then
itemexp1 = math.floor((baseexp*Exp_itemid[itemid])/100)
end
end
if shi2>=0 then
local itemid = Item.GetData(shi2,%道具_ID%);
if Exp_itemid[itemid] then
itemexp2 = math.floor((baseexp*Exp_itemid[itemid])/100)
end
end
local weekday = tonumber(os.date("%w"))
local weekday_exp = 0
if BattleExpPlusList[weekday] then
local hours = tonumber(os.date("%H"))
if hours >= BattleExpPlusList[weekday][1] and hours < BattleExpPlusList[weekday][2] then
weekday_exp = BattleExpPlusList[weekday][3]*baseexp
end
end
local Maptype = Char.GetData(player,%对象_地图类型%)
local MapId = Char.GetData(player,%对象_地图%)
local mapexp = -1
if Maptype == 1 then
MapId = NLG.Get_Dungeonconf_Int(player,0)
end
if MapExpRate[Maptype][MapId] then
mapexp=baseexp*MapExpRate[Maptype][MapId]
end
if mapexp==-1 then
baseexp=0
else
baseexp=baseexp+Activity_SkillExp*baseexp+GM_Exp_set[1]*baseexp+weekday_exp+mapexp+itemexp1+itemexp2+pvevalup
end
if baseexp<0 then
baseexp=0
end
return baseexp
end
function BattleSkillExpPlus(player,baseexp,skillid)
local pvevalup = 0
local pvevalbl = 0
if item_val_PVE[player] then
if item_val_PVE[player][1013] then
pvevalbl = pvevalbl + 0.1
end
if item_val_PVE[player][3013] then
pvevalbl = pvevalbl + 0.3
end
if item_val_PVE[player][4013] then
pvevalbl = pvevalbl + 0.4
end
pvevalup = pvevalup + math.floor(baseexp * pvevalbl)
end
local exprate = 1+GM_Exp_set[2]
local weekday = tonumber(os.date("%w"))
if SkillExpPlusList[weekday] then
local hours = tonumber(os.date("%H"))
if hours >= SkillExpPlusList[weekday][1] and hours < SkillExpPlusList[weekday][2] then
exprate = exprate + SkillExpPlusList[weekday][3]
end
end
baseexp=baseexp*exprate+pvevalup
--NLG.SystemMessage(player,"技能经验倍率:"..exprate)
return baseexp
end
function ProductSkillExpPlus(player,baseexp,skillid)
local exprate = 1+GM_Exp_set[3]
local weekday = tonumber(os.date("%w"))
if ProductExpPlusList[weekday] then
local hours = tonumber(os.date("%H"))
if hours >= ProductExpPlusList[weekday][1] and hours < ProductExpPlusList[weekday][2] then
exprate = exprate + ProductExpPlusList[weekday][3]
end
end
--NLG.SystemMessage(player,"生产经验倍率:"..exprate)
return baseexp*exprate
end
|
|