用于战神引擎的大转盘抽奖Npc脚本带自定义素材,素材默认支持2.0,主要是用于抽取奖品的,脚本里面的自定义物品需要单独更换,因为每一个版本设置的奖品不一样,可以直接用内观素材。
部分脚本
var prizeNum,r : integer; var PointerImg : string; //定于最后指针图片变量 procedure kjjg; begin r := random(probability(10))+1; //定义生成随机数 if r = probability(1) then prizeNum :=1; //奖品1 if (r > probability(1)) and (r <= probability(2)) then prizeNum :=2; //奖品2 if (r > probability(2)) and (r <= probability(3)) then prizeNum :=3; //奖品3 if (r > probability(3)) and (r <= probability(4)) then prizeNum :=4; //奖品4 if (r > probability(4)) and (r <= probability(5)) then prizeNum :=5; //奖品5 if (r > probability(5)) and (r <= probability(6)) then prizeNum :=6; //奖品6 if (r > probability(6)) and (r <= probability(7)) then prizeNum :=7; //奖品7 if (r > probability(7)) and (r <= probability(8)) then prizeNum :=8; //奖品8 if (r > probability(8)) and (r <= probability(9)) then prizeNum :=9; //奖品9 if (r > probability(9)) and (r <= probability(10)) then prizeNum :=10; //奖品10 if This_Player.GetV(30,27) = luck then prizeNum := 1; //幸运值满时奖品强制性设置为奖品1 case prizeNum of//奖品编号 1: begin PointerImg := '1:Img:qq1797962565:16:360:320|' //1号奖品指针图片 This_Player.Give(PrizeName(1),1); //给予奖品1 This_Player.playerNotice('卧槽!卧槽!人品大爆炸中大奖!恭喜获得'+PrizeName(1)+'', 0); This_Player.SetV(30,27,0);//重置幸运值 end; 2: begin PointerImg := '1:Img:qq1797962565:19:360:320|' //2号奖品指针图片 This_Player.Give(zb_n1,1); //给予奖品2 This_Player.playerNotice('恭喜你!探寻到'+zb_n1+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 3: begin PointerImg := '1:Img:qq1797962565:13:360:320|' //3号奖品指针图片 shougu This_Player.Give(zb_n2,1); //给予奖品3 This_Player.playerNotice('恭喜你!探寻到'+zb_n2+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 4: begin PointerImg := '1:Img:qq1797962565:22:360:320|' //4号奖品指针图片 shouhun This_Player.Give(zb_n3,1); //给予奖品4 This_Player.playerNotice('恭喜你!探寻到'+zb_n3+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 5: begin PointerImg := '1:Img:qq1797962565:9:360:320|' //5号奖品指针图片 shouxue This_Player.Give(zb_n4,1); //给予奖品5 This_Player.playerNotice('恭喜你!探寻到'+zb_n4+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 6: begin PointerImg := '1:Img:qq1797962565:25:360:320|' //6号奖品指针图片 1jipingzheng This_Player.Give(zb_n5,1); //给予奖品6 This_Player.playerNotice('恭喜你!探寻到'+zb_n5+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 7: begin PointerImg := '1:Img:qq1797962565:7:360:320:|' //7号奖品指针图片 erjipingzheng This_Player.Give(zb_n6,1); //给予奖品7 This_Player.playerNotice('恭喜你!探寻到'+zb_n6+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 8: begin PointerImg := '1:Img:qq1797962565:27:360:320|' //8号奖品指针图片 This_Player.Give(zb_n7,1); //给予奖品8 This_Player.playerNotice('恭喜你!探寻到'+zb_n7+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 9: begin PointerImg := '1:Img:qq1797962565:4:360:320|' //9号奖品指针图片 tiangong This_Player.Give(zb_n8,1); //给予奖品9 This_Player.playerNotice('恭喜你!探寻到'+zb_n8+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; 10: begin PointerImg := '1:Img:qq1797962565:32:360:320|' //10号奖品指针图片 This_Player.Give(zb_n9,1); //给予奖品10 This_Player.playerNotice('恭喜你!探寻到'+zb_n9+'', 0); This_Player.SetV(30,27,This_Player.GetV(30,27)+1);//增加幸运值 end; end; This_Npc.NpcDialog(This_Player, 'Bg:qq1797962565:0|'+ 'Exit:qq1797962565:33:33:715:235|' + '1:Text:647:280:14:亲爱的<'+This_Player.name+'>欢迎来到探寻宝藏@251|'+ '1:Text:647:420:14:探宝费用:抽奖卷1张@250|'+ '1:Text:647:400:16:探宝攻略:@253|'+ '1:Text:647:300:14:探宝1次增加1点幸运值@254|'+ '1:Text:647:320:14:幸运值'+inttostr(luck)+'点满值@254|'+ '1:Text:647:340:14:幸运值越高探到宝贝的概率越高@254|'+ '1:Text:647:360:14:幸运值满必出最高级奖品【超级祝福油】@254|'+ '1:Text:647:380:14:探寻出【超级祝福油】时,幸运值重置为0@254|'+ '1:Text:647:460:16:当前幸运值:'+inttostr(This_Player.GetV(30,27))+'@249|'+ '1:Item:'+PrizeName(1)+':26:1:360:450|'+ //装备1 '1:Item:'+zb_n1+':'+tzb_n1+':1:280:420|'+ //装备2 '1:Item:'+zb_n2+':'+tzb_n2+':1:440:420|'+ //装备3 '1:Item:'+zb_n3+':'+tzb_n3+':1:232:355|'+ //装备4 '1:Item:'+zb_n4+':'+tzb_n4+':1:488:355|'+ //装备5 '1:Item:'+zb_n5+':'+tzb_n5+':1:232:282|'+ //装备6 '1:Item:'+zb_n6+':'+tzb_n6+':1:488:282|'+ //装备7 '1:Item:'+zb_n7+':'+tzb_n7+':1:280:213|'+ //装备8 '1:Item:'+zb_n8+':'+tzb_n8+':1:440:213|'+ //装备9 '1:Item:'+zb_n9+':'+tzb_n9+':1:360:185|'+ //装备10 ''+PointerImg+''+//最后指针图片 '|{cmd}</@zd>\' ); This_Player.CallOut(This_Npc, 3, 'domain'); //跳到首页 end; begin if This_Player.GetV(30,27) < 0 then This_Player.SetV(30,27,0); //初始化幸运值 domain; end.