如何精简你的烈焰装备提示脚本文件
发表时间:2017-12-01 12:47点击人气:责任编辑:admin
烈焰服务端的掉落提示脚本文件在 X:\GameServer\scripts\init.lua3 X代表你烈焰服务端所在的盘符.
所有烈焰服务端的脚本文件都必须使用支持UTF-8编码的软件打开,服务器自带的记事本是不可以打开编辑的,会造成运行后浏览脚本对话乱码.
下面我们随便摘了一段代码过来作为演示.
if itemid == 100215 then
g_alert("<font color='#FFFF00'>玩家</font><font color='#84C1FF'>"..player:GetName().."</font><font color='#FFFF00'>在</font><font color='#84C1FF'>"..MapIdToMapName[player:GetMapId()].."</font><font color='#FFFF00'>击杀</font><font color='#84C1FF'>"..mon:GetName().."</font><font color='#FFFF00'>掉落了</font><font color='#84C1FF'>魂天靴子</font>",2,1000,0,1);
return;
end
大家可以看到,原始的烈焰服务端掉落提示文件里的掉落提示 都是根据itemid 来写的,每个ITEMID一个提示语句,这样对于数据量庞大的服务端来说,工作量真的是不可小觑啊.那有没有什么办法修改下呢.当然有.
MapIdToMapName =
{
[10] = "迷雾小径";
[11] = "卧龙村";
[12] = "烈焰城";
[13] = "荒漠皇城";
[14] = "红名村";
[15] = "沙漠土城";
[50] = "九幽海域(50级)";
[51] = "九幽海域(60级)";
[52] = "九幽海域(70级)";
[53] = "九幽海域(80级)";
[54] = "九幽海域(飞升1阶)";
[55] = "九幽海域(飞升3阶)";
[56] = "九幽海域(飞升5阶)";
[57] = "九幽海域(飞升7阶)";
[60] = "烈焰战场";
[61] = "夺宝奇兵";
[64] = "玛雅神殿1层";
[65] = "玛雅神殿2层";
[66] = "玛雅神殿3层";
[67] = "玛雅神殿4层";
[68] = "BOSS之家1层";
[69] = "BOSS之家2层";
[161] = "死亡陵墓1层";
[162] = "死亡陵墓2层";
[163] = "死亡陵墓3层";
[171] = "诅咒寺庙1层";
[172] = "诅咒寺庙2层";
[173] = "诅咒寺庙3层";
[175] = "诅咒殿堂";
[181] = "牛魔洞1层";
[182] = "牛魔洞2层";
[183] = "牛魔洞3层";
[185] = "牛魔祭坛";
[211] = "赤血魔宫1层";
[212] = "赤血魔宫2层";
[213] = "赤血魔宫3层";
[214] = "赤血魔宫4层";
[221] = "幽冥宫殿1层";
[222] = "幽冥宫殿2层";
[223] = "幽冥宫殿3层";
[231] = "冰火地狱1层";
[232] = "冰火地狱2层";
[233] = "冰火地狱3层";
[271] = "熔岩魔狱1层";
[272] = "熔岩魔狱2层";
[273] = "熔岩魔狱3层";
[281] = "邪灵天界1层";
[282] = "邪灵天界2层";
[283] = "邪灵天界3层";
[284] = "邪灵天界4层";
[285] = "邪灵天界5层";
[291] = "魔龙深渊1层";
[292] = "魔龙深渊2层";
[293] = "魔龙深渊3层";
[294] = "魔龙深渊4层";
[295] = "魔龙深渊5层";
[296] = "魔龙深渊6层";
[297] = "魔龙深渊7层";
[311] = "镇魔殿1层";
[312] = "镇魔殿2层";
[313] = "镇魔殿3层";
[314] = "镇魔殿4层";
[315] = "镇魔殿5层";
[316] = "镇魔殿6层";
[321] = "冥界1层";
[322] = "冥界2层";
[323] = "冥界3层";
[324] = "冥界4层";
[351] = "海底世界1层";
[352] = "海底世界2层";
[353] = "海底世界3层";
[361] = "凌霄幻境1层";
[362] = "凌霄幻境2层";
[363] = "凌霄幻境3层";
[364] = "炎龙神殿1层";
[365] = "炎龙神殿2层";
[366] = "炎龙神殿3层";
[367] = "雪域冰原1层";
[368] = "雪域冰原2层";
[369] = "雪域冰原3层";
[370] = "兽皇石窟1层";
[371] = "兽皇石窟2层";
[372] = "兽皇石窟3层";
[380] = "神威魔狱1层";
[381] = "神威魔狱2层";
[382] = "神威魔狱3层";
[383] = "神威魔狱4层";
[384] = "神威魔狱5层";
[385] = "神威魔狱6层";
[386] = "神威魔狱7层";
[387] = "神威魔狱8层";
[388] = "神威魔狱9层";
[389] = "神威魔狱10层";
[390] = "神威魔狱11层";
[391] = "神威魔狱12层";
[392] = "神威魔狱13层";
[393] = "神威魔狱14层";
[400] = "牛魔洞窟【副本】";
[401] = "诅咒殿堂【副本】";
[402] = "赤血魔域【副本】";
[403] = "幽冥宫殿【副本】";
[404] = "邪灵天界【副本】";
[405] = "熔岩地狱【副本】";
[406] = "镇魔殿【副本】";
[407] = "九幽海域【副本】";
[408] = "凌霄幻境【副本】";
[409] = "炎龙神殿【副本】";
}
function OnLoot(event,player,mon,num,itemid)
g_alert("<font color='#FFFF00'>玩家</font><font color='#84C1FF'>"..player:GetName().."</font><font color='#FFFF00'>在</font><font color='#84C1FF'>"..MapIdToMapName[player:GetMapId()].."</font><font color='#FFFF00'>击杀</font><font color='#84C1FF'>"..mon:GetName().."</font><font color='#FFFF00'>掉落了</font>#&item"..itemid.."#&",2,1000,0,1);
end
RegisterServerHook(17,"OnLoot")
更改为这段代码即可包含所有会掉落提示的道具了.
- 上一篇:烈焰私服红包捐献版脚本
- 下一篇:烈焰私服服务端增加宝宝守护脚本