夜游神论坛,传奇一条龙,GM论坛,GM部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

安全 php 88A
查看: 1303|回复: 0

[手游教程] GowLom2战神引擎程序变量操作指南

[复制链接]

签到天数: 1 天

[LV.1]初来乍到

47

主题

47

帖子

2

钻石

Rank: 1

积分
94
发表于 2019-8-22 20:21:20 | 显示全部楼层 |阅读模式
[size=18.018px]私人变量只有S和V,变量需要两个数字定位,X,Y
[size=18.018px]服务器变量只有G

[size=18.018px]如V变量使用:
[size=18.018px]This_Player.SetV(X,Y,valuel);
[size=18.018px]This_Player.GetV(X,Y);//返回值为valuel
[size=18.018px]X,Y 取值范围0-100
[size=18.018px]valuel取值范围±21亿
[size=18.018px]示例:每天领取3次经验脚本

[size=18.018px]procedure _GetFreeExp;
[size=18.018px]var today , num: integer;
[size=18.018px]begin
[size=18.018px]    today := GetDateNum(GetNow);// 获取当前日期
[size=18.018px]    if This_Player.GetV(13,1) <> today then     
[size=18.018px]    begin
[size=18.018px]       This_Player.SetV(13,1,today);
[size=18.018px]       This_Player.SetV(13,2,0);
[size=18.018px]    end;
[size=18.018px]             //初始化变量值,每天首次触发,将领取变量设置为0



[size=18.018px]    num := This_Player.GetV(13,2);  //获取已领取次数,**取值时切记写在初始化之后
[size=18.018px]    if num < 3 then
[size=18.018px]    begin
[size=18.018px]        This_Player.Give('经验',10000);
[size=18.018px]        This_Player.SetV(13,2, num + 1); //领取变量每领取一次加一
[size=18.018px]        This_NPC.NpcDialog(This_Player,
[size=18.018px]        '恭喜你获得1万点经验值'
[size=18.018px]        +'|{cmd}<继续领取经验/@GetFreeExp>');
[size=18.018px]         
[size=18.018px]    end else
[size=18.018px]    This_NPC.NpcDialog(This_Player,'你今天已领取了3次经验');
[size=18.018px]end;

[size=18.018px]begin//主函数入口
[size=18.018px]    This_NPC.NpcDialog(This_Player,
[size=18.018px]    '每天可免费领取3次经验,每次可领取1万'
[size=18.018px]    +'|{cmd}<免费经验领取/@GetFreeExp>');
[size=18.018px]end.


[size=18.018px]使用变量建议在Excel中保存

 V变量
1
2
3
4
5
6
7
8
9
1





2




3




4




5




6




7




8




9




10




11




12
已使用
已使用
已使用
已使用
已使用
已使用
已使用
已使用
已使用
13
免费经验日期
免费经验次数
免费金条日期
免费金条数量



14




15




16




G变量
1
2
3
4
5
1



2


3
免费金条日期
免费金条数量


4


5


6


7


8




[size=18.018px]S变量使用完全同V
[size=18.018px]This_Player.SetS(X,Y,valuel);
[size=18.018px]This_Player.GetS(X,Y);//返回值为valuel


[size=18.018px]G变量为服务器变量,不需要This_Player调用
[size=18.018px]SetG(X,Y,valuel);
[size=18.018px]GetG(X,Y);//返回值为valuel

[size=18.018px]示例:每人每天领取2个金条,服务器限量100个
[size=18.018px]procedure _GetFreeGold;  //方法
[size=18.018px]var today , num: integer;//局部语法变量声明
[size=18.018px]Snum : integer;
[size=18.018px]begin
[size=18.018px]    today := GetDateNum(GetNow);
[size=18.018px]    if This_Player.GetV(13,3) <> today then
[size=18.018px]    begin
[size=18.018px]       This_Player.SetV(13,3,today);
[size=18.018px]       This_Player.SetV(13,4,0);
[size=18.018px]    end;
[size=18.018px]   if GetG(3,1) <> today then
[size=18.018px]   begin
[size=18.018px]       SetG(3,1,today);
[size=18.018px]       SetG(3,2,0);
[size=18.018px]   end;
[size=18.018px]   Snum := GetG(3,2)
[size=18.018px]   num := This_Player.GetV(13,4);
[size=18.018px]   
[size=18.018px]    if Snum < 100 then
[size=18.018px]    begin
[size=18.018px]        if num < 2 then
[size=18.018px]        begin
[size=18.018px]            if This_Player.FreeBagNum >= 1 then
[size=18.018px]            begin
[size=18.018px]                This_Player.Give('金条',1);
[size=18.018px]                This_Player.SetV(13,4, num + 1);
[size=18.018px]                SetG(3,2,Snum + 1);
[size=18.018px]                This_NPC.NpcDialog(This_Player,
[size=18.018px]                '恭喜你获得金条1个'
[size=18.018px]                +'|{cmd}<继续领取金条/@GetFreeGold>');
[size=18.018px]            end else
[size=18.018px]            This_NPC.NpcDialog(This_Player,'你的包裹已满')
[size=18.018px]        end else
[size=18.018px]        This_NPC.NpcDialog(This_Player,'你今天已领取了2根金条');
[size=18.018px]    end else
[size=18.018px]    This_NPC.NpcDialog(This_Player,'今日服务器金条已全部领取!');
[size=18.018px]end;
[size=18.018px]var Stoday , Snum : integer; //主函数入口
[size=18.018px]begin
[size=18.018px]   Stoday := GetDateNum(GetNow);
[size=18.018px]   if GetG(3,1) <> Stoday then
[size=18.018px]   begin
[size=18.018px]       SetG(3,1,Stoday);
[size=18.018px]       SetG(3,2,0);
[size=18.018px]   end;
[size=18.018px]   Snum := GetG(3,2)
[size=18.018px]    This_NPC.NpcDialog(This_Player,
[size=18.018px]    '今日免费金条剩余数量: ' + inttostr(100 - Snum) + '\'
[size=18.018px]    +'|{cmd}<免费领取金条/@GetFreeGold>');
[size=18.018px]end.




上一篇:GowLom2战神引擎登录脚本触发实例
下一篇:owLom2战神引擎文本符号详解
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

传奇广告代理|传奇脚本|微变传奇|单职业传奇|热血传奇|传奇私服|GM论坛|英雄合击|小黑屋|百度统计|夜游神论坛 |网站地图

Powered by Discuz! X3.4© 2001-2013 Comsenz Inc.