在所有石器时代私服的监狱(迷宫)里,都是出去的NPC都是收走身上1/10的石币才让你出去,我记忆里官方的监狱都是需要仙人钓竿才能出去,于是乎用ablua写一个仿官方收仙人钓竿才能出去的NPC。
--NPC对话事件(NPC索引)function Talked(meindex, talkerindex , szMes, color ) if npc.isFaceToFace(meindex, talkerindex) == 1 then token = " 『" .. char.getChar(meindex, "名字") .. "』\n\n" .. " 你想通过监狱吗?" .. "\n\n 给我一个仙人钓竿才让你出去!" lssproto.windows(talkerindex, "对话框", "确定|取消", 1, char.getWorkInt( meindex, "对象"), token) end end--NPC窗口事件(NPC索引)function WindowTalked ( meindex, talkerindex, seqno, select, data) if npc.isFaceToFace(meindex, talkerindex) == 1 then if seqno == 1 then if select == 1 then --这一句判断调用的是普通脚本FREE的条件 if npc.Free(meindex, talkerindex, "ITEM="..needitem) == 1 then npc.DelItem(talkerindex, needitem.."*1") char.WarpToSpecificPoint(talkerindex, 3000, 94, 97) else char.TalkToCli(talkerindex, meindex, "没有仙人钓竿,无法通过!", "红色") end end end end end function Create(name, metamo, floor, x, y, dir) npcindex = npc.CreateNpc(name, metamo, floor, x, y, dir) char.setFunctionPointer(npcindex, "对话事件", "Talked", "") char.setFunctionPointer(npcindex, "窗口事件", "WindowTalked", "")end function data() --所需要的物品(仙人钓竿) needitem = 2432end function main() data() Create("监狱的通关处", 16204, 117, 4, 5, 4)end
效果图如下: