 
# F - Forest
# L - Land
# M - Mountain
# R - Ruines
# H - Home
# T - Tower

MAP
22222222222222222222222
222222222222222222222222
22222222222222222222222
222222222222222222222222
22222222222222222222222
222222222222222222222222
22222222222222222222222
222222222222222222222222
22222222222222222222222
222222222222222222222222
22222222222222L22222222
2222222222222LLLL2222222
222222222LLLLLLLLLL2222
22222222LLLLLLLLLLLL2222
22222LLLLLLLLLLLLLLLL22
22LLLLLLLLLLLLLLLLLLLL22
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLWWWWWLLLLLLLLLLLLLWWW
LWWLLLLWWLLLWWLLLLLLWLL
WWLLLLLLLWWWWLWWLLLLWLLL
LLLLLLLLLLLLLLLWWWWWLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLLL
#===MAPEND===

#       
CONSTANTS
Discord_X:14
Discord_Y:23
Dark_X:17
Dark_Y:23
HouseMustSave:6
HouseMustSaveLess:5
EnemyA_I:12
EnemyA_J:48
EnemyB_I:1
EnemyB_J:38
EnemyC_I:20
EnemyC_J:38
StoneNeed:2000

OBJECTS
Pony:i=13,j=16,"name= ",code=rainbow,tag=rainbow
Pony:i=14,j=17,"name= ",code=pinki,tag=pinki
Pony:i=15,j=18,"name=",code=flatter,tag=flatter
Pony:i=16,j=18,"name=",code=rarity,tag=rarity
Pony:i=17,j=17,"name=",code=twily,tag=twily
Pony:i=18,j=16,"name=",code=applejack,tag=applejack
Building:Code=House,"Name= ",Tag=house,i=14,j=20
Building:Code=House2,"Name= ",Tag=house,i=13,j=21
Building:Code=House3,"Name= ",Tag=house,i=16,j=22
Building:Code=House,"Name= ",Tag=house,i=13,j=23
Building:Code=House,"Name= ",Tag=house,i=9,j=24
Building:Code=House2,"Name= ",Tag=house,i=11,j=24
Building:Code=House3,"Name= ",Tag=house,i=16,j=25
Building:Code=House,"Name= ",Tag=house,i=18,j=23
Building:Code=House3,"Name= ",Tag=house,i=20,j=24
Building:Code=House3,"Name= ",Tag=house,i=21,j=22
Building:Code=House2,"Name= ",Tag=house,i=9,j=21
#===OBJECTSEND===

INITIAL
Stone:100
Food:300
EmptyManager:50,50,50,50,50,50
#EmptyManager:0,0,0,0,0,0
Task:  
NoSpaceProtection:True
Permits:action=deny,code=all
Permits:action=allow,code=BuildFarmFood
Permits:action=allow,code=Harvest
Permits:action=allow,code=AttackNear
Permits:action=allow,code=AttackLong
Permits:action=allow,code=FreezeEnemy
Permits:action=allow,code=Teleport
Permits:action=allow,code=SonicRainbow
Permits:action=allow,code=Heal
Permits:action=allow,code=Restore
Permits:action=allow,code=CutEmptySector
Permits:action=allow,code=BuildTreeShield
Permits:action=allow,code=BuildFarmStone
Permits:action=allow,code=BuildCrystalTowerBig
Permits:action=allow,code=BuildCrystalTowerSmall
Permits:action=allow,code=NightmareCall
Permits:action=allow,code=BuildCrystalTowerDark
Permits:action=allow,code=DarkTriden
Permits:action=allow,code=CrystallRain
Permits:action=allow,code=FrostAttack
Permits:action=allow,code=SuperHealthAJ
Permits:action=allow,code=SuperPowerPinki
Permits:action=allow,code=BearSplash
Permits:action=allow,code=SummoneBear
Permits:action=allow,code=PrincessKiss
Permits:action=allow,code=DeathKick
Permits:action=allow,code=DeathRainbow
Permits:action=allow,code=BuildForceTower
Permits:action=allow,code=BuildHealTower
Permits:action=allow,code=BuildMirage
Permits:action=allow,code=IntRelax
Permits:action=allow,code=SleepStar
Permits:action=allow,code=BuildTornado
Permits:action=allow,code=Wings
Permits:action=allow,code=FlatterView
Permits:action=allow,code=ForceShield
Permits:action=allow,code=ForceShieldNR
Permits:action=allow,code=SetupTeleport
Permits:action=allow,code=ConsumeEnergy
Permits:action=allow,code=ExtraEmptyClear
Permits:action=allow,code=CutEmptySectorEx
Permits:action=allow,code=SonicRainbowEx
Permits:action=allow,code=Repair
Permits:action=allow,code=MagicRepair

SCRIPT      
Event:Step=0
Action:Type=SetFocus,i=15,j=17,immediate=true
Action:Type=Message,icon=rarity_ico,"text= ,  ,    -    ?"
Action:Type=Message,icon=twily_ico,"text=,      ."
Action:Type=Message,icon=rainbow_ico,"text=    .     ."
Action:Type=Message,icon=applejack_ico,"text=,     .  ,    ,     ?"
Action:Type=SetBattleTask,code=protect,"Task=   @HouseMustSave@ ."
Action:Type=SetExtInfoModel,"ModelMicroCode=maptirek; : %d;house"
Action:Type=ShowBattleTask

SCRIPT      
Event:Step=1
Action:Type=Message,icon=rarity_ico,"text=   ?"
Action:Type=Message,icon=twily_ico,"text=,    .     ,  .  ... , ... ?"
Action:Type=Message,icon=rarity_ico,"text= ,  ,   !"
Action:Type=Message,icon=applejack_ico,"text= - ,      . ,       ?"
Action:Type=Message,icon=twily_ico,"text= ,  .    ,        ."
Action:Type=Message,icon=rainbow_ico,"text=      -  . ,   ."
Action:Type=NewObject,Object=Neutral,i=@Discord_X@,j=@Discord_Y@,"name=",code=discord,autofocus=true,tag=discord
Action:Type=Message,icon=discord_ico,"text=  ."
Action:Type=Message,icon=twily_ico,"text=!   ,  ."
Action:Type=Message,icon=discord_ico,"text= ,   .  ,       --,   ... .  ."
Action:Type=Message,icon=twily_ico,"text=     ?         ,   !"
Action:Type=Message,icon=discord_ico,"text= ,  .   ,        .         - ,   ,  ."
Action:Type=Message,icon=rainbow_ico,"text= ... ?"
Action:Type=Message,icon=discord_ico,"text= ,          -         ,        ."
Action:Type=Message,icon=pinki_ico,"text=  ? ,   ."
Action:Type=NewObject,Object=Neutral,i=@Dark_X@,j=@Dark_Y@,"name=",code=dark,autofocus=true,tag=dark
Action:Type=Message,icon=darkness_ico,"text=    .    - .        ,  .   ."
Action:Type=Message,icon=twily_ico,"text=  ,       -   -!       !"
Action:Type=Message,icon=darkness_ico,"text=  ,    ,  .        .   ...  .  ,   .   ,     ,  ."
Action:Type=Message,icon=twily_ico,"text= ...      !     ?"
Action:Type=Message,icon=darkness_ico,"text= ."
Action:Type=Message,icon=applejack_ico,"text=,     ,  ,   ,    . ,   ."
Action:Type=Message,icon=ok_ico,"text=   ,        -          ."
Action:Type=SetBattleTask,code=initial,"Task=  ,       ."
Action:Type=ChooseSol

SCRIPT
Event:Flag=fusesol
Action:Type=Message,icon=twily_ico,"text= ,     .      -    .     .  , ?"
Action:Type=Message,icon=discord_ico,"text=    .       -,     -       ."
Action:Type=Message,icon=twily_ico,"text=     .   ,   ."
Action:Type=Message,icon=discord_ico,"text=,      .       -  ,   ."
Action:Type=SetPermits,action=allow,code=FuseTwily
Action:Type=SetPermits,action=allow,code=FuseRarity
Action:Type=SetPermits,action=allow,code=FuseFlatter
Action:Type=SetPermits,action=allow,code=FusePinki
Action:Type=SetPermits,action=allow,code=FuseAJ
Action:Type=SetPermits,action=allow,code=FuseRD
Action:Type=SetPermits,action=deny,code=ConsumeEnergy
Action:Type=SetPermits,action=deny,code=ExtraEmptyClear
Action:Type=FailBattleTask,code=initial
Action:Type=SetBattleTask,code=final,"Task=    (   400 )      ."
Action:Type=ShowBattleTask
Action:Type=RemoveObject,i=@Discord_X@,j=@Discord_Y@
Action:Type=RemoveObject,i=@Dark_X@,j=@Dark_Y@

SCRIPT
Event:Flag=splitsol
Action:Type=Message,icon=twily_ico,"text=       -      .   ?"
Action:Type=Message,icon=darkness_ico,"text=   .   ,      .   ,   , ."
Action:Type=Message,icon=twily_ico,"text=  . ,   ,       ... ."
Action:Type=SetPermits,action=deny,code=ConsumeEnergy
Action:Type=SetPermits,action=deny,code=ExtraEmptyClear
Action:Type=FailBattleTask,code=initial
Action:Type=SetBattleTask,code=final,"Task= @StoneNeed@    ."
Action:Type=ShowBattleTask
Action:Type=RemoveObject,i=@Discord_X@,j=@Discord_Y@
Action:Type=RemoveObject,i=@Dark_X@,j=@Dark_Y@

SCRIPT
Event:Flag=spellsol
Action:Type=Message,icon=twily_ico,"text= ,      -     .     ."
Action:Type=Message,icon=darkness_ico,"text=  , . ,         - ."
Action:Type=Message,icon=discord_ico,"text=  , ,    .  ,  ."
Action:Type=ShowBattleTask
Action:Type=RemoveObject,i=@Discord_X@,j=@Discord_Y@
Action:Type=RemoveObject,i=@Dark_X@,j=@Dark_Y@

# Space speed inc

SCRIPT
Event:Step=4
Event1:Flag=spellsol
Action:Type=SetEmptyManager,AnyDir=65
Action:Type=Message,icon=twily_ico,"text=  .    -    .     ."
Action:Type=Message,icon=rainbow_ico,"text=-   ?   ,  -         ."

SCRIPT
Event:Step=9
Event1:Flag=spellsol
Action:Type=SetEmptyManager,AnyDir=80
Action:Type=Message,icon=twily_ico,"text=  .    4  5 .    ."

SCRIPT
Event:Step=14
Event1:Flag=spellsol
Action:Type=SetEmptyManager,AnyDir=100
Action:Type=Message,icon=twily_ico,"text=       -  .   ,   ."

# New Archon Rarilight
SCRIPT
Event:TagCount=0,TagName=twily,AllowTransp=true
Event1:Flag=fusesol
Action:Type=Message,icon=twily_ico,"text= , , .       ."
Action:Type=Message,icon=rarity_ico,"text=,         .   ,    ."

SCRIPT
Event:ObjectPos=True,Direction=GreatY,j=0,Object=rarilight,Mark=1
Action:Type=Message,icon=rarilight_ico,"text= -  !    .    ...         ! !"

# New Archon Pinapple
SCRIPT
Event:TagCount=0,TagName=pinki,AllowTransp=true
Event1:Flag=fusesol
Action:Type=Message,icon=pinki_ico,"text=, . ,          ."
Action:Type=Message,icon=applejack_ico,"text=  ,    ...        ,   ."

SCRIPT
Event:ObjectPos=True,Direction=GreatY,j=0,Object=pinapple,Mark=1
Action:Type=Message,icon=pinapple_ico,"text=. .    ...   -!"

# New Archon flatterrain
SCRIPT
Event:TagCount=0,TagName=rainbow,AllowTransp=true
Event1:Flag=fusesol
Action:Type=Message,icon=rainbow_ico,"text=        .  , ?"
Action:Type=Message,icon=flatter_ico,"text=,    - ."

SCRIPT
Event:ObjectPos=True,Direction=GreatY,j=0,Object=flatterrain,Mark=1
Action:Type=Message,icon=flatterrain_ico,"text=  !     ,   ...     , ."


# Monster

SCRIPT      
Event:Step=2
Action:Type=SetFocus,i=@EnemyA_I@,j=@EnemyA_J@
Action:Type=NewObjectGroup,Object=Monster,Code=avatar,"Name= ",i=@EnemyA_I@,j=@EnemyA_J@,count=1,radius=2
Action:Type=Message,icon=rarity_ico,"text=      ."
Action:Type=Message,icon=twily_ico,"text=      ,    ."
Action:Type=Message,icon=rarity_ico,"text=   -   ."

SCRIPT      
Event:StepModN=6
Action:Type=NewObjectGroup,Object=Monster,Code=avatar,"Name= ",i=@EnemyA_I@,j=@EnemyA_J@,count=1,radius=2

SCRIPT      
Event:StepModN=11
Action:Type=NewObjectGroup,Object=Monster,Code=avatar,"Name= ",i=@EnemyB_I@,j=@EnemyB_J@,count=2,radius=2

SCRIPT      
Event:StepModN=16
Action:Type=NewObjectGroup,Object=Monster,Code=avatar,"Name= ",i=@EnemyC_I@,j=@EnemyC_J@,count=2,radius=2

SCRIPT      
Event:StepModN=20
Action:Type=NewObjectGroup,Object=Monster,Code=avatar,"Name= ",i=@EnemyA_I@,j=@EnemyA_J@,count=3,radius=2

# Defeat
SCRIPT
Event:TagCount=@HouseMustSaveLess@,TagName=house,Compare=LessOrEqual
Action:Type=SetDefeat,"DefeatStr=   "

# Victory by split
SCRIPT
Event:StoneReach=@StoneNeed@
Event1:Flag=splitsol
Action:Type=SetFlag,FlagName=splitok

# Victory

SCRIPT
Event:Victory=True
Event1:Flag=fusesol
Action:Type=Message,icon=rarilight_ico,"text=!    ! ...  ."
Action:Type=Message,icon=flatterrain_ico,"text=    ,  !"
Action:Type=Message,icon=pinapple_ico,"text=,   ,       .  , ?"
Action:Type=Message,icon=rarilight_ico,"text=   ,    -   ,  -   ,   ?"
Action:Type=Message,icon=flatterrain_ico,"text=   ,       -     ,   .      .  ."
Action:Type=Message,icon=rarilight_ico,"text= ,      -      .  .   ,       ."
Action:Type=Message,icon=pinapple_ico,"text=, .   , ?"
Action:Type=Message,icon=rarilight_ico,"text=     . ,     .\n...\n    ,    ."
Action:Type=SetPersistentFlag,FlagName=final_fuse
Action:Type=SetPersistentVar,VarName=epilog_n,VarValue=12

SCRIPT
Event:Victory=True
Event1:Flag=splitok
Action:Type=Message,icon=darkness_ico,"text=   .   ."
Action:Type=Message,icon=rainbow_ico,"text=  ."
Action:Type=Message,icon=darkness_ico,"text=    , ? ,     -    ."
Action:Type=Message,icon=rarity_ico,"text= ,     -    ?"
Action:Type=Message,icon=twily_ico,"text=  ,     ."
Action:Type=Message,icon=darkness_ico,"text=   .     - .          ."
Action:Type=Message,icon=twily_ico,"text= ,     .   ,    ."
Action:Type=SetPersistentFlag,FlagName=final_split
Action:Type=SetPersistentVar,VarName=epilog_n,VarValue=13

SCRIPT
Event:Victory=True
Event1:Flag=spellsol
Action:Type=Message,icon=twily_ico,"text= !    !     - ..."
Action:Type=TeleportObject,method=tag,Tag=twily,dst_i=0,dst_j=0,immediate=true
Action:Type=RemoveObject,method=tag,Tag=twily
Action:Type=Message,icon=rainbow_ico,"text=! !...    ."
Action:Type=Message,icon=rarity_ico,"text=        . ,  .      ."
Action:Type=Message,icon=discord_ico,"text=   .  ,   ...     ,    ."
Action:Type=Message,icon=applejack_ico,"text=    ?"
Action:Type=Message,icon=discord_ico,"text=       -    .   ,     -    ,     ."
Action:Type=Message,icon=flatter_ico,"text=    ?"
Action:Type=Message,icon=discord_ico,"text=      ?   ,    .    ,     ."
Action:Type=SetPersistentFlag,FlagName=final_clear
Action:Type=SetPersistentVar,VarName=epilog_n,VarValue=11

VICTORY
ByNoSpaceLeft:null
->ByFlag:FlagName=splitok,AddType=Or
