佳丽云

英雄无敌3-WoG中文站

 找回密码
 英雄注册|Register
查看: 3434|回复: 4

求大家帮我解释一下这个erm

[复制链接]
  • TA的每日心情
    开心
    2024-8-7 01:57
  • 签到天数: 51 天

    连续签到: 1 天

    [LV.5]女巫

    230

    回帖

    9196

    金币

    0

    精华

    4级 Famous Hero

    Rank: 4

    积分
    1040
    发表于 2010-9-30 04:59:21 | 显示全部楼层 |阅读模式
    ZVSE
    _WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except [wiki]ERM[/wiki]_S for making any kind of changes!
    ERMS_PoweredBy=ERM Scripter v. 2004.6.29.918
    ERMS_ScriptDate=13.4(April).2009
    ** script to prevent creature experience reduction due to overflow. JHV,2/3/2009
    ** uses v7090-v7103 to store troop ranks @ start of battle
    ** uses FU459-FU462
    **"The bug you describe probably occurs when the experience exceeds the maximum
    **positive value that its (internal) variable can store.
    **For example, one byte (8 bits) can store a number from
    **0 to 255 (11111111 in binary), but it is convenient to the value stored as
    **from -128 to +127, by performing the "two's complement" (change all 0's to 1's
    **and 1's to 0's, then add 1) to convert a positive number to a negative number,
    **because any binary number and its two's-complement sum to zero (with a carry
    **that overflows out of the byte).  This makes integer subtraction easy (just add
    **the two's complement of the number to be subtracted), but it means that, for
    **example, if you are using 1-byte storage, adding 2 to
    **127 (00000010 to 01111111 in binary) produces -127 instead of 129."
    **In readable words :P this bug will certainly occur when the experience received
    **after a very big battle can't be handled by the game. Usually if you continue
    **to play a map after the 12th month and the neutral creatures have an
    **overgrowth. Your experience will go into the negative, all abilities will be
    **lost and you will need certainly more than hundred battles to restore it.
    **The script restore it automatically if lost.
    !?BA0&1000; start of (human) battle
    !!BA:H0/?v1; get attacker hero #
    !!BA:H1/?v2; get defender hero # (if any)
    !!DO459/0/6/1&v1>-1/v1<156:Pv1; check stacks 0-6 for attacker
    !!DO460/0/6/1&v2>-1/v2<156:Pv2; check stacks 0-6 for defender

    !?FU459; get exp. rank of troop in slot x16 of hero x1, store in v[7090+x16]
    !!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
    !!VRv5:S7090+x16;
    !!VRvv5:Sy3;
    !?FU460; get exp. rank of troop in slot x16 of hero x1, store in v[7097+x16]
    !!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
    !!VRv5:S7097+x16;
    !!VRvv5:Sy3;
    !?BA1&1000; end of (human) battle
    !!BA:H0/?v1; get attacker hero #
    !!BA:H1/?v2; get defender hero # (if any)
    !!VRv3:C-1/-1; set v3 & v4 to -1
    !!HEv1&v1>-1/v1<156:O?v3; get attacker's Owner - will be 0-7 if attacker won
    !!HEv2&v2>-1/v2<156:O?v4; get defender's Owner - will be 0-7 if defender won
    !!DO461/0/6/1&v3>-1/v3<8:Pv1; check stacks 0-6 for attacker
    !!DO462/0/6/1&v4>-1/v4<8:Pv2; check stacks 0-6 for defender
    !?FU461; get exp. rank of troop in slot x16 of hero x1, vs. v[7090+x16]
    !!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
    !!FU&y2<1:E; quit if no troops left in slot
    !!VRv5:S7090+x16;
    !!VRy4:Svv5;
    !!HEx1&y4>y3:C0/x16/d/d/11/12; set rank to 11 if negative experience was
    gained (overflow occurred)
    !?FU462; get exp. rank of troop in slot x16 of hero x1, vs. v[7097+x16]
    !!HEx1:C0/x16/?y1/?y2/?y3/2; y1=type, y2=no., y3=experience
    !!FU&y2<1:E; quit if no troops left in slot
    !!VRv5:S7097+x16;
    !!VRy4:Svv5;
    !!HEx1&y4>y3:C0/x16/d/d/11/12; set rank to 11 if negative experience was
    gained (overflow occurred)
    !!IF&610:V616/1;
  • TA的每日心情
    无聊
    2023-11-15 00:12
  • 签到天数: 310 天

    连续签到: 1 天

    [LV.8]神圣凤凰

    901

    回帖

    6682

    金币

    0

    精华

    5级 Honorable Hero

    Rank: 5Rank: 5

    积分
    6346
    发表于 2010-9-30 08:44:43 | 显示全部楼层
    等高人出現...
  • TA的每日心情
    开心
    2020-9-19 16:27
  • 签到天数: 7 天

    连续签到: 1 天

    [LV.3]火元素使者

    9896

    回帖

    64万

    金币

    19

    精华

    管理员

    风侠

    Rank: 12Rank: 12Rank: 12

    积分
    52396

    论坛元老魅力之星封魔玩家

    发表于 2010-9-30 12:21:58 | 显示全部楼层
    看起来像是修复经验溢出的脚本
  • TA的每日心情
    无聊
    昨天 16:54
  • 签到天数: 2734 天

    连续签到: 10 天

    [LV.Master]伴坛终老

    1万

    回帖

    4万

    金币

    0

    精华

    白银会员

    Rank: 5Rank: 5

    积分
    100541

    魅力之星

    QQ
    发表于 2010-9-30 19:49:37 | 显示全部楼层
    现在高人中好像也就风侠出现的频率高点了

    加油啊,大仙们,出现吧

    该用户从未签到

    1066

    回帖

    7228

    金币

    1

    精华

    5级 Honorable Hero

    Rank: 5Rank: 5

    积分
    6026
    发表于 2010-10-1 12:38:48 | 显示全部楼层
    LZ我来解释一下.看行不?
    !?BA0&1000; 战斗开始前并双方有一方不是电脑就促发一下事件.
    !!BA:H0/?v1; 得到攻方雄号码V1
    !!BA:H1/?v2; 得到防方雄号码V2
    !!DO459/0/6/1&v1>-1/v1<156:Pv1; 当V1>-1且V1<156就引发!?FU459并让他运行6次.并让!?FU459后的X1=V1
    !!DO460/0/6/1&v2>-1/v2<156:Pv2; 当V2>-1且V2<156就引发!?FU460并让他运行6次.并让!?FU460后的X1=V2


    !?FU459;
    !!HEx1:C0/x16/?y1/?y2/?y3/2; 改变X1号因雄1-6格的怪物.
    !!VRv5:S7090+x16;让V5=7090+X16(X16=1-6)
    !!VRvv5:Sy3;让W5=Y3
    !?FU460;
    !!HEx1:C0/x16/?y1/?y2/?y3/2;  改变X1号因雄1-6格的怪物.
    !!VRv5:S7097+x16;让V5=7090+X16(X16=1-6)
    !!VRvv5:Sy3;让W5=Y3
    !?BA1&1000; 战后.并双方有一方是非电脑就开使下面事件
    !!BA:H0/?v1; 得到攻方雄号码V1

    !!BA:H1/?v2; 得到攻方雄号码V2

    !!VRv3:C-1/-1; 让V3=-1 V4=-1
    !!HEv1&v1>-1/v1<156:O?v3; 当V1>-1且V1<156.就取V1号英雄的归属.
    !!HEv2&v2>-1/v2<156:O?v4; 当V2>-1且V2<156.就取V2号英雄的归属.
    !!DO461/0/6/1&v3>-1/v3<8:Pv1; 当V3>-1且V3<8就运行!?FU461 6次并让!?FU461以下的X1=V1
    !!DO462/0/6/1&v4>-1/v4<8:Pv2; 当V4>-1且V4<8就运行!?FU462 6次并让!?FU462以下的X1=V2

    !?FU461;
    !!HEx1:C0/x16/?y1/?y2/?y3/2; 改变X1号因雄1-6格的怪物.(注Y3=改怪的EXP)
    !!FU&y2<1:E; 当Y2<1就退出
    !!VRv5:S7090+x16;让V5=7090+X16(X16=1_6)
    !!VRy4:Svv5;让Y4+W5
    !!HEx1&y4>y3:C0/x16/d/d/11/12; 当Y4>Y3就设置等级11(溢出发生了)。
    !?FU462; 下面差不多.
    !!HEx1:C0/x16/?y1/?y2/?y3/2;
    !!FU&y2<1:E; quit if no troops left in slot
    !!VRv5:S7097+x16;
    !!VRy4:Svv5;
    !!HEx1&y4>y3:C0/x16/d/d/11/12; set rank to 11 if negative experience was
    gained (overflow occurred)
    !!IF&610:V616/1;如果表制610为真就让616为真.

    LZ这是生物EXP益出变负的ERM

    [ 本帖最后由 air 于 2010-10-1 12:39 编辑 ]

    评分

    1

    查看全部评分

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 英雄注册|Register

    本版积分规则

    捐赠
    关注我们,英3Mod一网打尽!

    WoG中文站 ( 辽B2-20210485-10 )|辽公网安备 21128202000228 号

    GMT+8, 2025-4-21 04:34 , Processed in 1.242717 second(s), 14 queries , Gzip On, File On.

    Powered by Discuz! X3.4

    Copyright © 2004-2022, Beijing Second Sight Technology Co., LTD.

    快速回复 返回顶部 返回列表