烈焰私服之超级元宝之家NPC代码
function ontalk2044(npc,event,player)
player:echo(0,npc:GetLowGUID(),[[
#&talk_line#&
刷新时间:
除死亡之王外地图内所有BOSS刷新时间为15分钟
死亡之王刷新时间:1小时
爆率与其他地图相同的BOSS一致
地图内本身不大,禁止随机
#&talk_line#&
V1-V5进入需要5万元宝
V6-V9进入需要2万元宝
V10或以上免费进入
<u><a href='event:M2402,1'>点击进入超级BOSS之家</a></u>
]]);
end
function onTalk2044_1(npc,event,player)
if player:get_player_type()<=5 and player:get_vcoin()>=50000 then
player:sub_vcoin(50000);
player:randomthismap(98);
g_alert("玩家[<font color='#FF0000'>"..player:GetName().."</font>]进入了超级BOSS之家",2,1000,0,1);
elseif (player:get_player_type()<=9 and player:get_player_type()>=6) and player:get_vcoin()>=20000 then
player:sub_vcoin(20000);
player:randomthismap(98);
g_alert("玩家[<font color='#FF0000'>"..player:GetName().."</font>]进入了超级BOSS之家",2,1000,0,1);
elseif player:get_player_type()>=10 then
player:randomthismap(98);
g_alert("玩家[<font color='#FF0000'>"..player:GetName().."</font>]进入了超级BOSS之家",2,1000,0,1);
else
player:alert(10,0,0,"条件不满足,元宝不足");
ontalk2044(npc,0,player,0);
end
end
Npc2044Funid =
{
[0] = ontalk2044;
[1] = onTalk2044_1;
}
function CreatureNpcFun(npc,event,player,funid)
if Npc2044Funid[funid] ~= nil then
Npc2044Funid[funid](npc,event,player);
end
end
RegisterUnitEvent(2044,20,"ontalk2044")
RegisterUnitEvent(2044,29,"CreatureNpcFun")
前面我们介绍了如何定时定点刷新元宝BOSS。那么现在我们就要建立一个烈焰NPC,这样玩家才能点击后进入该元宝之家地图.
要想使NPC生效显示并与客户端交互,我们需要在烈焰数据库的creature_proto,creature_staticspawns这2表增加NPC的数据.
不然是无法让NPC正确的显示和触发