战神引擎抽奖Npc脚本(带Gm后台设置中奖几率)

用于战神引擎抽奖Npc脚本,脚本自带Gm后台设置功能,GM可以直接设置中奖几率,非常的方便,明文版的脚本,可以任意设置奖品名单,默认是需要扣除积分,可以根据自己的需要换成金币,元宝等货币。

战神引擎抽奖Npc脚本(带Gm后台设置中奖几率)

战神引擎抽奖Npc脚本(带Gm后台设置中奖几率)

部分脚本

		This_Player.SetS(19,19, This_Player.GetS(19,19)+1);
		count:=This_Player.GetS(19,19);
		case count of	//满足以下次数必给的奖品
			100: awItem:=printStr(bigAwitem,1);
			200: awItem:=printStr(bigAwitem,2);
			300: awItem:=printStr(bigAwitem,3);
			400: awItem:=printStr(bigAwitem,4);
			500: awItem:=printStr(bigAwitem,5);
			600: awItem:=printStr(bigAwitem,6);
			700: awItem:=printStr(bigAwitem,7);
			800: awItem:=printStr(bigAwitem,8);
			900: awItem:=printStr(bigAwitem,9);
			1000: awItem:=printStr(bigAwitem,10);
		end;
		//if This_Player.GetS(19,19) >= 1000 then
		//This_Player.SetS(19,19, 0);
		rand := random(100) + 1;	
		if awItem <> '' then		
		else
		if rand = Aw_rand1 then	
		begin
		index:=strtoint(printStr(Aw_item1, 1));
		awItem:=printStr(Aw_item1, randseed(index)); 
		end
		else
		if rand < Aw_rand2 then	
		begin
		index:=strtoint(printStr(Aw_item2, 1));
		awItem:=printStr(Aw_item2, randseed(index)); 
		end
		else
		if rand < Aw_rand3 then	
		begin
		index:=strtoint(printStr(Aw_item3, 1));
		awItem:=printStr(Aw_item3, randseed(index));  
		end
		else
		if rand < Aw_rand4 then	
		begin
		index:=strtoint(printStr(Aw_item4, 1));
		awItem:=printStr(Aw_item4, randseed(index)); 
		end
		else	
		if rand < Aw_rand5 then	
		begin
		index:=strtoint(printStr(Aw_item5, 1));
		awItem:=printStr(Aw_item5, randseed(index)); 
		end
		else
		begin
		index:=strtoint(printStr(Aw_item6, 1));
		awItem:=printStr(Aw_item6, randseed(index)); 
		end			
		This_Player.Give(awItem, 1);		
		This_Player.PlayerNotice('恭喜你获得了'+awItem, 3);
end;
procedure _randAw(pstr:string);
var i ,pid, strid, point: integer; 		
begin	
	pid:=strtoint(copy(pstr, 0, pos(',', pstr)-1));
	strid:=strtoint(copy(pstr, pos(',', pstr)+1, length(pstr)));	
	if This_Player.FreeBagNum < strid then
	begin
		This_NPC.NpcDialog(This_Player, '你的背包格子少于 <'+inttostr(strid)+'> 格, 请整理后在来~');
		exit;
	end;
	point:=strid * 1010;
	if This_Player.MyShengwan < point then
	begin
		This_NPC.NpcDialog(This_Player, '你的声望不足'+inttostr(point));
		exit;
	end;
	i:=0;
	While i < strid Do
	begin	
		i:=i+1;
		This_Player.MyShengwan:=This_Player.MyShengwan-100;
		_getAwitem(pid);
	end;
	This_Npc.CloseDialog(This_Player);	
end;
begin	//脚本入口  点击NPC 脚本从这里开始运行。  放在脚本最底部
	if This_Player.GetS(19,19) < 0 then
	This_Player.SetS(19,19, 0);
	//This_Player.AddplayerAbil(24, 10005, 0)
	domain;
end.
分享到:
赞(0)