- 积分
- 9883
- 威望
- 156
- 魅力
- 161
- 经验
- 5187
- 热心度
- 0
- 注册时间
- 2009-12-24
- 最后登录
- 2018-7-8
- 主题
- 55
- 回帖
- 1546
- 精华
- 4
- 阅读权限
- 90
该用户从未签到
论坛嘉宾
- 积分
- 9883
|
发表于 2012-1-10 11:57:23
|
显示全部楼层
ZVSE
_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!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
ERMS_ScriptDate=12.9(September).2006
** All My Scripts (2005 Sept 12) (for WoG v3.58f script update)
** by Tobyn
** with big thanks to Fnord and the team for all their advice
**
** Each scriptlet is fully documented and contains a separate variables list.
** Vars v2361-v2367 are script activity "flags" for my scriptlets here.
** To enable a script, set respective var to 1 (normally Wogify Options will set them).
**
** Some scriptlets use my Universal Timer (which automatically runs with Wogify
** script00.erm). If you want to use them without wogify, e.g. by copying the code,
** enable UniTimer by setting v2370 to 1 in the following line (change S0 to S1 there).
!#VRv2370:S0; disabled Universal Timer setup and calculations (because already done by Wogify script00.erm)
!#UN:P193/?v2365; check if Warfare is enabled in WoGify Options
!#UN:P75/?v2360; check if Short Skill descriptions (script75.erm, Hermann the Weird) are enabled
**
** --------> TOBYN'S SCRIPTS (script64.erm) (2005 Aug 25)
** Author: Tobyn
** Scriptlets:
** (Universal Timer), Tobyn Library Functions, Advanced Witch Huts, Transfer Owner,
** Estates Enhanced, First Aid Enhanced, Warfare, Conflux/Rampart Monster Change
** ERM WoG Option Numbers: 64, 188-194
** Flags: 230-239 claimed (and 236-239 used)
** Permanent Variables: w47, w48, v2300-v2399 claimed (and v2301-v2334, v2360-v2399 used)
** Temporary Variables: m-t, flag 1, v248
** Timers: TM1, TM2 (both together with script00.erm form the Universal Timer)
** Functions: FU2300-FU2399 claimed (and FU2332-FU2345 used)
** Strings: z232-z239 claimed (and z237-239 used)
** Macros: $month$,$weeks$,$week$,$day$,$weekday$,$AI$,$color$,$once$,
** $red$,$blue$,$tan$,$green$,$orange$,$purple$,$teal$,$pink$,
** $monday$,$tuesday$,$wednesday$,$thursday$,$friday$,$saturday$,$sunday$
******************************************************************************************
** UNIVERSAL TIMER (2004 September 19) (for WoG v3.58)
** by Tobyn
**
** This scriptlet gives another, more universal approach on Timers.
** You now can use predefined timed conditions with triggers,
** not only have predefined timers.
** Timer 1 will be used to calculate several often-used conditions.
** Timer 2 trigger now may use that calculated stuff as conditions.
**
** Instead of defining a new timer when you need one, merely use and
** call timer 2 (TM2) trigger with following conditions (leave out irrelevant ones)
** v2396 or $month$ current month (cont count like standard HoMM3 itself: month 12,13,...)
** v2395 or $color$ current player color (0..7, or from $red$ to $pink$)
** v2394 or $AI$ current player status (=0 if human only, =1 if AI only, ignore if irrelevant)
** v2393 or $weekday$ current weekday (1..7, or from $monday$ to $sunday$)
** v2392 or $day$ current day (c is current day, but sometimes direct comparison with c won't work)
** v2391 or $once$ once-on-that-day flag (irrespective of real color: first active color sets, others reset)
** v2390 (internal day comparator for once-on-that-day flag v2391)
** v2389 or $weeks$ current weeks in total (1,2,3,4,5,6,...)
** v2388 or $week$ current week in a month (1,2,3,4,1,2,...)
**
** Never try to set v2371..96 or "c" var, just get/read them where needed.
**
** Then every script can use local TM2 trigger with conditions
** - e.g. trigger only if color=green, status=human and weekday=tuesday
** - omit conditions which don't matter (e.g. if color or human/AI irrelevant, or weekday for a daily trigger)
**
** If you need other calculations done (e.g. 10-day period starting with the second month)
** just call TM1 locally and calculate whatever you need for your next TM2 trigger condition
**
** uses TM1,2 and Tobyn universal vars v2371..v2395
** uses macros $day$, $weekday$, $week$, $weeks$, $month$, $AI$, $color$, $once$
** -- for easy usage of colors and weekdays, further macros are defined and initialized
** uses macros $red$, $blue$, $tan$, $green$, $orange$, $purple$, $teal$, $pink$
** uses macros $monday$, $tuesday$, $wednesday$, $thursday$, $friday$, $saturday$, $sunday$
UNIVERSAL TIMER INIT
!#TM1:S1/999/1/255; triggers every color every day
!#TM2:S1/999/1/255; same but triggers only *after* all calculations from TM1 are done
!#VRv2396:S1; init v2396 month indicator (starts with month 1)
!#VRv2390:S1; init v2390 day comparator (c also starts with day 1 value)
!#VRv2370:S1;
!#VRv2365:S1;
UNIVERSAL TIMER GLOBAL CALL EVERY DAY
!?TM1&v2370=1; GLOBAL CALL (careful: only one instance of these calculations allowed, which should normally be done by wogify script00.erm)
!!OW:C?v2395; get current player color (0..7)
!!OW:Iv2395/?v2394; get current player status (0=human, 1=AI)
!!VRv2393:Sc %7; set weekday (mon=1..sat=6,sun=0)
!!VRv2393&v2393=0:S7; set sunday=7 instead of sunday=0
!!VRv2392:Sc; set current day (comparison with c doesn't work in the next two lines)
!!VRv2391&v2390=v2392:S1; set once-on-that-day flag (only first active color)
!!VRv2391&v2390>v2392:S0; reset that flag (at second active color each day)
!!VRv2390&v2391=1:+1; inc day comparator (needed for flag)
!!VRv2389&v2391=1:Sc -1 :7 +1; set weeks (cont count)
!!VRv2388&v2393=1/v2391=1:+1; inc week counter by 1 for each monday
!!VRv2396&v2388=5/v2391=1:+1; inc month counter by 1 for each 5th week
!!VRv2388&v2388=5/v2391=1:S1; reset week counter for each new month
******************************************************************************************
** WARFARE (2004 September 19) (for WoG v3.58)
** by Tobyn
**
** This script combines the three war machine skills Artillery, Ballistics
** and First Aid and treats them as one skill. This new Warfare "skill"
** gives you control over all three War Machines and standard SoD abilities
** from all three skills.
**
** First Aid Tents get 750 HPs (only if no other First Aid enhancements active).
**
** Whenever a hero has one or more of the skills and a battle starts,
** the hero will get all three skills at the highest expertise available.
** Similar if clicked on any warfare skill in hero screen, but:
** - if clicked on icon of any Warfare skill, you get standard skill description
** - if clicked on text (name or expertise), you get another msgbox instead
** (left-click lets you choose, right-click cycles the displayed Warfare skill)
**
** Hero might temporarily have diverging expertises in the three Warfare
** skills while on adventure map (e.g. via Witch Huts or through other ERM),
** but this and display will adjust with the next click, levelup or battle.
**
** NOTE:
** - side effect with Arstahd's Enhanced Commander Artifacts (give hero skills)
** As soon as an artifact with one of the three skills is obtained, player may
** get instant Expert Warfare with just a few mouse clicks and without further
** need for the Artifact thereafter
** (by toggling the Warfare skills while repeatedly equipping the artifact).
** Three free Expert skills for just temporarily having one artifact equipped. WOW!
** And you can always give it to another hero or to a commander afterwards...
**
** uses vars (v248)
** uses vars v2398..99 (Tobyn universal vars, v2399/v2398 attacking/defending hero)
** uses fcts FU2340,2341
** uses strings z237..239 for skill names
** uses Universal Timer TM1/2 (day1)
** ONLY ACTIVE if v2365=1 (wogify option 193)
INIT SKILL NAMES (leaves descriptions unchanged)
!?TM2&v2392=1/v2391=1/v2365=1; triggers for first active color on day 1 only (if script active)
; (will trigger after script03.erm skill enhancement)
!!UN:P54/?y-1; check if War Machines I is active (Overlord, script54, war machine levels)
!!UN:P55/?y-2; check if War Machines II is active (Arstahd, script55, Tent mid-battle Resurrection)
!!UN:P204/?y-3; check if First Aid I is active (Arstahd, script48, Tent post-battle Resurrection)
!!UN:P190/?y-4; check if First Aid II is active (Tobyn, script64 see above, Tent Cure spell)
!!UN:P201/?y-5; check if Artillery I is active (Arstahd, script48, pre-battle damage)
!!MA&y-1=0/y-2=0/y-3=0/y-4=0:P147/750; all First Aid Tents will have 750 HPs (if neither First Aid skill nor the Tent war machine itself are enhanced)
!!VRz237:S^战争机器(弹道)^; if no warfare relevant skills were enhanced
!!VRz238:S^战争机器(炮术)^; .
!!VRz239:S^战争机器(急救)^; .
!!VRz237|y-1=1/y-2=1:S^{战争机器(弹道)}^; if Ballistics enhanced by script 54 or 55
!!VRz238|y-5=1:S^{战争机器(炮术)}^; if Artillery enhanced by script 48
!!VRz239|y-3=1/y-4=1:S^{战争机器(急救)}^; if First Aid enhanced by script 48 or 64
!!UN:G0/10/0/237 G0/20/0/238 G0/27/0/239; set skill names to Warfare
MANUALLY SET WARFARE MAIN SKILL
!?CM2&v2365=1; right-clicked at hero screen
!!CM:I?y-1; get right-click number (y-1) (79..102 is skill area)
!!CM:S?y-2; check left/right-click (=12 left click, =14 right click)
!!FU2345:Py-1/-1/?y-3/?y-4/?y-5; call skill click function (in: click number and hero number, out: skill (y-3), area (y-4) and slot (y-5))
!!VRy-6|y-3=10/y-3=20/y-3=27:S1; y-6 = 1 means either Bal, Art or FA was clicked
!!CM&y-1>78/y-1<103/y-6=1/y-4>1:R0; if clicked text area of a Warfare skill, disable standard skill click reaction
!!FU2340&y-6=1:Py-4/y-2/y-3; .. and call Warfare display function (in: skill area, left/right-click, skill)
!?FU2340; Warfare skill display and determination (x1=skill area, x2=click type, x3=skill)
!!VRy4&x2=12:S10; if left-click then init y4:=10 (OK/Cancel buttons with three pics, two of them selectable)
!!VRy4&x2=14:S4; if right-click then init y4:=4 (no button)
!!CM&y4=0:R1; enable standard reaction if unidentified click and exit
!!FU&y4=0:E; BUG COUNTERMEASURE (clicking non-functional-areas after Estates (with disabled std reaction) erroneously gives another msgbox and nasty side effects)
!!IF:W-1; set w var reference to current hero
!!VRy5:S0; init y5
!!VRy5&x1>1/x2=14:S1; set cycling "flag" y5 if right-clicked on text field (name or expertise)
!!FU2341:P-1/x3/y5; determine and set Warfare expertise (highest of all three skills) on current hero (-1)
!!HE-1:Sx3/?y6; get Warfare expertise
!!VRy1|w48<>10:S32 +y6; (calculate correct display for type 10 message below...)
!!VRy1|w48=10:S62 +y6; (... which stores result (=1 left, =2 middle, =0 cancel)
!!VRy2|w48=0/w48=27:S62 +y6; (... in v var instead of normally used dialogue flag)
!!VRy2|w48=10/w48=20:S83 +y6; .
!!VRy3|w48=0/w48=27:S83 +y6; .
!!VRy3|w48=10:S32 +y6; .
!!VRy3|w48=20:S62 +y6; .
!!VRv248:S0; init v248
!!VRz-1&v2360>0:S^{战争机器}
{炮术 + 弹道术 + 急救
{控制所有的战争机器
{实现特技增强
{单击图标查看描述^; msgbox text if short skill description (script75) active
!!VRz-1&v2360=0:S^{战争机器}
战争机器兼有下面显示的三种技能
让你控制三种战争机器。
特技增强拥有{黄色}名字的技能。
右键点击查看描述。
你也可以选择在单技能槽中显示哪一种技能。
另外二种技能隐藏起来了(单击经验图标)
三种技能共享同一经验值。^; if standard skill description (script75 inactive)
!!IF&x1>1:Q248/20/y1/20/y2/20/y3/y4^%Z-1^; msg each time Warfare skill text field (name or expertise) is clicked
!!VRy7:S0;
!!VRy7&v248=1/w48=27:S10; v248 | 1 2 0
!!VRy7&v248=2/w48=27:S20; -------+-----------
!!VRy7&v248=1/w48=20:S10; w48=10 | 20 27 10
!!VRy7&v248=2/w48=20:S27; 20 | 10 27 20
!!VRy7&v248=1/w48=10:S20; 27 | 10 20 27
!!VRy7&v248=2/w48=10:S27;
!!FU2341&v248>0:P-1/y7/0; determine and set Warfare expertise (highest of all three skills) on current hero (-1)
!!UN:R3/-1; redraw hero screen
GET WARFARE MAIN SKILL AND EXPERTISE
!?FU2341; set Warfare main skill and expertise (x1=hero, x2= w48 or clicked Warfare skill, x3=if cycling)
!!FU&x2<>0/x2<>10/x2<>20/x2<>27:E; exit if skill parameter invalid (neither none, Bal, Art nor FA)
!!IF:Wx1; set w var reference to that hero
!!HEx1:S10/?y1 S20/?y2 S27/?y3; get expertise of all three Warfare skills (y1, y2, y3)
!!VRy4:Sy1; (calculate highest Warfare expertise (y4))
!!VRy4&y2>y4:Sy2; .
!!VRy4&y3>y4:Sy3; .
!!HEx1:S10/0 S20/0 S27/0; remove any Warfare skill (to later guarantee they are the last displayed skills)
!!VRy6&x2=10/x3=1:S20; cycle to display next skill (if skill text field (name or expertise) was right-clicked)
!!VRy6&x2=20/x3=1:S27; .
!!VRy6&x2=27/x3=1:S10; .
!!VRx2&x2>0/x3=1:Sy6; .
!!VRx2&y4>0/x2=0:S10; set Ballistics default if Warfare but no skill set for display yet
!!HEx1&y4>0/x2>0:Sx2/y4; set max expertise to clicked/selected Warfare skill
!!VRw48&y4>0/x2>0:Sx2; set hero var w48 to respective Warfare display skill
!!HEx1:S?y5; get number of skills shown (y5)
!!HEx1:S10/y4 S20/y4 S27/y4; give the other two skills at same expertise, but hide them afterwards
!!HEx1&x2=10:S0/20/1 S0/27/1; if Bal then hide Art and FA
!!HEx1&x2=20:S0/10/1 S0/27/1; if Art then hide Bal and FA
!!HEx1&x2=27:S0/10/1 S0/20/1; if FA then hide Bal and Art
!!HEx1:Sy5; set back number of skills shown to avoid erroneous display
TRIGGERS TO SET CORRECT EXPERTISE FOR THE OTHER TWO WARFARE SKILLS
!?HL-1&v2365=1; hero levelup lets hero advance the other warfare skills to pre-levelup expertise [post-levelup trigger would be nice]
!!IF:W-1; set w var reference to current hero
!!FU2341:P-1/w48; update Warfare skill levels and displayed skill
!?OB104&v2365=1; University pre-visit trigger
!!IF:W-1; set w var reference to current hero
!!FU2341:P-1/w48; update Warfare skill levels and displayed skill
!$OB104&v2365=1; University post-visit trigger
!!IF:W-1; set w var reference to current hero
!!FU2341:P-1/w48; update Warfare skill levels and displayed skill
**OB63/51&v2365=1; Market of Time pre/post-visit trigger [NOT RECOMMENDED]
; pre-visit would still take place after script09 (Market of Time) effects
; -> problem now adressed and rectified in Market of Time script09
!$OB113&v2365=1; Witch Hut post-visit trigger [pre-visit trigger might interfere with Advanced Witch Huts]
!!IF:W-1; set w var reference to current hero
!!FU2341:P-1/w48; update Warfare skill levels and displayed skill
!?BA52&v2365=1; battle has started (trigger for both sides)
!!BA:H0/?v2399 H1/?v2398; store attacking/defending hero numbers
!!IF:Wv2399; set w var reference to attacking hero
!!FU2341:Pv2399/w48; check attacking hero
!!IF&v2398>-1:Wv2398; set w var reference to defending hero (if any)
!!FU2341&v2398>-1:Pv2398/w48; check defending hero (if any)
******************************************************************************************
楼主自行测试。有问题及时反馈。
[ 本帖最后由 fastarrow 于 2012-1-10 11:58 编辑 ] |
|