佳丽云

英雄无敌3-WoG中文站

 找回密码
 英雄注册|Register
查看: 2724|回复: 2

城堡升级脚本里影响资源增加的变量是哪个?

[复制链接]
  • TA的每日心情
    慵懒
    昨天 20:10
  • 签到天数: 3882 天

    连续签到: 21 天

    [LV.Master]伴坛终老

    3876

    回帖

    5万

    金币

    0

    精华

    9级 Promising Supreme Hero

    Rank: 9Rank: 9Rank: 9

    积分
    76918
    发表于 2013-10-15 23:48:59 | 显示全部楼层 |阅读模式
    1. ZVSE
    2. _WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
    3. ERMS_PoweredBy=ERM Scripter v. 2004.6.29.918
    4. ERMS_ScriptName=Castle upgrading
    5. ERMS_ScriptAuthor=Alexis Koz
    6. ERMS_ScriptVersion=1.0.0
    7. ERMS_ScriptDate=24.9(September).2013
    8. ERMS_ScriptERMVersion=2,6
    9. ERMS_ScriptLanguage=Russian or 痼耨觇?(native)
    10. ** Castle Upgrading by Alexis Koz
    11. ** Wogify name: script45.erm
    12. ** Last Updated: July 18, 2006 to let you check (but not make) your castle upgrades when it's not your turn
    13. ** Previously Updated: August 12, 2005

    14. ** This script lets a player upgrade once per day and town a dwelling or Gold Reserve.
    15. ** To upgrade, in the town screen click on the Town (Gold Reserve) or Castle (dwelling)
    16. ** icon left of and below the town's name.
    17. **
    18. ** The Gold Reserve gives you 1000 gold per day for each upgrade level. An upgraded
    19. ** dwelling increases the creature growth by 7 (for L1), 6 (L2), 5 (L3) ... 1 L7) per week.
    20. **
    21. ** To prevent unlimited upgrades, the gold costs for each upgrade increases POTENTIAL!
    22. ** This means, the first upgrade costs f.e. 1000 gold, the second 2000, the third
    23. ** 4000, the fourth 8000 and so on. The costs for other resource increases are linear
    24. ** (+1, +2, +3, +4 ...)
    25. **
    26. ** The AI tries daily to build either a Gold Reserve (chance is 33 %) or to upgrade
    27. ** a dwelling in every second town (randomly chosen). The AI may upgrade a dwelling
    28. ** or the gold reserve more than once per day (if the odds are very good) and
    29. ** pays only the basic, not increased upgrade price (7000 gold + 2 mithril for
    30. ** the Gold Reserve or the usual building costs for the upgraded dwelling for the dwellings).
    31. ** The AI will never build more than 7 upgrades of a dwelling or the Gold Reserve in a town.
    32. **
    33. ** As well, the player (including the AI) has to build at least the City Hall to build a Gold
    34. ** Reserve or the usual upgraded dwelling, before a dwelling upgrade can be built.

    35. ** @Scripters / Mapmakers: if you want to know how much bonus a town gets, use
    36. ** the FU862 (see description at the end of the script)

    37. ** Used v1600-v1984 EXCLUSIVE, v1-v9 not exclusive
    38. ** Flag 432
    39. ** FU819, FU859-864


    40. !#UN:P45/=1;
    41. !#IF&1:V432/1; // enable v432, if script is enabled

    42. !?PI&432; // post instruction (start of the map) - Init Vars v1600-v1984 (used to save which upgrades are built)
    43. !!VRv1600:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0; // there are 48 towns and 8 possible upgrades (town hall + 7 dwellings)
    44. !!VRv1616:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    45. !!VRv1632:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    46. !!VRv1648:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    47. !!VRv1664:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    48. !!VRv1680:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    49. !!VRv1696:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    50. !!VRv1712:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    51. !!VRv1728:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    52. !!VRv1744:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    53. !!VRv1760:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    54. !!VRv1776:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    55. !!VRv1792:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    56. !!VRv1808:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    57. !!VRv1824:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    58. !!VRv1840:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    59. !!VRv1856:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    60. !!VRv1872:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    61. !!VRv1888:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    62. !!VRv1904:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    63. !!VRv1920:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    64. !!VRv1936:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    65. !!VRv1952:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
    66. !!VRv1968:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;

    67. !?TM2&432/$once$=1;
    68. !!UN:U98/-1/?y-1; // count towns
    69. !!VRv7:S-1; // init
    70. !!DO859/1/y-1/1&y-1>0:P; // loop through them, give gold, increase creatures

    71. !?TM2&432;
    72. !!OW:I$lastplayer$/=1; // check if the last player was AI
    73. !!FU&-1:E; // exit, if not

    74. !!OW:W$lastplayer$/?y-1; // get number of his towns
    75. !!FU&y-1<1:E; // exit, if he has no towns
    76. !!VRy-2:Sy-1 :2; // halve the number of towns
    77. !!DO863/0/y-2/1:P$lastplayer$/y-1; // tries to  build / upgrade a random dwelling (or Gold Reserve) in every 2nd AI-town
    78. *********


    79. -------------------------------Click handling-----------------------------------
    80. !?CM1&432; // click inside a town
    81. ** y-1  - clicked field
    82. ** y-2  - flags of the click
    83. ** y-3  - owner of town
    84. ** y-4  - town number
    85. ** y-5  - current player
    86. ** y-6  - creature level (1..7)
    87. ** y-7  - type of town
    88. ** y-8  - number of already existing upgr. dwellings
    89. ** y-9  - total bonus of creatures of the chosen level
    90. ** y-10 - bonus per dwelling of the chosen level
    91. ** y-11 - creature that is available in this dwelling
    92. ** y-12 - subtype of click

    93. ** v1-v7 - prices for the upgrade

    94. !!CM:I?y-1 F?y-2 S?y-12;  // clicked field and flags
    95. !!FU|y-2>0/y-12=13:E; //Exit if no left-click or it's a click-release
    96. !!FU&y-1<>150/y-1<>158:E; // exit, if not clicked on the hall- or town icon

    97. !!CA-1:O?y-3 U?y-4 T?y-7; // get owner, town number, and town type
    98. !!OW:C?y-5; // get current player
    99. !!FU$LocalPlayer$:P; [Get local player: y-100]
    100. !!FU&y-3<>y-100:E; // exit, if owner <> local/current player (f.e. allied)

    101. !!CM:R0; // disable standard function of the icons

    102. ** Gold Reserve:
    103. !!FU860&y-1=158:Py-4/y-5; // Hall icon click: Build Gold Reserve; give town number and owner
    104. !!FU&y-1=158:E; // exit after that

    105. ** upgrade Creature dwellings

    106. !!IF:V2/0 V3/0;           [Initialize Flag 2 and 3 to False]
    107. !!DO819/1/7/1:Py-4; // Check for dwellings built and set z1-z7 to the correct texts;
    108. *                  // flag 2 will be set, if there is at least one upd. dwelling
    109. *                  // flag 3 will be set, if you already built an upgrade in this town today

    110. !!IF&-2:M1/z145020; // message: no upgraded dwellings in this town
    111. !!FU&-2:E; // exit

    112. !!VRz-9:Sz145017;  // Upgrade-Question    [Set strings for radio button box]
    113. !!VRz-8:Sz145018; // have changed my mind
    114. !!IF:G1/1/128/-9/1/2/3/4/5/6/7/-8; // ask for the dwelling
    115. !!FU&v1=128:E; // exit if don't update chosen

    116. !!IF&y-5<>y-100:M1/z145024; [Msg: you can only upgrade a dwelling on your own turn]
    117. !!FU&y-5<>y-100:E; [Exit if not player's turn]

    118. !!VRy-6&v1=1:S1; !!VRy-6&v1=2:S2; !!VRy-6&v1=4:S3; !!VRy-6&v1=8:S4; !!VRy-6&v1=16:S5; !!VRy-6&v1=32:S6; !!VRy-6&v1=64:S7; // set y-6 to the chosen level

    119. !!VRy-99:Sy-6 -1; // correct level (0..6) for UN:T
    120. !!UN:Ty-7/y-99/1/?y-11 N3/-10/y-11/1; // get creature to hire in this town and make a name lookup (to z-10)
    121. !!VRy-10:Sy-6 *-1 +8; // additional number of creatures per dwelling: 7 for each L1, 6 for each L2 ... 1 for each L7

    122. !!FU862:Py-4/y-6/0/?y-8/?y-9; // get current number of upgrades of the dwelling to y-8, y-9 will be the number of bonus creatures
    123. !!CA-1:N?z-9; // get name of town
    124. !!VRz-1:Sz145000; // set status-text

    125. !!VRz-1&3:+z145008; // add "already improved today"
    126. !!IF&3:Q1/21/y-11/1/z-1; // show the message
    127. !!FU&3:E; // and exit

    128. !!FU861:Py-7/y-6;  // get price of a simple upgrade, return in v1-v7
    129. !!VRy-8:+1; // increase number of upgrades by one
    130. !!FU$bit$:Py-8; // get the xth power of 2 (1, 2, 4, 8, 16 ...) depending on the number of built upgrades, return in y-100
    131. !!VRv7:*1;// calc new price (gold): it is increased potential depending on the already built upgrades, other resources are untouched
    132. !!VRv1&v1>0:+y-8; !!VRv2&v2>0:+y-8; !!VRv3&v3>0:+y-8; !!VRv4&v4>0:+y-8; !!VRv5&v5>0:+y-8; !!VRv6&v6>0:+y-8; // increase the resource costs linear
    133. !!VRz-1&v7>0:+z145001;
    134. !!VRz-1&v1>0:+z145002;
    135. !!VRz-1&v3>0:+z145003; // add resource-costs to z-1
    136. !!VRz-1&v2>0:+z145004;
    137. !!VRz-1&v4>0:+z145005;
    138. !!VRz-1&v5>0:+z145006;
    139. !!VRz-1&v6>0:+z145007;

    140. !!OW:R-1/0/?y-21 R-1/1/?y-22 R-1/2/?y-23 R-1/3/?y-24 R-1/4/?y-25 R-1/5/?y-26 R-1/6/?y-27; // get players resources
    141. !!IF:V4/0; // init flag 4
    142. !!IF|y-21<v1/y-22<v2/y-23<v3/y-24<v4/y-25<v5/y-26<v6/y-27<v7:V4/1; // enable flag, if the player has not enough resources
    143. !!VRz-1&4:+z145010; // msg can not afford update
    144. !!IF&4:Q1/21/y-11/1/z-1; // show message
    145. !!FU&4:E; // and exit

    146. !!VRz-1:+z145009; // msg: ask to improve
    147. !!IF:Q1/21/y-11/2/z-1; // show message
    148. !!FU&-1:E; // exit, if no chosen

    149. !!VRy-8:*-1; // negate the new number of upgrades (to mark it as built today)
    150. !!FU862:Py-4/y-6/1/y-8; // set the new value
    151. !!VRy-21:-v1; !!VRy-22:-v2; !!VRy-23:-v3; !!VRy-24:-v4; !!VRy-25:-v5; !!VRy-26:-v6; !!VRy-27:-v7; // take resources
    152. !!OW:R-1/0/y-21 R-1/1/y-22 R-1/2/y-23 R-1/3/y-24 R-1/4/y-25 R-1/5/y-26 R-1/6/y-27; // write reduced resources back

    153. *********

    154. -------------------------Mouse Move trigger (for hint text)---------------------

    155. !?MM1&432/999;
    156. !!CM:I?y-1; //Area mouse moves over
    157. !!VRz-1&y-1=158:Sz145021;
    158. !!VRz-1&y-1=150:Sz145022;
    159. !!CM&y-1=150|y-1=158:Mz-1; //Display mouse-over hint text
    160. *********


    161. ------------------------- Functions --------------------------------------------

    162. !?FU819; // check, if upgr. dwelling is built and set z1-z7
    163. !!VRy1:Sx16 +36; // get the correct building number
    164. !!CA0/x1:B3/y1; // check, if it is built
    165. !!VRy1&-1:S-1; [If not built, initialize y1 to -1]
    166. !!VRy1&-1/y-7=0/x16=3:S19; [Castle horde building for Royal Griffins (L3) is #19: y1]
    167. !!VRy1&-1/y-7=1/x16=2:S19; [Rampart horde building for Battle Dwarves (L2) is #19: y1]
    168. !!VRy1&-1/y-7=1/x16=5:S25; [Rampart horde building for Dendroid Soldiers (L5) is #25: y1]
    169. !!VRy1&-1/y-7=2/x16=2:S19; [Tower horde building for Obsidian Gargoyles (L2) is #19: y1]
    170. !!VRy1&-1/y-7=3/x16=1:S19; [Inferno horde building for Familiars (L1) is #19: y1]
    171. !!VRy1&-1/y-7=3/x16=3:S25; [Inferno horde building for Cerberi (L3) is #25: y1]
    172. !!VRy1&-1/y-7=4/x16=1:S19; [Necropolis horde building for Skeleton Warriors (L1) is #19: y1]
    173. !!VRy1&-1/y-7=5/x16=1:S19; [Dungeon horde building for Troglodytes (L1) is #19: y1]
    174. !!VRy1&-1/y-7=6/x16=1:S19; [Stronghold horde building for Hobgoblins (L1) is #19: y1]
    175. !!VRy1&-1/y-7=7/x16=1:S19; [Fortress horde building for Gnoll Marauders (L1) is #19: y1]
    176. !!VRy1&-1/y-7=8/x16=1:S19; [Conflux horde building for Sprites is #19: y1]
    177. !!CA0/x1&-1/y1>0:B3/y1; [Check if horde building is built]
    178. !!VRzx16&-1:S^^; // set z-var to blank, if there is no upgr. building
    179. !!FU&-1:E; // and exit

    180. !!IF:V2/1; // set flag 2 to mark, that there is (at least one) upgr. dwelling

    181. !!VRy2:Sx16 -1; // correct creature level
    182. !!CA0/x1:T?y3; // get type of town
    183. !!UN:Ty3/y2/1/?y4 N3/-10/y4/1; // get creature to hire in this town and make a name lookup (to z-10)

    184. !!FU862:Px1/x16/0/?y98/?y99; // check number of already build upgrades
    185. !!VRzx16:S145019; // set text "Level X16 (z-10)"
    186. !!IF&y98<0:V3/1; // enable flag, if a dwelling was already upgraded today

    187. *********


    188. !?FU859; // called by TM2; loop through towns, give gold, increase creatures
    189. !!UN:U98/-1/-1/7; // get next town
    190. !!CAv7/v8/v9:U?y1 O?y2; // get town number and owner
    191. !!FU862&y2>-1:Py1/0/0/?y3/?y4; // get gold resources and gold bonus
    192. !!OW&y2>-1:Ry2/6/dy4; // give additional gold from gold reserve
    193. !!VRy5&y3<0:Sy3 *-1; // get positive value, if gold reserve was upgraded the day before
    194. !!FU862&y3<0:Py1/0/1/y5; // write this value back

    195. !!IF:V1/0; !!IF&$weekday$=1:V1/1; // set flag 1 on mondays

    196. !!FU862:Py1/1/0/?y3/?y4; // get L1-Upgrades
    197. !!CAv7/v8/v9&y4>0/1:M1/0/d/dy4; // add creatures to town
    198. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    199. !!FU862&y3<0:Py1/1/1/y5; // write this value back

    200. !!FU862:Py1/2/0/?y3/?y4; // get L2-Upgrades
    201. !!CAv7/v8/v9&y4>0/1:M1/1/d/dy4; // add creatures to town
    202. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    203. !!FU862&y3<0:Py1/2/1/y5; // write this value back

    204. !!FU862:Py1/3/0/?y3/?y4; // get L3-Upgrades
    205. !!CAv7/v8/v9&y4>0/1:M1/2/d/dy4; // add creatures to town
    206. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    207. !!FU862&y3<0:Py1/3/1/y5; // write this value back

    208. !!FU862:Py1/4/0/?y3/?y4; // get L4-Upgrades
    209. !!CAv7/v8/v9&y4>0/1:M1/3/d/dy4; // add creatures to town
    210. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    211. !!FU862&y3<0:Py1/4/1/y5; // write this value back

    212. !!FU862:Py1/5/0/?y3/?y4; // get L5-Upgrades
    213. !!CAv7/v8/v9&y4>0/1:M1/4/d/dy4; // add creatures to town
    214. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    215. !!FU862&y3<0:Py1/5/1/y5; // write this value back

    216. !!FU862:Py1/6/0/?y3/?y4; // get L6-Upgrades
    217. !!CAv7/v8/v9&y4>0/1:M1/5/d/dy4; // add creatures to town
    218. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    219. !!FU862&y3<0:Py1/6/1/y5; // write this value back

    220. !!FU862:Py1/7/0/?y3/?y4; // get L7-Upgrades
    221. !!CAv7/v8/v9&y4>0/1:M1/6/d/dy4; // add creatures to town
    222. !!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
    223. !!FU862&y3<0:Py1/7/1/y5; // write this value back
    224. *********


    225. --------------------------Dialog to build gold reserve-----------------------------
    226. !?FU860;
    227. ** x1 - town
    228. ** x2 - owner
    229. ** y1 - players gold
    230. ** y2 - players mithril
    231. ** y3 - already built reserves
    232. ** y4 - amount of gold you already get
    233. ** y5 - gold price for the next upgrade
    234. ** y6 - mithril price for the next upgradee

    235. !!CA0/x1:B3/12 T?y99; // check for city hall and get type
    236. !!CA0/x1&-1:B3/13; // check for capitol
    237. !!VRy99:+22; // add 22 to get the correct building number for IF:Q
    238. !!IF&-1:Q1/y99/12/1/z145014; // message: you need at least city house
    239. !!FU&-1:E; // and exit, if it is not built

    240. !!OW:Rx2/6/?y1 Rx2/7/?y2; // get amount of players gold and mithril to y1/y2
    241. !!FU862:Px1/0/0/?y3/?y4; // get current number of built reserves to y3, y4=amount of gold earned

    242. !!IF:V2/0; !!IF&y3<0:V2/1; // set flag 2, if already built today
    243. !!VRz1:Sz145011; // current number of gold by reserve (status)
    244. !!VRz1&2:+z145012; // msg: you have already built today
    245. !!VRy4&2:*-1; // negative value for correct picture
    246. !!IF&2:Q1/6/y4/1/z1; // show message
    247. !!FU&2:E; // and exit (if already built)

    248. !!VRz1&y-5<>y-100:+z145023; [Msg: you only upgrade the gold reserve on your turn]
    249. !!IF&y-5<>y-100:Q1/6/y4/1/z1; [Show message]
    250. !!FU&y-5<>y-100:E; [Exit if not the player's turn]

    251. !!VRy3:+1; // increase y3 by one to get the correct bit
    252. !!FU$bit$:Py3; // get the xth power of 2 (1, 2, 4, 8, 16 ...), return in y-100
    253. !!VRy5:S7000; // 固定7000
    254. !!VRy6:Sy3 +1; // increase mithril linear (2, 3, 4, 5, 6 ...)

    255. !!VRz1|y1<y5/y2<y6:+z145016 +z145015; // combine price info and not-enough-gold-message
    256. !!IF|y1<y5/y2<y6:Q1/6/y5/7/y6/1/z1; // show message
    257. !!FU|y1<y5/y2<y6:E; // and exit

    258. !!VRz1:+z145013; // add: Ask to upgrade
    259. !!IF:Q2/6/y5/7/y6/2/z1; // show question (get answer to flag 2)
    260. !!FU&-2:E; // exit, if no chosen

    261. !!VRy3:*-1; negate the value of built reserves (to prevent further upgrades today)
    262. !!FU862&2:Px1/0/1/y3; // increase number of gold resources in the town
    263. !!VRy1:-y5; !!VRy2:-y6; // substract gold / mithril from the players gold / mithril
    264. !!OW:Rx2/6/y1 Rx2/7/y2; // remove the gold and mithril

    265. ***********************


    266. !?FU861; // get price of a simple upgrade, return in v1-v7
    267. !!VRv1&x1=0/x2=1:C0/0/7/0/0/0/1000/5; //pikeman
    268. !!VRv1&x1=0/x2=2:C5/0/5/0/0/0/1500/4; //archers
    269. !!VRv1&x1=0/x2=3:C0/0/5/0/0/0/2500/3; //griffins
    270. !!VRv1&x1=0/x2=4:C0/0/5/0/5/0/2500/2; //swordman
    271. !!VRv1&x1=0/x2=5:C5/2/5/2/2/2/3000/2; //monk
    272. !!VRv1&x1=0/x2=6:C10/0/0/0/0/0/5000/1; //cavalier
    273. !!VRv1&x1=0/x2=7:C0/10/0/10/10/10/6000/1; //angel

    274. !!VRv1&x1=1/x2=1:C7/0/0/0/0/0/1000/5; //centaur
    275. !!VRv1&x1=1/x2=2:C0/0/5/0/0/0/2000/4; //dwarf
    276. !!VRv1&x1=1/x2=3:C5/0/0/0/0/0/2500/3; //elf
    277. !!VRv1&x1=1/x2=4:C0/0/5/0/5/0/2500/2; //pegasi
    278. !!VRv1&x1=1/x2=5:C5/0/0/0/0/0/4200/2; //dendroid
    279. !!VRv1&x1=1/x2=6:C5/0/5/0/0/5/4500/1; //unicorn
    280. !!VRv1&x1=1/x2=7:C0/0/15/0/10/0/10000/1; //dragon

    281. !!VRv1&x1=2/x2=1:C5/0/5/0/0/0/1000/5; //gremlin
    282. !!VRv1&x1=2/x2=2:C0/0/10/0/0/0/1200/4; //gargobli
    283. !!VRv1&x1=2/x2=3:C3/3/3/0/0/0/2000/3; //golem
    284. !!VRv1&x1=2/x2=4:C0/3/0/3/3/3/2200/2; //magi
    285. !!VRv1&x1=2/x2=5:C0/5/0/0/5/5/2500/2; //genie
    286. !!VRv1&x1=2/x2=6:C5/2/5/2/2/2/4500/1; //nagas
    287. !!VRv1&x1=2/x2=7:C10/0/10/0/0/15/6000/1; //titan

    288. !!VRv1&x1=3/x2=1:C4/0/4/0/0/0/1000/5; //imps
    289. !!VRv1&x1=3/x2=2:C0/5/5/0/0/0/1250/4; //gog
    290. !!VRv1&x1=3/x2=3:C5/0/0/5/0/0/1750/3; //cerbers
    291. !!VRv1&x1=3/x2=4:C5/0/5/0/0/0/2700/2; //demon
    292. !!VRv1&x1=3/x2=5:C0/5/0/5/0/0/3000/2; //pit
    293. !!VRv1&x1=3/x2=6:C0/5/10/5/5/5/3500/1; //efreet
    294. !!VRv1&x1=3/x2=7:C10/10/10/0/0/0/8000/1; //devils

    295. !!VRv1&x1=4/x2=1:C0/0/7/0/0/0/1000/5; //skeleton
    296. !!VRv1&x1=4/x2=2:C5/0/5/0/0/0/1500/4; //zombie
    297. !!VRv1&x1=4/x2=3:C3/3/3/0/0/0/2000/3; //wights
    298. !!VRv1&x1=4/x2=4:C5/0/5/0/10/10/2500/2; //vampire
    299. !!VRv1&x1=4/x2=5:C0/0/5/5/0/0/3200/2; //lich
    300. !!VRv1&x1=4/x2=6:C10/2/10/2/2/2/5000/1; //knights
    301. !!VRv1&x1=4/x2=7:C5/10/5/5/5/5/7000/1; //dragon

    302. !!VRv1&x1=5/x2=1:C7/0/0/0/0/0/1000/5; //troglodyte
    303. !!VRv1&x1=5/x2=2:C0/0/0/2/2/0/2000/3; //harpies
    304. !!VRv1&x1=5/x2=3:C0/2/0/2/2/2/2000/3; //eyes
    305. !!VRv1&x1=5/x2=4:C5/0/10/0/0/0/2500/2; //medusa
    306. !!VRv1&x1=5/x2=5:C0/0/10/0/0/10/2500/2; //minotaur
    307. !!VRv1&x1=5/x2=6:C5/5/5/5/0/0/4000/1; //manticore
    308. !!VRv1&x1=5/x2=7:C9/0/9/10/0/0/10000/1; //drg

    309. !!VRv1&x1=6/x2=1:C5/0/5/0/0/0/1000/5; //goblin
    310. !!VRv1&x1=6/x2=2:C10/0/5/0/0/0/1000/4; //wolf
    311. !!VRv1&x1=6/x2=3:C5/0/5/0/0/0/2200/3; //orc
    312. !!VRv1&x1=6/x2=4:C5/0/5/0/0/5/2200/2; //ogre
    313. !!VRv1&x1=6/x2=5:C5/0/10/0/0/10/2200/2; //roc
    314. !!VRv1&x1=6/x2=6:C5/0/10/0/10/0/3000/1; //cyclop
    315. !!VRv1&x1=6/x2=7:C5/0/5/0/10/0/10000/1; //behemoth

    316. !!VRv1&x1=7/x2=1:C7/0/0/0/0/0/1000/5; //gnoll
    317. !!VRv1&x1=7/x2=2:C5/0/0/0/0/0/2000/4; //lizard
    318. !!VRv1&x1=7/x2=3:C0/3/0/3/0/0/2200/3; //flies
    319. !!VRv1&x1=7/x2=4:C0/0/10/0/0/5/2000/2; //bas
    320. !!VRv1&x1=7/x2=5:C10/0/10/0/0/10/2000/2; //gorgons
    321. !!VRv1&x1=7/x2=6:C10/10/0/0/0/0/3500/1; //wyvern
    322. !!VRv1&x1=7/x2=7:C10/0/10/10/0/0/7000/1; //hydra

    323. !!VRv1&x1=8/x2=1:C5/0/5/0/0/0/1000/6; //sprites
    324. !!VRv1&x1=8/x2=2:C2/2/5/0/0/2/2000/3; //air
    325. !!VRv1&x1=8/x2=3:C0/5/5/0/0/0/2000/3; //water
    326. !!VRv1&x1=8/x2=4:C5/5/5/0/0/5/2000/2; //fire
    327. !!VRv1&x1=8/x2=5:C0/0/10/5/0/0/3000/2; //earth
    328. !!VRv1&x1=8/x2=6:C5/3/5/3/3/3/4000/1; //magic
    329. !!VRv1&x1=8/x2=7:C10/10/10/0/0/0/5000/1; //phoenix
    330. ***********************


    331. ----------------------------- AI upgrades town ---------------------------------

    332. !?FU863; // tries to  build / upgrade a random dwelling (or Gold Reserve) in every 2nd AI-town
    333. !!VRy1:Sx2 -1; // correct number of total towns for further usage
    334. !!VRy2:S0 Ry1; // random town
    335. !!FU864:Px1/y2; // build / upgrade a random dwelling (or Gold Reserve) there
    336. *********


    337. !?FU864;
    338. ** x1 - the last player ($lastplayer$)
    339. ** x2 - town number in players list

    340. ** y1 - real town number on the map
    341. ** y2 - random 0-2, if 0 AI builds a gold reserve (33% chance), if > 0 it upgrades a dwelling
    342. ** y3 - random 0 = town hall, 1-7 the dwelling to upgrade
    343. ** y4 - already build upgrades
    344. ** y5 - town type
    345. ** y6 - bonus creatures for one dwelling upgrade (depends on level y3)

    346. ** y21-y28 - players resources

    347. !!OW:Wx1/x2/?y1; // get the real town number on the map
    348. !!FU|y1<0/y1>48:E; // exit, if town is out of range (should never happen)
    349. !!VRy2:S0 R2; // random 0-2
    350. !!VRy3&y2>0:S1 R6; // if y2 is not 0: get random dwelling (1-7)  (means: Gold Reserve has a chance of 33% to built, dwelling 66%)

    351. !!CA0/y1:B3/12; !!CA0/y1&-1:B3/13; // check, if cityhall or capitol are built
    352. !!FU&y2=0/-1:E; // exit, if not and random = GRes

    353. !!OW:Rx1/0/?y21 Rx1/1/?y22 Rx1/2/?y23 Rx1/3/?y24 Rx1/4/?y25 Rx1/5/?y26 Rx1/6/?y27 Rx1/7/?y28; // get players resources
    354. !!FU862:Py1/y3/0/?y4/?y5; // check, how much of the random GRes / Dwelling are already build, return in y4 (y5 is a dummy)
    355. !!FU&y4>7:E; // exit, if there are already 7 upgrades of the chosen type in this town
    356. !!VRy4&y2=0/y27>6999/y28>1:+1; // increase number of GRes, if player has 7000 gold and 2 mithril
    357. !!OW&y2=0/y27>6999/y28>1:Rx1/6/d-6000 Rx1/7/d-2; // take the resources (takes only 6000 gold, because he gets 1000 back from the GRes)
    358. !!FU862&y2=0/y27>6999/y28>1:Py1/0/1/y4; // set the new number of GRes
    359. !!FU&y2=0:E; // exit, if AI "chose" to upgrade the gold reserve

    360. !!VRy99:Sy3+36; // get building number for the upgraded dwelling
    361. !!CA0/y1:B3/y99; // check, if it is built
    362. !!FU&-1:E; // exit, if not

    363. !!CA0/y1:U?y5; // get town type
    364. !!VRy3:-1; // correct dwelling (to get 0..6 instead of 1..7)
    365. !!FU861:Py5/y3; // get costs for the dwelling upgrade to v1-v7
    366. !!FU|y21<v1/y22<v2/y23<v3/y24<v4/y25<v5/y26<v6/y27<v7:E; // exit, if player has not enough resources

    367. !!VRy4:+1; // increase dwelling upgrade by one
    368. !!FU862:Py1/y3/1/y4; // set the new value
    369. !!VRy21:-v1; !!VRy22:-v2; !!VRy23:-v3; !!VRy24:-v4; !!VRy25:-v5; !!VRy26:-v6; !!VRy27:-v7; // take resources
    370. !!OW:Rx1/0/y21 Rx1/1/y22 Rx1/2/y23 Rx1/3/y24 Rx1/4/y25 Rx1/5/y26 Rx1/6/y27; // write reduced resources back
    371. !!FU&$weekday$<>$monday$:E; // exit, if not monday

    372. !!VRy6:Sy3 *-1 +8; // get number of bonus creatures for this level
    373. !!CA0/y1:M1/y3/d/dy6;// add them (necessary on monday, because the usual bonus-routine is already ran and we simulate, that the AI built at the end of the day before
    374. *********

    375. -----------------------------Get / set current values---------------------------------
    376. !?FU862;
    377. ** x1 = number of town
    378. ** x2 = index of building (0 if hall 1-7 dwellings)
    379. ** x3 = if 0 then get (return in x4, if 1 then set to x4)
    380. ** x4 = return value / new value
    381. ** x5 = returns the bonus for gold or creatures (ignored if x3 = 1)
    382. !!VRy1:Sx1 *8 +1600 +x2;               ;index of variable where saved
    383. !!VRvy1&x3=1:Sx4; // set value
    384. !!FU&x3=1:E; // exit, if set-call

    385. ** get values
    386. !!VRy2:Svy1; // the number of built upgrades
    387. !!VRx4:Sy2; // return this number in x4
    388. !!VRy2&y2<0:*-1; // correct, if negative value (sign, that is built today)
    389. !!VRx5&x2=0:S1000 *y2; // city hall
    390. !!VRx5&x2>0:Sx2 *-1 +8 *y2; // dwellings: 7 for each L1, 6 for each L2 ... 1 for each L7
    391. ***********************
    复制代码


    上次只固定了金钱的需求,资源需求还是不断往上涨
    @贤知有您 @songfx @神奇的卡片 @独孤求败  
    =w=
  • TA的每日心情
    郁闷
    2015-6-6 16:12
  • 签到天数: 52 天

    连续签到: 1 天

    [LV.5]女巫

    4951

    回帖

    3万

    金币

    35

    精华

    超级版主

    Rank: 11Rank: 11Rank: 11Rank: 11

    积分
    34692

    论坛守望者论坛元老杰出贡献

    发表于 2013-10-16 08:59:05 | 显示全部楼层
    决定资源的应该是这段.
    感觉好像涨得不多啊.每次才多加1点.
    如果要保持不变,直接删掉"increase the resource costs linear"那一大行吧.
    另外,楼主好像没改处理AI的脚本.看来AI要吃亏,呵呵呵.


    !!FU861:Py-7/y-6;  // get price of a simple upgrade, return in v1-v7
    !!VRy-8:+1; // increase number of upgrades by one
    !!FU$bit$:Py-8; // get the xth power of 2 (1, 2, 4, 8, 16 ...) depending on the number of built upgrades, return in y-100
    !!VRv7:*1;// calc new price (gold): it is increased potential depending on the already built upgrades, other resources are untouched
    !!VRv1&v1>0:+y-8; !!VRv2&v2>0:+y-8; !!VRv3&v3>0:+y-8; !!VRv4&v4>0:+y-8; !!VRv5&v5>0:+y-8; !!VRv6&v6>0:+y-8; // increase the resource costs linear

    点评

    谢谢,资源不涨了.每次1点是不多但是是所有需求资源的1点,象邪眼1级要全资源1点2级就要全资源2点,这样翻下去很快就比黑龙要的都多了 但是金库的秘银还在涨 AI的在哪里改呢?  详情 回复 发表于 2013-10-16 19:01
  • TA的每日心情
    慵懒
    昨天 20:10
  • 签到天数: 3882 天

    连续签到: 21 天

    [LV.Master]伴坛终老

    3876

    回帖

    5万

    金币

    0

    精华

    9级 Promising Supreme Hero

    Rank: 9Rank: 9Rank: 9

    积分
    76918
     楼主| 发表于 2013-10-16 19:01:39 | 显示全部楼层
    贤知有您 发表于 2013-10-16 08:59
    决定资源的应该是这段.
    感觉好像涨得不多啊.每次才多加1点.
    如果要保持不变,直接删掉"increase the resou ...

    谢谢,资源不涨了.每次1点是不多但是是所有需求资源的1点,象邪眼1级要全资源1点2级就要全资源2点,这样翻下去很快就比黑龙要的都多了
    但是金库的秘银还在涨
    AI的在哪里改呢?
    =w=
    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 英雄注册|Register

    本版积分规则

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

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

    GMT+8, 2025-5-1 18:10 , Processed in 1.022468 second(s), 15 queries , Gzip On, File On.

    Powered by Discuz! X3.4

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

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