佳丽云

英雄无敌3-WoG中文站

 找回密码
 英雄注册|Register
查看: 4596|回复: 5

WOG菜鸟求ERM脚本

[复制链接]

该用户从未签到

178

回帖

6800

金币

0

精华

2级 Adventuring Hero

Rank: 2

积分
452
发表于 2008-3-14 08:20:05 | 显示全部楼层 |阅读模式
我是[wiki]WoG[/wiki]新人,在做[wiki]WoG地图[/wiki]时,想在地图中的事件中设置[wiki]ERM[/wiki]选项,可惜我不是太明白ERM的,所以发贴求助,望解答。
我需要在WOG地图中设置如下ERM(在[wiki]游戏[/wiki]时,由于不在对地图WOG化了,这些选项也可能无效)
1、[wiki]英雄[/wiki]十技能
2、指挥官、[wiki]追随者[/wiki]可用
3、城镇八级兵建筑
4、英雄、城镇改名与重排
5、英雄右键放兵、丢宝物。
目前只需要这几个,再次感谢。

 成长值: 27745

  • TA的每日心情
    无聊
    2020-5-27 00:09
  • 签到天数: 24 天

    连续签到: 2 天

    [LV.4]狂狼人

    5772

    回帖

    2696万

    金币

    42

    精华

    管理员

    精灵奇侠

    Rank: 12Rank: 12Rank: 12

    积分
    9244835

    社区QQ达人论坛创始人杰出贡献论坛元老

    发表于 2008-3-14 12:05:34 | 显示全部楼层
    除了第三条不太好实现以外,其他都有安全脚本,不知道楼主需要怎样帮助?是我把安全脚本贴出来楼主自己带入地图还是什么其他的解决办法?

    该用户从未签到

    178

    回帖

    6800

    金币

    0

    精华

    2级 Adventuring Hero

    Rank: 2

    积分
    452
     楼主| 发表于 2008-3-14 12:08:14 | 显示全部楼层
    我的意思,就是麻烦您贴出来,让我自己带入地图,谢谢。

     成长值: 27745

  • TA的每日心情
    无聊
    2020-5-27 00:09
  • 签到天数: 24 天

    连续签到: 2 天

    [LV.4]狂狼人

    5772

    回帖

    2696万

    金币

    42

    精华

    管理员

    精灵奇侠

    Rank: 12Rank: 12Rank: 12

    积分
    9244835

    社区QQ达人论坛创始人杰出贡献论坛元老

    发表于 2008-3-14 12:19:59 | 显示全部楼层
    给我一点时间,5楼将附上脚本。

     成长值: 27745

  • TA的每日心情
    无聊
    2020-5-27 00:09
  • 签到天数: 24 天

    连续签到: 2 天

    [LV.4]狂狼人

    5772

    回帖

    2696万

    金币

    42

    精华

    管理员

    精灵奇侠

    Rank: 12Rank: 12Rank: 12

    积分
    9244835

    社区QQ达人论坛创始人杰出贡献论坛元老

    发表于 2008-3-14 16:21:47 | 显示全部楼层

    请将下面的脚本拷贝入你的地图,触发天数要大于500天

    城镇可以招募[wiki]8级兵[/wiki],这个脚本我暂时找不到,无法合成给你——这个不是现在wog的官方脚本。以下的脚本,请你按照下面给出的顺序将脚本引入地图,即可正常使用。

    1、地图选项-
    1. ZVSE
    2. !#UN:P5/0;禁止wog化地图
    3. !#UN:P0/1;启用8级兵生物巢穴
    4. !#UN:P1/0;箭塔经验累积
    5. !#UN:P2/0;怪物可以放置在地图上
    6. !#UN:P3/0;启用指挥官系统
    7. !#UN:P6/0;英雄初始拥有指挥官,如果需要雇佣指挥官,把0改成1
    8. !#UN:P7/1;生物巢穴积累生物,如果不需要,把1改成0
    9. !#UN:P8/1;生物巢穴累积守卫(如果有的话),不需要,把1改成0
    10. !#UN:P900/1;启用生物经验系统,不需要,把1改成0
    11. !#UN:P124/1;英雄获得10个技能
    12. !#UN:P169/1;城镇可以改名
    13. !#UN:P187/1;英雄可以改名


    14. !#UN:V?y1/?y2;
    15. !#VRy3|y1<358/y2<281:Sy1 :100;
    16. !#VRy4|y1<358/y2<281:Sy1 %100;
    17. !#VRy5|y1<358/y2<281:Sy2 :100;
    18. !#VRy6|y1<358/y2<281:Sy1 %100;
    19. !#VRz10|y1<358/y2<281:S^你的 ERM 版本 : %Y5.%Y6
    20. 你的 WOG 版本 : %Y3.%Y4

    21. 此地图必须要求WOG版本 3.58 和ERM版本 2.81
    22. 你的WOG或者ERM不是最新版,请升级你的WOG^;
    23. !#IF|y1<358/y2<281:D5/10;
    24. !#IF|y1<358/y2<281:E1/5;
    复制代码
    2、GB修改加强版的第一追随者脚本(该脚本较大,需要分两部分引入地图),第一部分-
    1. ZVSE
    2. !#VRv7206:S0;                                        [initialize "done" flag]
    3. !#VRv7181:S1;
    4. ** Timer routines
    5. !#TM19:S1/1/1/255;
    6. !?TM19&1000/v7181=1;                                 [continue if enabled   day 1 only ]
    7. !!VRv7218:S0;                                        经验调整
    8. !!VRv7220:S0;                                        进化开关
    9. !!DO7105/0/155/1&v7206=0:P;                          [iterate through all heroes]

    10. ** start of hero screen mouse trigger **
    11. !?CM2&v7181=1;                                       [continue if enabled]

    12. !!CM:I?y-3 F?y-4 S?y-5;                              [get mouse click, flag, subtype]
    13. !!IF&y-3=141/y-4=512:Q2/-1/-1/1^HENCHMAN BONUS STATS AT LEVEL 1 :

    14. +1 Attack
    15. +1 Defense
    16. +1 Speed
    17. +2-5 Base Damage
    18. +10 Base Health

    19. At every 3rd level : +1 Attack, +1 Defense
    20. At every 10th level : +1 Speed

    21. Henchmen gain {Status} for each battle fought and gain levels (indicated by increased stack quantity). They also benefit from a {Status Bonus} based on hero level and current day.

    22. Henchmen will die after one of the stack is lost, they may offer one last retaliation before doing so.

    23. Lower level/un-upgraded creatures level up faster than higher level/upgraded creatures.

    24. The "Disguise" spell is applied to color their quantity tag to help separate them from normal creatures.

    25. Dead henchmen can be resurrected in a town for a fee based on creature cost and level.

    26. AI heroes have a (good) chance of having a henchman of random level ({Status} based on hero level). The creature type is chosen randomly each battle and may even be of a type not in the hero's army.
    27. ^;

    28. !!FU|y-3<>141/y-4<>0/y-5<>12:E;                      [continue if player banner (141) was left clicked only, else exit]

    29. !!CM:H?y-1/?y-2;                                     [get hero number]
    30. !!IF&y-1>-1:Wy-1;                                    [enable hero variable]

    31. !!FU7106&w118>-1:Py-1;                               [if a henchman, display henchman info]
    32. !!FU7102&w118<0:P;                                   [if no henchman, select one]
    33. !!UN:R3/-1;                                          [redraw]

    34. ** end of hero screen mouse trigger **

    35. ** start of object trigger - towns **
    36. !?OB98&1000/v7181=1;
    37. !!OW:I-1/?y-2;                                        [check if human hero]
    38. !!CA998&y-2=0:O?y-4;                                  [get town owner]
    39. !!HE-1&y-2=0:N?y-1 O?y-3;                             [get hero number, owner]
    40. !!IF&y-2=0/y-1>-1:Wy-1;                               [enable hero variable]
    41. !!FU7108&y-2=0/w118>-1/w119=0/y-3=y-4:Py-1;           [if dead henchman, display resurrection info]

    42. *!FU7109&y-2=0/w118=-1/y-3<>y-4:P;                    [function for reminder message]
    43. ** end of object trigger - towns **

    44. ** start of object trigger - monsters **
    45. !?OB54&1000/v7181=1;                                  [object trigger - monsters]
    46. !!FU7109:P;    测试时最好关闭                         [function for reminder message]
    47. ** end of object trigger - monsters **

    48. !?FU7109;

    49. !!OW:I-1/?y-2;                                       [check if human hero]
    50. !!HE-1&y-2=0:N?y-1 O?y-3;                            [get hero number, owner if human]
    51. !!IF&y-2=0/y-1>-1:Wy-1;                              [enable hero variable]

    52. !!IF&y-2=0/w118=-1:Q2/10/y-3/2^You have not yet chosen a Henchman.
    53. Do you wish to look over your troops and see if any are worthy of the honor?

    54. (Selecting NO will disable future reminders for this hero.)



    55. {To open Henchman screen : Left Click on color banner on hero screen}
    56. {To view Henchman help : Right Click on color banner on hero screen}^;

    57. !!FU7102&2/y-2=0/w118=-1:P;                          [if yes select henchman]
    58. !!VRw118&-2/y-2=0/w118=-1:S-2;                       [if no set to disable future messages]
    59. ** end of function **


    60. ** start of battlefield trigger **
    61. !?BF&1000/v7181=1;                                   [continue if enabled]

    62. !!VRv7207:C-1/-1/-1/-1/-1/-1;                        [initialize variables]
    63. !!VRy-1:S-2;                                         [initialize variable]

    64. !!BU:E2/?y-7;                                        [check for enemy creature at position 2 for banks]

    65. !!BA:H0/?y-1;                                        [get hero number - attacker]
    66. !!HEy-1&y-1>-1:O?y-3;                                [get attacker's owner]
    67. !!OW:Iy-3/?y-6;                                      [check if AI]
    68. !!FU7103&y-6=1/y-1>-1:Py-1;                          [choose henchman for AI]
    69. !!IF&y-1>-1:Wy-1;                                    [enable hero variable - attacker]
    70. !!VRy-8&y-7<21:S20;                                  [set position - normal]
    71. !!VRy-8&y-7>20:S25;                                  [set position - bank]
    72. !!FU7117&v7220=1/y-6<>1:Py-1;                        进攻者的追随者进化
    73. !!VRy18&v7220=1/y-6<>1:Sw118;                        临时保存变量
    74. !!VRw118&v7220=1/y-6<>1/v7221>0:Sv7221;              变更追随者
    75. !!BU&w118>-1/w119=1/y-1>-1:Sw118/1/y-8/0/-1/0;       [add a creature to attacker's army at position y-8]
    76. !!BU&w118>-1/w119=1/y-1>-1:Ey-8/?v7207;              [get stack]
    77. !!VRv7216:S0;
    78. !!VRv7216&y-1=144:S1;                                hero144 henchman spec
    79. !!FU7101&w118>-1/w119=1/y-1>-1/v7207>-1:Pv7207/0/y-1;[add stat increases - attacker]
    80. !!BMv7207&w118>-1/w119=1/y-1>-1/v7221>0:M8/100/1;    添加异次门标志
    81. !!VRw118&v7220=1/y-6<>1/v7221>0:Sy18;                重置追随者类型

    82. !!VRy-2:S-2;                                         [initialize variable]
    83. !!BA:H1/?y-2;                                        [get hero number - defender]
    84. !!FU&y-2<0:E;
    85. !!HEy-2:O?y-3;                                [get defender's owner]
    86. !!OW:Iy-3/?y-6;                               [check if AI]
    87. !!FU7103&y-6=1:Py-2;                          [choose henchman for AI]
    88. !!IF:Wy-2;                                    [enable hero variable - defender]
    89. !!FU7117&v7220=1/y-6<>1:Py-2;                 防守者,电脑英雄不会有可变追随者
    90. !!VRy18&v7220=1/y-6<>1:Sw118;                 不然,一个不小心计算出圣龙级追随者
    91. !!VRw118&v7220=1/y-6<>1/v7221>0:Sv7221;       玩家就要倒霉了
    92. !!BU&w118>-1/w119=1:Sw118/1/30/1/-1/0;        [add a creature to defender's army at position 30]
    93. !!BU&w118>-1/w119=1:E30/?v7208;               [get stack]
    94. !!VRv7217:S0;
    95. !!VRv7217&y-1=144:S1;                         hs
    96. !!FU7101&w118>-1/w119=1/v7208>-1:Pv7208/1/y-2;[add stat increases - defender]
    97. !!BMv7207&w118>-1/w119=1/v7221>0:M8/100/1;
    98. !!VRw118&v7220=1/y-6<>1/v7221>0:Sy18;
    99. ** end of battlefield trigger **

    100. ;-------------------------------------------------------------------------------
    101. *由英雄的7支部队计算新追随者的ID
    102. !?FU7117;
    103. !!VRv7221:S-1;
    104. !!VRy30:S0;
    105. !!HEx1:C0/0/?y11/d;
    106. !!VRy30&y11<0:+1;
    107. !!HEx1:C0/1/?y12/d;
    108. !!VRy30&y12<0:+1;
    109. !!HEx1:C0/2/?y13/d;
    110. !!VRy30&y13<0:+1;
    111. !!HEx1:C0/3/?y14/d;
    112. !!VRy30&y14<0:+1;
    113. !!HEx1:C0/4/?y15/d;
    114. !!VRy30&y15<0:+1;
    115. !!HEx1:C0/5/?y16/d;
    116. !!VRy30&y16<0:+1;
    117. !!HEx1:C0/6/?y17/d;
    118. !!VRy30&y17<0:+1;
    119. !!VRy20:S0 +y11 +y12 +y13;
    120. !!VRy20:+y14 +y15 +y16 +y17;
    121. !!VRy20&y30>0:+y30;           负补
    122. !!VRy21:S0;
    123. !!VRy21&y11>-1:+1;
    124. !!VRy21&y12>-1:+1;
    125. !!VRy21&y13>-1:+1;
    126. !!VRy21&y14>-1:+1;
    127. !!VRy21&y15>-1:+1;
    128. !!VRy21&y16>-1:+1;
    129. !!VRy21&y17>-1:+1;
    130. !!VRv7221&y20>0/y21>0:Sy20 :y21;
    131. *!IF:M^1-7:%Y11,%Y12,%Y13,%Y14,%Y15,%Y16,%Y17,all=%Y20,num=%Y21,new=%V7221^;
    132. ;-------------------------------------------------------------------------------

    133. ** pre-action trigger
    134. *v7207为进攻方追随者的堆栈,v7208防守追随者
    135. !?BG&v7181=1;                              [continue if enabled]
    136. !!BMv7207&v7207>-1:N?v7211;                  [get quantity and health of henchman - attacker]
    137. !!BMv7208&v7208>-1:N?v7212;                  [get quantity and health of henchman - defender]
    138. !!BG&v7207=v7210/v7211=0:A3;                 [if dead henchman is next set to defend - attacker]
    139. !!BG&v7208=v7210/v7212=0:A3;                 [if dead henchman is next set to defend - defender]


    140. ** end of pre-action trigger

    141. ** post-action trigger
    142. *v7211是动作发生前的进攻方追随者数量,y-2是发生后的数量
    143. *v7216,v7217是追随者特长英雄144的标志,其追随者不受死亡规则影响
    144. !?BG1&v7181=1;                                       [continue if enabled]
    145. !!BG:N?v7210;                                        [get current stack #]
    146. *进攻
    147. !!BMv7207&v7207>-1:N?y-2 T?y-3;                      [get quantity, type of henchman stack - attacker]
    148. !!BMv7207&v7207>-1/y-2<v7211/v7216<>1:K100000;       [kill henchman stack if any were killed - attacker]
    149. !!FU7107&v7207>-1/y-2<v7211/v7216<>1:P0/0/v7207;     [set dead - attacker]

    150. !!BMv7207&v7207>-1/y-2>v7211/y-3<>159/v7216<>1:Nv7213 L0;     [reset quantity of henchman stack if resurrected (unless ghost) - attacker]
    151. !!FU7107&v7207>-1/y-2>v7211/y-3<>159/v7216<>1:P0/1/v7207;     [set alive (unless ghost) - attacker]
    152. !!BU&v7207>-1/y-2<v7211/y-3<>159/v7216<>1:R;                  [redraw screen (unless ghost)]
    153. *防守
    154. !!BMv7208&v7208>-1:N?y-2 T?y-3;                      [get quantity, type of henchman stack - defender]
    155. !!BMv7208&v7208>-1/y-2<v7212/v7217<>1:K100000;       [kill henchman stack if any were killed - defender]
    156. !!FU7107&v7208>-1/y-2<v7212/v7217<>1:P1/0/v7208;           [set dead - defender]

    157. !!BMv7208&v7208>-1/y-2>v7212/y-3<>159/v7217<>1:Nv7214 L0;     [reset quantity of henchman stack if resurrected (unless ghost) - defender]
    158. !!FU7107&v7208>-1/y-2<v7212/y-3<>159/v7217<>1:P1/1/v7208;     [set alive (unless ghost) - defender]
    159. !!BU&v7208>-1/y-2<v7212/y-3<>159/v7217<>1:R;                  [redraw screen (unless ghost)]
    160. ** end of post-action trigger

    161. ** function to get monster names
    162. !?FU7100;             x1= Z index
    163. !!HE-1:C0/x16/?y1/?y2;                               [get monster in slot x16 type, quantity]
    164. !!UN&x16=0/y1>-1:N3/2/y1/0;                          [get monster name]
    165. !!UN&x16=1/y1>-1:N3/3/y1/0;                          [get monster name]
    166. !!UN&x16=2/y1>-1:N3/4/y1/0;                          [get monster name]
    167. !!UN&x16=3/y1>-1:N3/5/y1/0;                          [get monster name]
    168. !!UN&x16=4/y1>-1:N3/6/y1/0;                          [get monster name]
    169. !!UN&x16=5/y1>-1:N3/7/y1/0;                          [get monster name]
    170. !!UN&x16=6/y1>-1:N3/8/y1/0;                          [get monster name]

    171. ** end of function


    172. ** function to give stat increases    x1=stack  x2=attacker/defender  x3=hero number
    173. !?FU7101;

    174. !!BMx1:T?y6;                                         [get stack type]
    175. !!FU7104&y6>-1:Py6;                                  [get monster level]
    176. !!VRy7&y6>-1:Sv7215;                                 [copy monster level]
    177. !!IF&y6>-1:Wx3;                                      [enable hero variable]
    178. !!HEx3:E?y1/?y2/1;                                   [get hero exp, level]
    179. !!VRy10:Sy2 -1 *10 +w117 +c;                         [experience points = (hero level -1) x10  +earned xp + current day]
    180. !!VRv7213&x2=0/y6>-1:Sy10 :y7 +1;                    [level = experience points / monster level + 1 - attacker]
    181. !!VRv7214&x2=1/y6>-1:Sy10 :y7 +1;                    [level = experience points / monster level + 1 - defender]
    182. !!VRy8&x2=0/y6>-1:Sv7213;                            [copy attacker level to y8]
    183. !!VRy8&x2=1/y6>-1:Sv7214;                            [copy defender level to y8]

    184. !!VRy4&y6>-1:Sy8 :10 +1;                             [bonus = level / 10 + 1]
    185. !!BMx1&y6>-1:Sdy4;                                   [give +1 speed per 10 levels]

    186. !!BMx1&y6>-1:U1/d2;                                  [give +2 min damage]
    187. !!BMx1&y6>-1:U2/d5;                                  [give +5 max damage]

    188. !!VRy4&y6>-1:Sy8 :3 +1;                              [bonus = level / 3 + 1]
    189. !!BMx1&y6>-1:Ady4 Ddy4;                              [give +1 attack and +1 defense per 3 levels]

    190. !!BMx1&y6>-1:H?y4;                                   [get health]
    191. !!VRy5&y6>-1:Sy4 +10 *y8;                            [health - add 10, multiply by level]
    192. !!BMx1&y6>-1:Hy5;                                    [set health]
    193. **参考nf_xp的"帐篷导致追随者死亡Bug修正"一帖,Thank
    194. !!BMx1&y6>-1:Ny8 By8;                                [set quantity to level]

    195. *!BMx1|y6=63/y6=154:By8;                             [if vampire lord or blood dragon set starting quantity to level]

    196. !!BMx1&y6>-1/v7221<=0:M4/100/1;                      [give disguise dummy spell to make tag yellow]

    197. ;由v7218的内容选择执行下面其中一条.
    198. !!VRw117&v7218=0:+6 T4;       [After win,gain 6-10 points per battle]
    199. !!VRw117&v7218=1:+10 T5;      10-15
    200. !!VRw117&v7218=2:+20 T10;     20-30
    201. !!VRw117&v7218=3:+50;         50

    202. ;由英雄等级确定追随者的经验等级
    203. !!VRy11:Sy2 :2;                                  英雄级别/2
    204. !!VRy11&y11>10:S10;                              限制最高10级
    205. !!VRy12:Sx1 *-1 -1;                              计算经验堆栈值
    206. !!EAy12:Ey11/12/d/d;                             按英雄级别给予追随者经验等级

    207. !!FU7118&y11>=5/y5>999:Px3/x1;                   5级+1000生命以上的追随者获得英雄奖励特技

    208. *tactics speed boost if enabled*
    209. !!UN:P218/?y1;                                       [check if tactics is enabled in WoG options]
    210. !!FU&y1<>1:E;                                        [exit if it isn't]
    211. !!VRy3:S0;                                           [initialize y3]
    212. !!VRy4:S0;                                           [initialize y4]
    213. !!BH0:N?y1;                                          [attacking hero #]
    214. !!BH1:N?y2;                                          [defending hero #]
    215. !!HEy1&y1>=0:S19/?y3;                                [get attacker's tactics]
    216. !!HEy2&y2>=0:S19/?y4;                                [get defender's tactics]
    217. !!FU&y3=0/y4=0:E;                                    [exit if no one has tactics]
    218. !!FU&y3=y4:E;                                        [exit if equal tactics level]
    219. !!FU&y3<y4/x2=0:E;                                   [exit if defender's tactics superior - attacker]
    220. !!FU&y3>y4/x2=1:E;                                   [exit if attacker's tactics superior - defender]
    221. !!VRy5&y3>y4/x2=0:S0 +y3 -y4;                        [set bonus if attackers tactics superior - attacker]
    222. !!VRy5&y3<y4/x2=1:S0 +y4 -y3;                        [set bonus if defenders tactics superior - defender]
    223. !!BMx1&y6>-1:Sdy5;                                   [give tactics speed boost]

    224. ** end of function
    复制代码
    GB修改加强版的第一追随者脚本(该脚本较大,需要分两部分引入地图),第二部分-
    1. ZVSE
    2. *各族英雄的追随者给予相应奖励
    3. !?FU7118;
    4. !!BMx2:F?y72;
    5. !!HEx1:B2/?y70;
    6. !!VRy70::2;
    7. !!VRy71&y70=0:Sy72|65536;        人,无反击
    8. !!VRy71&y70=1:Sy72|32768;        森,2连击
    9. !!VRy71&y70=2:Sy72|1024;         雪,免疫精神
    10. !!VRy71&y70=3:Sy72|16384;        恶,免疫火
    11. !!VRy71&y70=4:Sy72|262144;       鬼,亡灵
    12. !!VRy71&y70=5:Sy72|8;            龙,龙息
    13. !!VRy71&y70=6:Sy72|524288;       野,环击
    14. !!VRy71&y70=7:Sy72|2;            泽,飞行
    15. !!VRy71&y70=8:Sy72|131072;       元,无士气
    16. !!BMx2:Fy71;

    17. ** function to pick henchman
    18. !?FU7102;             x1=

    19. !!VRz1:S^你需要选择一个新的追随者吗?^;
    20. !!VRz2:S^^;
    21. !!VRz3:S^^;
    22. !!VRz4:S^^;
    23. !!VRz5:S^^;
    24. !!VRz6:S^^;
    25. !!VRz7:S^^;
    26. !!VRz8:S^^;
    27. !!VRz9:S^解散追随者^;
    28. !!VRz10:S^取消^;
    29. !!VRz11:S^进入追随者ERM加强菜单>>^;


    30. !!DO7100/0/6/1:P2;
    31. !!IF&1000:G1/1/256/1/2/3/4/5/6/7/8/9/11/10;                [give choice to human]
    32. !!FU&v1=512:E;

    33. !!VRy2&v1=1:S0;
    34. !!VRy2&v1=2:S1;
    35. !!VRy2&v1=4:S2;
    36. !!VRy2&v1=8:S3;
    37. !!VRy2&v1=16:S4;
    38. !!VRy2&v1=32:S5;
    39. !!VRy2&v1=64:S6;

    40. !!HE-1&v1<256:N?y3;                                  [get hero number]
    41. !!HE-1&v1<128:C0/y2/?y1/d-1;                         [get monster type, reduce quantity by 1]
    42. !!IF&v1<256/y3>-1:Wy3;                               [enable hero variable]
    43. *!VRw117&v1<256:S0;                                  [reset experience]
    44. *!VRw117&v1<128::2;                                  更换则经验值减半.

    45. !!VRw120&v1<128:S1;                                  更换则追随天数=1.
    46. !!VRw118&v1<128:Sy1;                                 [store monster type]
    47. !!VRw119&v1<128:S1;                                  [set to alive]
    48. !!IF&v1<128:Q2/21/w118/1^Be worthy of the honor,
    49. my hero.^; 追随者回应,这句话是"非常荣幸受此殊荣,我的英雄"的意思?

    50. !!VRw118&v1=128:S-2;                                 [reste monster type if dismissed]
    51. !!VRw117&v1=128:S0;                                  解雇则经验值为零
    52. !!VRw120&v1=128:S0;                                  解雇则追随天数归零.

    53. !!MA&v1<128/w118>-1/y3=62:Lw118/?y14;                恶魔泽达
    54. !!VRy15&v1<128/w118>-1/y3=62:Sy14 +1;                每次更换追随者则增加相应级别的经验
    55. !!VRw117&v1<128/w118>-1/y3=62:+y15;

    56. !!FU7115&v1=256:P;
    57. ;-------------------------------------------------------------------------------
    58. !?FU7115;
    59. !!HE-1:N?y3;
    60. !!FU&y3<0:E;
    61. !!IF:Wy3;
    62. !!VRz1:S^追随者ERM加强菜单^;
    63. !!VRz2:S^^;
    64. !!VRz2&v7220=0:S^启动 追随者融合进化!迈向终极最强生物!^;
    65. !!VRz3:S^^;
    66. !!VRz3&v7220=1:S^禁断 追随者融合进化^;
    67. !!VRz4:S^消耗魔法点来复活追随者^;
    68. !!VRz5&w121=0:S^停止该追随者的自动转职^;
    69. !!VRz5&w121=1:S^^;
    70. !!VRz6&w121=1:S^启用该追随者的自动转职^;
    71. !!VRz6&w121=0:S^^;
    72. !!VRz7&w121=1:S^手动转职^;
    73. !!VRz7&w121=0:S^^;
    74. !!VRz8:S^查看该英雄的追随者奖励特技^;
    75. !!VRz9:S^重新设定经验获得值^;
    76. !!VRz10:S^取消^;
    77. !!IF&1000:G1/1/256/1/2/3/4/5/6/7/8/9/10;
    78. !!FU&v1=256:E;

    79. !!VRv7220&v1=1:S1;                             进化
    80. !!VRv7220&v1=2:S0;                             无进化

    81. !!IF&w118<0/v1<64:M^Where is your Henchmen?^;  容错处理

    82. !!IF&w118>-1/w119=1/v1=4:M^Your Henchman alive.Dont need to resurrect.^;
    83. !!FU7116&w118>-1/w119=0/v1=4:Py3;           魔法复活函数

    84. !!VRw121&w118>-1/v1=8/w121=0:S1;            停止自动转职w121=1
    85. !!VRw121&w118>-1/v1=16/w121=1:S0;           启用手动转职w121=1

    86. !!FU7111&w118>-1/v1=32/w119=1:Py3/200;      转职函数

    87. !!FU7119&v1=64:Py3;

    88. !!FU7110&v1=128:P;                           经验点增加函数

    89. ;---------------------------------------------------------------------
    90. **魔法复活函数
    91. !?FU7116;
    92. !!IF:Wx1;
    93. !!MA:Lw118/?y14;
    94. !!VRy15:Sy14 +1;
    95. !!VRy16:Sv7213 *y15;
    96. !!HEx1:I?y17/1;
    97. !!IF&y17<y16:M^Need %Y16 MP to resurrect.^;
    98. !!FU&y17<y16:E;
    99. !!UN&y17>=y16:N3/2/w118/0;                     [get monster name]
    100. !!IF&y17>=y16:Q2/21/w118/2^Resurrect %Z2 for %Y16 MP?^;
    101. !!VRw119&2:S1;
    102. !!VRy17&2:-y16;
    103. !!HE-1&2:Iy17;

    104. ** end of function
    105. ;---------------------------------------------------------------------
    106. ** 重新设定经验点-函数
    107. !?FU7110;
    108. !!VRz1:S^请选择每次战斗后获得的经验范围:^;
    109. !!VRz2:S^6-10,默认.^;
    110. !!VRz3:S^10-15,标准.^;
    111. !!VRz4:S^20-30,加强.^;
    112. !!VRz5:S^50-50,超快.^;
    113. !!VRz6:S^不选择,退出^;
    114. !!IF&1000:G1/1/16/1/2/3/4/5/6;
    115. !!VRv7218&v1=1:S0;    变量v7218保存选择结果
    116. !!VRv7218&v1=2:S1;
    117. !!VRv7218&v1=4:S2;
    118. !!VRv7218&v1=8:S3;

    119. !?FU7119;
    120. !!HEx1:B2/?y-70;
    121. !!VRy-70::2;
    122. !!VRz1&y-70=0:S^人族英雄追随者: 无反击
    123. =天佑我军,誓死追随!=^;
    124. !!VRz1&y-70=1:S^女巫族英雄追随者: 二连击
    125. 暗夜,出击.^;
    126. !!VRz1&y-70=2:S^精灵族英雄追随者: 免疫精神魔法
    127. 绝对服从,永远追随.^;
    128. !!VRz1&y-70=3:S^恶魔族英雄追随者: 免疫火魔法
    129. 追随到地狱的最深处!^;
    130. !!VRz1&y-70=4:S^亡灵族英雄追随者: 不死属性
    131. 和平,我们最大的敌人^;
    132. !!VRz1&y-70=5:S^男巫族英雄追随者: 龙息攻击
    133. 宝物,财富,还是死亡?^;
    134. !!VRz1&y-70=6:S^野蛮人族英雄追随者: 环击
    135. 吼吼!杀啊!^;
    136. !!VRz1&y-70=7:S^驯兽师族英雄追随者: 飞行
    137. 啊!哦,嗯.^;
    138. !!VRz1&y-70=8:S^元素族英雄追随者: 无士气
    139. 无^;
    140. !!IF:D19/1;
    141. !!IF:E2/19;
    142. ** 完
    143. ;---------------------------------------------------------------------
    144. !?TM1&1000/v7181=1;
    145. !!DO7112/0/155/1:P;     追随天数每天加一

    146. *每天自动检查是否能转职,仅限于玩家的8个可见英雄.
    147. !!OW:O-1/?y9/?y1/?y2/?y3/?y4/?y5/?y6/?y7/?y8/?y10;
    148. !!IF&y1>-1:Wy1;
    149. !!FU7111&y1>-1/w121=0:Py1;
    150. !!IF&y2>-1:Wy2;
    151. !!FU7111&y2>-1/w121=0:Py2;
    152. !!IF&y3>-1:Wy3;
    153. !!FU7111&y3>-1/w121=0:Py3;
    154. !!IF&y4>-1:Wy4;
    155. !!FU7111&y4>-1/w121=0:Py4;
    156. !!IF&y5>-1:Wy5;
    157. !!FU7111&y5>-1/w121=0:Py5;
    158. !!IF&y6>-1:Wy6;
    159. !!FU7111&y6>-1/w121=0:Py6;
    160. !!IF&y7>-1:Wy7;
    161. !!FU7111&y7>-1/w121=0:Py7;
    162. !!IF&y8>-1:Wy8;
    163. !!FU7111&y8>-1/w121=0:Py8;

    164. !?FU7112;
    165. !!IF:Wx16;
    166. !!VRw120&w119=1:+1;
    167. !!VRw117&x16=106:+20;      Dessa's HENCHMAN DAY DAY UP

    168. *升级提示
    169. !!FU&w118<0:E;
    170. !!MA&w118>-1:Lw118/?y44;
    171. *!IF&y44=5/w120=7:M^6to7^;
    172. *!IF&y44=6/w120=8:M^7to7^;
    173. !!FU|w120<>13/y44<6:E;
    174. !!IF|w118=13/w118=27/w118=41/w118=131/w118=97:M^Tomorrow,Holy!Light!Victory!
    175. 8th henchman coming.^;
    176. !!IF|w118=83/w118=69/w118=111/w118=55:M^Tomorrow,Evil!Darkness!Kill!
    177. 8th henchman coming.^;

    178. ;-------------------------------------------------------------------------------
    179. ** 转职函数 **
    180. !?FU7111;
    181. !!IF:Wx1;
    182. !!FU|w118<0/w119=0:E;                        追随者不存在或死亡则退出
    183. !!FU7113:Pw118;                              检查该兵种的最低追随天数
    184. !!IF&w120<v7219/x2=200:M^Follow days too low.^;    少于最低天数则退出
    185. !!FU&w120<v7219:E;

    186. !!VRy18:Sw118;
    187. !!VRw118:+1;                     在原追随者类型上+1来获得转职对象的类型

    188. *7级兵另外处理
    189. !!VRw118&y18=158:S150;          8级兵循环转职
    190. !!VRw118&y18=13:S150;
    191. !!VRw118&y18=27:S151;
    192. !!VRw118&y18=41:S152;
    193. !!VRw118&y18=55:S153;
    194. !!VRw118&y18=69:S154;
    195. !!VRw118&y18=83:S155;
    196. !!VRw118&y18=97:S156;
    197. !!VRw118&y18=111:S157;
    198. !!VRw118&y18=131:S158;

    199. *元素城的非线性处理,真麻烦
    200. !!VRw118&y18=119:S112;
    201. !!VRw118&y18=112:S127;
    202. !!VRw118&y18=113:S125;
    203. !!VRw118&y18=114:S129;
    204. !!VRw118&y18=115:S123;
    205. !!VRw118&y18=127:S115;
    206. !!VRw118&y18=123:S114;
    207. !!VRw118&y18=129:S113;
    208. !!VRw118&y18=125:S120;
    209. !!VRw118&y18=121:S130;

    210. *中立兵种的转职重排,trouble..
    211. !!VRw118&y18=117:S173;   钻石人到圣诞小鬼
    212. !!VRw118&y18=139:S138;
    213. !!VRw118&y18=138:S143;
    214. !!VRw118&y18=143:S140;
    215. !!VRw118&y18=140:S142;
    216. !!VRw118&y18=142:S141;
    217. !!VRw118&y18=141:S144;
    218. !!VRw118&y18=136:S193;
    219. !!VRw118&y18=137:S170;
    220. !!VRw118&y18=135:S132;
    221. !!VRw118&y18=168:S133;
    222. !!VRw118&y18=167:S169;

    223. !!VRw118&y18=148:S164;    禁止箭塔出现,转向到火使者164
    224. !!VRw118&y18=196:S0;      龙巫妖到枪兵(196>>0),循环处理
    225. !!VRy12:Sw120;
    226. !!VRw120&x2<>200:S0;              追随天数置一

    227. **手动转职的提问,真FC,以前同样的代码竟然写了两次.
    228. !!IF&x2=200:Q5/21/y18/21/w118/2^Fellow days OK,upgrade?^;   提问是否转职
    229. !!VRw118&-5/x2=200:Sy18;
    230. !!VRw120&5/x2=200:S0;

    231. ** 转职函数结束 **
    232. ;---------------------------------------------------------------------
    233. ** 检查最低追随天数
    234. !?FU7113;
    235. !!MA:Lx1/?y10;         检查该追随者的等级
    236. !!VRv7219&y10=0:S3;    一级兵为3天,每级+1
    237. !!VRv7219&y10=1:S4;
    238. !!VRv7219&y10=2:S5;
    239. !!VRv7219&y10=3:S6;
    240. !!VRv7219&y10=4:S7;
    241. !!VRv7219&y10=5:S8;
    242. !!VRv7219&y10=6:S9;   未升级的7级兵转升级的需9天
    243. ;高级七级兵到八级兵需要14天
    244. !!VRv7219|x1=13/x1=27/x1=41/x1=55/x1=69/x1=83/x1=97/x1=111/x1=131:S14;
    245. ;---------------------------------------------------------------------

    246. ** function to pick henchman for AI
    247. !?FU7103;             x1= hero #  x16= slot #

    248. !!IF:Wx1;                                         [enable hero variable]
    249. *!HEx1&y1<7:C0/y1/?y2/?y3;                        [get monster type, quantity in slot y1]
    250. !!VRy2:S0 T173;                              [random 0 to 199]
    251. !!VRy2&y2>=132/y2<=135:S105;                 [random 0 to 173 (reroll if super dragons were selected)]
    252. !!VRy2&y2>=150/y2<=158:S136;                 [random 0 to 173 (reroll if 8th levels were selected)]
    253. !!VRy2&y2>=145/y2<=149:S172;                 [random 0 to 131 (reroll if war machines were selected)]
    254. !!VRy2&y2>=160/y2<=163:S63;                  [random 0 to 131 (reroll if emissaries were selected)]
    255. !!VRy2&y2=122:S192;                             [set NOT USED 1 to sylvan centaur]
    256. !!VRy2&y2=124:S193;                             [set NOT USED 2 to sorceress]
    257. !!VRy2&y2=126:S194;                             [set NOT USED 3 to werewolf]
    258. !!VRy2&y2=128:S195;                             [set NOT USED 4 to hell steed]
    259. !!VRy2&y2>173:S196;                             Dracolich
    260. !!VRy2&y2<0:S132;                               xixi
    261. !!MA:Ly2/?y11;
    262. !!VRy2&y11=6:S121;                              7级兵替换为魔法元素

    263. !!HEx1&y2>-1:E?y6/?y7/1;                             [get hero exp, level]
    264. !!VRy4&y2>-1:S25 T10 *y7;                            [random # 25-35 x hero level]
    265. !!VRw118&y2>-1:Sy2;                                  [set henchman type]
    266. !!VRw117&y2>-1/w118>-1/y4>w117:Sy4;                  [set AI experience if greater than previous]
    267. !!VRw117&y7>=15/y7<=19:+250;                         高等级电脑英雄每次有更多经验奖励
    268. !!VRw117&y7>=20/y7<=25:+500;
    269. !!VRw117&y7>=26:+1000;
    270. !!VRw119&y2>-1:S1;                                   [set to alive]
    271. *!VRw119&y2=-1:S0;                                   [set to dead]
    272. ** end of function

    273. ** function to get creature level    x1=type
    274. !?FU7104;

    275. !!MA:Lx1/?y7;                                        [get monster level (0-6)]

    276. !!VRy8:S0;                                           [set to 0]
    277. !!VRy8&x1<112:Sx1 %2;                                [check if upgraded]

    278. !!VRv7215&y7=0/y8=0:S20;                             [if level 1 = 20]
    279. !!VRv7215&y7=1/y8=0:S25;                             [if level 2 = 25]
    280. !!VRv7215&y7=2/y8=0:S35;                             [if level 3 = 35]
    281. !!VRv7215&y7=3/y8=0:S50;                             [if level 4 = 50]
    282. !!VRv7215&y7=4/y8=0:S75;                             [if level 5 = 75]
    283. !!VRv7215&y7=5/y8=0:S115;                            [if level 6 = 115]
    284. !!VRv7215&y7=6/y8=0:S180;                            [if level 7 = 180]

    285. !!VRv7215&y7=0/y8=1:S22;                             [if level 1 = 22 (upgrade)]
    286. !!VRv7215&y7=1/y8=1:S28;                             [if level 2 = 28 (upgrade)]
    287. !!VRv7215&y7=2/y8=1:S40;                             [if level 3 = 40 (upgrade)]
    288. !!VRv7215&y7=3/y8=1:S58;                             [if level 4 = 58 (upgrade)]
    289. !!VRv7215&y7=4/y8=1:S88;                             [if level 5 = 88 (upgrade)]
    290. !!VRv7215&y7=5/y8=1:S136;                            [if level 6 = 136 (upgrade)]
    291. !!VRv7215&y7=6/y8=1:S250;                            [if level 7 = 250 (upgrade)]


    292. !!VRv7215&x1=112:S35;                                [make air elemental = 35]
    293. !!VRv7215&x1=127:S40;                                [make storm elemental = 40]
    294. !!VRv7215&x1=113:S50;                                [make earth elemental = 50]
    295. !!VRv7215&x1=121:S58;                                [make magma elemental = 58]
    296. !!VRv7215&x1=119:S22;                                [make sprite = 22]
    297. !!VRv7215&x1=121:S136;                               [make magic elemental = 136]
    298. !!VRv7215&x1=123:S40;                                [maker ice elemental = 40]
    299. !!VRv7215&x1=129:S58;                                [make energy elemental = 58]
    300. !!VRv7215&x1=131:S225;                               [make phoenix = 225]

    301. !!VRv7215&x1=132:S550;                               [make azure dragon = 550]
    302. !!VRv7215&x1=133:S450;                               [make crystal dragon = 450]
    303. !!VRv7215&x1=134:S350;                               [make faerie dragon = 350]
    304. !!VRv7215&x1=135:S400;                               [make rust dragon = 400]
    305. !!VRv7215&x1>=150/x1<=158:S400;                      [make level 8 creatures = 400]

    306. !!VRv7215&x1=63:S80;                                 [make vampire lord = 80]
    307. !!VRv7215&x1=159:S25;                                [make ghost = 25]
    308. !!VRv7215&x1=172:S136;                               [make nightmare = 136]
    309. !!VRv7215&x1=196:S500;                               [make dracolich = 500]

    310. ** end of function

    311. ** function to initialize hero variable w118
    312. !?FU7105;
    313. !!IF:Wx16;                                           [enable hero variable]
    314. !!VRw117:S0;                                         经验清零
    315. !!VRw118:S-1;                                        追随者无
    316. !!VRw120:S0;                                         追随天数清零
    317. !!VRw121:S0;                                         默认为自动转职
    318. !!VRw117&x16>=145:S256;                              特殊战役英雄开始有经验奖励
    319. **给予追随者
    320. !!VRw118&x16=146:S12;                                女王的天使追随者
    321. !!VRw118&x16=149:S96;                                独眼龙的小白
    322. !!VRw118&x16=150:S67;                                哈特的黑骑
    323. !!VRw118&x16=152:S139;                               地主的农民
    324. !!VRw118&x16=153:S82;                                龙女的红龙
    325. !!VRw118&x16=155:S54;                                X的小恶魔
    326. !!VRw119|x16=146/x16=149/x16=150/x16=152/x16=153/x16=155:S1;
    327. !!VRv7206:S1;                                        [set "done" flag]
    328. ** end of function

    329. ** function to display henchman    x1 = hero number
    330. !?FU7106;
    331. !!IF&x1>-1:Wx1;                                      [enable hero variable]
    332. !!VRz1:S^^;
    333. !!VRz1&w119=0:S^<<<<{DEAD}>>>>^;
    334. !!FU7104&w118>-1:Pw118;                              [function to get monster level]
    335. !!HEx1:E?y1/?y2/1;                                   [get hero exp, level]
    336. !!VRy2:-1 *10 +c -1;                                 [bonus status = (hero level -1) x10  + current day -1]
    337. !!VRy11:Sw117 +y2;                                   [total status points = earned status + bonus status]
    338. !!VRy3:Sy11 :v7215 +1;                               [henchman level = status points / level rate + 1]
    339. !!VRy4:Sy11 %v7215 -v7215 *-1;                       [calculate status needed for next level]


    340. !!MA&w118>-1:Aw118/?y1;                              [get base attack]
    341. !!VRy5:Sy3 :3 +1 +y1;                                [attack = level / 10 + 1 + base]
    342. !!MA&w118>-1:Dw118/?y1;                              [get base defense]
    343. !!VRy6:Sy3 :3 +1 +y1;                                [defense = level / 3 + 1 + base]
    344. !!MA&w118>-1:Pw118/?y1;                              [get base health]
    345. !!VRy7:Sy1 +10 *y3;                                  [health = base + 2 x level]
    346. !!MA&w118>-1:Mw118/?y1;                              [get base damage min]
    347. !!VRy8:Sy1 +2 *y3;                                   [damage min = base + 2 x level]
    348. !!MA&w118>-1:Ew118/?y1;                              [get base damage max]
    349. !!VRy9:Sy1 +5 *y3;                                   [damage max = base + 5 x level]
    350. !!MA&w118>-1:Sw118/?y1;                              [get base speed]
    351. !!VRy10:Sy3 :10 +1 +y1;                              [speed = level / 3 + 1 + base]
    352. !!FU7113:Pw118;

    353. !!IF:Q2/21/w118/2^{Henchman level} : %Y3
    354. {Level Rate} : %V7215  {Status for next level} : %Y4
    355. {Status Total} : %Y11  {Earned} : %W117  {Bonus} : %Y2
    356. Attack : %Y5   Defense : %Y6
    357. Health : %Y7   Damage : %Y8-%Y9
    358. Speed : %Y10
    359. Follow : %W120 days
    360. (Follow Rate=%V7219 days)
    361. %Z1
    362. {Do you wish to select a new Henchman?}^;
    363. !!FU7102&2:P;                                        [if yes, select henchman]
    364. ** end of function

    365. ** function to handle dead/alive status
    366. !?FU7107;               x1=attacker/defender    x2= dead/alive
    367. !!BA&x1=0:H0/?y1;                                    [get hero number - attacker]
    368. !!BA&x1=1:H1/?y1;                                    [get hero number - defender]
    369. !!IF:Wy1;                                            [enable hero variable]
    370. !!VRw119:Sx2;                                        [set to x2 0=dead,1=alive]
    371. !!BMx3&x2=0:V15 V80;                                 追随者死亡时动画
    372. !!BMx3&x2=1:V20 V51;                                 追随者复活时动画
    373. !!BMx1&x2=1/v7221<=0:M4/100/1;                       标志
    374. !!BMx1&x2=1/v7221>0:M8/100/1;

    375. ** end of function

    376. ** function to resurrect dead henchman
    377. !?FU7108;
    378. !!IF&x1>-1:Wx1;                                      [enable hero variable]
    379. !!FU7104&w118>-1:Pw118;                              [get monster level]
    380. !!HEx1:E?y6/?y7/1;                                   [get hero exp, level]
    381. !!IF&x1>-1:Wx1;                                      [enable hero variable]
    382. !!VRy10:Sy7 -1 *10 +w117 +c;                         [experience points = (hero level -1) x10  +earned xp + current day]
    383. !!VRy3:Sy10 :v7215 +1;                               [henchman level = experience points / level rate + 1]
    384. !!MA:Cw118/6/?y8;                                    [get base creature cost]
    385. !!VRy4:Sy8 *y3 :5;                                   [resurrection cost = base cost x henchman level / 5]
    386. !!IF:Q2/21/w118/2^{Henchman level = %Y3}

    387. Do you wish to resurrect this Henchman?
    388. It will cost %Y4 gold.^;
    389. !!OW:R-1/6/?y5;                                      [get current gold amount]
    390. !!VRy8&2/y5>=y4:Sy5 -y4;                             [calculate gold transaction]
    391. !!OW&2/y5>=y4:R-1/6/y8;                              [if yes and player has enough gold,set new gold amount]
    392. !!VRw119&2/y5>=y4:S1;                                [if yes and player has enough gold, set to alive]
    393. !!IF&2/y5<y4:M^Sorry, you can't afford to pay for the resurrection.^; [if yes and player does not have enough gold, display message]
    394. ** end of function
    395. ***END***
    复制代码
    3.城镇、英雄可以改名、重排-
    1. ZVSE
    2. !?CM1&999;

    3. !!UN:P169/?v1; [Check if town renaming option is enabled]
    4. !!CM:A?v2/?v3 F?v4 S?v5; [Get x/y position, mode and flags of click]
    5. !!FU10813&v1=1/v2>=79/v2<=240/v3>=387/v3<=405/v4=0/v5=12:P;  [Call renaming function if town name is left-clicked]

    6. -------------------------------------------------------------------------------

    7. [Hint Text trigger: Display new hint text for Town Name field]
    8. !?MM1&999;
    9. !!UN:P169/?v1; [Check if town renaming option is enabled]
    10. !!FU&v1<>1:E; [Exit if Town Renaming isn't enabled]
    11. !!VRz-1:Sz125000;
    12. !!CM:A?v2/?v3; [Get x/y position of mouse pointer (v2/v3)]
    13. !!CM&v2>=79/v2<=240/v3>=387/v3<=406:Mz-1; [Display hint text]

    14. -------------------------------------------------------------------------------

    15. [Town renaming function]

    16. !?FU10813;

    17. !!CA-1:N?z1; [Store name of town in z-1]
    18. !!VRz2:Sz125001;
    19. !!VRz3:Sz125002;
    20. !!VRz4:S^^;
    21. !!IF:D17/2/3/4/4/4/4/4/4/4/4/4/4/4/4/4; [Set up dialogue box]
    22. !!IF:E1/17; [Display dialogue box]
    23. !!VRz1:H1; [Set flag 1 to true if text entered, false if no text entered]
    24. !!FU|-1/v1<1:E; [Exit if no text entered]

    25. !!UN:U98/-1/?y1; [Number of towns on map: y1]
    26. !!VRv1:S-1; [Initialize v1 to -1 for fast UN:U looping: v1]
    27. !!IF:V2/0; [Initialize Flag 2 to False]
    28. !!DO10808/1/y1/1:P; [Loop through all towns to check for duplicate names]
    29. !!CA-1&-2:Nz1; [Change town name if text entered and not a duplicate]
    30. !!IF&-2:M1/z125003; [Display message that name will be updated]
    31. !!IF&2:M1/z125087; [Display message that duplicate name was found]

    32. -------------------------------------------------------------------------------

    33. [Check for duplicate town name - set Flag 2 to True if duplicate found]

    34. !?FU10808;

    35. !!UN:U98/-1/-1/1; [Next town coordinates at v1/v2/v3]
    36. !!CAv1/v2/v3:N?z5; [Town name: z5]
    37. !!IF&z1=z5:V2/1; [Set Flag 2 to TRUE if duplicate town is found]
    38. !!VRx16&2:S999; [Exit loop if duplicate town name found]

    39. -------------------------------------------------------------------------------

    40. [End of Town Renaming]


    41. ZVSE
    42. !?CM2&999;
    43. !!UN:P187/?y-1; [Check if script is enabled: y-1]
    44. !!FU&y-1<>1:E; [Exit if script isn't enabled]
    45. !!CM:A?v1/?v2 F?v3 S?v4; [x/y location clicked, v3 = flags, v4 = type of click]
    46. !!VRv3:S0; [Initialize v3 to 0]
    47. !!VRv3&v1>=146/v2>=27/v1<=362/v2<=60/v3=0/v4=12:S1; [Set v3 to 1 if Hero's name is clicked on]
    48. !!FU&v3<>1:E; [Exit if Hero's name isn't clicked]

    49. !!HE-1:B0/?z9; [Store name of Hero in z9]
    50. !!VRz2:Sz125019;
    51. !!VRz3:Sz125020;
    52. !!VRz4:S^^;
    53. !!IF:D17/2/3/4/4/4/4/4/4/4/4/4/4/4/4/4; [Set up dialogue box]
    54. !!IF:E1/17; [Display dialogue box]
    55. !!VRz1:H1; [Set flag 1 to true if text entered, false if no text entered]
    56. !!FU|-1/v1<1:E; [Exit if nothing entered]
    57. !!VRy-9:S0; [Initialize y-9 to 0]
    58. !!DO10815/0/155/1:P; [Check for a duplicate hero name: set y-9 to 99 if duplicate]
    59. !!FU&y-9=99:E; [Exit if duplicate name found]

    60. !!VRz2:Sz9; [Store old name in z2]
    61. !!VRz2:M4/?y-2; [Length of old name: y-2]

    62. !!VRz1:M5/?y-6; [1st non-space character position of new name: y-6]
    63. !!VRz1:M6/?y-7; [Last non-space character position of new name: y-7]
    64. !!VRy-8:Sy-7 +1 -y-6; [Length of new name string to copy: y-8]
    65. !!VRy-8&y-8>12:S12; [Maximum 12 characters: y-8]
    66. !!VRz3:M1/z1/y-6/y-8; [Store up to first 12 characters of new name in z3]
    67. !!VRz3:M4/?y-3; [Length of new name: y-3]

    68. !!HE-1:B0/z3; [Change hero's name if text entered: z3]

    69. !!HE-1:B1/?z1; [Read custom bio (if any): z1]
    70. !!VRz1:H1; [Set flag 1 to True if custom bio exists, false if no custom bio yet]
    71. !!HE-1&-1:B3/?z1; [Read hero's default bio if no custom bio: z1]
    72. !!VRz1:M4/?y-1; [Length of bio: y-1]

    73. !!VRy-4:Sy-1 +200; [Add 200 to bio length: y-4]
    74. !!VRy-5:S-1; [Initialize y-5 to -1]

    75. !!DO10937/0/y-4/1&y-1>0:P; [Replace old name with new name in hero's bio]

    76. !!UN:R3/-1; [Redraw Hero screen]

    77. ------------------------------------------------------------------------------------------------------------------

    78. [Loop through all heroes to check for a duplicate]
    79. [hero name: Set y-9 to 99 if duplicate found]

    80. !?FU10815;
    81. !!HEx16:B0/?z8; [Hero x16's name: z8]
    82. !!VRy-9&z8=z1:S99; [Set y-9 to 99 if duplicate found]
    83. !!VRx16&z8=z1:S999; [Set x16 to 999 to exit loop if duplicate found]
    84. !!IF&z8=z1:M1/z125088; [Display message that a duplicate hero name was found]

    85. ------------------------------------------------------------------------------------------------------------------

    86. [Replace old name with new name in hero's bio]

    87. !?FU10937;
    88. !!VRz-1:M1/z1/x16/y-2; [Get a substring of old name-length: z-1]
    89. !!FU&z-1<>z2:E; [Skip to next loop number if old name not found yet]

    90. !!VRy-5:Sx16; [If old name found, set y-5 to start position: x16]

    91. [Build new bio string: z-2]
    92. !!VRz-2:M1/z1/0/x16;  [1st part of string: z-2]
    93. !!VRy1:Sx16 +y-2; [Start of 2nd part of string after name: y1]
    94. !!VRy2:Sy-1 -y1; [Length of 2nd part of string after name: y2]
    95. !!VRz-3:M1/z1/y1/y2; [2nd part of string: z-3]
    96. !!VRz1:S^%Z-2%Z3%Z-3^; [New string: z1]
    97. !!HE-1:B1/z1; [Set new bio: z1]
    98. !!VRz1:M4/?y-1; [Update length of bio: y-1]

    99. ------------------------------------------------------------------------------------------------------------------

    100. [End of Hero Renaming]

    101. !?CM5&999;
    102. !!CM:F?y-1 I?y-2; [Type of click (1=shift): y-1, Location clicked: y-2]
    103. !!CM:S?y-3; [Subtype of click (12 if left click, 13 if left click-release): y-3]
    104. !!FU&y-1<>1:E; [Exit if not a shift-click]

    105. !!FU41&y-2>=39/y-2<=43:P; [Call Function 41 if a Hero slot is shift-clicked]
    106. !!FU42&y-2>=32/y-2<=36:P; [Call Function 42 if a Town slot is shift-clicked]

    107. [Move Hero shift-clicked to first slot]
    108. !?FU41;
    109. !!VRy1:Sy-2 -39; [Hero slot that's shift-clicked (0..4): y1]
    110. !!OW:O-1/y1/?y2; [Hero that's shift-clicked in Hero list: y2]
    111. !!OW:A-1/?y3; [Active hero: y3]
    112. !!CM&y2=y3/y-3<>13:R0; [Cancel normal click operation if active hero shift-clicked]
    113. !!FU|y2<0/y-3<>13:E; [Exit if no hero in hero slot or if not shift-click release]
    114. !!OW:O-1/1/y1/0; [Move hero to top of list]
    115. !!OW:A-1/y2; [Set active hero to hero shift-clicked: y2]
    116. !!CM:R0; [Cancel normal click operation for shift click-release]
    117. !!UN:R1; [Redraw screen]

    118. [Move town shift-clicked to first slot]
    119. !?FU42;
    120. !!VRy1:Sy-2 -32; [Town slot that's shift-clicked (0..4): y1]
    121. !!OW:N-1/y1/?y2; [Real Town number of Town shift-clicked in Town list: y2]
    122. !!OW:N-1/?y3; [Active town number: y3]
    123. !!CM&y2=y3/y2>=0/y-3<>13:R0; [Disabled standard click response if active town clicked]
    124. !!FU|y2<0/y-3<>13:E; [Exit if no town in town slot or if not shift-click release]
    125. !!OW:N-1/1/y1/0; [Move town to top of list]
    126. !!UN:R1; [Redraw screen]

    127. !?CM5&999;
    128. !!CM:F?y-1 I?y-2; [Type of click (1=shift): y-1, Location clicked: y-2]
    129. !!CM:S?y-3; [Subtype of click (12 if left click, 13 if left click-release): y-3]
    130. !!FU&y-1<>1:E; [Exit if not a shift-click]

    131. !!FU41&y-2>=39/y-2<=43:P; [Call Function 41 if a Hero slot is shift-clicked]
    132. !!FU42&y-2>=32/y-2<=36:P; [Call Function 42 if a Town slot is shift-clicked]

    133. [Move Hero shift-clicked to first slot]
    134. !?FU41;
    135. !!VRy1:Sy-2 -39; [Hero slot that's shift-clicked (0..4): y1]
    136. !!OW:O-1/y1/?y2; [Hero that's shift-clicked in Hero list: y2]
    137. !!OW:A-1/?y3; [Active hero: y3]
    138. !!CM&y2=y3/y-3<>13:R0; [Cancel normal click operation if active hero shift-clicked]
    139. !!FU|y2<0/y-3<>13:E; [Exit if no hero in hero slot or if not shift-click release]
    140. !!OW:O-1/1/y1/0; [Move hero to top of list]
    141. !!OW:A-1/y2; [Set active hero to hero shift-clicked: y2]
    142. !!CM:R0; [Cancel normal click operation for shift click-release]
    143. !!UN:R1; [Redraw screen]

    144. [Move town shift-clicked to first slot]
    145. !?FU42;
    146. !!VRy1:Sy-2 -32; [Town slot that's shift-clicked (0..4): y1]
    147. !!OW:N-1/y1/?y2; [Real Town number of Town shift-clicked in Town list: y2]
    148. !!OW:N-1/?y3; [Active town number: y3]
    149. !!CM&y2=y3/y2>=0/y-3<>13:R0; [Disabled standard click response if active town clicked]
    150. !!FU|y2<0/y-3<>13:E; [Exit if no town in town slot or if not shift-click release]
    151. !!OW:N-1/1/y1/0; [Move town to top of list]
    152. !!UN:R1; [Redraw screen]
    复制代码

    该用户从未签到

    178

    回帖

    6800

    金币

    0

    精华

    2级 Adventuring Hero

    Rank: 2

    积分
    452
     楼主| 发表于 2008-3-14 16:36:18 | 显示全部楼层
    谢谢管理员大大!我可以完成我的地图了!

    [ 本帖最后由 快乐BOY 于 2008-3-14 16:37 编辑 ]
    穿名牌不是帅,走路带风才是真正的帅!
    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 英雄注册|Register

    本版积分规则

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

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

    GMT+8, 2024-5-29 15:54 , Processed in 0.355065 second(s), 14 queries , Gzip On, File On.

    Powered by Discuz! X3.4

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

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