|
- program Mir2;
- var ShowStr:string;ShowNum:integer;
- EquipType : array[1..8] of string;
- Eqcolor: array[1..8] of integer;
-
- //This_Player.GetS(88,15) 个人动态显示变量勿改
- //This_Player.GetS(85,37) 个人时间设定变量勿改
- //This_Player.GetS(85,38) 个人每天抽取上限变量
- //GetG(85,31) 货币类型,此参数0为元宝,1为灵符,2为金刚石,请根据自身情况修改
- //GetG(85,32) 抽奖所需货币数量
- //GetG(85,33) 大奖几率,此参数0为完全随机,1为提高大奖几率,2为避开大奖几率
- //GetG(85,34) 避开大奖变量勿改
- //GetG(85,35) 抽奖开关
- //GetG(85,36) 服务器每天最大可抽取次数
- //GetG(85,37) 时间设定勿改
- //GetG(85,38) 服务器每天剩余抽取次数
- //GetG(85,39) 个人每天抽取上限(修改后第二天生效)
- Const DrawRandx = 80; //80%几率出每类奖励中的前3类
- Procedure _exit;
- begin
- This_Npc.CloseDialog(This_Player);
- end;
- procedure P100;
- begin
- end;
- function GetItemsName(ItemType:integer;ItemID:integer):String;
- begin
- case ItemType of //以下奖励请自行按格式增加或修改,每类奖励4个小分类,DrawRandx为小分类前3类的出现几率
- 1 : begin //武器类
- case ItemID of
- 1 : result := '银蛇,魔杖,炼狱,井中月,无极棍';
- 2 : result := '血饮,裁决之杖,骨玉权杖,龙纹剑';
- 3 : result := '怒斩,龙牙,霸者之刃';
- 4 : result := '屠龙,嗜魂法杖,逍遥扇';
- end;
- end;
-
- 2 : begin //衣服类
- case ItemID of
- 1 : result := '天师长袍';
- 2 : result := '霓裳羽衣';
- 3 : result := '圣战宝甲';
- 4 : result := '天魔神甲,法神披风,天尊道袍';
- end;
- end;
- 3 : begin //首饰类
- case ItemID of
- 1 : result := '绿色项链,灵魂项链,恶魔铃铛,黑铁头盔,力量戒指';
- 2 : result := '紫绸靴,青铜腰带';
- 3 : result := '圣战头盔,圣战戒指,圣战手镯';
- 4 : result := '钢铁腰带,避魂靴';
- end;
- end;
-
- 4 : begin //鼓励奖
- case ItemID of
- 1 : result := '50000,100000';
- 2 : result := '200000,300000';
- 3 : result := '400000,500000';
- 4 : result := '1000000';
- end;
- end;
-
- 5 : begin //元宝类(所有元宝请在数据库做好物品)
- case ItemID of
- 1 : result := '50元宝';
- 2 : result := '100元宝';
- 3 : result := '500元宝';
- 4 : result := '1000元宝';
- end;
- end;
-
- 6 : begin //灵符类(所有灵符请在数据库做好物品)
- case ItemID of
- 1 : result := '1灵符礼包,10灵符礼包';
- 2 : result := '20灵符礼包,50灵符礼包';
- 3 : result := '100灵符礼包';
- 4 : result := '幸运灵符礼包';
- end;
- end;
-
- 7 : begin //物品类(所有物品请在数据库做好物品)
- case ItemID of
- 1 : result := '祝福油,金条';
- 2 : result := '金刚石10个';
- 3 : result := '金刚石50个';
- 4 : result := '金刚石100个';
- end;
- end;
-
- 8 : begin //大奖类
- case ItemID of
- 1 : result := '魔龙玉佩';
- end;
- end;
- end;
- end;
- function printStr(Pstr:string;Pid:integer):string;
- var len,arrlen,index,temp_len,temp_index,i:integer;
- str,temp_str:string;
- strArr:array[1..100] of string;
- begin
- str := Pstr;
- len := length(str);
- index:=1;
- for i:=1 to 100 do
- begin
- temp_str:= copy(str,index,len);
- temp_len := length(temp_str);
- temp_index := pos(',',temp_str);
- if temp_index = 0 then
- begin
- strArr[i] := copy(temp_str,0,temp_len);
- arrlen:=i; break;
- end else
- strArr[i] := copy(temp_str,0,temp_index-1);
- index := index + temp_index;
- end
- result:=strArr[Pid];
- end;
- function LastStrIdx(Lstr:string):integer;
- var temp_str:string;l,temp_index:integer;
- begin
- temp_str:=Lstr;
- for l:=1 to 100 do
- begin
- if printStr(Lstr,l) = '' then
- break;
- temp_index:=l-1;
- end;
- result:=temp_index;
- end;
- procedure OnInitialize;
- var il:integer;
- begin
- if GetG(85,31) < 1 then SetG(85,31,0);
- if GetG(85,32) < 1 then SetG(85,32,1); //第一次打开默认货币数量为1个
- if GetG(85,33) < 1 then SetG(85,33,0);
- if GetG(85,36) < 1 then SetG(85,36,1000);
- if GetG(85,39) < 1 then SetG(85,39,100); //第一次打开默认个人上限为100
- EquipType[1]:='武 器';
- EquipType[2]:='衣 服';
- EquipType[3]:='首 饰';
- EquipType[4]:='鼓 励 奖';
- EquipType[5]:='元 宝';
- EquipType[6]:='灵 符';
- EquipType[7]:='物 品';
- EquipType[8]:='大 奖';
-
- case GetG(85,31) of
- 0 : begin
- ShowStr:='元宝';
- ShowNum:=This_Player.YBNum;
- end;
- 1 : begin
- ShowStr:='灵符';
- ShowNum:=This_Player.MyLFnum;
- end;
- 2 : begin
- ShowStr:='金刚石';
- ShowNum:=This_Player.MyDiamondnum;
- end;
- end;
-
- for il:=1 to 8 do
- begin
- Eqcolor[il] := 250;
- end;
- end;
- procedure _GmPage;
- var LiStr,BiStr,DiStr,GiStr:string;
- begin
- if GetG(85,34) = 1 then
- begin
- LiStr:='<是/@SetDraw~34>';
- end else
- LiStr:='<否/@SetDraw~34>';
-
- if GetG(85,35) = 1 then
- begin
- BiStr:='<关闭中/@SetDraw~35>';
- end else
- BiStr:='<已开启/@SetDraw~35>';
-
- case GetG(85,31) of
- 0 : begin GiStr:='元宝'; end;
- 1 : begin GiStr:='灵符'; end;
- 2 : begin GiStr:='金刚石'; end;
- end;
-
- case GetG(85,33) of
- 0 : begin DiStr:='完全随机'; end;
- 1 : begin DiStr:='提高大奖'; end;
- 2 : begin DiStr:='避开大奖'; end;
- end;
-
- This_Npc.NpcDialog(This_Player,
- '当前<抽奖功能/fcolor=254>状态(点击修改):['+BiStr+']|'+
- '<━━━━━━━━━━━━━━━━━━━━━/fcolor=5>|'+
- '大奖后<是否自动开启避开/fcolor=254>大奖:['+LiStr+']|'+
- '<━━━━━━━━━━━━━━━━━━━━━/fcolor=5>|'+
- '个人每天<抽取上限/fcolor=254>:[<'+inttostr(GetG(85,39))+'/@HumTopLim>]|'+
- '全区次数(<剩余/fcolor=254>/<上限/fcolor=254>) <'+inttostr(GetG(85,38))+'> /<'+inttostr(GetG(85,36))+'/@DrawAll>^^^[<重置剩余/@ResetDraw>]|'+
- '<━━━━━━━━━━━━━━━━━━━━━/fcolor=5>|'+
- '当前<大奖几率/fcolor=254>为:[<'+DiStr+'/@Drawrand~33>]|'+
- '参数:<完全随机/fcolor=22>、<提高大奖/fcolor=22>、<避开大奖/fcolor=22>|'+
- '<━━━━━━━━━━━━━━━━━━━━━/fcolor=5>|'+
- '当前<货币类型/fcolor=254>为:[<'+GiStr+'/@Drawrand~31>]|'+
- '参数:<元宝/fcolor=22>、<灵符/fcolor=22>、<金刚石/fcolor=22>|'+
- '当前抽奖所需<货币数量/fcolor=254>:[<'+inttostr(GetG(85,32))+'/@DrawNum>]|'+
- '{cmd}<重置他人当日剩余/@ResetOther><返回主页/@main>');
- end;
- procedure ShowDialog;
- var GMShowStr:string;today:integer;
- begin
- if GetG(85,35) = 1 then
- begin
- if This_Player.GMLevel > 0 then
- begin
- _GmPage;
- end else
- This_NPC.InputDialog(This_Player,' 抽奖暂未开放!',1,100);exit;
- end;
- if This_Player.GMLevel > 0 then GMShowStr:='{cmd}<GM管理界面/@GmPage>';
-
- today:=GetDateNum(GetNow);
- if This_Player.GetS(85,37) <> today then
- begin
- This_Player.SetS(85,37,today);
- This_Player.SetS(85,38,GetG(85,39));
- end;
-
- if GetG(85,37) <> today then
- begin
- SetG(85,37,today);
- SetG(85,38,GetG(85,36));
- end;
-
- OnInitialize;
- This_Npc.NpcDialog(This_Player,
- ' ┏━━━━┳━━━━┳━━━━┓|'+
- ' ┃<'+EquipType[1]+'/fcolor='+inttostr(Eqcolor[1])+'>^ ┃<'+EquipType[2]+'/fcolor='+inttostr(Eqcolor[2])+'>^ ┃<'+EquipType[3]+'/fcolor='+inttostr(Eqcolor[3])+'>^┃|'+
- ' ┣━━━━╋━━━━╋━━━━┫|'+
- ' ┃<'+EquipType[8]+'/fcolor='+inttostr(Eqcolor[8])+'>^ ┃<[抽★奖]/@Drawluck>^ ┃<'+EquipType[4]+'/fcolor='+inttostr(Eqcolor[4])+'>^┃|'+
- ' ┣━━━━╋━━━━╋━━━━┫|'+
- ' ┃<'+EquipType[7]+'/fcolor='+inttostr(Eqcolor[7])+'>^ ┃<'+EquipType[6]+'/fcolor='+inttostr(Eqcolor[6])+'>^ ┃<'+EquipType[5]+'/fcolor='+inttostr(Eqcolor[5])+'>^┃|'+
- ' ┗━━━━┻━━━━┻━━━━┛|'+
- '全区每天最多可抽取 <'+inttostr(GetG(85,38))+'> /<'+inttostr(GetG(85,36))+'/fcolor=251> 次|'+
- '每人每天只能抽取 <'+inttostr(GetG(85,39))+'/fcolor=254> 次,每次需 <'+inttostr(GetG(85,32))+'/fcolor=254> '+ShowStr+'|'+
- '你当前剩余次数:<'+inttostr(This_Player.GetS(85,38))+'/fcolor=70>^'+ShowStr+'数量:<'+inttostr(ShowNum)+'/fcolor=70>|'+GMShowStr);
- end;
- procedure _SetDraw(GStr:string);
- begin
- if GetG(85,StrToInt(GStr)) = 1 then
- begin
- SetG(85,StrToInt(GStr),0);
- _GmPage;
- end else
- SetG(85,StrToInt(GStr),1);
- _GmPage;
- end;
- procedure _ResetDraw;
- begin
- SetG(85,38,GetG(85,36));
- _GmPage;
- This_NPC.InputDialog(This_Player,' 修改成功!',1,100);
- end;
- procedure _HumTopLim;
- begin
- This_NPC.InputDialog(This_Player,'请输入您要设置的个人上限数量',0,114);
- end;
- procedure P114;
- begin
- SetG(85,39,StrToIntDef(This_NPC.InputStr,-1));
- _GmPage;
- This_NPC.InputDialog(This_Player,' 修改成功!',1,100);
- end;
- procedure _ResetOther;
- begin
- This_NPC.InputDialog(This_Player,'请输入您要重置的玩家名字 可输入自己名字',0,113);
- end;
- procedure P113;
- var ClearName:string;
- begin
- ClearName:=This_NPC.InputStr;
- if This_Player.FindPlayer(ClearName) then
- begin
- This_Player.FindPlayerByName(ClearName).SetS(85,38,100);
- This_NPC.InputDialog(This_Player,'您已成功重置了'+ClearName+'今日的抽奖次数!',1,100);
- end else
- This_NPC.InputDialog(This_Player,'重置失败!'+ClearName+'当前不在线!',1,100);
- end;
- procedure _DrawNum;
- begin
- This_NPC.InputDialog(This_Player,'请输入您要设置的全区上限数量',0,112);
- end;
- procedure P112;
- begin
- SetG(85,32,StrToIntDef(This_NPC.InputStr,-1));
- _GmPage;
- This_NPC.InputDialog(This_Player,' 修改成功!',1,100);
- end;
- procedure _DrawAll;
- begin
- This_NPC.InputDialog(This_Player,'请输入您要设置的全区上限数量',0,111);
- end;
- procedure P111;
- begin
- SetG(85,36,StrToIntDef(This_NPC.InputStr,-1));
- _GmPage;
- This_NPC.InputDialog(This_Player,' 修改成功!',1,100);
- end;
- procedure _Drawrand(GStr:string);
- begin
- if GetG(85,StrToInt(GStr)) = 0 then
- begin
- SetG(85,StrToInt(GStr),1);
- _GmPage;exit;
- end;
-
- if GetG(85,StrToInt(GStr)) = 1 then
- begin
- SetG(85,StrToInt(GStr),2);
- _GmPage;exit;
- end;
-
- if GetG(85,StrToInt(GStr)) = 2 then
- begin
- SetG(85,StrToInt(GStr),0);
- _GmPage;exit;
- end;
- end;
- procedure GiveExpPrize(Pstr:string);
- var ExpNum:integer;
- begin
- ExpNum:=StrToIntDef(Pstr,0);
- This_Player.Give('经验',ExpNum);
- ServerSay('恭喜玩家【'+This_Player.Name+'】抽奖获得了'+inttostr(ExpNum)+'经验!',3);
- This_NPC.InputDialog(This_Player,' 恭喜你获得了'+inttostr(ExpNum)+'经验!',1,100);exit;
- end;
- procedure _Drawluck;
- var i,c,ia,DrawRandNum:integer;
- begin
- This_Player.SetS(88,15,0);
- if GetG(85,35) = 1 then
- begin
- This_NPC.InputDialog(This_Player,' 抽奖功能已被关闭!',1,100);exit;
- end;
- case GetG(85,31) of
- 0 : begin
- if This_Player.YBNum < GetG(85,32) then
- begin
- This_NPC.InputDialog(This_Player,' 你的元宝不足无法抽取!',1,100);exit;
- end;
- end;
- 1 : begin
- if This_Player.MyLFnum < GetG(85,32) then
- begin
- This_NPC.InputDialog(This_Player,' 你的灵符不足无法抽取!',1,100);exit;
- end;
- end;
- 2 : begin
- if This_Player.MyDiamondnum < GetG(85,32) then
- begin
- This_NPC.InputDialog(This_Player,' 你的金刚石不足无法抽取!',1,100);exit;
- end;
- end;
- end;
-
- if GetG(85,36) < 1 then
- begin
- This_NPC.InputDialog(This_Player,' 服务器当前抽奖次数已到达限制!',1,100);exit;
- end;
-
- if This_Player.GetS(85,38) < 1 then
- begin
- This_NPC.InputDialog(This_Player,' 你今天已无法再抽取!',1,100);exit;
- end;
-
- case GetG(85,33) of
- 0 : begin DrawRandNum:=random(10)+10; end;
- 1 : begin DrawRandNum:=random(4)+8; end;
- 2 : begin DrawRandNum:=random(8)+9; end;
- end;
- for i := 1 to DrawRandNum do
- begin
- for ia:=1 to 8 do
- begin
- Eqcolor[ia] := 250;
- end;
- c:=random(15)+241;
- if This_Player.GetS(88,15) = 8 then
- begin
- This_Player.SetS(88,15,1);
- Eqcolor[This_Player.GetS(88,15)]:=249;
- This_Npc.NpcDialog(This_Player,
- ' <┏━━━━┳━━━━┳━━━━┓/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[1]+'/fcolor='+inttostr(Eqcolor[1])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[2]+'/fcolor='+inttostr(Eqcolor[2])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[3]+'/fcolor='+inttostr(Eqcolor[3])+'>^<┃/fcolor='+inttostr(c)+'>|'+
- ' <┣━━━━╋━━━━╋━━━━┫/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[8]+'/fcolor='+inttostr(Eqcolor[8])+'>^< ┃/fcolor='+inttostr(c)+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[4]+'/fcolor='+inttostr(Eqcolor[4])+'>^< ┃/fcolor='+inttostr(c)+'>|'+
- ' <┣━━━━╋━━━━╋━━━━┫/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[7]+'/fcolor='+inttostr(Eqcolor[7])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[6]+'/fcolor='+inttostr(Eqcolor[6])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[5]+'/fcolor='+inttostr(Eqcolor[5])+'>^<┃/fcolor='+inttostr(c)+'>|'+
- ' <┗━━━━┻━━━━┻━━━━┛/fcolor='+inttostr(c)+'>|');
- end
- else
- begin
- This_Player.SetS(88,15,This_Player.GetS(88,15)+1);
- Eqcolor[This_Player.GetS(88,15)]:=249;
- This_Npc.NpcDialog(This_Player,
- ' <┏━━━━┳━━━━┳━━━━┓/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[1]+'/fcolor='+inttostr(Eqcolor[1])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[2]+'/fcolor='+inttostr(Eqcolor[2])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[3]+'/fcolor='+inttostr(Eqcolor[3])+'>^<┃/fcolor='+inttostr(c)+'>|'+
- ' <┣━━━━╋━━━━╋━━━━┫/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[8]+'/fcolor='+inttostr(Eqcolor[8])+'>^< ┃/fcolor='+inttostr(c)+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[4]+'/fcolor='+inttostr(Eqcolor[4])+'>^< ┃/fcolor='+inttostr(c)+'>|'+
- ' <┣━━━━╋━━━━╋━━━━┫/fcolor='+inttostr(c)+'>|'+
- ' <┃/fcolor='+inttostr(c)+'><'+EquipType[7]+'/fcolor='+inttostr(Eqcolor[7])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[6]+'/fcolor='+inttostr(Eqcolor[6])+'>^< ┃/fcolor='+inttostr(c)+'><'+EquipType[5]+'/fcolor='+inttostr(Eqcolor[5])+'>^<┃/fcolor='+inttostr(c)+'>|'+
- ' <┗━━━━┻━━━━┻━━━━┛/fcolor='+inttostr(c)+'>|');
- end;
- end;
-
- case GetG(85,31) of
- 0 : begin This_Player.PsYBConsum(This_NPC,'DeBugYB',20051,GetG(85,32),1); end;
- 1 : begin This_Player.DecLF(0,GetG(85,32),false); end;
- 2 : begin This_Player.TakeDiamond(GetG(85,32),this_npc); end;
- end;
-
- SetG(85,38,GetG(85,38)-1);
- This_Player.SetS(85,38,This_Player.GetS(85,38)-1);
- This_Npc.NpcDialog(This_Player,
- ' ┏━━━━┳━━━━┳━━━━┓|'+
- ' ┃<'+EquipType[1]+'/fcolor='+inttostr(Eqcolor[1])+'>^ ┃<'+EquipType[2]+'/fcolor='+inttostr(Eqcolor[2])+'>^ ┃<'+EquipType[3]+'/fcolor='+inttostr(Eqcolor[3])+'>^┃|'+
- ' ┣━━━━╋━━━━╋━━━━┫|'+
- ' ┃<'+EquipType[8]+'/fcolor='+inttostr(Eqcolor[8])+'>^ ┃<[抽★奖]/@Drawluck>^ ┃<'+EquipType[4]+'/fcolor='+inttostr(Eqcolor[4])+'>^┃|'+
- ' ┣━━━━╋━━━━╋━━━━┫|'+
- ' ┃<'+EquipType[7]+'/fcolor='+inttostr(Eqcolor[7])+'>^ ┃<'+EquipType[6]+'/fcolor='+inttostr(Eqcolor[6])+'>^ ┃<'+EquipType[5]+'/fcolor='+inttostr(Eqcolor[5])+'>^┃|'+
- ' ┗━━━━┻━━━━┻━━━━┛|'+
- '全区每天最多可抽取 <'+inttostr(GetG(85,38))+'> /<'+inttostr(GetG(85,36))+'/fcolor=251> 次|'+
- '每人每天只能抽取 <'+inttostr(GetG(85,39))+'/fcolor=254> 次,每次需 <'+inttostr(GetG(85,32))+'/fcolor=254> '+ShowStr+'|'+
- '你当前剩余次数:<'+inttostr(This_Player.GetS(85,38))+'/fcolor=70>^'+ShowStr+'数量:<'+inttostr(ShowNum)+'/fcolor=70>|');
- This_Player.CallOut(This_Npc, 1, 'TrueGiveReward');
- end;
- procedure TrueGiveReward;
- var i,r,inum:integer;
- PrizeName:string;
- begin
- i:=This_Player.GetS(88,15);
- if DrawRandx >= random(100) then
- begin
- r:=random(3)+1;
- end else
- begin
- r:=4;
- end;
-
- if i = 8 then
- begin
- r:=1;
- if GetG(85,34) = 1 then SetG(85,33,2);
- end;
- inum:=LastStrIdx(GetItemsName(i,r));
- inum:=random(inum)+1;
- PrizeName:=printStr(GetItemsName(i,r),inum);
-
- if i = 4 then
- begin
- GiveExpPrize(PrizeName); exit;
- end;
-
- This_Player.Give(PrizeName,1);
- ServerSay('恭喜玩家【'+This_Player.Name+'】抽奖获得了'+PrizeName+'1个!',3);
- This_NPC.InputDialog(This_Player,' 恭喜你获得了'+PrizeName+'1个!',1,100);exit;
- end;
- Begin
- ShowDialog;
- end.
复制代码
|
上一篇:传奇改变天气脚本完整版下一篇:Call原始回收系统,循环回收脚本
|