Quote:
Guess I never really understood the power or potential of scripting zones. Are there any help docs? Any examples that we could see?
Wel for instance properly randomizing the location of items in the cretan shark area so that players can't beeline to the key was done by using a BlobbieScript zone reset. Feel free to try and decipher for yourselves what is happening in the following zone BlobbieScript:
Code:
protect
{
static @whaleShark1
if( !%isValid( @whaleShark1 ) )
#@whaleShark1 = %load( mobile, 125205, 125206 )
#%setCharStat( @whaleShark1, npcGroup, 125206 )
endif
static @largeShark1
if( !%isValid( @largeShark1 ) )
#@largeShark1 = %load( mobile, 125204, 125213 )
#%setCharStat( @largeShark1, npcGroup, 125207 )
endif
//----
static @dolphin1
if( !%isValid( @dolphin1 ) )
#@dolphin1 = %load( mobile, 125217, 125218 )
#%setCharStat( @dolphin1, npcGroup, 125202 )
endif
static @dolphin2
if( !%isValid( @dolphin2 ) )
#@dolphin2 = %load( mobile, 125217, 125223 )
#%setCharStat( @dolphin2, npcGroup, 125202 )
endif
static @dolphin3
if( !%isValid( @dolphin3 ) )
#@dolphin3 = %load( mobile, 125217, 125204 )
#%setCharStat( @dolphin3, npcGroup, 125202 )
endif
//----
static @lamprey1
if( !%isValid( @lamprey1 ) )
#@lamprey1 = %load( mobile, 125208, 125205 )
#%setCharStat( @lamprey1, npcGroup, 125210 )
endif
static @lamprey2
if( !%isValid( @lamprey2 ) )
#@lamprey2 = %load( mobile, 125208, 125205 )
#%setCharStat( @lamprey2, npcGroup, 125210 )
endif
static @lamprey3
if( !%isValid( @lamprey3 ) )
#@lamprey3 = %load( mobile, 125208, 125208 )
#%setCharStat( @lamprey3, npcGroup, 125210 )
endif
static @lamprey4
if( !%isValid( @lamprey4 ) )
#@lamprey4 = %load( mobile, 125208, 125208 )
#%setCharStat( @lamprey4, npcGroup, 125210 )
endif
static @lamprey5
if( !%isValid( @lamprey5 ) )
#@lamprey5 = %load( mobile, 125208, 125217 )
#%setCharStat( @lamprey5, npcGroup, 125210 )
endif
static @lamprey6
if( !%isValid( @lamprey6 ) )
#@lamprey6 = %load( mobile, 125208, 125217 )
#%setCharStat( @lamprey6, npcGroup, 125210 )
endif
static @lamprey7
if( !%isValid( @lamprey7 ) )
#@lamprey7 = %load( mobile, 125208, 125222 )
#%setCharStat( @lamprey7, npcGroup, 125210 )
endif
static @lamprey8
if( !%isValid( @lamprey8 ) )
#@lamprey8 = %load( mobile, 125208, 125222 )
#%setCharStat( @lamprey8, npcGroup, 125210 )
endif
static @lamprey9
if( !%isValid( @lamprey9 ) )
#@lamprey9 = %load( mobile, 125208, 125224 )
#%setCharStat( @lamprey9, npcGroup, 125210 )
endif
static @lamprey10
if( !%isValid( @lamprey10 ) )
#@lamprey10 = %load( mobile, 125208, 125224 )
#%setCharStat( @lamprey10, npcGroup, 125210 )
endif
static @lamprey11
if( !%isValid( @lamprey11 ) )
#@lamprey11 = %load( mobile, 125208, 125228 )
#%setCharStat( @lamprey11, npcGroup, 125210 )
endif
static @lamprey12
if( !%isValid( @lamprey12 ) )
#@lamprey12 = %load( mobile, 125208, 125228 )
#%setCharStat( @lamprey12, npcGroup, 125210 )
endif
//----
static @jellyfish1
if( !%isValid( @jellyfish1 ) )
#@jellyfish1 = %load( mobile, 125202, 125224 )
#%setCharStat( @jellyfish1, npcGroup, 125205 )
endif
static @squid1
if( !%isValid( @squid1 ) )
#@squid1 = %load( mobile, 125203, 125228 )
#%setCharStat( @squid1, npcGroup, 125204 )
endif
static @whale1
if( !%isValid( @whale1 ) )
#@whale1 = %load( mobile, 125210, 125200 )
#%setCharStat( @whale1, npcGroup, 125201 )
endif
//----
static @stuff
if( %isNull( @stuff ) )
{
#@stuff->1 = 125218
#@stuff->2 = 125219
#@stuff->3 = 125220
#@stuff->4 = 125200
#@stuff->5 = -1
#@stuff->6 = 125221
#@stuff->7 = 125222
#@stuff = %arrayShuffle( @stuff )
}
endif
//----
static @greatWhite1
if( !%isValid( @greatWhite1 ) )
#@greatWhite1 = %load( mobile, 125212, 125215 )
#%setCharStat( @greatWhite1, npcGroup, 125207 )
endif
static @limb1
if( !%isValid( @limb1 ) )
#@limb1 = %load( object, 125202, @greatWhite1 )
endif
static @hand1
if( !%isValid( @hand1 ) )
#@hand1 = %load( object, 125210, @greatWhite1, hold )
endif
static @treasure1
if( !%isValid( @treasure1 ) && !%isPc( %getOwner( @hand1 ) ) )
#@treasure1 = %load( object, @stuff->1, @hand1 )
endif
//----
static @greatWhite2
if( !%isValid( @greatWhite2 ) )
#@greatWhite2 = %load( mobile, 125212, 125217 )
#%setCharStat( @greatWhite2, npcGroup, 125207 )
endif
static @limb2
if( !%isValid( @limb2 ) )
#@limb2 = %load( object, 125202, @greatWhite2 )
endif
static @hand2
if( !%isValid( @hand2 ) )
#@hand2 = %load( object, 125210, @greatWhite2, hold )
endif
static @treasure2
if( !%isValid( @treasure2 ) && !%isPc( %getOwner( @hand2 ) ) )
#@treasure2 = %load( object, @stuff->2, @hand2 )
endif
//----
static @greatWhite3
if( !%isValid( @greatWhite3 ) )
#@greatWhite3 = %load( mobile, 125212, 125209 )
#%setCharStat( @greatWhite3, npcGroup, 125207 )
endif
static @limb3
if( !%isValid( @limb3 ) )
#@limb3 = %load( object, 125226, @greatWhite3 )
endif
static @hand3
if( !%isValid( @hand3 ) )
#@hand3 = %load( object, 125210, @greatWhite3, hold )
endif
static @treasure3
if( !%isValid( @treasure3 ) && !%isPc( %getOwner( @hand3 ) ) )
#@treasure3 = %load( object, @stuff->3, @hand3 )
endif
//----
static @greatWhite4
if( !%isValid( @greatWhite4 ) )
#@greatWhite4 = %load( mobile, 125212, 125211 )
#%setCharStat( @greatWhite4, npcGroup, 125207 )
endif
static @limb4
if( !%isValid( @limb4 ) )
#@limb4 = %load( object, 125227, @greatWhite4 )
endif
static @hand4
if( !%isValid( @hand4 ) )
#@hand4 = %load( object, 125210, @greatWhite4, hold )
endif
static @treasure4
if( !%isValid( @treasure4 ) && !%isPc( %getOwner( @hand4 ) ) )
#@treasure4 = %load( object, @stuff->4, @hand4 )
endif
//----
static @greatWhite5
if( !%isValid( @greatWhite5 ) )
#@greatWhite5 = %load( mobile, 125212, 125213 )
#%setCharStat( @greatWhite5, npcGroup, 125207 )
endif
static @limb5
if( !%isValid( @limb5 ) )
#@limb5 = %load( object, 125226, @greatWhite5 )
endif
static @hand5
if( !%isValid( @hand5 ) )
#@hand5 = %load( object, 125210, @greatWhite5, hold )
endif
static @treasure5
if( !%isValid( @treasure5 ) && !%isPc( %getOwner( @hand5 ) ) )
#@treasure5 = %load( object, @stuff->5, @hand5 )
endif
//----
static @greatWhite6
if( !%isValid( @greatWhite6 ) )
#@greatWhite6 = %load( mobile, 125212, 125212 )
#%setCharStat( @greatWhite6, npcGroup, 125207 )
endif
static @limb6
if( !%isValid( @limb6 ) )
#@limb6 = %load( object, 125227, @greatWhite6 )
endif
static @hand6
if( !%isValid( @hand6 ) )
#@hand6 = %load( object, 125210, @greatWhite6, hold )
endif
static @treasure6
if( !%isValid( @treasure6 ) && !%isPc( %getOwner( @hand6 ) ) )
#@treasure6 = %load( object, @stuff->6, @hand6 )
endif
//----
static @greatWhite7
if( !%isValid( @greatWhite7 ) )
#@greatWhite7 = %load( mobile, 125212, 125208 )
#%setCharStat( @greatWhite7, npcGroup, 125207 )
endif
static @limb7
if( !%isValid( @limb7 ) )
#@limb7 = %load( object, 125227, @greatWhite7 )
endif
static @hand7
if( !%isValid( @hand7 ) )
#@hand7 = %load( object, 125210, @greatWhite7, hold )
endif
static @treasure7
if( !%isValid( @treasure7 ) && !%isPc( %getOwner( @hand7 ) ) )
#@treasure7 = %load( object, @stuff->7, @hand7 )
endif
//----
#@exit = %getRoomExits( 125226 )->down
#%setExitStat( @exit, isLocked, 1 )
#@exit = %getRoomExits( 125244 )->up
#%setExitStat( @exit, isLocked, 1 )
}
endprotect
For the record, this was implemented ages ago, and I could have done it better, but I felt lazy. Also using resolutions would make it a lot clearer... eg:
Code:
#%setCharStat( @greatWhite7, npcGroup, 125207 )
Would be cleaner as:
Code:
#@greatWhite7->npcGroup = 125207