Mar 212009
 

Various map scripts for Achaea using ZMud. USeful for those wanting to create a details map.

#CLASS {Aliases|aSystem|MapA}
#ALIAS _FindRooms {
;_UpdateRooms  ZoneID Zone String WalktoY/N RoomNumber
#VAR SQLString "" _nodef  MapA
SQLString = "[ZoneID] = %1 and [Desc] LIKE '% %2%'"
#IF  (%if( %null( %3), N, Y)=Y) {#SLOW %walk( %item( %mapquery( @SQLString),  %4))} {#ECHO %mapquery( @SQLString)}
}
#ALIAS _TelMe {
#VAR  SQLString "" _nodef MapA
#VAR TelMeFound 0 _nodef MapA
SQLString = {[Name] = '@sRoomName'}
#VAR TelMeFoundRooms %mapquery(  @SQLString) _nodef MapA
#IF (%numitems( @TelMeFoundRooms) = 1)  {#TELEPORT @TelMeFoundRooms} {
#VAR TelMeWantedRooms "" _nodef  MapA
#VAR TelMeTemp "" _nodef MapA
#FORALL @DirectionsFull  {#IF (%match( @sExits, " (%i)%p", TelMeTemp)) {#ADDITEM  TelMeWantedRooms @TelMeTemp}}
TelMeWantedRooms = %replace(  @TelMeWantedRooms, northeast, j)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, southeast, l)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, southwest, k)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, northwest, h)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, north, n)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, east, e)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, south, s)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, west, w)
;  TelMeWantedRooms = %replace(  @TelMeWantedRooms, in, i)
;  TelMeWantedRooms = %replace(  @TelMeWantedRooms, out, o)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, up, u)
TelMeWantedRooms = %replace(  @TelMeWantedRooms, down, d)
TelMeWantedRooms = %sort(  @TelMeWantedRooms)
#FORALL @TelMeFoundRooms {
#IF  (%sort( %roomexit( %i))=@TelMeWantedRooms) {
#TELEPORT %i
#EXEC _Debug "_TelMe: Found You After Search"
TelMeFound = 1
}
}
#IF (not @TelMeFound)  {#EXEC _Debug TelMe: Didn't find you}
}
}
#ALIAS  _Compress {
%expand( %1, -1) = %replace( @{%1}, northeast, j)
%expand( %1, -1) = %replace( @{%1}, southeast, k)
%expand( %1, -1) =  %replace( @{%1}, southwest, l)
%expand( %1, -1) = %replace( @{%1},  northwest, h)
%expand( %1, -1) = %replace( @{%1}, north, n)
%expand( %1, -1) = %replace( @{%1}, east, e)
%expand( %1, -1) =  %replace( @{%1}, south, s)
%expand( %1, -1) = %replace( @{%1},  west, w)
%expand( %1, -1) = %replace( @{%1}, in, i)
%expand(  %1, -1) = %replace( @{%1}, out, o)
%expand( %1, -1) = %replace(  @{%1}, up, u)
%expand( %1, -1) = %replace( @{%1}, down, d)
}
#ALIAS  _WhereIs {
#VAR SQLString "" _nodef MapA
SQLString = {[Name] =  '%replace( %1, "'", "''")'}
#VAR WhereIsFound %mapquery(  @SQLString) _nodef MapA
#IF (%numitems( @WhereIsFound)=1) {
"  "
#ECHO %1 is in %zonename( %roomzone( @WhereIsFound))
}  {#EXEC _Debug {_WhereIs Found %numitems( @WhereIsFound)}}
}
#ALIAS  _WalkTo {
#VAR SQLString "" _nodef MapA
SQLString = {[Name] =  '%replace( %1, "'", "''")'}
#VAR WhereIsFound %mapquery(  @SQLString) _nodef MapA
#IF (%numitems( @WhereIsFound)=1) {#SLOW  %walk( @WhereIsFound)} {#EXEC _Debug {_WalkTo Found %numitems(  @WhereIsFound)}}
}
#ALIAS _PAll {#LOOPDB @RoomObjects  {_SendCommandOnPrompt %string( probe %key)}}
#ALIAS _ZoneObjects {
#VAR ZoneObjectsRooms %mapquery( {[ZoneID] = %zonenum and not [Content]  = ''}) _nodef MapA
#VAR ZoneObjectsFound "" _nodef MapA
#VAR  ZoneObjectsFoundStrings "" _nodef MapA
#FORALL @ZoneObjectsRooms  {#ADDITEM ZoneObjectsFound %roomcontents( %i)}
ZoneObjectsFound =  %replace( @ZoneObjectsFound, "(", "")
ZoneObjectsFound = %replace(  @ZoneObjectsFound, ")", "")
ZoneObjectsFound = %dups(  @ZoneObjectsFound)
ZoneObjectsFound = %sort( @ZoneObjectsFound)
#IF (not %null( ZoneObjectsFound)) {
#PRIORITY {
#FORALL @ZoneObjectsFound {
;    #DBOFFLINE
#DBLOAD Items
#ADDITEM ZoneObjectsFoundStrings %db( %i, Name)
;    #DBONLINE
}
}
" "
#ECHO %replace(  @ZoneObjectsFoundStrings, "|", %%crlf)
}
}
#ALIAS  _FindObject {
#DBLOAD Items
#DBFIRST
#VIEW All
#VAR  FindObject %mapquery( {[Content] = '%1'}) _nodef MapA
#IF (not  %null( @FindObject)) {
" "
#ECHO "Objects for in:"
#FORALL @FindObject {#ECHO %roomname( %i)}
} {#EXEC _Debug  "_FindObject: No %1 Found"}
}
#ALIAS _UpdateZone {
_Debug  "_UpdateZone: Stated"
#VAR UpdateZoneRooms %mapquery( {[ZoneID] =  %1 and [Flags] = 56}) _nodef MapA
#WHILE (not %null(  @UpdateZoneRooms)) {
#IF (%null( %walk( @UpdateZoneRooms.1)))  {#NOOP %pop( UpdateZoneRooms)} {
#SLOW %walk(  @UpdateZoneRooms.1)
#WHILE %inwalk {#WAIT 1000}
#VAR  UpdateZoneRooms %mapquery( {[ZoneID] = %1 and [Flags] = 56}) _nodef MapA
}
}
_Debug "_UpdateZone: Finished"
}
#ALIAS  _DelItemsALL {
#PRIORITY {
; DBOFFLINE causes delete to fail
;   #DBOFFLINE
#DBLOAD Items
#DBFIRST
#VIEW All
#DBFIRST
#WHILE (not %null( %rec)) {
;    #EXEC _Debug  {_DelShop Deleting &num &Description}
#DBDELETE  &num
}
;  #DBRESET
;DBONLINE
}
}
#VAR  SQLString {}
#VAR TelMeFoundRooms {243}
#VAR TelMeWantedRooms  {k|w}
#VAR TelMeTemp {west}
#VAR TelMeFound {0}
#VAR  WhereIsFound {285}
#VAR ZoneObjectsRooms  {8172|8173|8174|8175|8176|8179|8181|8183|8184|8185|8186|8187|8189|8191|8192|8195|8196|8197|8198|8200|8201|8202|8203|8204|8205|8206|8208|8209|8211}
#VAR  ZoneObjectsFound  {15it|3it|501it|55it|73it|951it|952it|953it|954it|955it|957it|959it|960it|961it|962it|963it|964it|965it|966it|967it|968it|969it|970it|971it|972it|973it|974it|975it|976it|977it|978it|979it|980it|981it|9it}
#VAR  ZoneObjectsFoundStrings {a cube sigil|a shrine of Lupus|a beautiful  blackjack table|a shrine of Pentharian|a shrine of Selene|a shiny gold  disk|a pirate with an eye-patch|a broken crystal disk|Thierry, the  ferryman|a pirate lass|a drunken pirate|a squat pig|a chicken|a scantily  dressed prostitute|Anan, Priest of Mysia|a wooden statue of bleached  wood|Delmar, a pirate with a peg-leg|Devon, a bow-legged pirate|a deck  of playing cards|a crow's feather|Jarvace, the Xorani brawler|Cassian, a  blue-robed mage|Kavan, the first mate|Tai, the spider monkey|Favian, a  towering bartender|Greybeard, an aged pirate|Niran, the first mate|Enys,  a denounced cleric|Captain Kelley, Mayor of Mysia|a wooden  chest|Steele, the Mysian Cook|Aneurin, the card shark|an opulent  roulette wheel|Cressa, the roulette attendant|a shrine of Neraeos}
#VAR  FindObject {}
#VAR UpdateZoneRooms {}
#ONINPUT {^{ih|look|map}$}  {#NOMAP}
#CLASS 0
Share

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>