- 积分
- 2490
- 威望
- 1
- 魅力
- 1
- 经验
- 1865
- 热心度
- 5
- 注册时间
- 2019-3-12
- 最后登录
- 2024-3-3
- 主题
- 41
- 回帖
- 342
- 精华
- 0
- 阅读权限
- 40
TA的每日心情 | 开心 2021-3-22 22:17 |
---|
签到天数: 14 天 连续签到: 1 天 [LV.3]火元素使者
4级 Famous Hero
- 积分
- 2490
|
楼主 |
发表于 2021-6-1 22:39:52
|
显示全部楼层
这样可以吗?
ZVSE2
; Author: Archer30
; Engine: ERM 2.0+
; Requires: ERA 3.4+, Era Erm Framework
loop through all towns and add in first level creature to the garrison if a town is with no army daily 防止裸城
!?FU(OnEveryDay); [add in creature daily]
!!FU(TownMustHaveArmy):P;
!?FU(TownMustHaveArmy);
!#VA(x:y) (y:y) (z:y); [define variables to store object coordinates]
!!VR(x):S-1; [set x-coordinate to -1 to force to start search from scratch]
!!re i; [endless loop]
!!SN:F^FindNextObject^/(OBJ_TOWN)/(ANY_OBJ)/?(x)/?(y)/?(z)/-1; [find next town, v1 is (TRUE) on success]
!!br&v1=(FALSE); [exit loop if nothing found]
!!re f/(ARMY_SLOT_FIRST)/(ARMY_SLOT_LAST);
!!CA(x)/(y)/(z):M2/f/?(monType:y)/?(monCount:y);
!!co 2&(monType)>(NO_MON)/(monCount)>0;
!!en;
!!CA(x)/(y)/(z):T?t; [Check type of the town if the town is with no army]
!!VR(firstLevelMon[9]:y):C(MON_PIKEMAN)/(MON_CENTAUR)/(MON_GREMLIN)/(MON_IMP)/(MON_SKELETON)/(MON_TROGLODYTE)/(MON_GOBLIN)/(MON_GNOLL)/(MON_PIXIE);
!!CA(x)/(y)/(z):M2/(ARMY_SLOT_FIRST)/(firstLevelMon[t])/1; [add in first level creature according to the type of town]
!!en;
!?FU(OnAfterBattleUniversal);
!#VA(x:y) (y:y) (z:y); [define variables to store object coordinates]
!!VR(x):S-1; [set x-coordinate to -1 to force to start search from scratch]
!!re i; [endless loop]
!!SN:F^FindNextObject^/(OBJ_TOWN)/(ANY_OBJ)/?(x)/?(y)/?(z)/-1; [find next town, v1 is (TRUE) on success]
!!br&v1=(FALSE); [exit loop if nothing found]
!!re f/(ARMY_SLOT_FIRST)/(ARMY_SLOT_LAST);
!!CA(x)/(y)/(z):M2/f/?(monType:y)/?(monCount:y);
!!co 2&(monType)>(NO_MON)/(monCount)>0;
!!en;
!!CA(x)/(y)/(z):T?t; [Check type of the town if the town is with no army]
!!VR(firstLevelMon[9]:y):C(MON_PIKEMAN)/(MON_CENTAUR)/(MON_GREMLIN)/(MON_IMP)/(MON_SKELETON)/(MON_TROGLODYTE)/(MON_GOBLIN)/(MON_GNOLL)/(MON_PIXIE);
!!CA(x)/(y)/(z):M2/(ARMY_SLOT_FIRST)/(firstLevelMon[t])/1; [add in first level creature according to the type of town]
!!en;
|
|