- local msg = "";
- local Msg = "";
- local pet_index = "";
- local selectitem = "";
- local m = "";
- local X = "";
- local biao = {};
- table.insert(biao,1, "你好!!年轻人,欢迎使用宠物算档系统,俺可以瞬间计算出你所选择宠物的档位排布哟!!你确定要计算你的宠物档位么?!!.....");
- table.insert(biao,2, "我马上要给你的宠物算档了哟.......\\n请在下表选择你的宠物!...");
- table.insert(biao,3, "你好!!年轻人,欢迎使用宠物重生系统,俺可以将非1级宠物重置为1级,也可以将1级宠物档位重新排布哟!!!你确定要重生你的宠物么?!!......");
- table.insert(biao,4, "你确定要重生你的宠物么?!!!............\\n那么请在下表选择你的宠物!...");
- table.insert(biao,5, "你好!!年轻人,欢迎使用宠物满档系统,俺可以瞬间将你的宠物重置为满档!!非1级的宠物重置满档后会变成1级哟,你确定要重置你的宠物为满档么?!!......");
- table.insert(biao,6, "请你准备好呀,嗖的一下,你的宠物就可以满档!..\\n请在下表选择你的宠物!...");
- table.insert(biao,7, "您确定要进行宠物算档么?!!......");
- table.insert(biao,8, "您确定要进行宠物重生么?!!......");
- table.insert(biao,9, "您确定要进行宠物满档么?!!......");
-
-
- local Biao = {};
- table.insert(Biao,1, "一");
- table.insert(Biao,2, "二");
- table.insert(Biao,3, "三");
- table.insert(Biao,4, "四");
- table.insert(Biao,5, "五");
-
- local biaO = {};
- table.insert(biaO,8, "』已经重生了哟!");
- table.insert(biaO,9, "』已经满档了哟!");
-
- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
- Delegate.RegInit("PetRebirth_Init");
-
- function PetRebirth_Init()
- PetRebirth_Creat();
- end
-
- function InitFuncName()
- return true;
- end
-
- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
- function PetRebirth_Creat()
- if (PetRebirth_index == nil) then
- PetRebirth_index = NL.CreateNpc(nil, "InitFuncName");
- Char.SetData(PetRebirth_index, %对象_形象%, 231088);
- Char.SetData(PetRebirth_index, %对象_原形%, 231088);
- Char.SetData(PetRebirth_index, %对象_MAP%, 0);
- Char.SetData(PetRebirth_index, %对象_地图%, 1000);
- Char.SetData(PetRebirth_index, %对象_X%, 228);
- Char.SetData(PetRebirth_index, %对象_Y%, 83);
- Char.SetData(PetRebirth_index, %对象_方向%, %右下%);
- Char.SetData(PetRebirth_index, %对象_原名%, "宠物大师");
- NLG.UpChar(PetRebirth_index);
- if (Char.SetTalkedEvent(nil, "PetRebirth_Talked", PetRebirth_index) < 0) then
- print("PetRebirth_Talked 注册事件失败。");
- return false;
- end
- if (Char.SetWindowTalkedEvent(nil, "PetRebirth_WindowTalked", PetRebirth_index) < 0) then
- print("PetRebirth_WindowTalked 注册事件失败。");
- return false;
- end
- end
- end
-
- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
- function PetRebirth_Talked( _MePtr,_TalkPtr)
- if (NLG.CanTalk(_MePtr,_TalkPtr) == true) then
- msg = "3\\n 你好!!亲爱的["..Char.GetData(_TalkPtr,%对象_原名%).."],请选择你要办理的业务吧!!!......"..NLG.c("\\n\\n宠物算档".."\\n\\n宠物重生".."\\n\\n宠物满档");
- NLG.ShowWindowTalked(_TalkPtr, _MePtr, %窗口_选择框%, %按钮_关闭%,1,msg);
- end
- end
-
- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
- function PetRebirth_WindowTalked(_MePtr,_TalkPtr,_Seqno,_Select,_Data)
- selectitem = tonumber(_Data)-1;
-
-
- if (_Select == 2 or _Select == "2") and _Data ~= nil then
- return;
- elseif _Seqno == 1 and (_Select ~= 2 and _Select ~= "2") and _Data ~= nil then
- if selectitem == 0 then
- m = 7;
- elseif selectitem == 2 then
- m = 8;
- elseif selectitem == 4 then
- m = 9;
- end
- mSg = "\\n"..biao[m].."\\n"
- Msg = "3\\n"..biao[tonumber(_Data)+1].."\\n\\n";
- msg = "\\n "..biao[tonumber(_Data)];
- NLG.ShowWindowTalked(_TalkPtr, _MePtr, %窗口_选择框%,%按钮_上下取消%,2,msg);
- elseif _Seqno == 2 and (_Select == 16 or _Select == "16") and _Data ~= nil then
- return PetRebirth_Talked( _MePtr,_TalkPtr);
- elseif _Seqno == 2 and (_Select == 32 or _Select == "32") and _Data ~= nil then
- for i=0,4 do
- local pet = Char.GetPet(_TalkPtr,i);
- if(VaildChar(pet) == false) then
- Msg = Msg.. " 空\\n";
- else
- Msg = Msg.." "..Char.GetData(pet,%对象_原名%).."\\n";
- end
- end
- NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_上取消%,3,Msg);
-
-
- elseif _Seqno == 3 and (_Select == 0 or _Select == "0") and _Data ~= nil then
-
- X = tonumber(_Data);
- pet_index = Char.GetPet(_TalkPtr,selectitem);
- if (selectitem == nil or (selectitem ~= nil and (selectitem > 4 or selectitem < 0))) then
- NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_上取消%,4,"\\n您所选择的位置不正常!");
- elseif (VaildChar(pet_index) == false) then
- NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_上取消%,5,"\\n请确定您对应的宠物栏有宠物!");
- elseif (selectitem ~= nil and (selectitem >=0 and selectitem <= 4)) then
- NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_是否%,6,mSg);
- end
-
- elseif _Seqno == 3 and (_Select == 16 or _Select == "16") and _Data ~= nil then
- return NLG.ShowWindowTalked(_TalkPtr, _MePtr, %窗口_选择框%,%按钮_上下取消%,2,msg);
- elseif (_Seqno == 4 or _Seqno == 5) and (_Select == 16 or _Select == "16") and _Data ~= nil then
- return NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_上取消%,3,Msg);
- elseif _Seqno == 6 and (_Select == 8 or _Select == "8") and _Data ~= nil then
- return;
- elseif _Seqno == 6 and (_Select == 4 or _Select == "4") and _Data ~= nil then
- if m == 7 and (selectitem >=0 and selectitem <= 4) then
- local arr_rank1 = Pet.GetArtRank(pet_index,%宠档_体成%);
- local arr_rank11 = Pet.FullArtRank(pet_index,%宠档_体成%);
- local arr_rank2 = Pet.GetArtRank(pet_index,%宠档_力成%);
- local arr_rank21 = Pet.FullArtRank(pet_index,%宠档_力成%);
- local arr_rank3 = Pet.GetArtRank(pet_index,%宠档_强成%);
- local arr_rank31 = Pet.FullArtRank(pet_index,%宠档_强成%);
- local arr_rank4 = Pet.GetArtRank(pet_index,%宠档_敏成%);
- local arr_rank41 = Pet.FullArtRank(pet_index,%宠档_敏成%);
- local arr_rank5 = Pet.GetArtRank(pet_index,%宠档_魔成%);
- local arr_rank51 = Pet.FullArtRank(pet_index,%宠档_魔成%);
- local a1 = math.abs(arr_rank1 - arr_rank11);
- local a2 = math.abs(arr_rank2 - arr_rank21);
- local a3 = math.abs(arr_rank3 - arr_rank31);
- local a4 = math.abs(arr_rank4 - arr_rank41);
- local a5 = math.abs(arr_rank5 - arr_rank51);
- local a6 = a1 + a2+ a3+ a4+ a5;
- local a11 = math.abs(arr_rank11);
- local a21 = math.abs(arr_rank21);
- local a31 = math.abs(arr_rank31);
- local a41 = math.abs(arr_rank41);
- local a51 = math.abs(arr_rank51);
- local a61 = a11 + a21+ a31+ a41+ a51;
- local a12 = math.abs(arr_rank1);
- local a22 = math.abs(arr_rank2);
- local a32 = math.abs(arr_rank3);
- local a42 = math.abs(arr_rank4);
- local a52 = math.abs(arr_rank5);
- local a62 = a12 + a22+ a32+ a42+ a52;
- if(a6 == 0) then
- msg = "\\n宠物名:"..Char.GetData(pet_index,%对象_名字%).."\\n".."\\n\\n恭喜你!!!\\n\\n该宠物总掉档数: 掉["..a6.."]档\\n";
- else
- msg = "\\n宠 物 名: "..Char.GetData(pet_index,%对象_名字%)..""
- .."\\n体力档数: -"..a1.." 档 ("..a12.."/"..a11..") "
- .."\\n力量档数: -"..a2.." 档 ("..a22.."/"..a21..") "
- .."\\n防御档数: -"..a3.." 档 ("..a32.."/"..a31..")"
- .."\\n敏捷档数: -"..a4.." 档 ("..a42.."/"..a41..")"
- .."\\n魔法档数: -"..a5.." 档 ("..a52.."/"..a51..")"
- .."\\n最 高: "..a61.." 档 "
- .."\\n当 前: "..a62.." 档 "
- .."\\n掉 档 数: "..a6.." 档\\n";
- end
- NLG.ShowWindowTalked(_TalkPtr, _MePtr,%窗口_选择框%,%按钮_确定%,7,msg);
- elseif (m == 8 or m==9) and (selectitem >=0 and selectitem <= 4) then
- if m == 8 then
- Pet.SetArtRank(pet_index,%宠档_体成%,Pet.FullArtRank(pet_index,%宠档_体成%) - math.random(0,4));
- Pet.SetArtRank(pet_index,%宠档_力成%,Pet.FullArtRank(pet_index,%宠档_力成%) - math.random(0,4));
- Pet.SetArtRank(pet_index,%宠档_强成%,Pet.FullArtRank(pet_index,%宠档_强成%) - math.random(0,4));
- Pet.SetArtRank(pet_index,%宠档_敏成%,Pet.FullArtRank(pet_index,%宠档_敏成%) - math.random(0,4));
- Pet.SetArtRank(pet_index,%宠档_魔成%,Pet.FullArtRank(pet_index,%宠档_魔成%) - math.random(0,4));
- Pet.ReBirth(_TalkPtr,pet_index);
- Pet.UpPet(_TalkPtr,pet_index);
- elseif m == 9 then
- Pet.SetArtRank(pet_index,%宠档_体成%,Pet.FullArtRank(pet_index,%宠档_体成%));
- Pet.SetArtRank(pet_index,%宠档_力成%,Pet.FullArtRank(pet_index,%宠档_力成%));
- Pet.SetArtRank(pet_index,%宠档_强成%,Pet.FullArtRank(pet_index,%宠档_强成%));
- Pet.SetArtRank(pet_index,%宠档_敏成%,Pet.FullArtRank(pet_index,%宠档_敏成%));
- Pet.SetArtRank(pet_index,%宠档_魔成%,Pet.FullArtRank(pet_index,%宠档_魔成%));
- Pet.ReBirth(_TalkPtr, pet_index);
- Pet.UpPet(_TalkPtr,pet_index);
- end
- msg = NLG.c("\\n\\n\\n\\n\\n您选择的第" ..Biao[X].. "栏宠物『"..Char.GetData(pet_index,%对象_名字%)..biaO[m]);
- NLG.ShowWindowTalked(_TalkPtr,_MePtr,%窗口_选择框%,%按钮_确定%,8,msg);
- msg = "[系统]您选择的第"..Biao[X].."栏宠物『"..Char.GetData(pet_index,%对象_名字%)..biaO[m];
- NLG.SystemMessage(_TalkPtr,msg)
- end
- end
- end
- --print("Seqno:".._Seqno.." Select:".._Select.." Data:".._Data.." selectitem:"..selectitem.." m:"..m.." pet_index:"..pet_index.." X:"..X.." BiaoX:"..Biao[tonumber(X)].." Biaom:"..biaO[tonumber(m)])
复制代码
|