ZVSE 
ERMS_ScriptDate=29.7(July).2004
_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.6.29.918

Script: Magic Mushrooms
WoGify name: script10.erm
Updated: July 29, 2004
 
************************ 
*** Magic Mushrooms  *** 
***     By Bruno     *** 
***       V1.10f     ***
************************ 

IA support 10e 
This version is working well 10.d 
Thanks To Donald for his suggestions and his help 
 
When you visit the Mushroom, your hero gains Expert level in 
one of the four schools of magic for the rest of the week. 
This works even if your hero has all eight skill slots filled. 
 
Uses timer 10 and Functions 10-12 
Uses v1-v2-v3 just for local use 
Uses w20-w27 to track hero visits to mushrooms and previous skill levels 
Uses z11-z17 and z159 for hint texts

!#UN:P110/?v1; check if Magic Mushrooms are enabled
 
*** Init for amm mushroom 
!#TM10&v1=1:S1/999/7/255; launch timer every 7 days launch timer every 7 days for all players 
 
*** Init for Magic Water Mushroom 
!#VRz159&v1=1:Sz110000;
!#VRz11&v1=1:Sz110001; 
!#HT63/18&v1=1:W21/0/159;  Rename all Magic Water mushrooms
!#HT63/18&v1=1:W21/1/11;  call z11 string if mushroom was visited 
*** Init for Magic Fire Mushroom 
!#VRz12&v1=1:Sz110002; 
!#VRz13&v1=1:Sz110003; 
!#HT63/29&v1=1:W23/0/12;  Rename all Magic Fire mushrooms 
!#HT63/29&v1=1:W23/1/13;  call z13 string if mushroom was visited 
*** Init for Magic Earth Mushroom 
!#VRz14&v1=1:Sz110004; 
!#VRz15&v1=1:Sz110005; 
!#HT63/23&v1=1:W25/0/14;  Rename all Magic Earth mushrooms
!#HT63/23&v1=1:W25/1/15;  call z15 string if mushroom was visited 
*** Init for Magic Air Mushroom 
!#VRz16&v1=1:Sz110006; 
!#VRz17&v1=1:Sz110007; 
!#HT63/14&v1=1:W27/0/16;  Rename all Magic Air mushrooms 
!#HT63/14&v1=1:W27/1/17;  call z17 string if mushroom was visited 
 
*** Timer 
!?TM10;
!!UN:P110/?y-1; [check if script is enabled: y-1] 
!!OW&y-1=1:C?v1; [get current player] 
!!DO10/0/155/1&y-1=1:P; 
 
** function to check one hero for variable resetting 
!?FU10; 
!!HEx16:O?v2; [get owner of this hero if any] 
!!FU11&v1=v2:P; [continue if it's this player's turn] 
 
*** Function to reset variable 
!?FU11; 
!!IF:Wx16; 
*** water 
!!HEx16&w21=1:S16/w20; 
!!VRw20:S0; [reinstate old skill level if visited mushroom] 
!!VRw21:S0; free the visit 
*** Fire 
!!HEx16&w23=1:S14/w22; 
!!VRw22:S0; [reinstate old skill level if visited mushroom] 
!!VRw23:S0; free the visit 
*** Earth 
!!HEx16&w25=1:S17/w24; 
!!VRw24:S0; [reinstate old skill level if visited mushroom] 
!!VRw25:S0; free the visit 
*** Air 
!!HEx16&w27=1:S15/w26; 
!!VRw26:S0; [reinstate old skill level if visited mushroom] 
!!VRw27:S0; free the visit 
 
*** Magic Water Mushroom *** 
!?OB63/18; 
!!UN:P110/?y-1; [check if script is enabled: y-1] 
!!FU&y-1=0:E; [Exit if script isn't enabled]
!!VRv1:S0; 
!!IF:W-1; 
!!HE-1&w21<>1/v1<>3:S16/?v1; ask skill 
!!IF&v1=3/1000:Q1/20/53/1/z110008; 
!!IF&w21=1/1000:M1/z110009; 
!!VRw20&v1<>3/w21<>1:Sv1; w20 stock the level of the skill 
!!IF&v1<>3/w21<>1/1000:Q1/20/53/1/z110010; 
!!HE-1&v1<>3:S16/3; put skill in expert 
!!VRw21&v1<>3:S1; heroes have visited the magic water mushroom 
 
*** Magic Fire Mushrooms *** 
!?OB63/29; 
!!UN:P110/?y-1; [check if script is enabled: y-1] 
!!FU&y-1=0:E; [Exit if script isn't enabled]
!!VRv1:S0; 
!!IF:W-1; 
!!HE-1&w23<>1/v1<>3:S14/?v1; 
!!IF&v1=3/1000:Q1/20/47/1/z110011; 
!!IF&w23=1/1000:M1/z110012; 
!!VRw22&v1<>3/w23<>1:Sv1; w22 stock the level of the skill 
!!IF&v1<>3/w23<>1/1000:Q1/20/47/1/z110013; 
!!HE-1&v1<>3:S14/3; put skill in expert 
!!VRw23&v1<>3:S1; heroes have visited the magic mushroom 
 
*** Magic Earth Mushrooms *** 
!?OB63/23; 
!!UN:P110/?y-1; [check if script is enabled: y-1] 
!!FU&y-1=0:E; [Exit if script isn't enabled]
!!VRv1:S0; 
!!IF:W-1; 
!!HE-1&w25<>1/v1<>3:S17/?v1; 
!!IF&v1=3/1000:Q1/20/56/1/z110014; 
!!IF&w25=1/1000:M1/z110015; 
!!VRw24&v1<>3/w25<>1:Sv1; w22 stock the level of the skill 
!!IF&v1<>3/w25<>1/1000:Q1/20/56/1/z110016; 
!!HE-1&v1<>3:S17/3; put skill in expert 
!!VRw25&v1<>3:S1; heroes have visited the magic mushroom 
 
*** Magic Air Mushrooms *** 
!?OB63/14; 
!!UN:P110/?y-1; [check if script is enabled: y-1] 
!!FU&y-1=0:E; [Exit if script isn't enabled]
!!VRv1:S0; 
!!IF:W-1; 
!!HE-1&w27<>1/v1<>3:S15/?v1; 
!!IF&v1=3/1000:Q1/20/50/1/z110017; 
!!IF&w27=1/1000:M1/z110018; 
!!VRw26&v1<>3/w27<>1:Sv1; w22 stock the level of the skill 
!!IF&v1<>3/w27<>1/1000:Q1/20/50/1/z110019; 
!!HE-1&v1<>3:S15/3; put skill in expert 
!!VRw27&v1<>3:S1; heroes have visited the magic mushroom

