|
以下内容为:烈焰私服里添加修仙脚本具体步骤以及注意事项
--1、本脚本用到的用户变量 228 修仙等级;变量被用了就自己换
--
--2、添加一个NPC,这个必须的,不用说了,NPC编号不一样的自己改下边代码
--
--3、添加一个物品,物品ID: 19116 物品名称: 仙灵之花,被占用了自己改,不添加物品,会出现加入修仙后点NPC没反应的情况
--
--4、添加一类buff (编号2001-2010): playbuff表添加buff, res资源目录添加buff图标,修改nokillbuff.xml文件显示buff
--
--5、player.lua 角色死亡触发事件函数里添加以下代码(在 if killer:IsPlayer() then 代码下边):
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- if player:get_param(228)>0 and killer:get_param(228)>0 then
-- local jilv = 0;
-- math.randomseed(tostring(os.time()):reverse():sub(1, 10));
-- for i=1,5 do
-- jilv = math.random(10);
-- end
-- if jilv<=2 then
-- if player:num_bag_black() >= 1 then
-- player:add_item(19116,1,1);
-- player:alert(10,0,0,"您碰上了大机缘,获得一朵珍稀的【仙灵之花】");
-- else
-- player:alert(10,0,0,"您的背包已经满了,无法获得仙灵之花");
-- end
-- end
-- end
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--6、player.lua 角色上线触发事件函数里添加上线显示称号,称号占用 5 位置;
--上线加载修仙称号BUFF
-- if param228>0 then
-- if param228==1 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>炼气★</font>");
-- elseif param228==2 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>筑基★</font>");
-- elseif param228==3 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>结丹★</font>");
-- elseif param228==4 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>元婴★</font>");
-- elseif param228==5 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>化神★</font>");
-- elseif param228==6 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>炼虚★</font>");
-- elseif param228==7 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>合体★</font>");
-- elseif param228==8 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>大乘★</font>");
-- elseif param228==9 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>渡劫★</font>");
-- elseif param228==10 then
-- player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>真仙★</font>");
-- end
-- end
--最后,感谢群里朋友提供游戏创意,顺便鄙视那些改改别人脚本就拿去卖的XXX
--***********************************************************************************--
function ontalk2803(npc,event,player)
local dj228 = player:get_param(228);
if dj228==0 then
player:echo(0,npc:GetLowGUID(),[[
#&talk_line#&
<h1>想成仙?太难了,太难了......
修仙路漫漫,想修成真仙获得长生,除身体要健壮,心
性要坚定之外,修仙路上强者为尊,杀戮无数,为有大
机缘之人,才能最终修成真身,获得永生!</h1>
#&talk_line#&
身体健壮:飞升达12级,轮回达20级
心性坚定:一心追求修真大道,永世不坠轮回
有大机缘:屠戮心术不正之人,获取提升修为之珍宝
#&talk_line#&
境界划分:下境界、中境界、上境界
下境界有:炼气、筑基、结丹、元婴、化神
中境界有:炼虚、合体、大乘
上境界其实只剩下渡劫这一层关口了,过了此层就可飞
升仙界,与天地同寿了。
#&talk_line#&
<a href='event:M2402,1'>【开启武神修仙之路】</a>
]]);
elseif dj228==1 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★炼气★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 10 <a href='event:M2402,2'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==2 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★筑基★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 20 <a href='event:M2402,3'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==3 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★结丹★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 30 <a href='event:M2402,4'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==4 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★元婴★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 40 <a href='event:M2402,5'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==5 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★化神★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 50 <a href='event:M2402,6'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==6 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★炼虚★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 60 <a href='event:M2402,7'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==7 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★合体★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 70 <a href='event:M2402,8'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==8 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★大乘★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 80 <a href='event:M2402,9'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==9 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★渡劫★</font>
#&talk_line#&
#&item19116#& 仙灵之花 X 100 <a href='event:M2402,10'>【修为进阶】</a>
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
elseif dj228==10 then
player:echo(0,npc:GetLowGUID(),[[
<img border="0" src="../res/mpsys/xx.png">
#&talk_line#&
你当前修为等级:<font color='FF6600'>★真仙★</font>
#&talk_line#&
【修为大圆满 - 与天地同寿】
仙灵之花,杀死玩家可获取,物品自动掉落背包中
商城元宝可购买.刷小号秒封.永不解封,注意行为
]]);
end
end
function ontalk2803_1(npc,event,player)
if player:get_param(258)>=12 and player:get_param(265)>=20 then
player:set_param(228,1);
player:set_status(2001,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>炼气★</font>");
player:alert(110,0,0,"你开启了修仙之路,愿你在修仙路上走得更远......");
else
player:alert(110,0,0,"哎呀,你的身体条件不行啊,飞升没满12级,轮回没满20级,无法开启修仙路");
end
return;
end
function ontalk2803_2(npc,event,player)
if player:num_item_level(19116,1) >= 10 then
player:remove_item_level(19116,10,1);
player:set_param(228,2);
player:set_status(2002,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>筑基★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:筑基");
else
player:alert(110,0,0,"你没有10朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_3(npc,event,player)
if player:num_item_level(19116,1) >= 20 then
player:remove_item_level(19116,20,1);
player:set_param(228,3);
player:set_status(2003,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>结丹★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:结丹");
else
player:alert(110,0,0,"你没有20朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_4(npc,event,player)
if player:num_item_level(19116,1) >= 30 then
player:remove_item_level(19116,30,1);
player:set_param(228,4);
player:set_status(2004,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>元婴★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:元婴");
else
player:alert(110,0,0,"你没有30朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_5(npc,event,player)
if player:num_item_level(19116,1) >= 40 then
player:remove_item_level(19116,40,1);
player:set_param(228,5);
player:set_status(2005,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>化神★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:化神");
else
player:alert(110,0,0,"你没有40朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_6(npc,event,player)
if player:num_item_level(19116,1) >= 50 then
player:remove_item_level(19116,50,1);
player:set_param(228,6);
player:set_status(2006,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>炼虚★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:炼虚");
else
player:alert(110,0,0,"你没有50朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_7(npc,event,player)
if player:num_item_level(19116,1) >= 60 then
player:remove_item_level(19116,60,1);
player:set_param(228,7);
player:set_status(2007,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>合体★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:合体");
else
player:alert(110,0,0,"你没有60朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_8(npc,event,player)
if player:num_item_level(19116,1) >= 70 then
player:remove_item_level(19116,70,1);
player:set_param(228,8);
player:set_status(2008,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>大乘★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:大乘");
else
player:alert(110,0,0,"你没有70朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_9(npc,event,player)
if player:num_item_level(19116,1) >= 80 then
player:remove_item_level(19116,80,1);
player:set_param(228,9);
player:set_status(2009,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>渡劫★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:渡劫");
else
player:alert(110,0,0,"你没有80朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
function ontalk2803_10(npc,event,player)
if player:num_item_level(19116,1) >= 100 then
player:remove_item_level(19116,100,1);
player:set_param(228,10);
player:set_status(2010,0,100,5);
player:set_name_pre(5,"<font color='#37B306'>★武神</font><font color='#ADF263'>修仙</font><font color='#F2D963'>路★</font><font color='#F2AA63'>真仙★</font>");
player:alert(110,0,0,"恭喜进阶成功,你现在等级是:真仙");
else
player:alert(110,0,0,"你没有100朵仙灵之花,天地灵气不足,提升修为失败!");
end
return;
end
Npc2803Funid =
{
[0] = ontalk2803;
[1] = ontalk2803_1;
[2] = ontalk2803_2;
[3] = ontalk2803_3;
[4] = ontalk2803_4;
[5] = ontalk2803_5;
[6] = ontalk2803_6;
[7] = ontalk2803_7;
[8] = ontalk2803_8;
[9] = ontalk2803_9;
[10] = ontalk2803_10;
}
function CreatureNpcFun(npc,event,player,funid)
if Npc2803Funid[funid] ~= nil then
Npc2803Funid[funid](npc,event,player);
end
end
RegisterUnitEvent(2803,20,"ontalk2803")
RegisterUnitEvent(2803,29,"CreatureNpcFun")
注:该烈焰私服修仙脚本的NPC代码以2803为实例,可以修改成你需要的NPC代码!
|
|