Explorar o código

Multiple fixes and improvements

WS:
Fixed 2 critical bugs from previous commits, including
- Fixed a critical bug where heroes could learn War Machines secondary skills even when the Warfare option isn't enabled.
- Fixed spell banning options not working at all.

- Transfer owner now works once per week for each mine or town. This is to prevent spamming battles.
- Master of Life no longer upgrades creatures owned by heroes with no owner.
- Fixed the text description error of Scouting II.
- Fixed Learning I not showing which primary skill is granted when a hero gains a new level.

GEM:
- Fixed a bug where sometimes a hero could appear in a tavern even when already recruited by another player.

Enhanced Henchmen:
- Warlord's Banner equipped by a henchman now behaves like commander artifacts on commanders: You can equip or unequip it freely when the henchman is killed. The banner will stay with the henchman even if the hero loses a battle.
Patrick Lin hai 7 meses
pai
achega
cf575c620b

+ 1 - 1
ERA Scripts Eng/Data/s/option 770 - tyrant.erm

@@ -6,7 +6,7 @@ ZVSE2
 ** Options       : 770
 
 ; A tyrant would appear in the game and flag most of the map objects. The colour of the tyrant depends on the whatever colour is available in the game (Chosen from Pink to Red by order).
-; Note: This script would disable Extension Heroes option (if enabled) on erm instructions to preveny other players having special heroes at the start. 
+; Note: This script would disable Extension Heroes option (if enabled) on erm instructions to prevent other players having special heroes at the start. 
 ; After the tyrant is set up, Extension Heroes would be re-enabled if it was enabled.
 
 

+ 1 - 1
ERA Scripts Rus/Data/s/option 770 - tyrant.erm

@@ -6,7 +6,7 @@ ZVSE2
 ** Options       : 770
 
 ; A tyrant would appear in the game and flag most of the map objects. The colour of the tyrant depends on the whatever colour is available in the game (Chosen from Pink to Red by order).
-; Note: This script would disable Extension Heroes option (if enabled) on erm instructions to preveny other players having special heroes at the start. 
+; Note: This script would disable Extension Heroes option (if enabled) on erm instructions to prevent other players having special heroes at the start. 
 ; After the tyrant is set up, Extension Heroes would be re-enabled if it was enabled.
 
 

+ 28 - 31
Enhanced Henchmen/Data/s/29 wog - henchmen.erm

@@ -99,8 +99,6 @@ ZVSE2
 
 ; Prevent reseting Disguise from henchman stack
 !!SN:E(setHook)/1/4473430/(WOG_OnResetSpellFromStack);
-; Manage henchmen's banners before battle result
-!!SN&i^hench_stackExpEnabled^:E(setHook)/1/4681149/(WOG_OnBeforeBattleResult);
 
 !?FU(WOG_OnResetSpellFromStack);
 !#VA(hook:x);
@@ -176,15 +174,15 @@ ZVSE2
 
     !!if&(holdingArt)=(ART_WARLORDS_BANNER)/i^hench_banner_%(hero)^<0;
 
-      !!if&w119;
+      *!if&w119;
         !!VRi^hench_banner_%(hero)^:S0; [Equip banner and set the Health boost]
         !!FU(hench_OpenBannerDlg):P(hero);
         !!UN:C6916824/4/(NO_ART);
         !!UN:R5/0/0;                    [Refresh cursor]
-      !!el;
-        !!SN:T^henchmen.strings.bannerDead^/?(bannerDead:z);
-        !!IF:Q1/(PIC_TYPE_ART)/(ART_WARLORDS_BANNER)/(MSG_TYPE_MES)^%(bannerDead)^;
-      !!en;
+      *!el;
+        *!SN:T^henchmen.strings.bannerDead^/?(bannerDead:z);
+        *!IF:Q1/(PIC_TYPE_ART)/(ART_WARLORDS_BANNER)/(MSG_TYPE_MES)^%(bannerDead)^;
+      *!en;
 
     ; Show henchman info if not holding banner
     !!el;
@@ -421,6 +419,7 @@ ZVSE2
 !!IF:G1/1/256/1/2/3/4/5/6/7/8/9/10;
 !!FU(IntLog2):Pv1/?(choice);
 
+; If chosed any creature from the hero's army
 !!if&(choice)<7;
   !!HE(hero):C0/(choice)/?(mon:y)/?(qty:y)/?(stackExp:y);
   !!EX(hero)/(choice):R?(hasArt:y)/?(art:y)/?(artOpt:y)/?(artQty:y); [Note: artQty=0 to 3, means 1 to 4 Warlord's Banner]
@@ -455,8 +454,13 @@ ZVSE2
 
   !!VRw118:S(mon);
   !!VRw119:S(TRUE);
-!!el&(choice)=7;
-  !!VRi^hench_stackExp_%(hero)^&i^hench_stackExpEnabled^/(choice)=7:S0; [Enhanced]
+
+; If chosed to dimiss the henchman
+!!el;
+  !!if&i^hench_stackExpEnabled^;
+    !!VRi^hench_stackExp_%(hero)^:S0; [Enhanced]
+    !!VRi^hench_banner_%(hero)^&i^hench_bannerEnabled^:S-1;
+  !!en;
 
   !!VRw117:S0;
   !!VRw118:S-2;
@@ -722,30 +726,23 @@ ZVSE2
   !!VRw119&i^henchmen_side_1^:S(TRUE);
 !!en;
 
-; Manage banner after battle if any henchman is killed
-!?FU(WOG_OnBeforeBattleResult);
+!?FU(OnAfterBattleUniversal)&i^hench_enabled^;
 !!re i/(BATTLE_LEFT)/i^battle_hero_vs_hero^;
-  ; Next if the henchman is alive
-  !!VR(hero:y):Si^battle_hero_%i^;
-  !!IF:W(hero);
-  !!co&w119;
+  ; Reward the henchman exp if won the battle
+  !!FU(hench_GiveExpAfterBattle):Pi^battle_hero_%i^/i;
 
-  ; Reset stack exp
-  !!VRi^hench_stackExp_%(hero)^:S0;
+  ; Reset stack exp after battle if the henchman is killed [Enhanced]
+  !!if&i^hench_stackExpEnabled^;
+    ; Next if the henchman is alive
+    !!VR(hero:y):Si^battle_hero_%i^;
+    !!IF:W(hero);
+    !!co&w119;
 
-  ; Bring the banner to the hero
-  !!if&i^hench_banner_%(hero)^>-1;
-    !!VRi^hench_banner_%(hero)^:S-1;
-    !!HE(hero):A(ART_WARLORDS_BANNER);
+    ; Reset stack exp
+    !!VRi^hench_stackExp_%(hero)^:S0;
   !!en;
 !!en;
 
-; Reward the henchman exp if won the battle
-!?FU(OnAfterBattleUniversal)&i^hench_enabled^;[Enhanced]
-!!BA:H0/?(atkHero:y) H1/?(defHero:y);
-!!FU(hench_GiveExpAfterBattle)&(atkHero)>(NO_HERO):P(atkHero)/(BATTLE_LEFT);
-!!FU(hench_GiveExpAfterBattle)&(defHero)>(NO_HERO):P(defHero)/(BATTLE_RIGHT);
-
 !?FU(hench_GiveExpAfterBattle);
 !#VA(hero:x) (side:x);
 
@@ -968,7 +965,7 @@ ZVSE2
 
 !!if&i^hench_bannerEnabled^;
   !!FU(hench_ManageHenchBanner):P(hero);
-  !!FU(hench_OpenBannerDlg)&i^hench_banner_%(hero)^>=0/w118>(NO_MON)/w119:P(hero);
+  !!FU(hench_OpenBannerDlg)&i^hench_banner_%(hero)^>=0/w118>(NO_MON):P(hero);
 !!en;
 
 !!IF&i^hench_bannerEnabled^<>(TRUE)/i^hench_reviveAnywhere^<>(TRUE):Mz149000;  [henchman help]
@@ -982,9 +979,9 @@ ZVSE2
 !!if&w118>(NO_MON)/w119<>(TRUE);
   !!FU&i^hench_reviveAnywhere^:E;
   
-  !!SN:T^henchmen.strings.bannerDead^/?z-1;
-  !!IF:Q1/(PIC_TYPE_ART)/(ART_WARLORDS_BANNER)/1^%z-1^;
-  !!FU:E;
+  *!SN:T^henchmen.strings.bannerDead^/?z-1;
+  *!IF:Q1/(PIC_TYPE_ART)/(ART_WARLORDS_BANNER)/1^%z-1^;
+  *!FU:E;
 !!en;
 
 !!if&i^hench_banner_%(hero)^<0;

+ 34 - 2
Game Enhancement Mod/data/s/gem_fixes.erm

@@ -541,6 +541,36 @@ ZVSE2
 !!UN:Cx1/(STRUCT_HOOK_CONTEXT_EDI)/4/(exp);
 
 
+// Fix tavern hero generation
+// by Archer30
+; Occasionally, the tavern may generate a hero who has already been recruited by another player.
+; When this occurs, the tavern can no longer display hero portraits correctly. 
+; (Reference: https://discord.com/channels/665742159307341827/1058335681144950795/1331221338735775786)
+; This fix double-checks the hero's owner using ERM (HE:O) when retrieving available hero IDs.
+; It also corrects the owner data in the game manager ([game manager + 319256 + hero ID]) if it is incorrectly set to -1.
+
+; The issue might originate from the HD Mod's "Invite Hero" feature. Some game manager data may not be properly set when the invited hero is placed in a tavern.
+!?FU(gem_CreateERMHook);
+!#VA(setHook:x);
+
+!!SN:E(setHook)/1/4961464/(gem_OnGenerateRandomHeroCheckOwner);
+
+!?FU(gem_OnGenerateRandomHeroCheckOwner);
+!#VA(hook:x);
+
+!!UN:C(hook)/(STRUCT_HOOK_CONTEXT_ESI)/4/?(heroId:y);
+!!HE(heroId):O?(owner:y);
+!!FU&(owner)=(NO_OWNER):E;
+
+; Fix the wrong data in game manager
+!!UN:C(hook)/(STRUCT_HOOK_CONTEXT_ECX)/4/?(gameMgr:y);
+!!VR(address:y):S(heroId) +(gameMgr) +319256;
+!!UN:C(address)/1/(NO_OWNER);
+
+!!SN:X?t/0;
+!!UN:C(hook)/(STRUCT_HOOK_CONTEXT_RET)/4/4961523;
+
+
 // Fix resetting AI thinking radius to 4096 after loading a save game with HD mod feature
 // by Archer30
 ; This is not a fix but simiply setting UN:J4 to ERA default, should secure the gameplay in most cases
@@ -663,8 +693,10 @@ ZVSE2
 !!SN:Ex1/1/4435778/(gem_AI_GetCloneCastValue);
 
 // disable message about hiring army from dwelling after combat;
-!!SN:Ex1/1/4856136/(gem_OnDwellingFreeJoin);
-!!SN:Ex1/1/4856798/(gem_OnDwellingJoinMessage);
+; Archer30: Tried to fix the issue of not mentioning the the hero's amry is full but failed
+; Discussion: https://discord.com/channels/665742159307341827/1366008155565457489
+!!SN:Ex1/1/4856136/(gem_OnDwellingFreeJoin); 4A1948
+!!SN:Ex1/1/4856798/(gem_OnDwellingJoinMessage); 4A1BDE
 
 !?FU(gem_OnDwellingFreeJoin);
 !!UN:Cx1/(STRUCT_HOOK_CONTEXT_EDX)/4/?(dwellingMons:y);

BIN=BIN
Game Enhancement Mod/eraplugins/ArchBugFixes.era


+ 2 - 2
TrainerX/Data/s/lib/trainer.erm

@@ -4076,7 +4076,7 @@ ZVSE2
 !!el|(obj)=(OBJ_CREATURE_GENERATOR_1)/(obj)=(OBJ_CREATURE_GENERATOR_4);
   !!DW(x)/(y)/(z):O?(owner);
 !!el|(obj)=(OBJ_MINE)/(obj)=(OBJ_MINE_2)/(obj)=(OBJ_LIGHTHOUSE);
-  !!MN(x)/(y)/(z):O?(owner)/1;           [set for owner and redraw]
+  !!MN(x)/(y)/(z):O?(owner)/1;          [check for owner without redraw]
 !!el&(obj)=(OBJ_GARRISON);
   !!GR(x)/(y)/(z):O?(owner);
 !!el&(obj)=(OBJ_SHIPYARD);
@@ -4124,7 +4124,7 @@ ZVSE2
   !!DW(x)/(y)/(z):O(ownerNew);
   !!VR(sound):S^Military.wav^;
 !!el|(obj)=(OBJ_MINE)/(obj)=(OBJ_MINE_2)/(obj)=(OBJ_LIGHTHOUSE);
-  !!MN(x)/(y)/(z):O(ownerNew)/0;           [set for owner and redraw]
+  !!MN(x)/(y)/(z):O(ownerNew);          [set for owner and redraw]
   !!VR(sound):S^flagmine.wav^;
 !!el&(obj)=(OBJ_GARRISON);
   !!GR(x)/(y)/(z):O(ownerNew);

BIN=BIN
WoG Fix Lite/Data/WF_Archer_Fixes.pac


+ 3 - 3
WoG Scripts Rus/Data/s/3 wog - secondary skill text.ert

@@ -50,13 +50,13 @@
 Разведка на уровне Эксперта позволяет герою видеть на 3 квадрата дальше под покровом и дает 2% шанс найти что-либо на каждом шагу.		
 175017	{Базовая} {Разведка}
 
-Базовая Разведка позволяет герою видеть на 1 квадрат дальше под покровом, привлекает 1 Вора каждый день если доступен слот в армии, и дает 2% шанс найти что-либо на каждом шагу.		
+Базовая Разведка позволяет герою видеть на 1 квадрат дальше под покровом, привлекает 1 Вора каждый день если доступен слот в армии, и дает 1% шанс найти что-либо на каждом шагу.		
 175018	{Продвинутая} {Разведка}
 
-Продвинутая Разведка позволяет герою видеть на 2 квадрата дальше под покровом, привлекает 3 Воров каждый день если доступен слот в армии, и дает 3% шанс найти что-либо на каждом шагу.		
+Продвинутая Разведка позволяет герою видеть на 2 квадрата дальше под покровом, привлекает 3 Воров каждый день если доступен слот в армии, и дает 1.5% шанс найти что-либо на каждом шагу.		
 175019	{Экспертная} {Разведка}
 
-Разведка на уровне Эксперта позволяет герою видеть на 3 квадрата дальше под покровом, привлекает 5 Воров каждый день если доступен слот в армии, и дает 4% шанс найти что-либо на каждом шагу.		
+Разведка на уровне Эксперта позволяет герою видеть на 3 квадрата дальше под покровом, привлекает 5 Воров каждый день если доступен слот в армии, и дает 2% шанс найти что-либо на каждом шагу.		
 175020	{Сопротивление}		
 175021	{Базовое} {Сопротивление}
 

+ 2 - 1
WoG Scripts Rus/Lang/wog scripts rus.json

@@ -720,7 +720,8 @@
 			"mainMsg": "{Передача имущества}\n\nВыберите цвет игрока, которому хотите передать объект:",
 			"heroInTown": "{Передача города невозможна!} \n\n Вы не можете передать город другому игроку, пока в нём находится ваш герой. Пожалуйста, выведите героя и отойдите им от города.",
 			"neutralName": "Нейтральный",
-			"level_8": "{Передача имущества}\n\nСила {Божественных Созданий} не позволяет передать этот объект."
+			"level_8": "{Передача имущества}\n\nСила {Божественных Созданий} не позволяет передать этот объект.",
+			"cooldown": "{Смена владельца}\n\nЭтот объект можно передавать только раз в неделю. Пожалуйста, попробуйте снова на следующей неделе."
 		},
 		"201": {
 			"ballista_description": "{Баллиста}\n\nБаллиста может стрелять по врагам в битве и может нанести повреждения на (1-50 + уровень героя) вражеским войскам при арт-подготовке.",

+ 7 - 1
WoG Scripts/Data/s/14 wog - tobyn's scripts.erm

@@ -17,7 +17,7 @@ ZVSE2
 
 !#UN:P188/?i^wog_188_enabled^;          check if Rampart Monster Change is enabled in WoGify Options
 !#UN:P189/?i^wog_189_enabled^;          check if Conflux Monster Change is enabled in WoGify Options
-!#UN:P190/?i^wog_190_enabled^; check if First Aid Enhanced is enabled in WoGify Options
+!#UN:P190/?i^wog_190_enabled^;          check if First Aid Enhanced is enabled in WoGify Options
 !#UN:P191/?i^wog_191_enabled^;          check if Estates Enhanced is enabled in WoGify Options
 !#UN:P193/?i^wog_193_enabled^;          check if Warfare is enabled in WoGify Options
 !#UN:P194/?i^wog_194_enabled^;          check if Advanced Witch Huts are enabled in WoGify Options
@@ -876,6 +876,9 @@ lvl 10+ and cycling
 *!IF:M^WOG_193_SetSkillToShow^;
 
 !?FU(WOG_ERM_Hero_BeforeSkillAffection);
+!!UN:P904/(TRUE);                       [Archer30: Temp solution for HE:S unknown error when setting a skill to NOT_LEARNED]
+!!FU&i^wog_193_enabled^<>(TRUE):E;
+
 !!if&i^wog_193_HE_S_do_not_affect^=(FALSE)/i^wog_193_HE_S_Affection^=(NULL);
   !!UN:Cx1/(STRUCT_HOOK_CONTEXT_EBP)/4/?(ebp:y) C(ebp)/-84/4/?(skillId:y);
 
@@ -889,6 +892,9 @@ lvl 10+ and cycling
 *!IF:M^WOG_ERM_Hero_BeforeSkillAffection^;
 
 !?FU(WOG_ERM_Hero_AfterSkillAffection);
+!!UN:P904/(FALSE);                      [Archer30: Temp solution for HE:S unknown error when setting a skill to NOT_LEARNED]
+!!FU&i^wog_193_enabled^<>(TRUE):E;
+
 !!if&i^wog_193_HE_S_Affection^;
   !!VR(skillId:y):Si^wog_193_HE_S_Affection^;
   !!VRi^wog_193_HE_S_Affection^:S0;

+ 40 - 11
WoG Scripts/Data/s/192 wog - transfer owner.erm

@@ -5,6 +5,7 @@ ZVSE2
 
 ** Option 192 by Tobyn
 ** Rewritten by igrik (03.03.2021)
+** Updated by Archer30 (08.05.2025)
 
 * Enables ownership transference of own heroes,
 * towns, mines, dwellings, lighthouses, 
@@ -21,6 +22,17 @@ ZVSE2
 !#UN:P(WOG_OPT_TRANSFER_OWNER)/?(wogOption:y);
 !#VRi^wog_192_dwellingEnabled^&(wogOption):S(TRUE); [Switch for dwelling transfer]
 
+; Array for Towns and Mines
+!?FU(OnAfterErmInstructions);
+!!UN:P(WOG_OPT_TRANSFER_OWNER)/?(wogOption:y);  
+!!FU&(wogOption)<>(TRUE):E;
+
+!!FU(NewIntArray):P?i^wog_192_transferedObjects^/(M_STORED);
+
+; Reset the array every week
+!?FU(OnEveryDay)&i^timerOnce^/i^timerWeekDay^=1/i^timerDay^>1/i^wog_192_transferedObjects^;
+!!SN:Mi^wog_192_transferedObjects^/0;
+
 !?FU(OnAdventureMapLeftMouseClick)&999/i^key_shift^/i^mouse_action^=(MOUSE_LMB_PRESSED)/i^mouse_item^=(ITEM_ADVMAP_ADVENTURE_MAP);
 !!UN:P(WOG_OPT_TRANSFER_OWNER)/?(wogOption:y);  
 !!FU&(wogOption)<>(TRUE):E;
@@ -38,13 +50,32 @@ ZVSE2
 ; get object params
 !!OB(x)/(y)/(z):T?(objectType:y) U?(objectSubype:y);
 
+; get object entrance coordinates
+!!SN:O?(x)/?(y)/?(z);
+
 ; checking for allowed objects
 !!VR(isAllowedObjects:y):S(FALSE);
 
 ; list of allowed objects
-!!VR(isAllowedObjects)&(objectType)=(OBJ_TOWN):S(TRUE);
-!!VR(isAllowedObjects)&(objectType)=(OBJ_MINE):S(TRUE);
+; For towns and mines, they can only be transfered once a week (for all players)
+!!if|(objectType)=(OBJ_TOWN)/(objectType)=(OBJ_MINE);
+  !!SN:Mi^wog_192_transferedObjects^/?(size:y);
+
+  !!re i/0/(size)/1/-1;
+    !!SN:Mi^wog_192_transferedObjects^/0/?(packedValue:y);
+    !!FU(UnpackUnion):P(packedValue)/?(packedX:y)/8/?(packedY:y)/8/?(packedZ:y)/8/?(packedOwner:y)/8;
+
+    *!if&(packedX)=(x)/(packedY)=(y)/(packedZ)=(z)/(packedOwner)=i^timerOwner^;
+      *!IF:M^%T(wog.192.cooldown)^;
+      *!CM:R0;
+      *!FU:E;
+    *!en;
+  !!en;
+
+  !!VR(isAllowedObjects):S(TRUE);
+!!en;
 
+; For dwellings
 !!if&i^wog_192_dwellingEnabled^;
   !!if&(objectType)=(OBJ_CREATURE_GENERATOR_1);
     !!re i/80/88;
@@ -65,6 +96,7 @@ ZVSE2
   !!VR(isAllowedObjects)&(objectType)=(OBJ_CREATURE_GENERATOR_4):S(TRUE);
 !!en;
 
+; For Gardens, Water Wheels and Windmills (Era Scripts Mod feature)
 !!UN:P879/?(capture:y);
 !!if&(capture);
   !!VR(isAllowedObjects)&(objectType)=(OBJ_MYSTICAL_GARDEN):S(TRUE);
@@ -77,9 +109,6 @@ ZVSE2
 
 !!FU&(isAllowedObjects)<>(TRUE):E;
 
-; get object entrance coordinates
-!!SN:O?(x)/?(y)/?(z);
-
 ; init owner var
 !!VR(owner:y):S-1;
 
@@ -103,8 +132,6 @@ ZVSE2
 
 !!FU(WOG_SetupMultiPlayerDlg):P^%T(wog.192.mainMsg)^/(TRUE)/?(chosenPicture:y)/?(newOwner:y);
 
-
-
 !!if&(chosenPicture)<>(NO_PLAYER);
   ; передаём объекты: эти не нуждаются в настройке
   !!DW(x)/(y)/(z)&(objectType)=(OBJ_CREATURE_GENERATOR_1):O(newOwner)/1;
@@ -118,11 +145,13 @@ ZVSE2
   ; передаём объекты: эти нуждаются в настройке
   !!FU(WOG_192_TownTransferOwner)&(objectType)=(OBJ_TOWN):P(x)/(y)/(z)/(newOwner);
   !!FU(WOG_192_MineTransferOwner)&(objectType)=(OBJ_MINE):P(x)/(y)/(z)/(newOwner);
-!!en;
-
-
-
 
+  ; Set as transfered in the array
+  !!if|(objectType)=(OBJ_TOWN)/(objectType)=(OBJ_MINE);
+    !!FU(PackUnion):P(x)/8/(y)/8/(z)/8/i^timerOwner^/8/?(packedValue);
+    !!FU(Array_Push):Pi^wog_192_transferedObjects^/(packedValue);
+  !!en;
+!!en;
 
 ; ==================================================================================================
 

+ 8 - 5
WoG Scripts/Data/s/29 wog - henchmen.erm

@@ -250,6 +250,7 @@ ZVSE2
 !!IF:G1/1/256/1/2/3/4/5/6/7/8/9/10;
 !!FU(IntLog2):Pv1/?(choice);
 
+; If chosed any creature from the hero's army
 !!if&(choice)<7;
   !!HE(hero):C0/(choice)/?(mon:y)/?(qty:y)/?(stackExp:y);
   !!EX(hero)/(choice):R?(hasArt:y)/?(art:y)/?(artOpt:y)/?(artQty:y); [Note: artQty=0 to 3, means 1 to 4 Warlord's Banner]
@@ -273,7 +274,9 @@ ZVSE2
   !!VRw117:S0;
   !!VRw118:S(mon);
   !!VRw119:S(TRUE);
-!!el&(choice)=7;
+
+; If chosed to dimiss the henchman
+!!el;
   !!VRw117:S0;
   !!VRw118:S-2;
 !!en;
@@ -500,10 +503,10 @@ ZVSE2
 !!en;
 
 ; Reward the henchman exp if won the battle
-!?FU(OnAfterBattleUniversal)&i^hench_enabled^;
-!!BA:H0/?(atkHero:y) H1/?(defHero:y);
-!!FU(hench_GiveExpAfterBattle)&(atkHero)>(NO_HERO):P(atkHero);
-!!FU(hench_GiveExpAfterBattle)&(defHero)>(NO_HERO):P(defHero);
+!?FU(OnAfterBattleUniversal)&i^hench_enabled^;[Enhanced]
+!!re i/(BATTLE_LEFT)/i^battle_hero_vs_hero^;
+  !!FU(hench_GiveExpAfterBattle):Pi^battle_hero_%i^/i;
+!!en;
 
 !?FU(hench_GiveExpAfterBattle);
 !#VA(hero:x);

+ 6 - 6
WoG Scripts/Data/s/3 wog - secondary skill text.ert

@@ -39,22 +39,22 @@ Advanced Scouting allows your hero to see 2 squares further into the shroud and
 Expert Scouting allows your hero to see 3 squares further into the shroud and gain 5 Rogues each day if an army slot is available.		
 175014	{Basic} {Scouting}
 
-Basic Scouting allows your hero to see 1 square further into the shroud and gives a 2% chance per step of finding a random encounter.		
+Basic Scouting allows your hero to see 1 square further into the shroud and gives a 1% chance per step of finding a random encounter.		
 175015	{Advanced} {Scouting}
 
-Advanced Scouting allows your hero to see 2 squares further into the shroud and gives a 3% chance per step of finding a random encounter.		
+Advanced Scouting allows your hero to see 2 squares further into the shroud and gives a 1.5% chance per step of finding a random encounter.		
 175016	{Expert} {Scouting}
 
-Expert Scouting allows your hero to see 3 squares further into the shroud and gives a 4% chance per step of finding a random encounter.		
+Expert Scouting allows your hero to see 3 squares further into the shroud and gives a 2% chance per step of finding a random encounter.		
 175017	{Basic} {Scouting}
 
-Basic Scouting allows your hero to see 1 square further into the shroud, gain 1 Rogue each day if an army slot is available, and gives a 2% chance per step of finding a random encounter.		
+Basic Scouting allows your hero to see 1 square further into the shroud, gain 1 Rogue each day if an army slot is available, and gives a 1% chance per step of finding a random encounter.		
 175018	{Advanced} {Scouting}
 
-Advanced Scouting allows your hero to see 2 squares further into the shroud, gain 3 Rogues each day if an army slot is available, and gives a 3% chance per step of finding a random encounter.		
+Advanced Scouting allows your hero to see 2 squares further into the shroud, gain 3 Rogues each day if an army slot is available, and gives a 1.5% chance per step of finding a random encounter.		
 175019	{Expert} {Scouting}
 
-Expert Scouting allows your hero to see 3 squares further into the shroud, gain 5 Rogues each day if an army slot is available, and gives a 4% chance per step of finding a random encounter.		
+Expert Scouting allows your hero to see 3 squares further into the shroud, gain 5 Rogues each day if an army slot is available, and gives a 2% chance per step of finding a random encounter.		
 175020	{Resistance}		
 175021	{Basic} {Resistance}
 

+ 32 - 16
WoG Scripts/Data/s/53 wog - map options.erm

@@ -262,27 +262,43 @@ Dialogue Box numbers used: 17
 
 !?FU(WOG_CheckIfAnySpellBannedByWoGOptions);
 !#VA(result:x) (bannedSpellsList:x);
-!#VA(spellIsBanned[11]:y);
 
 !!VR(result):S(FALSE);
 
-!!UN:P152/?(spellIsBanned[0]); [Check if Summon Boat is banned: y2=1 if banned]
-!!UN:P153/?(spellIsBanned[1]); [Check if Water Walk is banned: y3=1 if banned]
-!!UN:P154/?(spellIsBanned[2]); [Check if Town Portal is banned: y4=1 if banned]
-!!UN:P155/?(spellIsBanned[3]); [Check if Dimension Door is banned: y5=1 if banned]
-!!UN:P156/?(spellIsBanned[4]); [Check if Fly is banned: y6=1 if banned]
-!!UN:P221/?(spellIsBanned[5]); [Check if Scuttle Boat is banned: y7=1 if banned]
-!!UN:P222/?(spellIsBanned[6]); [Check if Visions is banned: y8=1 if banned]
-!!UN:P223/?(spellIsBanned[7]); [Check if Armageddon is banned: y9=1 if banned]
-!!UN:P246/?(spellIsBanned[8]); [Check if View Air is banned: y10=1 if banned]
-!!UN:P247/?(spellIsBanned[9]); [Check if View Earth is banned: y11=1 if banned]
-!!UN:P249/?(spellIsBanned[10]); [Check if Disguise is banned: y11=1 if banned]
-
 !!FU(NewIntArray):P?(bannedSpellsList);
 
-!!re i/0/10;
-  !!FU(Array_Push)&(spellIsBanned[i]):P(bannedSpellsList)/(spellIsBanned[i]);
-!!en;
+!!UN:P152/?(isBanned:y); [Check if Summon Boat is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_SUMMON_BOAT);
+
+!!UN:P153/?(isBanned); [Check if Water Walk is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_WATER_WALK);
+
+!!UN:P154/?(isBanned); [Check if Town Portal is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_TOWN_PORTAL);
+
+!!UN:P155/?(isBanned); [Check if Dimension Door is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_DIMENSION_DOOR);
+
+!!UN:P156/?(isBanned); [Check if Fly is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_FLY);
+
+!!UN:P221/?(isBanned); [Check if Scuttle Boat is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_SCUTTLE_BOAT);
+
+!!UN:P222/?(isBanned); [Check if Visions is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_VISIONS);
+
+!!UN:P223/?(isBanned); [Check if Armageddon is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_ARMAGEDDON);
+
+!!UN:P246/?(isBanned); [Check if View Air is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_VIEW_AIR);
+
+!!UN:P247/?(isBanned); [Check if View Earth is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_VIEW_EARTH);
+
+!!UN:P249/?(isBanned); [Check if Disguise is banned]
+!!FU(Array_Push)&(isBanned):P(bannedSpellsList)/(SPELL_DISGUISE);
 
 !!SN:M(bannedSpellsList)/?(size:y);
 

+ 21 - 19
WoG Scripts/Data/s/59 wog - masters of life.erm

@@ -29,30 +29,32 @@ ZVSE2
 !!UN:P67/?(neutralTown:y);              [check if Masters of Life and Neutral town are both active]
 !!MA&(masterOfLife)/(neutralTown):C(MON_HALFLING)/(RES_GOLD)/?(cost:y) C(MON_ROGUE)/(RES_GOLD)/(cost); [if yes set costs of Halfing and Rogue to the same if script active]
 
-!?FU(OnEveryDay)&i^timerOnce^/i^timerDay^>1; [daily event, starting from the second day]
+!?FU(OnEveryDay)&i^timerDay^>1;         [daily event, starting from the second day]
 !!UN:P19/?(masterOfLife:y);
+!!FU&(masterOfLife)<>(TRUE):E;
+
 !!UN:P67/?(neutralTown:y);
 
-!!if&(masterOfLife);
-  !!re i/(HERO_FIRST)/(HERO_LAST_WOG);
-    !!HEi:B2/?(class:y);                [get class of the hero]
-    !!VR(townType:y):S(class):2;        [divide by 2 to get the town typ]
-    ; Upgrade the non-upgraded level 1 troops to upgraded for non-Necropolis and non-Neutral Town Heroes
-    !!if&(townType)<>(TOWN_NECROPOLIS);
-      !!if|(townType)<>(TOWN_CONFLUX)/(neutralTown)<>(TRUE);
-        !!UN:T(townType)/0/0/?(lv1Mon:y);
-
-        !!VR(upgMon:y):S(lv1Mon) +1;
-        ; The new experience will be the old experience multiplied by the Upgrade Multiplier
-        !!HEi:C1/(lv1Mon)/(upgMon)/d/d/0/5; [upg 1st level creatures]
-        ; For peasants
-        !!FU(WOG_19_UpgradeMonsters):Pi/(upgMon);
-      !!en;
-    !!en;
-  !!en;
+!!re i/(HERO_FIRST)/(HERO_LAST_WOG);
+  !!HEi:O?(owner:y);
+  !!co&(owner)<>i^timerOwner^;
+
+  !!HEi:B2/?(class:y);                [get class of the hero]
+  !!VR(townType:y):S(class):2;        [divide by 2 to get the town typ]
+  !!co&(townType)=(TOWN_NECROPOLIS);
+  !!co&(townType)=(TOWN_CONFLUX)/(neutralTown);
+
+  ; Upgrade the non-upgraded level 1 troops to upgraded
+  !!UN:T(townType)/0/0/?(lv1Mon:y);
+
+  !!VR(upgMon:y):S(lv1Mon) +1;
+  ; The new experience will be the old experience multiplied by the Upgrade Multiplier
+  !!HEi:C1/(lv1Mon)/(upgMon)/d/d/0/5; [upg 1st level creatures]
+  ; For peasants
+  !!FU(WOG_19_UpgradeMonsters):Pi/(upgMon);
 !!en;
 
-!!SN:D;
+!!SN&i^timerIsHuman^:D;
 
 !?FU(WOG_19_UpgradeMonsters);
 !#VA(hero:x) (upgMon:x);

+ 1 - 1
WoG Scripts/Data/s/75 wog - secondary skills boost.erm

@@ -57,7 +57,7 @@ ZVSE2
 
 ; Learning I
 !!UN:P217/?(learningI:y);               [Check if Learning is enabled in WoGify Options]
-!!SN&(learningI):E(address)/1/5214729/(WOG_Dlg_HeroLvlUp_PrimarySkillText);
+!!SN&(learningI):E(address)/1/5214734/(WOG_Dlg_HeroLvlUp_PrimarySkillText);
 
 ; Tactics
 !!SN&i^wog_218_enabled^:E(address)/1/5137385/(WOG_218_OnMonGetSpec); [hook for the artifacts giving mon stats]

+ 2 - 1
WoG Scripts/Lang/wog scripts.json

@@ -584,7 +584,8 @@
 			"mainMsg": "{Transfer owner} \n\n Chose the player you want to pass this object:",
 			"heroInTown": "{You can't transfer the town!} \n\n You can't transfer the town to another player while your hero is in it. Please take out the hero and move them away from the town.",
 			"neutralName": "Neutral",
-			"level_8": "{Transfer owner}\n\n{God Creatures}' power doesn't allow to transfer this object."
+			"level_8": "{Transfer owner}\n\n{God Creatures}' power doesn't allow to transfer this object.",
+			"cooldown": "{Transfer owner}\n\nThis object can only be transferred once per week. Please try again next week."
 		},
 		"201": {
 			"ballista_description": "{Ballista}\n\nThe Ballista can target your enemy's troops in combat and can deal (1-50 + hero level) points of damage to an enemy unit prior to combat.",