手游传奇SF-以战神引擎为例,我写个脚本用超级祝福油喝幸运,
{********************************************************************
*******************************************************************}
program mir2;
procedure _DoExit;
begin
This_Npc.CloseDialog(This_Player);
end;
procedure _Exit;
begin
This_Npc.CloseDialog(This_Player);
end;
var
ck_name : array[1..17] of string;
ck_value : array[1..17] of integer;
procedure OnInitialize;
begin
ck_name[1] :='镇天';
ck_name[2] :='开天';
ck_name[3] :='玄天';
ck_name[4] :='屠龙';
ck_name[5] :='龙牙';
ck_name[6] :='逍遥扇';
ck_name[7] :='怒斩';
ck_name[8] :='井中月';
ck_name[9] :='裁决之杖';
ck_name[10] :='骨玉权杖';
ck_name[11] :='霸者之刃';
ck_name[12] :='龙纹剑';
ck_name[13] :='血饮';
ck_name[14] :='无极棍';
ck_name[15] :='魔杖';
ck_name[16] :='炼狱';
ck_name[17] :='杀意';
ck_value[1] :=10;
ck_value[2] :=10;
ck_value[3] :=10;
ck_value[4] :=10;
ck_value[5] :=10;
ck_value[6] :=10;
ck_value[7] :=10;
ck_value[8] :=10;
ck_value[9] :=10;
ck_value[10] :=10;
ck_value[11] :=10;
ck_value[12] :=10;
ck_value[13] :=10;
ck_value[14] :=10;
ck_value[15] :=10;
ck_value[16] :=10;
ck_value[17] :=10
end;
procedure _Checkup;
begin
This_Npc.NpcDialog(This_Player,
'以下是可以加幸运的武器:\'
+'屠龙,霸者之刃,嗜魂法杖,\'
+'怒斩,龙牙,逍遥扇,\'
+'裁决之杖,骨玉权杖,血饮,龙纹剑,\'
+'井中月,魔杖,无极棍,炼狱,\'
+'杀意,无常,飞天凤羽,\'
+'<每升一点幸运需要一瓶金色祝福油,武器幸运最高+7/c=red>\'
+'|{cmd}<开始升级/@Checkup_1> ^<关闭/@doexit>'
);
end;
procedure _Checkup_1;
begin
This_NPC.Click_CommitItem(This_Player,1,'待升级武器:');
end;
procedure CommitItem(AType:word);
var
i,ck_num,ck_kind,ck_gold,ck_rand:integer;
ck_str,ck_red:string;
begin
ck_gold := 0; //初始化
ck_str := ''; //初始化
ck_red := ''; //初始化
for ck_kind := 1 to 17 do
begin
if ck_name[ck_kind] = This_Item.ItemName then
begin
ck_num := This_Item.AddPa4 ;
ck_gold := ck_value[ck_kind];
if (ck_num > 0) and (ck_num < 7) then
begin
for i:= 1 to ck_num do
begin
//ck_gold := ck_gold*2;
ck_gold := 1;
end;
end;
end;
end;
if ck_num > 6 then
begin
This_Player.NotifyClientCommitItem(0,'您的'+This_Item.ItemName+'幸运已经+7无法再升!');
end else
if ck_gold > 0 then
begin
if This_Player.YBNum >= ck_gold then
begin
ck_rand := random(100);
if ck_rand > 191 then
begin
This_Player.NotifyClientCommitItem(0,'升级失败');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
//This_Player.PsYBConsum(This_NPC,'xin',20150,100,1);
end else
//if ck_rand < 79 then
//begin
//if (ck_rand < 119) and (This_Player.GetBagItemCount('金色祝福油') > 0) then
if This_Player.GetBagItemCount('金色祝福油') > 0 then
begin
This_Player.Take('金色祝福油',1);
This_Item.AddPa4 := This_Item.AddPa4 + 1; //幸运+1
//This_Player.PsYBConsum(This_NPC,'xin',20150,100,1);
ck_str :='1点幸运';
ck_red :='红字公告';
//end;
end else
begin
This_Player.NotifyClientCommitItem(0,'你包里没有金色祝福油'+inttostr(ck_gold)+'无法升级!');
end;
if ck_str <> '' then
begin
This_Player.NotifyClientCommitItem(0,'升级成功:你的'+This_Item.ItemName+'提升了'+ck_str+'!');
This_NPC.NotifyClientUPdBagItem(This_Player,This_Item);
end;
if ck_red <> '' then This_NPC.NpcNotice('恭喜:'+This_Player.Name+'在幸运长矛兵处把'+This_Item.ItemName+'提升'+ck_str+'!');
This_Player.AddLogRec(9, This_Item.ItemName, 811152, ck_gold, ck_str);
end else
begin
This_Player.NotifyClientCommitItem(0,'该物品不可升级,请投入可升级的装备!');
end;
end;
end;
function xin(price, num: Integer):boolean;
begin
result := true;
end;
begin
This_Npc.NpcDialog(This_Player,
'我可以免费帮你武器加幸运前提是你包里要有,\'
+'<金色祝福油/c=red>\'
+'|{cmd}<开始升级幸运/@Checkup>\'
);
end.