战神引擎-战神引擎脚本命令总汇

白猪自定义npc版面命令解读

begin
    This_Npc.NpcDialog(This_Player,
	'DBg:haoli:npcbg:1:topleft:0:41:608:topleft|'+
	'DExit:haoli:exit2:1:102:469:0|'+
	'1:DImg:haoli:wx:0.8:330:40|'+
	'1:Text:10:33:18:【关注奖励】:三职业召唤卷 * 1@254:left|'+
	'1:Text:10:68:18:【关注有礼】:不定期公众哈留言抽奖@254:left|'+
	'1:Text:10:103:18:【领取密码】:输入:联系客服获得@243:left|'+
	'1:Text:10:138:18:【更多福利】:请联系客服咨询@251:left|'+
	'1:DRBtn:haoli:2144@2145:1:50:180:领取奖励@youjian:14:251|'+
	'1:DRBtn:haoli:2144@2145:1:180:180:点击加line@youjian111:14:251|'+
	'1:DRBtn:haoli:2144@2145:1:310:180:关闭此页@exit:14:251|'+
	+'|{cmd}</@exit></@youjian></@youjian111>'
	);
end.
//data下的素材包
'DBg:素材包:图片名:1:topleft:0:X坐标:Y坐标:topleft|'+
'DExit:素材包:图片名:1:X坐标:Y坐标:0|'+
'1:Text:X坐标:Y坐标:字体大小:字体内容@字体颜色:left|'+
'1:DRBtn:素材包:默认图片@按下图片:1:X坐标:Y坐标:领取奖励@youjian:字体大小14:字体颜色|'+

游戏内点击跳转链接

Procedure _GetYB;
begin
	//这里输入你的充值地图,或者直接修改你想要的提示
	This_Player.PlayerNotice('LINK$https@by.1234500000.com~cz~10003tlZOquMkXdJ',5);

end;

万能脚本截断命令,任意位置

  if  This_Player.GetV(101,101) = 1 then
  begin
  This_NPC.NpcNotice('您已经领取过了');
    Exit;
  end; 

//例子
Procedure _jiangli2;
begin
  if  This_Player.GetV(101,101) = 1 then
  begin
  This_NPC.NpcNotice('您已经领取过了');
    Exit;
  end; 

Begin 
  if This_Player.GetV(88,88) >= 30 then
Begin
   This_Player.SetV(101,101,1);
   This_Player.SysGiveGift('贵族斗笠',1,true);
   This_NPC.NpcNotice('恭喜:'+This_Player.Name+'领取了【贵族斗笠】');
end else
   This_NPC.NpcNotice('领取失败,您没有充值30元');
end;
end;

脚本重置变量命令

procedure _domain;   
var today , mei: integer; //声明变量
begin	
 today := GetDateNum(GetNow);// 获取当前日期        //
  if This_Player.GetV(55,91) <> today then     // 初始化 
 begin
   This_Player.SetV(55,91,today);      
   This_Player.SetV(280,41,0);          
 end;

This_Npc.NpcDialog(This_Player,
<'+ inttostr(This_Player.GetV(280,40)) +'/c=70>   //显示变量
);
end;

延时执行脚本命令

这个功能和老脚本中的callout基本一致。
通过调用This_Player的CallOut函数来实现延时执行。
procedure delayFly;  
begin    
This_player.flyTo('3', 355, 291);  
end;  
This_Player.CallOut(This_Npc, 60, 'delayFly');
//callout的三个参数分别是npc对象,延时多久(秒为单位),延迟调用的函数名
//以上功能就是60秒后玩家被传送到盟重的355,291的坐标上。

定义变量const(相当于GOM引擎的MOV)

// 放在这个下面
program mir2;
const JB_NUM = 1000;	//需求金币数量
脚本里写:JB_NUM,相当于就直接是1000
------------------------------------
显示定义变量:'+inttostr(JB_NUM)+'
这样在NPC版面就会显示1000

检测PK值

procedure _pk;
begin
   if This_Player.MyPkpoint >= 100 then        //检测pk值
   begin
      if This_Player.YBNum >= 1 then           //检测元宝
      begin
         This_Player.DecPkPoint(100);          //减少pk值
        This_Player.ScriptRequestSubYBNum(1);  //扣元宝
      end else
      begin
         This_Npc.NpcDialog(This_Player,
         '对不起,你的元宝不足,不能消减PK值!'
         );
      end;
   end else
   begin
      This_Npc.NpcDialog(This_Player,
      '你现在不需要消减PK值!' 
      );
   end;
end;

检测宝宝数量

if This_Player.GetSlaveCount('') < 2 then  //<2就是检测小于2只宝宝

给人物增加经验倍数

This_Player.MultiTempExpRate := 2;   //2=2倍,是几倍就等于几

检测人物性别给予物品(例如:衣服,性别检测:0=男,1=女)

if This_Player.Gender = 0 then
begin
This_Player.SysGiveGift('魔法长袍(男)',1,true);
end else
begin
This_Player.SysGiveGift('魔法长袍(女)',1,true);end;
end;

检测多个物品物品和扣除物品

procedure _1;
 begin
if ((This_Player.GetBagItemCount ('命运神石') >= 1) and (This_Player.GetBagItemCount ('金矿') >= 20) and  (This_Player.GoldNum  >= 1000000)) then
   begin
This_Player.Take('金矿',20);
This_Player.Take('命运神石',1);
This_Player.DecGold(1000000);
This_Player.Give('命运之刃',1);
ServerSay('恭喜玩家【' + This_Player.Name + '】成功兑换了[命运之刃]', 3);
//等待
    end else
begin
   This_NPC.NpcDialog(This_Player,
    '<>   <无法兑换,请看以下说明/fcolor=103>:|\'
    +'|1.<材料不足/fcolor=250>|'
    +'|                                                             </@zhanshen>') ;
end;
end;

检测金币和扣除金币

if This_Player.GoldNum >= 100000 then
begin
This_Player.DecGold(100000);
ServerSay('系统:玩家【' + This_Player.Name + '】开启了狂暴之力.干掉他可获得10W金币!!',3);
This_Player.PlayerNotice('成功开启狂暴之力!', 5);
end else
This_Player.PlayerNotice('你没有元宝,无法开启狂暴之力!', 5);
end;

检测背包格子数

 if This_Player.FreeBagNum >= 2

检测背包中的物品

if This_Player.GetBagItemCount ('屠龙') >= 2

给物品 :

This_Player.Give('屠龙',2);

扣除物品

This_Player.Take('屠龙',2');

检查人物等级

if This_Player.Level >= 1

人物元宝>检测,增加,减少

if This_Player.YBNum >= 10 then  //检测人物元宝数量
This_Player.ScriptRequestAddYBNum(10);  //增加人物10元宝
This_Player.ScriptRequestSubYBNum(10);  //扣除人物10元宝

人物灵符>检测,增加,减少

if This_Player.MyLFnum >= 1 then  //检测人物灵符数量
This_Player.AddLF(0,10);   //增加人物10灵符
This_Player.DecLF(0,10,false);  //扣除人物10灵符

杀死人物给10元宝(狂暴专用)

This_Player.findPlayerByName(KillerName).ScriptRequestAddYBNum(10);

检查人物职业(0=战士,1=法师,2=道士)

if This_Player.Job = 0 then

检测某地图指定怪物数量

This_NPC.CheckMapMonByName(地图名称 , 怪物名称)

检测指定地图所有怪物数量

CheckOtherMapMon(地图名称);该接口不需要npc调用

地图刷怪命令

This_Npc.CreateMon('地图名称', X, Y, 范围, '怪物名称', 数量);

传送:

This_Player.Flyto(地图名,x,y); 将角色传送至某地图的x、y点

This_Player.RandomFlyTo(地图名); 将角色传送至某地图的随机点

如:  
This_Player.Flyto('D711',200 + random(3) - 1,204 + random(3) - 1);

表示将角色传送至地图 D711的 200,204的 3*3范围内随机点
温馨提示: 本文最后更新于2026-01-14,某些文章具有时效性,若有错误或已失效,请在下方留言或联系游戏素材网
© 版权声明
喜欢就支持一下吧
点赞7 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容