用于战神引擎的元宝抽奖Npc脚本,脚本相比之前帮主更新的类似抽奖脚本,这个脚本功能很强大一些,带Gm后台控制中奖概率,通过gm打开NPC,可以看到GM管理按钮,点击进去,可以设置中奖概率,脚本是明文版的,可以任意修改里面的奖品名单和抽奖所需要的元宝等货币。


部分脚本
program mir2;
var
Aw_rand1, Aw_rand2, Aw_rand3, Aw_rand4, Aw_rand5 : integer;
bigAwitem : string;
procedure OnInitialize;
begin
Aw_rand1:=1;
Aw_rand2:=20;
Aw_rand3:=50;
Aw_rand4:=200;
Aw_rand5:=500;
bigAwitem:='黑铁头盔,圣战项链,法神项链,天尊项链,霸者之刃,屠龙,嗜魂法杖,无极棍,凤天魔甲,凰天魔衣';
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;
procedure domain;
var
count, index : integer; saiji,showAw, tocon : string;
begin
//This_Player.SetS(19,19, 0);
count:=This_Player.GetS(19,19);
if length(inttostr(count)) > 2 then
begin
tocon:=inttostr(100-strtoint(copy(inttostr(count), 2, 3)));
end
else
tocon:=inttostr(100-count);
index:=1+count div 100;
showAw:=printStr(bigAwitem,index);
if count > 999 then
begin
showAw:='你已获得本赛季所有奖励';
tocon:='';
end;
case GetMonth of
3:
begin
saiji := 'S1赛季'
end
4:
begin
saiji := 'S2赛季'
end
5:
begin
saiji := 'S3赛季'
end
6:
begin
saiji := 'S4赛季'
end
end;
if This_Player.GMLevel > 0 then
This_NPC.NpcDialog(This_Player,
'<---------------------------------------------------------->'+
'|<'+ saiji +'/fcolor=253><宝藏/fcolor=249> '+
'|已抽 <'+inttostr(count)+'> 次'+
'|再抽 < '+tocon+' > 次获得 <['+ showAw+']/fcolor=250>'+
'|<---------------------------------------------------------->'+
'{cmd}'+
'|<首饰抽奖/@awDialg~randAw~1> ^<武器抽奖/@awDialg~randAw~2> ^<防具抽奖/@awDialg~randAw~3>'+
//'| '+
'|<GM管理/@setGM>|'
)
else
This_NPC.NpcDialog(This_Player,
'<----------------------------------------------------------->'+
'|<'+ saiji +'/fcolor=253><宝藏/fcolor=249> '+
'|累抽 <'+inttostr(count)+'> 次'+
'|再抽 <'+tocon+'> 次获得 <['+ showAw+']/fcolor=250>'+
'|<---------------------------------------------------------->'+
'{cmd}'+
'|<首饰抽奖/@awDialg~randAw~1> ^<武器抽奖@awDialg~randAw~2> ^<防具抽奖/@awDialg~randAw~3>'
//'|<防具抽奖/@awDialg~randAw~3> |'
{^<物品抽奖/@awDialg~randAw~4>}
)
end;








