WORLD NAME Underworld CLUSTER Underworld VERSION 9.8.3 ' Tested on DimensioneX 6.4.9d 'AUTHOR Cristiano Leoni, Lorenzo Ficarra ' English revision by JoKen Jash SITE http://www.underworld-game.net/ ' The following for local mode IMAGESFOLDER_LOCAL /dimx/uwpics/ ' The following for network (light) mode IMAGESFOLDER_PUBLIC http://www.dimensionex.net/underworld/uwpics/ 'alternates 'IMAGESFOLDER_PUBLIC http://www.underworld-game.net/uwpics/ 'IMAGESFOLDER_PUBLIC http://digilander.libero.it/dimensionexy/uwpics/ HELP http://www.underworld-game.net/?page_id=12 SAVEGAME_PERSISTENCE 2 INTERPHONE 1 ' The following only for network (light) mode COUNTERHTML
The FORWARD-POINTING ARROW icon in the square box will let you move closer to the Castle.
Use arrow icons to move yourself in the game.
Click the FORWARD-POINTING ARROW icon now.
ATTRLIST introductory=1,dark=1
PANEL initial
IMAGE castledist.png
ROOM pre1a
NAME Rules and privacy policy
DESCRIPTION @privacy()
ATTRLIST introductory=1
PANEL initial
IMAGE castledist.png
ROOM pre2
NAME Class choice
ATTRLIST introductory=1
PANEL initchoice
IMAGE SHOWAREA 0,130,-1 castlemid.png
ROOM start
NAME The gate
DESCRIPTION There's a closed gate to the south, and a castle to the North.
IMAGE N SHOWAREA 100,300,10 start.jpg
IMAGE S SHOWAREA 100,300,10 1.png
ATTRLIST mapx=100,mapy=181
ROOM R2
NAME Entrance
IMAGE N 2.jpg
IMAGE E 3.png
IMAGE S 4.png
IMAGE W 5.png
ATTRLIST mapx=100,mapy=169
ROOM B
NAME Southwest tower
DESCRIPTION There's a cell for horses here, and a there's a pack of hay lying nearby.
IMAGE N 6.png
IMAGE E 7.png
IMAGE S 8.png
IMAGE W 9.jpg
ATTRLIST mapx=45,mapy=163
ROOM guildroom
NAME Guilds Room
DESCRIPTION @guildroom_description()
IMAGE S armoroom2.jpg
ATTRLIST mapx=21,mapy=175
ROOM cell
NAME cell for horses
IMAGE W SHOWAREA 120,300,-1 pictureevme1.gif
IMAGE E SHOWAREA -1,320,-1 pictureevme4.gif
ATTRLIST mapx=25,mapy=143
ROOM C
NAME west side
IMAGE N 10.png
IMAGE E 11.jpg
IMAGE S SHOWAREA 100,-1,-1 12.png
IMAGE W 13.jpg
ATTRLIST mapx=41,mapy=102
ROOM bscell
NAME blacksmith cell
IMAGE W SHOWAREA 0,295,12 pictures1.gif
ATTRLIST mapx=25,mapy=102
DESCRIPTION In this room, craftsmen can make weapons, protections and bottles, to be used or sold! More info
ROOM D
NAME NorthWest tower
IMAGE N 14.jpg
IMAGE E 15.png
IMAGE S 16.png
IMAGE W 17.jpg
ATTRLIST mapx=39,mapy=56
ROOM E
NAME North side
IMAGE N 400x230 18.png
IMAGE E 19.png
IMAGE S 20.jpg
IMAGE W 21.png
ATTRLIST mapx=101,mapy=52
ROOM F
NAME NorthEast tower
IMAGE N 22.jpg
IMAGE E 23.jpg
IMAGE S 24.png
IMAGE W 25.png
ATTRLIST mapx=155,mapy=58
ROOM G
NAME East side
IMAGE N 26.png
IMAGE S 27.png
ATTRLIST mapx=161,mapy=104
ROOM T
NAME SouthEast tower
IMAGE N 28.png
IMAGE E 29.jpg
IMAGE S 30.png
IMAGE W 31.png
ATTRLIST mapx=156,mapy=158
ROOM bank
NAME Garumir Bank
IMAGE S armoroom.jpg
DESCRIPTION @bank_description()
ATTRLIST mapx=169,mapy=170
ROOM R4
NAME entrance staircase
IMAGE N SHOWAREA 50,350,-1 32.jpg
IMAGE S SHOWAREA 50,350,-1 33.jpg
ATTRLIST mapx=100,mapy=150
ROOM hall
NAME the hall
IMAGE N SHOWAREA 50,-1,-1 34.jpg
IMAGE E 35.jpg
IMAGE S 36.jpg
IMAGE W 37.jpg
ATTRLIST mapx=100,mapy=140
ROOM biblio
NAME the library
IMAGE W SHOWAREA 50,350,-1 38.jpg
ATTRLIST mapx=70,mapy=140
ROOM salotto
NAME the lounge
IMAGE E 39.jpg
ATTRLIST mapx=130,mapy=140
ROOM J
NAME initial hallway
IMAGE N SHOWAREA 50,350,-1 40.jpg
IMAGE E 41.jpg
IMAGE S SHOWAREA 200,340,-1 42.jpg
IMAGE W 43.jpg
ATTRLIST mapx=100,mapy=121
ROOM armory
NAME the armory
DESCRIPTION @panelhtml("pbuyshop")+"
This is the armory of the castle. All sorts of items can be bought and sold here."
PANEL pshop
IMAGE E SHOWAREA 60,-1,-1 44.jpg
ATTRLIST shop=1,shopkeeper=auron,mapx=130,mapy=121
ROOM upstairs
NAME first floor vestibulus
IMAGE N SHOWAREA 100,-1,-1 housefire.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=95,mapy=136
ROOM salon1
NAME ballroom
IMAGE N lunarp2.jpg
IMAGE S room1.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=114,mapy=96
ROOM salon2
NAME guards room
IMAGE N bof1.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=82,mapy=101
ROOM salon2a
NAME the staircase
IMAGE N SHOWAREA 172,236,86 staircse.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=54,mapy=102
ROOM upstcorr
NAME the hallway at first floor
IMAGE S upcorrs.jpg
IMAGE N upcorrn.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=54,mapy=69
ROOM seat
NAME throne room
DESCRIPTION @KingdomStats()
IMAGE N ballseat.jpg
ATTRLIST map=uw1_map_floor1.gif,mapx=53,mapy=34
ROOM warroom
NAME war room
IMAGE N SHOWAREA 0,180,-1 warroom.jpg
DESCRIPTION @warroom_description()
ATTRLIST map=uw1_map_floor1.gif,mapx=27,mapy=67
ROOM castletop
NAME castle top
DESCRIPTION From this little tower I can see the surrounding lands. There's a river flowing around the castle, running far away.
IMAGE W castletop.png
ATTRLIST map=uw1_map_floor2.gif,mapx=122,mapy=98
ROOM N
NAME central hallway
IMAGE N SHOWAREA 140,350,-1 45.jpg
IMAGE E 46.jpg
IMAGE S SHOWAREA 50,350,-1 47.jpg
IMAGE W SHOWAREA 0,150,-1 48.jpg
ATTRLIST mapx=101,mapy=103
ROOM P
NAME final hallway
IMAGE N SHOWAREA 50,250,-1 50.jpg
IMAGE E 51.jpg
IMAGE S SHOWAREA 50,250,-1 52.jpg
IMAGE W 53.jpg
ATTRLIST mapx=100,mapy=86
ROOM BAR
NAME the tavern
IMAGE E 49.jpg
ATTRLIST mapx=130,mapy=105
ROOM chapel
NAME the chapel
IMAGE E SHOWAREA 100,300,-1 54.jpg
IMAGE W SHOWAREA 120,280,-1 55.jpg
ATTRLIST mapx=130,mapy=87
ROOM bedroom
NAME the bedroom
IMAGE N 56.jpg
ATTRLIST mapx=72,mapy=88
ROOM forest
NAME the woods
IMAGE N forest.jpg
ATTRLIST mapx=99,mapy=27
ROOM lake
NAME the river side
DESCRIPTION The river is surrounded by a evil fog. There's a small boat here but I'm afraid I can't get anywhere with it.
PANEL pgather
IMAGE N lake.jpg
ATTRLIST mapx=98,mapy=11
ROOM dhall
NAME the dwarven hall
DESCRIPTION An eerie place, with an underground fountain and a bright fire within a singluar fireplace.
IMAGE S 450x205 SHOWAREA 300,430,-1 dwarvenhall2.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=157,mapy=63
ROOM cave1
NAME small cave
IMAGE E donjohn1c.jpg
IMAGE W donjohn1b.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=182,mapy=71
ROOM cave2
NAME a cave
IMAGE S lunari.jpg
IMAGE N lunari2.jpg
IMAGE W battle_yuu23.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=167,mapy=89
ROOM cave3
NAME a cave
IMAGE W b6.jpg
IMAGE E b6f.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=154,mapy=91
ROOM cave4
DESCRIPTION There's a magic fountain here, a writing on the wall says it's powered by a magic source.
NAME a cave
PANEL pgather
IMAGE N thron.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=124,mapy=96
ROOM cave5
NAME a cave
IMAGE N lunar6b.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=93,mapy=95
ROOM cave6
NAME a cave
IMAGE N lunars2.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=44,mapy=93
ROOM cave7
NAME a cave
IMAGE N lavacave2.jpg
ATTRLIST map=uw1_map_floor-2.gif,mapx=11,mapy=93
DESCRIPTION @PanelHtml("pextract")
ROOM gateroom
NAME gate catecombs
DESCRIPTION There's a closed gate, with two fires at the sides.
IMAGE S gateroom.jpg
ATTRLIST map=map_uw3.gif,mapx=133,mapy=108
ROOM hellfire
NAME the pit
PANEL initial
END_ROOMS
LINKS
LINK w1 start-R2 N
LINK w2 R2-B W
LINK w3 R2-R4 N
LINK w4 R4-hall N
LINK w5 hall-biblio W
LINK w6 hall-salotto E
MLINK w20 hall-upstairs U
NAME stairs
IMAGE 80x130 blank.gif
SHOW ONSCREEN 265,65 FOR 34.jpg
MLINK w20a upstairs-hall D NAME stairs
LINK w7 hall-J N
LINK w8 J-N N
LINK w9 N-bar E
LINK w10 N-P N
MLINK st1 N-gateroom D
NAME stairs
IMAGE 72x45 blank.gif
SHOW ONSCREEN 60,15 FOR 45.jpg
MLINK st1a gateroom-N U NAME stairs
LINK c1 gateroom-gateroom S
MLINK tr1 gateroom-dhall D
NAME a trapdoor
ATTRLIST open=0,locked=1,unlocker=key3,linked=tr1a,imageOpen=tdopen.gif,imageClosed=td.gif
ICON trapdoor.gif
IMAGE 82x35 td.gif
SHOW ONSCREEN 155,5
MLINK tr1a dhall-gateroom U
NAME a trapdoor
ATTRLIST open=0,locked,unlocker=key3,linked=tr1,imageOpen=dhall_open.jpg,imageClosed=blank.gif
IMAGE 128x108 blank.gif
SHOW ONSCREEN 323,96
LINK w11 P-chapel E
LINK w12 T-R2 W
LINK w12a T-bank S
LINK w13 B-C N
LINK w13a B-cell W
LINK w13b B-guildroom S
LINK w14 C-D N
LINK w14a C-bscell W
LINK w15 D-E E
LINK w16 E-F E
LINK arch1 E-forest N
LINK wfola forest-lake N
LINK wboat lake-lake N
LINK w17 F-G S
LINK w18 G-T S
LINK w19 J-armory E
LINK w23 dhall-cave1 E
LINK w24 dhall-cave2 S
LINK w25 cave2-cave3 W
LINK w26 cave3-cave4 W
LINK w27 cave4-cave5 W
LINK w28 cave5-cave6 W
LINK w29 cave6-cave7 W
LINK door1 P-bedroom W
NAME door
ATTRLIST open=0,locked=1,unlocker=key4,imageClosed=blank.gif,imageOpen=door1_open.jpg
ICON icoDoor.gif
IMAGE 87x162 blank.gif
SHOW ONSCREEN 122,43 FOR 53.jpg
LINK door2 C-bedroom E
NAME door
ATTRLIST open=0,locked
ICON icoDoor.gif
MLINK p0 pre1-pre1a N
MLINK p0a pre1a-pre2 N
MLINK p1 pre2-pre2 N
MLINK w21a upstairs-salon2 N
NAME door
ATTRLIST open=0,locked=0,unlocker=key2,linked=w21b,imageOpen=blank.gif,imageClosed=housefire_doorclosed.jpg
ICON icoDoor.gif
IMAGE 51x211 housefire_doorclosed.jpg
SHOW ONSCREEN 0,0
MLINK w21b salon2-upstairs S
NAME door
ATTRLIST open=0,locked=0,unlocker=key2,linked=w21a
ICON icoDoor.gif
LINK w31 salon2-salon2a W
MLINK w22a upstairs-salon1 E
NAME door
ATTRLIST open=0,locked,unlocker=key1,linked=w22b,imageOpen=door2open.gif,imageClosed=blank.gif
ICON icoDoor.gif
IMAGE 43x84 blank.gif
SHOW ONSCREEN 317,53
MLINK w22b salon1-upstairs E
NAME door
ATTRLIST open=0,locked,unlocker=key1,linked=w22a,imageOpen=w22b_open.jpg,imageClosed=blank.gif
ICON icoDoor.gif
IMAGE 90x123 blank.gif
SHOW ONSCREEN 232,107 FOR room1.jpg
MLINK w30 salon2-castletop U
NAME stairs
IMAGE 55x60 blank.gif
SHOW ONSCREEN 250,160
MLINK w30a castletop-salon2 D
NAME stairs
IMAGE 32x48 blank.gif
SHOW ONSCREEN 60,105
MLINK w32a salon2a-upstcorr N
NAME door
ATTRLIST open=0,locked=0,unlocker=key5,linked=w32b,imageClosed=blank.gif,imageOpen=w32a_open.jpg
ICON icoDoor.gif
IMAGE 65x107 blank.gif
SHOW ONSCREEN 180,100
MLINK w32b upstcorr-salon2a S
NAME door
ATTRLIST open=0,locked=0,unlocker=key5,linked=w32a,imageOpen=blank.gif,imageClosed=w32b_closed.jpg
ICON icoDoor.gif
IMAGE 81x112 w32b_closed.jpg
SHOW ONSCREEN 165,52 FOR upcorrs.jpg
LINK w33 upstcorr-warroom W
NAME door
ATTRLIST open=0,imageClosed=blank.gif,imageOpen=w33_open.jpg
ICON icoDoor.gif
IMAGE 39x148 blank.gif
SHOW ONSCREEN 85,63 FOR upcorrn.jpg
LINK w34 upstcorr-seat N
NAME door
ATTRLIST open=0,imageClosed=blank.gif,imageOpen=w34_open.jpg
ICON icoDoor.gif
IMAGE 53x77 blank.gif
SHOW ONSCREEN 177,90 FOR upcorrn.jpg
END_LINKS
CHARACTERS
ATTRLIST Health=10,Strength=1,Experience=0,type=0,Level=1,gender=M
' Types from 10 to up are monsters
' from 1 to 9 are humans
' 0 means unattackable character
CHARACTER asia
NAME Asia
DESCRIPTION Asia is the princess of the Reign. She looks like she's waiting for something from me.
POSITION bedroom
ACCEPTS ring
ATTRLIST type=6,status=0,steady=1,pacific,nohands,balanceignore,gender=F,noteleport,remoteAddr=dummy
IMAGE 70x71 chrAsia.gif
SHOW ONSCREEN 160,75 FOR 56.png
CHARACTER nkono
NAME N'Kono
DESCRIPTION N'Kono is a Zulu warrior. What is he doing here? I swear I don't know!
POSITION forest
ATTRLIST type=5,Classe=Warrior,Strength=3,pacific,nohands
IMAGE 52x130 chrNkono.gif
CHARACTER guard
NAME the guard
DESCRIPTION What is he going to do with that sword...?
POSITION E
IMAGE 55x90 guard.gif
ATTRLIST type=1,Classe=Warrior,Level=2,Strength=2,weapon=weapon.20.sword,steady=1,nohands=1,keeper=1,pacific,noteleport
SHOW ONSCREEN 160,55 FOR 18.png
CHARACTER merlin
NAME Merlin
DESCRIPTION This seems to be an old sorcerer... He can't be dangerous.
POSITION R4
IMAGE 54x90 merlin.gif
SHOW ONSCREEN
CHARACTER garumir
NAME Garumir
DESCRIPTION He's the banker of the castle
POSITION bank
IMAGE 44x100 garumir.gif
ATTRLIST accepts=*
SHOW ONSCREEN 300,-1
CHARACTER guilford
NAME Lord Guilford
DESCRIPTION He's the captain of the guards
POSITION guildroom
IMAGE 86x120 odin.gif
'ATTRLIST accepts=*
SHOW ONSCREEN 130,-1
CHARACTER auron
NAME Auron
DESCRIPTION Auron keeps the castle's Armory.
POSITION armory
IMAGE 48x72 auron3.gif
SHOW ONSCREEN
' Monsters
CHARACTER deathelem
NAME a death elemental
DESCRIPTION It won't allow me to proceed.
POSITION cave3
IMAGE 104x95 deathelemental1.png
ATTRLIST type=15,Strength=7,steady,nohands,affi=0/4/0/0,artdefense=counterattack
SHOW ONSCREEN -1,-1 FOR b6.png
CHARACTER deathpede
NAME a deathpede
DESCRIPTION It's a sort of monster worm.
POSITION cave6
IMAGE 84x80 dethpede.png
ATTRLIST type=11,vuln_mob,Strength=7,nohands,affi=0/4/0/0,artdefense=survival
CHARACTER giantworm
NAME a giant worm
DESCRIPTION It's really horrible!
POSITION rndSet(setCastle)
IMAGE 100x125 horror091.gif
ATTRLIST type=11,Strength=6,accepts=*,affi=0/4/0/0,artdefense=survival
CHARACTER template
NAME Yourself
DESCRIPTION Choose a character type. Click on the sample character to view its properties.
POSITION pre2
IMAGE 64x100 uomo.gif
SHOW ONSCREEN 170,-1
ATTRLIST Class=unknown
END_CHARACTERS
ITEMS
ITEM book1
NAME large book
DESCRIPTION Ancient book of magic recipes.
The first page is entitled: 'To awaken an evil creature from the Darkness'.
It seems to have a fake bottom...
TYPE book1
POSITION biblio
ATTRLIST pickable,openable,open=0,uses=6,Value=3,imageOpen=BookOpen1.gif,imageClosed=Book1.gif
ICON Book1.gif
IMAGE 26x36 Book1.gif
SHOW ONSCREEN 0,129 FOR 38.jpg
ITEM book2
NAME tiny book
DESCRIPTION It says: "Love songs - an anthology". What am I supposed to do with this now?
POSITION book1
ATTRLIST type=book2,pickable,openable,open=0,Value=3,imageOpen=BookOpen2.gif,imageClosed=Book2.gif
IMAGE 25x36 Book1.gif
ICON Book2.gif
SHOW ICON
ITEM hay
NAME hay
DESCRIPTION Ordinary hay. I'd swear it's useless!
POSITION B
ICON hay.gif
ATTRLIST pickable
IMAGE 32x32 hay.gif
SHOW ONSCREEN 325,30 FOR 9.jpg
ITEM pot
NAME pot
DESCRIPTION A pot, iron, so heavy.
POSITION bscell
ATTRLIST open,openable=0,capacity=1
IMAGE 32x32 pot.gif
SHOW ONSCREEN
ITEM bowl
NAME bowl
DESCRIPTION A stone bowl. It has some tiny holes, but can be good to carry sand.
POSITION cell
ATTRLIST type=bowl,open,openable=0,capacity=1,pickable,Value=10
IMAGE 32x32 bowl.gif
ICON bowl.gif
SHOW ICON
ITEM fire
NAME fire
DESCRIPTION Fire has red flames from burning charcoal.
POSITION bscell
IMAGE 101x17 fire.gif
SHOW ONSCREEN 140,90
ITEM sand
NAME sand pack
POSITION lake
ATTRLIST pickable
IMAGE 32x16 sandpack.gif
SHOW ONSCREEN 70,-1
ITEM powder
NAME pyric powder
POSITION cave5
ATTRLIST pickable
IMAGE 48x48 blank.gif
SHOW ONSCREEN 160,120
ITEM martello
NAME hammer
DESCRIPTION A well built, heavy hammer.
POSITION bscell
ICON hammer.gif
IMAGE 40x40 hammer.gif
SHOW ICON 290,63
ITEM mould
NAME mould
DESCRIPTION A mould for bottles. In brief, you pour liquid glass inside and obtain a bottle.
POSITION bscell
ICON mouldicon.gif
IMAGE 105x105 mould.gif
SHOW ICON 73,87
ITEM bomb
NAME bomb
POSITION armory
DESCRIPTION A bomb. Use with caution.
ATTRLIST type=bomb,pickable,Value=10,sound=match.wav,seller=auron,Level=1
ICON bomb.gif
IMAGE 40x40 bomb.gif
SHOW ICON 240,64 FOR 44.jpg
ITEM trap
NAME trap mechanism
POSITION armory
DESCRIPTION A mechanism that can be used to build traps.
ATTRLIST type=trap,pickable,Value=5,seller=auron,Level=2
ICON trap.gif
IMAGE 40x40 trap.gif
SHOW ICON
' Magic Items
ITEM cross
NAME a cross
POSITION chapel
DESCRIPTION It's a cross which seems to be made of gold. Apart from the fact it can be handy with vampires, it may be valuable!
ATTRLIST type=cross,pickable
ICON croce.gif
IMAGE 84x88 croce.gif
SHOW ICON
ITEM silvering
NAME silver ring
TYPE ring.silver
DESCRIPTION A silver ring, with strange inscriptions.
POSITION seat
ATTRLIST pickable,volume=0,Value=10
ICON icosilvering.gif
IMAGE 200x150 silvering.jpg
SHOW ICON
ITEM waterspell
NAME Water spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: 'When this spell is used by magicians, it fills a bottle with healing potion'
ATTRLIST type=spell.water,pickable,Value=30,Level=1
ICON spellwater.gif
IMAGE 48x48 spellwater.gif
SHOW ICON
ITEM firespell
NAME Fire spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: 'When this spell is used by magicians, it can hurt opponents'
ATTRLIST type=spell.attack.02.02.0004.fire,pickable,Power=2,Value=20,sound=roarlong2.wav,Level=2,affi=0/0/0/4
ICON spellfire.gif
IMAGE 48x48 spellfire.gif
SHOW ICON 30,110 FOR 44.jpg
ITEM windspell
NAME Wind spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: 'When this spell is used by magicians, it can hurt opponents'
ATTRLIST type=spell.attack.01.01.0040.wind,pickable,Power=1,Value=15,sound=wind.wav,Level=1,affi=0/0/4/0
ICON spellwind.gif
IMAGE 48x48 spellwind.gif
SHOW ICON
ITEM teleport
NAME Teleport spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: 'This will teleport people and objects somewhere else'
ATTRLIST type=spell.tele,pickable,Value=10,sound=music.wav,hidden,Level=1
ICON spellsun.gif
IMAGE 48x48 spellsun.gif
SHOW ICON
ITEM invis
NAME Invisibility spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: 'This will make you invisible to enemies'
ATTRLIST type=spell.invis,pickable,Value=20,sound=music.wav,hidden,Level=3
ICON spellxplode.gif
IMAGE 48x48 spellxplode.gif
SHOW ICON
ITEM whirl
NAME Whirl Spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: "Their objects will fall like leaves in the wind".
ATTRLIST type=spell.whirl,pickable,Value=20,sound=wind.wav,hidden,Level=4
ICON spellwhirl.gif
IMAGE 48x48 spellwhirl.gif
SHOW ICON
ITEM gemini
NAME Gemini Spell
POSITION rndSet(setAll)
DESCRIPTION It's a stone tablet with a symbol on it.
A carved note says: "If Mother Earth's Drops will have thy, The Magical Weapons you will multiply.".
ATTRLIST type=spell.gemini,pickable,Value=30,Level=2
ICON spellgemini.gif
IMAGE 48x48 spellgemini.gif
SHOW ICON
' Weapons
ITEM sword
NAME sword
POSITION guard
DESCRIPTION A nice and elegant sword.
ATTRLIST type=weapon.02.02.0000.sword,pickable,Power=2,Value=20,sound=swordlong.wav,Level=2
ICON sword1.gif
IMAGE 40x40 sword1.gif
ZOOMIMAGE 300x225 sword_revenge.jpg
SHOW ONSCREEN 243,90 FOR 44.jpg
ITEM sword2
NAME sword
POSITION armory
DESCRIPTION A nice and elegant sword.
ATTRLIST type=weapon.02.02.0000.sword,pickable,seller=auron,Power=2,Value=20,sound=swordlong.wav,Level=2
ICON sword1.gif
IMAGE 40x40 sword1.gif
ZOOMIMAGE 300x225 sword_revenge.jpg
SHOW ONSCREEN 243,90 FOR 44.jpg
ITEM dagger
NAME dagger
POSITION armory
DESCRIPTION Basic dagger
ATTRLIST type=weapon.01.01.0000.dagger,pickable,seller=auron,Power=1,Value=10,sound=sword1.wav,Level=1
ICON sword1.gif
IMAGE 30x30 sword1.gif
SHOW ONSCREEN 7,10 FOR 44.jpg
ITEM axe
NAME axe
POSITION cave4
DESCRIPTION A nice and heavy axe.
ATTRLIST type=weapon.03.03.0000.axe,pickable,Power=3,Value=30,sound=sword2.wav,Level=3
ICON dblaxe.gif
IMAGE 40x40 dblaxe.gif
SHOW ONSCREEN
' Armour
ITEM bodyiron
NAME iron armour
POSITION armory
DESCRIPTION An iron armour.
ATTRLIST type=armour.02.05.0000.iron,pickable,seller=auron,Protection=5,Value=25,volume=0,Level=2,material=iron
ICON bodyprot4.gif
IMAGE 32x32 bodyprot4.gif
SHOW ONSCREEN 186,73 FOR 44.jpg
ITEM shieldwood
NAME wooden shield
POSITION salon1
DESCRIPTION A wooden shield.
ATTRLIST type=shield.01.01.0000.wood,pickable,Protection=1,Value=15,Level=1,material=wood
ICON shieldwood3.gif
IMAGE 32x32 shieldwood3.gif
SHOW ONSCREEN
ITEM shieldiron
NAME iron shield
POSITION armory
DESCRIPTION An iron shield.
ATTRLIST type=shield.02.05.0000.iron,pickable,seller=auron,Protection=5,Value=25,Level=2,material=iron
ICON shieldiron3.gif
IMAGE 32x32 shieldiron3.gif
SHOW ONSCREEN 186,110 FOR 44.jpg
ITEM helmet1
NAME basic helmet
POSITION castletop
DESCRIPTION A war helmet, light type.
ATTRLIST type=helmet.01.01.0000.wood,pickable,Protection=1,Value=15,volume=0,Level=1,material=wood
ICON cap3.gif
IMAGE 48x48 cap3.gif
SHOW ICON
ITEM helmet2
NAME iron helmet
POSITION salon2a
DESCRIPTION A war helmet, heavy type.
ATTRLIST type=helmet.02.05.0000.iron,pickable,Protection=5,Value=25,volume=0,Level=2,material=iron
ICON helmet5.gif
IMAGE 48x48 helmet5.gif
SHOW ICON
' Drinks
ITEM poison
NAME the liquor
POSITION bar
DESCRIPTION Home-made liquor... Prepared with an ancient recipe... natural herbs... what an aroma.
ATTRLIST type=bottle.poison,pickable
ICON bottle3.gif
SHOW ICON 150,108 FOR 49.jpg
IMAGE 60x90 veleno.gif
ITEM potion1
NAME healing potion
POSITION J
DESCRIPTION The label says: "Healing potion"
ATTRLIST type=bottle.potion,pickable,Value=5,uses=5
ICON bottle3.gif
SHOW ICON
IMAGE 60x90 potion.gif
ITEM potion2
NAME healing potion
POSITION forest
DESCRIPTION The label says: "Healing potion"
ATTRLIST type=bottle.potion,pickable,Value=5,uses=5
ICON bottle3.gif
SHOW ICON
IMAGE 60x90 potion.gif
ITEM potion3
NAME Healing potion
POSITION armory
DESCRIPTION The label says: "Healing potion"
ATTRLIST type=bottle.potion,pickable,Value=5,uses=5,seller=auron
ICON bottle3.gif
SHOW ICON 101,92 FOR 44.jpg
IMAGE 60x90 potion.gif
' Hints
ITEM scroll
NAME a scroll
POSITION R2
DESCRIPTION The scroll reads: "I am going to kill all the monsters and save the princess.
Hope to be successful.
If you are reading this, though, I probably didn't.
May God assist you, stranger, so that you succeed where I failed!"
Signed: J.D.
ICON scroll.gif
IMAGE 100x100 pergamena.gif
SHOW ICON
ITEM scroll2
NAME a scroll
POSITION rndSet(setCastle)
DESCRIPTION The scroll reads: Before going to fight, I've decided to hide my gold coins in the castle rooms and in the court. If you are reading this, I probably don't need them anymore - so SEARCH.
Signed: P.V.
ATTRLIST pickable
ICON scroll.gif
SHOW ICON
IMAGE 100x100 pergamena.gif
' Insects and plants
ITEM spider
NAME a spider
POSITION rndSet(setCastle)
DESCRIPTION A spider... Disgusting, it looks like a walking armpit!
ATTRLIST pickable,hidden
ICON icospider.gif
IMAGE 54x32 spider_walk.gif
SHOW ICON
ITEM cymbidium
NAME cymbidium
POSITION forest
DESCRIPTION a plant of Cymbidium Goeringii. How nice.
ATTRLIST pickable,branches=10
ICON cymbidium.gif
IMAGE 100x100 cymbidium.gif
SHOW ICON
ITEM garlic
NAME garlic
TYPE garlic
POSITION rndSet(setAll)
DESCRIPTION a piece of garlic. It stinks a little bit.
ATTRLIST type=garlic,pickable,hidden,Value=20
ICON garlic.gif
IMAGE 70x70 garlic.gif
SHOW ICON
' Keys
ITEM key1
NAME copper key
TYPE key1
DESCRIPTION Each lock has its key and each key opens a lock... right?
ATTRLIST pickable,Value=1
ICON key.gif
IMAGE 67x50 chiavegold.gif
SHOW ICON
ITEM key2
NAME iron key
TYPE key2
POSITION book2
DESCRIPTION A key, which surely opens something!
ATTRLIST pickable,Value=1
ICON keysilver.gif
IMAGE 67x50 chiavegold.gif
SHOW ICON
ITEM key3
NAME shiny key
TYPE key3
POSITION B
DESCRIPTION A little, shiny key.
ATTRLIST pickable,hidden,Value=1
ICON key.gif
IMAGE 67x50 chiavegold.gif
SHOW ICON 328,38 FOR 9.jpg
ITEM key4
NAME golden key
TYPE key4
DESCRIPTION A golden key.
ATTRLIST pickable,Value=30
ICON key.gif
IMAGE 67x50 chiavegold.gif
SHOW ICON
ITEM key5
NAME bronze key
TYPE key5
DESCRIPTION A key which surely unlocks something!
ATTRLIST pickable,Value=1
ICON key.gif
IMAGE 67x50 chiavegold.gif
SHOW ICON
' Money
ITEM coins
NAME coins
TYPE money
POSITION hall
ATTRLIST hidden,pickable,Cash=5,volume=0
ICON money.gif
IMAGE 31x31 money.gif
SHOW ICON
ITEM jukebox
NAME juke-box
POSITION bar
IMAGE 83x129 jukebox.gif
ATTRLIST capacity=1,open,openable=0
SHOW ONSCREEN 12,38
END_ITEMS
SETS
SET setCastle R4,J,N,P,biblio,hall,salotto,bar,gateroom,upstairs
SET setAll J,N,P,biblio,salotto,armory,chapel,bar,R2,B,C,D,E,F,G,gateroom,dhall,upstairs,cell,bscell,cave1,cave2,cave3,cave4,cave5,cave6,cave7,salon1,salon2,salon2a,castletop,upstcorr,seat,warroom
SET setCovered Start,guildroom,bank,cell,bscell,R4,J,N,P,armory,hall,biblio,salotto,chapel,bar,gateroom,upstairs,dhall,cave1,cave2,cave3,cave4,cave5,cave6,cave7,salon1,salon2,salon2a,upstcorr,seat,bedroom,warroom
END_SETS
SCRIPTS
Include "commons.dxl"
' Everything starts from this event
'
EVENT onStart
Call common_onStart()
mode=1 'Game mode 1=phase1 2=phase2
Call config()
mkilled=0 'Killed monsters counter
hkilled=0 'Killed humans counter
population=0 'Population (phase2)
taxes=2 'Taxes, coins per day (phase2)
starved=0 'Starved people (phase 2)
kingTicks=0 'Ticks counter
killfriend=0 'Kill counter for citizens phase 2
killenemy=0 'Kill counter for enemies phase 2
guildOps = NewSet("0new=Start new guild,1edt_logo=Set guild logo (url),2edt_web=Set guild website (url),3fund=Give (funds) for guild,8del=Delete guild,4info=Info about (name),5appr=Approve member (name),5ban=Eject member (name),5purge=Purge guild,6status=Calculate Guild rank,7delegate=Delegate to (name),8deldele=Revoke delegation (name),8type=Toggle guild type") 'managed apart: leave/join
warOps = NewSet("1wardecl=Declare war to...,2warcancel=Cancel war with...,6guildstatus=Update kills count")
craftOps = NewSet("10ren=Rename object as ...,20img=Set image ...,22rde=Edit description,23lev=Set level ...,30pro=Set protection/power ...,40prx=Set price ...")
arrDrinks = NewSet("1=a beer,2=a glass of wine,3=grape juice")
arrShopkeepers = NewArray("auron")
msgKingQueen = NewSet("F=Queen,M=King")
guard.weapons = NewArray("weapon.02.02.0000.sword")
Call LoadContext() ' Reads game saved status from disk
Call updFrontpageText()
Call doRndMusic()
' Create vampire or ghost
Call popMonster(6,monstersPopupSet)
' Create werewolf
Call popMonster(5,monstersPopupSet)
' Create 2 other random monsters
Call CalcAvgPower()
Call popMonster(avgPowerHumans,monstersPopupSet)
Call popMonster(avgPowerHumans,monstersPopupSet)
Call popMonster(avgPowerHumans,monstersPopupSet)
Call NewItem(RndSet(setCastle),"bomb","A bomb.",NewImage("bomb.gif",40,40),"type=bomb,pickable,Value=10,sound=match.wav,icon=bomb.gif,showmode=2")
If debugtype<>0 Or mode=2
Dim passg = NewItem(cave7,"passage","A passage to outside",NewImage("crack1.gif",46,64),"type=passg,pickable=0,showmode=1,showx=0,showy=150,hideable")
AttachEvent passg,"onLook","transfer2"
tr1.locked=0
tr1a.locked=0
End_If
If debugtype = "war"
w21a.locked=false
w21b.locked=false
w22a.locked=false
w22b.locked=false
w32a.locked=false
w32b.locked=false
notifyinterval = "000000000000" ' Notification interval for guild wars
guildwar_duration = "000000000001" ' Duration interval for guild wars
guildwar_mindiff = 0.01
guildwar_prizeperc = 0.001
End_If
If debugtype = "cmds"
Dim i
For i = 1 To 10
Call popHuman(avgPowerMonsters,monstersPopupSet)
Next
End_If
End_EVENT
'
' Game configuration parameters
'
Sub config()
If debugmode 'Must set debugMode=1 in worldnav.properties for enabling the following
debugtype="craft" ' 1=debug end phase 1, 2=debug king mode, 3=debug other area, gem=debug gemini spell, war=debug war system, shop=debug shop, cmds=Commands to pg, craft=Craftsman
End_If
targkilled=40 'Killed Monsters target
maxTicks=4800 'Ticks to the evil crusade victory
monstersPopupSet=setCastle 'Set of rooms where monsters will pop up
escapeSet=setCastle 'Set of rooms where monsters can escape
lake.effect = NewImage("mist.gif",400,200) ' New! Animated effect for lake
scoretype=10 'Type of scoring method
baseprofiles = NewSet("s1=15,e1=10,s2=8,e2=15,s4=15,e4=15,s10=17,e10=8,s16=17,e16=8,s12=17,e12=8,s14=17,e14=8,s19=17,e19=8,s11=17,e11=8")
guildmemberprice = 200 'Price for each guild member
disable_locking = 1 'Set to 1 to disable doors locking
' Guild Wars Config
notifyinterval = "000000000002" ' Notification interval for guild wars
guildwar_duration = "000000000100" ' Duration interval for guild wars
guildwar_mindiff = 2 ' Minimum difference for win (kills per player)
guildwar_prizeperc = 0.01 ' Percentage for prizes
guildwar_cost = 10 ' Cost for war declaring
End_Sub
Sub onNew_local()
'Speak $AGENT,frontpagetext
'****************
' Wars management
'****************
Dim w = war_menaced($AGENT.guild)
If w <> null
Call war_notify(w,$AGENT)
Return
End_If
Dim w = war_running($AGENT.guild)
If w <> null
If w("finishes") <> null And w("finishes") < getTime("yyyyMMddHHmm")
'Update stats
Call getGuildKillStats(w("comp1"),false)
Call getGuildKillStats(w("comp2"),false)
'Record in past wars
pastwars(w("name")) = "Ended on " + getTime("MM-dd, yyyy") + ": " + WarComment(w,w("comp1"),w("comp2"),true)
Call war_result(w,w("comp1"),w("comp2"),$AGENT)
saveSetting "ctx_pastwars",pastwars
SetRemove guildwars,w("comp1")+"*"+w("comp2")
SetRemove guildwars,w("comp2")+"*"+w("comp1")
saveSetting "ctx_guildwars",guildwars
Speak SYS,$WORLD,"The war "+w("name")+" is OVER!!"
Else
Speak SYS,$AGENT,"You are fighting a war: "+w("name")+"!!"
End_If
End_If
'****************
' Debug modes
'****************
If debugtype = ""
Return
' Quick exit
End_If
If debugtype="shop"
Move $AGENT,armory
$AGENT.Level=7
Call giveMoney($AGENT,500)
End_If
If debugtype="craft"
Call NewItem($AGENT,"stone","It's a table of rock mineral.",NewImage("spelltablet.gif",48,48),"pickable,showmode=2,icon=spelltablet.gif,type=stone,Value=2")
Move shieldwood,$AGENT
End_If
If debugtype=2
mode=2
w21a.locked=false
w21b.locked=false
w22a.locked=false
w22b.locked=false
w32a.locked=false
w32b.locked=false
'population = 200
'Move $AGENT, seat
Dim crown = getContainedType($WORLD,"crown")
If Exists(crown)
Move crown,$AGENT
Else
Call NewKing($AGENT,false)
End_If
richness=30
Call livePopulation($AGENT)
End_If
End_Sub
Sub onTick_local()
kingTicks=kingTicks+1
If debugtype=2
Call updateKingdom("FULL")
Else
Call updateKingdom(null)
End_If
Call war_possiblystart()
Call updFrontpageText()
If mode=1
' Phase 1 in progress
If kingTicks >= maxTicks
'Evil wins
Kill asia
Goal "Monsters won: Time ran out, monsters killed the princess."
End_If
'Pop up devilman?
If mkilled >= targkilled And Not(key4appeared)
'If target number of killed monsters reached AND key4 not appeared yet
'pop devilman and place key4 in him
Call popDevilman()
End_If
End_If
If mode=0
' Phase 1 has been just won
' Experimental: enter phase 2
mode=2
saveSetting "ctx_mode",mode
End_If
End_Sub
Sub crown_whenPicked()
If ExistScript("NewKing")
Call NewKing($TARGET,false)
End_If
End_Sub
EVENT pre2.onReceive
Print "The castle of Graiel is a few steps away.
Before entering the castle, choose which player type you will impersonate.
The class icons can be used to view each class' features. After clicking the FORWARD-POINTING ARROW the decision will be accepted."
template.image = NewImage("uomo.gif",64,100)
template.Class = "Warrior"
template.description = "Choose a character type. Click on the sample character to view its properties."
EVENT pre2.onLoose
If $TARGET = p1
' Check that we are exiting from the castle gate
If $AGENT.type=0
Speak "You MUST choose your character type before entering the Reign!"
Return 0
End_If
Display "You enter this world with the role of a " + $AGENT.Class + " - OK."
Call SetAffinity($AGENT,"0/0/0/0")
$AGENT.__startnow = true
Move $AGENT,Start
'Display "In order to further customize your character, you now choose how your affinity to the elements will be like.
This will influence which enemies you will defeat more easily.
Please click [+] and [-] buttons until all the affinity points have been distributed.
You can give all 4 points to FIRE for example, or just choose 1-1-1-1 if you are very unsure.
If you want to learn more on this feature now, you can click the EXPLAIN icon.
"
'Call chooseAffinity($AGENT,"Start")
Return
End_If
EVENT cave3.onLoose
If $TARGET=w25
$AGENT.facing = "N"
Return
End_If
If deathelem<>null
If $TARGET=w26 And deathelem.container = cave3
Speak deathelem, $AGENT, "Grrrrrrrrr..."
Call doAttack(deathelem,$AGENT,null,true)
Return 0
End_If
End_If
End_EVENT
EVENT guilford.onLook
Speak "I am the captain of the guards...","Fighters here organise themselves in guilds.","You can create your own guild here, or join an existing one!"
Print PanelHtml("pguilds")
$OWNER.__clearInfo=true
END_EVENT
EVENT garumir.onLook
Dim richest = SetKeyOfMax(garumir.accounts)
Speak "Deposit here thy coins! So thou shalt not risk of losing'em.","To deposit, give me the coins I should keep safe.","To withdraw, click Withdraw. You can even specify the amount in the textbox.","Do you know who's the richest one? It's " + richest + ", owns " + garumir.accounts(richest)
Print PanelHtml("pbank")
'$AGENT.__clearFocus=true
$OWNER.__clearInfo=true
END_EVENT
EVENT garumir.onHear
Speak "I do not understand your accent, where do you cometh from?","Give me your coins, please let us not lose more time."
END_EVENT
EVENT garumir.onReceiveItem
Dim howmuch = Int($TARGET.Cash)
If howmuch <= 0
Speak $OWNER,$AGENT,"Thou shalt deposit here thy gold coins."
Move $TARGET,$AGENT.container
Return false
Else
Call deposit_money($AGENT,$OWNER,howmuch)
Kill $TARGET
End_If
END_EVENT
Sub deposit_money(from,banker,howmuch)
Dim credits = from.Credits
Dim text = ""
If credits <> banker.accounts(from.name)
credits = banker.accounts($AGENT.name)
text = "Credits you claim are not correct. I owed you: " + credits + " coins. "
End_If
banker.accounts(from.name) = Int(credits) + howmuch
from.Credits = banker.accounts(from.name)
text = text + "I now owe you: " + from.Credits + " coins."
Speak banker,from,text
If banker.accounts(from.name) <= 0 'Cleanup
SetRemove banker.accounts,from.name
End_If
End_Sub
Sub morubar_onLook
Speak "I keep the finances of our kingdom!", "Our richness is currently " + $WORLD.richness + " coins."
Sub morubar_onHear
Speak "If you don't know how to govern the kingdom, read the guide. Click the [Explain] icon!"
EVENT morubar_onReceiveItem
If $WORLD.richness >= 30
Speak $OWNER,$AGENT,"I cannot accept, we have got enough money."
Move $TARGET,$AGENT.container
Return false
End_If
If $TARGET.Cash <= 0
Speak $OWNER,$AGENT,"Only money, please."
Move $TARGET,$AGENT.container
Return false
End_If
If $WORLD.richness+$TARGET.Cash > 30
Speak $OWNER,$AGENT,"I can accept up to " + (30 - $WORLD.richness) + " coins right now."
Move $TARGET,$AGENT.container
Return false
End_If
Speak $OWNER,$AGENT,"Thy donation to our kingdom is very appreciated."
$WORLD.richness = $WORLD.richness+$TARGET.Cash
Kill $TARGET
END_EVENT
EVENT auron.onLook
Speak "Hi stranger, would you like to buy something?", "We've got great stuff for fighting, have a look!"
$AGENT.__clearFocus=true
$OWNER.__clearInfo=true
END_EVENT
EVENT bedroom.onReceive
Call onReceive()
If door1.open=1 And asia.container = bedroom And asia.type < 10
' Asia sees someone entering
If $AGENT.type < 10
Speak asia,asia.container,"KEEP THAT DOOR CLOSED, PLEASE!!"
Else
Speak asia,$WORLD,"EEEEEEeeeeEEEeeekkkk!! A monster in my room!! Help! HEEELP!"
End_If
End_If
EVENT chapel.onReceive
Call onReceive()
If Exists(priest)
If priest.step > 0
Call priest_celebrate()
End_If
End_If
End_EVENT
EVENT chapel.onHear
If InStr($TARGET,"priest")
If Not(Exists(priest))
priest = NewCharacter(chapel,"priest","",NewImage("priest.gif",64,100),"type=3,pacific,nohands,steady,noteleport")
Speak priest,priest.container,"Here I am!"
AttachEvent priest,"onLook","priest_onLook"
AttachEvent priest,"onExit","priest_onDie"
End_If
Return
End_If
If Exists(priest) And priest.step > 0
Return priest_onHear($TARGET,$AGENT)
End_If
End_EVENT
EVENT asia.onReceiveItem
' When asia receives the ring...
If mode <> 1
Return
End_If
If asia.inlovewith <> $AGENT.name
Speak asia,$AGENT,"Thank you but I do not accept gifts from who I do not know and love..."
Move $TARGET,$AGENT
Return false
End_If
If asia.container = chapel
If Exists(priest)
If priest.step > 0 And priest.step < 4
Speak asia,$AGENT,"Ehm... dear... listen at what the priests says..."
Move $TARGET,$AGENT
Return false
End_If
Goal $AGENT.name + ", " + $AGENT.Class + " completed phase 1"
asia.status=3
Call NewKing($AGENT,false)
Else
Speak asia, chapel, "Thanks a lot, and now that the priest's gone, what are we supposed to do??"
Move $TARGET,$AGENT
Return false
End_If
Else
Speak asia,$AGENT,"Ok, ok, keep it for when we will be in front of the priest..."
Move $TARGET,$AGENT
Return false
End_If
End_EVENT
EVENT asia.onHear
If $AGENT.type >= 10
'Monster
Speak asia,$WORLD,"EEEeeeeeek! " + $AGENT.name + " is at my neck! Help! Help!"
Speak asia,$AGENT,"GO AWAY!! GO AWAY!!"
Return false
End_If
If $AGENT.gender = "M"
If asia.status < 1
Speak "WHAT? Hey, tell me something ROMANTIC! I've been locked here for weeks, but I still look for real LOVE!","Is this all your fantasy can do? Don't you have a book of poems to learn from? Oh gosh!","Hmmmm.... tell me more..."
End_If
If asia.status = 2
If $AGENT.hooked = asia
Speak $OWNER,$AGENT,"Oh, my brave companion! Let's not waste time! Bring me to the chapel!"
Else
Speak $OWNER,$AGENT,"I'm very busy, sorry, I am organizing my wedding..."
End_If
End_If
Else
Speak "I don't want anything from you, thanks. Do you have a handsome, male friend who I can meet by the way?"
End_If
EVENT hay.whenPicked
Dim k = getContainedType(B,"key3")
If k <> null
k.hidden=false
End_If
EVENT guard.onLook
Speak "Hey stop!","Who's there?!?","How many are you?","What are you carrying?","OK, but how many are you?","A GOLD PIECE PLEASE!"
Call onLook
End_Event
EVENT E.onLoose
If guard <> null
If $TARGET=arch1 And guard.container = E
Speak guard, $AGENT, "Don't you dare!", "You are in danger!", "You want to make me angry do you?"
Call doAttack(guard,$AGENT,guard.weapon,true)
Return 0
End_If
End_If
EVENT nkono.onExit
' Bounces back Nkono if guard is in place
If guard <> null
If guard.container = E
Return 0
End_If
End_If
EVENT merlin.onLook
Dim merlinphrase,merlinphrase2=$WORLD.frontpagetext,merlinphrase3=getTournamentMessage()
If merlinphrase3 = null
If mode<2
merlinphrase3="You know, with my vengeance powers I have seen there's gold hidden in " + coins.container.name + ""
Else
merlinphrase3="Click [SAVE] to save your game and [SAVE AND EXIT] before quitting."
End_If
End_If
If containsType("money",$AGENT,false)
merlinphrase = "You shouldn't go around with all that money, deposit it at the Garumir's bank!"
Else
merlinphrase = "Withdraw money at Garumir's, and buy something useful!"
End_If
Speak merlinphrase,merlinphrase2,merlinphrase3
End_EVENT
EVENT merlin.onHear
If $TARGET <> ""
If $TARGET = "cleanup"
Speak "Oh! That was the formula!"
Call cleanup()
Return
End_If
If $TARGET = "legion"
Dim i
For i = 1 To 10
Call popHuman(avgPowerMonsters,monstersPopupSet)
Next
Return
End_If
Speak "You look like a smart one. Perhaps one day you will rule these lands!","Hm.","Aha."
Else
Speak "Hey, I can't hear you."
End_If
EVENT cross.whenPicked
If $TARGET.type > 9
Display $TARGET,"Ouch!! I can't hold this thing..."
Move $OWNER,$TARGET.container
Return false
Else
PlaySound $TARGET,"fanfare.wav"
Display $TARGET,"Hey, I feel brilliant!"
End_If
EVENT cross.onUse
If $AGENT = infected
' Heals infection
infected = ""
infector = ""
Display "Ahhhh.... I feel better now."
$AGENT.Health = $AGENT.Health + 1
End_If
EVENT garlic.whenPicked
If $TARGET.type = 14
Display $TARGET,"Bleah!! I can't stand garlic!!"
Move $OWNER,$TARGET.container
Return false
End_If
EVENT silvering.whenPicked
If $TARGET.type = 16
Display $TARGET,"Won't touch silver!"
Move $OWNER,$TARGET.container
Return false
End_If
Return whenPicked()
EVENT silvering.onUse
If $AGENT = infected And infectype=16
' Heals infection
infected = ""
infector = ""
Display "Ahhhh.... I feel better now."
$AGENT.Health = $AGENT.Health + 1
End_If
EVENT cymbidium.onExit
' Management of plants
Call getBranch($OWNER,$AGENT)
Return false
EVENT sand.onExit
' Management of sand
Dim cont = getContainedType($AGENT,"bowl")
If cont <> null
Dim new = NewItem(cont,"sand","",NewImage("sand.gif",32,32),"pickable,showmode=2,icon=sand.gif,type=sand,vanishing")
If new.container <> cont
Print "The bowl is full..."
Kill new
Else
Print "I will put some in the bowl."
End_If
Else
Print "I haven't got the proper container."
End_If
Return false
EVENT powder.onExit
' Management of powder
Dim cont = getContainedType($AGENT,"bowl")
If cont <> null
Dim new = NewItem(cont,"pyric powder","",NewImage("powder.gif",32,32),"pickable,showmode=2,icon=powder.gif,type=powder,vanishing")
If new.container <> cont
Print "The bowl is full..."
Kill new
Else
Print "I will put some in the bowl."
End_If
Else
Print "Mi serve un contenitore adatto."
End_If
Return false
EVENT armory.onLooseItem
' Management of sold items
If $TARGET.seller <> ""
Display "This item is sold by " + $TARGET.seller.name
Speak $TARGET.seller, $AGENT, "Hey, this will cost you " + $TARGET.Value + " coins!", "You need " + $TARGET.name + " huh? It is on sale, you know.", "Look: special price for you: "+ $TARGET.Value + " coins!"
Return false
End_If
' Transfer function to move people to Area 2
Function transfer2
$AGENT.fromarea = $WORLD.name
MoveOutside $AGENT,"Underworld2"
Return False
End_Function
'Local explosives management
'input: cont=bomb container
Sub bombExplode_local(cont)
If cont=cave7 And Not(containsType(cont,"passg",false))
Dim passg = NewItem(cave7,"a passage","An exit to outside",NewImage("crack1.gif",46,64),"type=passg,pickable=0,showmode=1,showx=0,showy=150,hideable")
AttachEvent passg,"onLook","transfer2"
End_If
End_Sub
EVENT pre1.onReceive
' Teleport comers from other areas to correct places
If $TARGET.fromarea = "Underworld2"
Move $TARGET,cave7
End_If
If $TARGET.fromarea = "Underworld3"
Move $TARGET,gateroom
End_If
If $TARGET.fromarea = "Underworld4"
Move $TARGET,lake
End_If
End_EVENT
EVENT pre1.onReceiveItem
If $TARGET.type <> "msg"
'Unknown object, make it visible
Move $TARGET,start
Return
End_If
'Debug "Got command message. cmd=" + $TARGET.cmd
If HandleCommandMessage_Common($TARGET) = false
' Handle control/command message
If $TARGET.cmd = "upd_guildkills"
guildkills($TARGET.guild) = $TARGET.guildkills
guildavglvl($TARGET.guild) = $TARGET.guildavglvl
End_If
End_If
Kill $TARGET
End_EVENT
Sub diePrincess()
If mode<>1 ' Suppress if phase 1 completed
Return
End_If
Dim name = "somebody"
Dim killer = asia.killer
If Exists(killer)
If IsPlayer(killer)
name = killer.Class + " "
End_If
name = name + killer.name
End_If
Goal "Monsters won: " + name + " killed the princess"
Call doMusic("livetotell.mid",6)
If Not(crowncreated)
Call NewKing(killer,false)
End_If
End_Sub
'popDevilman
'pop devilman and place key4 in him if needed
'returns: the Devilman
Function popDevilman()
Dim new = popMonster(15,setCastle)
If Not(key4appeared)
Move key4, new
key4appeared = true
End_If
Return new
End_Function
Sub Living_local(person)
If IsPlayer(person) ' Affinity check
If person.affinity = null
If Not(person.container.introductory)
Call chooseAffinity(person,person.container)
End_If
Else
If SetLen(person.affinity)=4 And (person.affinity(1)+person.affinity(2)+person.affinity(3)+person.affinity(4))>4
Call chooseAffinity(person,person.container)
End_If
End_If
End_If
If person.Level = 1
If IsPlayer(person) And SetContainsKey(setAll,person.container.id)
Call Hints(person)
End_If
End_If
If mode<>1 ' Suppress if phase 1 completed
Return
End_If
If person.type=14 Or person.type=16 Or person.type=12
' Vampire, Werewolf or BatVampire
Dim key4 = getContainedType($WORLD,"key4")
If person.InfectedHumans >= targkilled And key4 <> null And key4.seller = null
' Make devilman appear and give key
Dim new=popDevilman()
Move new,person.container
Move key4,person
If key4.container<>person
' Handles case in which player is at full capacity
Move key4,person.container
End_If
Speak new,person,"Here's the key, you deserve it! Have fun with the princess, har! har! har!"
End_If
End_If
End_Sub
EVENT onReceive_Local
If asia <> null
If $TARGET.hooked <> asia
Return
End_If
If asia.inlovewith = $TARGET.name
Move asia, $OWNER
End_If
End_If
End_EVENT
EVENT bscell.onReceiveItem
If $TARGET.type = "sand" And $OWNER=bscell And SetLen(getItemsIn(pot))=0
Move $TARGET,pot
Print $AGENT,"Placing the sand in the pot."
Return 1
End_If
' Else call global event
Call onReceiveItem
End_EVENT
EVENT onChooseWarrior
$AGENT.type = 1
$AGENT.Class = "Warrior"
$AGENT.image = NewImage("uomo.gif",60,94)
$AGENT.gender = "M"
$AGENT.suffersound = rndSet(setSndHumanYell)
template.description = "A warrior can use weapons and wear protections.
Choose this one if you prefer to fight with physical force."
Call updTemplate
EVENT onChooseFWarrior
$AGENT.type = 1
$AGENT.Class = "Female Warrior"
$AGENT.image = NewImage("fwarrior.gif",35,102)
$AGENT.gender = "F"
$AGENT.suffersound = "bighit1.wav"
template.description = "A warrior can use weapons and wear protections.
Choose this one if you prefer to fight with physical force."
Call updTemplate
EVENT onChooseCleric
$AGENT.type = 2
$AGENT.Class = "Cleric"
$AGENT.image = NewImage("cleric.gif",63,100)
$AGENT.gender = "M"
$AGENT.suffersound = rndSet(setSndHumanYell)
template.description = "Cleric: helps others with the Magic Arts and is capable of casting spells and preparing potions.
Choose this one if you would like your mental energy to dominate your phisical strength."
Call updTemplate
EVENT onChooseSorceress
$AGENT.type = 2
$AGENT.Class = "Sorceress"
$AGENT.image = NewImage("mystic.gif",64,100)
$AGENT.gender = "F"
$AGENT.suffersound = "scream1.wav"
template.description = "Sorceress: helps others with the Magic Arts and is capable of casting spells and preparing potions.
Choose this one if you would like your mental energy to dominate your physical strength."
Call updTemplate
EVENT onChooseArtisan
$AGENT.type = 4
$AGENT.Class = "Craftsman"
$AGENT.image = NewImage("paesant.gif",60,94)
$AGENT.gender = "M"
$AGENT.suffersound = rndSet(setSndHumanYell)
template.description = "The Craftsman is able to extract metal from rock and to create useful objects.
Choose this one if you like to work and trade rather than fight."
Call updTemplate
EVENT onChooseDarken
$AGENT.type=19
$AGENT.Class = "Dark Entity"
$AGENT.image = NewImage("horror047.gif",121,144)
$AGENT.gender = "F"
$AGENT.yell = "roar2.wav"
$AGENT.suffersound = "pig.wav"
template.description = "Dark Entity: She's the ghost of an evil sorceress. Dark creature, pure evil energy, is the evil version of the Sorceress.
Choose this one if you feel evil and if your energy is more mental than physical."
Call updTemplate
EVENT onChooseVampire
$AGENT.type=14
$AGENT.Class = "Vampire"
$AGENT.image = NewImage("vampire.gif",95,100)
$AGENT.gender = "M"
$AGENT.yell = "roar2.wav"
$AGENT.suffersound = "pig.wav"
template.description = "Vampire: Evil creature.
Can turn humans into vampires, hates werewolves.
Hates crosses and garlic, cannot bear the sunlight, except when as bat.
Choose this one if strength and seduction enforce the dark side of yourself."
Call updTemplate
EVENT onChooseVampireBride
$AGENT.type=14
$AGENT.Class = "Vampire Bride"
$AGENT.image = NewImage("vampirebride.gif",94,100)
$AGENT.gender = "F"
$AGENT.yell = "roar2.wav"
$AGENT.suffersound = "scream1.wav"
template.description = "Vampire Bride: Evil creature.
Can turn hHumans into vampires, hates werewolves.
Hates crosses and garlic, cannot bear the sunlight, except when as bat.
Choose this one if strength and seduction enforce the dark side of yourself."
Call updTemplate
EVENT onChooseWerewolf
$AGENT.type=16
$AGENT.Class = "Werewolf"
$AGENT.image = NewImage("werewolf.gif",90,100)
$AGENT.gender = "M"
$AGENT.yell = "roar2.wav"
$AGENT.oldimage = NewImage("paesant.gif",64,100)
$AGENT.oldstrength = 2
$AGENT.suffersound = null
template.description = "Werewolf: Evil creature, can turn humans into werewolves, hates vampires.
Hates silver.
Can transform into a Wolf when in psychically altered.
Choose this one if rage makes you feel a real beast."
Call updTemplate
Sub updTemplate()
$AGENT.Strength = 1
If $AGENT.mainpg = "" Or $AGENT.mainpg = $AGENT.name Or debugmode>0 'True beginner
If arrIps($AGENT.remoteAddr)<>1
$AGENT.invul = 60
If garumir.accounts($AGENT.name) = null
$AGENT.Credits = 100
garumir.accounts($AGENT.name) = 100
Else
$AGENT.Credits = garumir.accounts($AGENT.name)
End_If
arrIps($AGENT.remoteAddr)=1
End_If
End_If
template.image = $AGENT.image
template.Strength = $AGENT.Strength
template.Class = $AGENT.Class
Display template.description
If $AGENT.mainpg <> "" And $AGENT.mainpg <> $AGENT.name
Print $AGENT,"No initial invulnerability (existing user)"
Else
Print $AGENT,"Initial invulnerability: " + ($AGENT.invul/2) + " minutes"
'If getTime("dd/MM/yyyy")=smDay
' $AGENT.Crediti = 500
' garumir.accounts($AGENT.name) = 500
' Speak SYS,$AGENT,"Oggi è il Sottomondo Day. Per aver iniziato a giocare oggi ti spetta una SUPER dotazione iniziale di ben 500 monete!!"
'End If
End_If
Display "
Notice: This is just the default look, after playing a bit your avatar can be customized with any image you like"
End_Sub
'
' Updates kingdom's situation
'
Sub updateKingdom(full_mode)
Dim king = null
Dim crown = getContainedType($WORLD,"crown")
Dim text = ""
If Exists(crown)
If IsCharacter(crown.container)
king = crown.container
End_If
End_If
If Not(Exists(king))
Return
End_If
If full_mode = null
Call livePopulation(king)
Return
End_If
'Update kingdom duration
king.kingdays = king.kingdays + 1
text=text+"
So far, "+king.name+" ruled for " + king.kingdays + " days."
'Income from villains
Dim totincome = 5 * population
text=text+"
Villains produced a total income of " + totincome + " coins"
'Tax villains
Dim tottaxes = taxes * population
If tottaxes >= totincome
richness = richness + totincome
totincome = 0
Else
richness = richness + tottaxes
totincome = totincome - tottaxes
End_If
text=text+"
Taxes we got from villains: " + tottaxes + " coins"
Dim dconf = 0 ' Confidence increment
Dim alive = Int(totincome/3) 'How many villains will stay alive
If alive < population
starved = population - alive
text=text+"
" + starved + " villains starve to death because of taxes too high"
dconf = dconf-2
Else
If alive > population
text=text+"
All villains survive"
dconf = dconf+1
End_If
End_If
population = alive
'Tax players
Dim playtaxes = TaxPlayers(king,taxes)
text=text+"
Taxes we got from players: " + playtaxes + " coins"
richness = richness + playtaxes
'How good is safety?
If king.type < 10
killfriend = hkilled
killenemy = mkilled
Else
killenemy = hkilled
killfriend = mkilled
End_If
text=text+"
Kill ratio Enemies/Citizens: "+killenemy + ":" + killfriend
if killfriend < killenemy
dconf = dconf+1
text=text+"
Villains feel safe"
End_If
if killfriend > killenemy
dconf = dconf-2-2*(king.Level>3)
text=text+"
Villains complain, safety is not there"
Speak morubar,king,"Majesty, please take care about citizens' safety!"
End_If
If Int(richness/3) = 0 And population < 200
text=text+"
There is not enough richness to feed new villains!"
Speak morubar,king,"Majesty, the richness of the kingdom do not allow us to get new villains! Give me some coins."
dconf = dconf-1-2*(king.Level>3)
End_If
' Reset counters for next day
mkilled=0
hkilled=0
text=text+"
"+msgKingQueen(king.gender)+"'s reputation "
If dconf < 0
text=text+"
got worse: " + dconf
Else
If dconf > 0
text=text+"got better: +" + dconf
Else
text=text+"stayed the same: +" + dconf
End_If
End_If
confidence = confidence + dconf
If confidence>10
confidence=10
End_If
text=text+"
Current confidence: " + confidence + " out of 10"
If confidence<0
confidence=0
Call insurrection(king)
End_If
If Exists(king) ' Is king still alive?
text=text+"
Kingdom's richness amounts to: " + richness + " coins"
' Newcomers
Dim maxnewcomers = Int(richness/3)
If (200-population) < maxnewcomers
maxnewcomers = 200-population
End_If
Dim newcomers = RndInt(1+confidence*2)-1 ' from 5 to 15 newcomers
If newcomers > maxnewcomers
newcomers = maxnewcomers
End_If
population = population + newcomers
richness = richness - 3*newcomers ' Subtract wheat from newcomers
text=text+"
There are " + newcomers + " newcomers. Population is now: " + population + " villains."
Call livePopulation(king)
Dim incr = Round(confidence + richness/2000 + population/20,0)
text = text + "
Score increment: " + incr
Speak SYS,king,"Score increment: " + incr
Call advanceCheck(king,"score",incr)
If king.married <> null
If incrScore(king.married,incr) = false ' Try other areas
Call BroadcastOtherWorlds("incr_score","incr="+incr+",to="+king.married)
End_If
If ProfileExists(king.married)
Dim wifescore = Int(LookupProfileDB(king.married,"score_added"))
wifescore = incr+wifescore
Dim nick = CookName(king.married)
Dim tmp = getSetting(nick + "_properties","")
SaveSetting nick + "_properties",tmp+",score_added="+wifescore
End_If
End_If
Dim new = NewItem(king,"Kingdom's Log "+ getTime("MM dd, yyyy HH:mm"),"...",NewImage("pergamena.gif",100,100),"icon=scroll.gif,showmode=2,vanishing,pickable,volume=0")
new.description = text
Dim hiscore = 0 + getSetting("hiscore") 'Sum to force considering number value
If king.Score > hiscore
saveSetting "hiscore",king.Score
saveSetting "hiscoretext","Best score: " + king.Score + " by " + king.name + ", "+king.Class+ " on " + getTime("MM dd, yyyy")
Speak SYS,$WORLD,"The best "+msgKingQueen(king.gender)+" is " + king.name + " with Score " + king.Score
Print king,"I am the best "+msgKingQueen(king.gender)+" ever!"
End_If
End_If
'SaveSetting "fbusers",fbusers
End_Sub
EVENT doNewTax
Dim newtax = Int($TARGET)
If newtax < 1 Or newtax > 5
Print "This one is to set daily taxes. You type a number (From 1 to 5) in the textbox and click button."
Return
End_If
If containsType($AGENT,"crown",false)
taxes = newtax
Print "OK - starting from today daily taxes will be: " + taxes + " coins per person."
Else
Print "To set taxes I should be King or Queen... maybe one day..."
End_If
END_EVENT
EVENT doWithdraw
If $AGENT.container = bank
Dim banker = garumir
Dim howmuch = Int($TARGET)
Dim credits = Int($AGENT.Credits)
Dim text = ""
$AGENT.ticket = ""
Dim personname = $AGENT.name
banker.accounts(personname) = Int(banker.accounts(personname)) ' Convert to number
If credits <> banker.accounts(personname)
credits = banker.accounts(personname)
text = "Credits you claim are not correct. I owed you: " + credits + " coins. "
End_If
If credits <= 0
text = text + "I owe nothing to you. Bring coins if you want to keep them safe."
Else
If howmuch <= 0
howmuch = 10 'default 10
End_If
If howmuch > credits ' withdraw all
howmuch = credits
End_If
Call giveMoney($AGENT,howmuch)
banker.accounts(personname) = credits - howmuch
If $AGENT.Credits < 1
text = text + "Now we are done, pay attention, there are some kind of freaks around... hah hah hah..."
Else
text = text + "I now owe you: " + banker.accounts(personname) + " coins."
End_If
End_if
$AGENT.Credits = banker.accounts(personname)
Speak banker,$AGENT,text
If banker.accounts(personname) <= 0 'Cleanup
SetRemove banker.accounts,personname
End_If
Return
End_If
If $AGENT.container = seat
If Exists(morubar) And richness > 0
If getContainedType($AGENT,"crown") <> null
Call giveMoney($AGENT,richness)
Speak morubar,$AGENT,"Here they are, Majesty."
richness = 0
Else
Speak morubar,$AGENT,"I have been told not to give the money to anyone except to the King or the Queen."
Return false
End_If
Else
Print "There is nothing to get, by now"
Return false
End_If
Return
End_If
If $AGENT.container = bar
If jukebox.contents > 0
If getContainedType($AGENT,"crown") <> null
Call giveMoney($AGENT,jukebox.contents)
jukebox.contents = 0
Else
Return false
End_If
Else
Print "It's empty, by now."
Return false
End_If
Return
End_If
END_Event
' Makes a new King or Queen
' input: person who will become king
' force=true will force creation of crown
Sub NewKing(person,force)
If person = null
person = Start
Else
If person.name <> prevking
PlaySound $WORLD,"fanfare.wav"
Dim phrase = "a new King"
If person.gender = "F"
phrase = "a new Queen"
End_If
Dim pname = person.name
Dim link = gameinfo("site")
If IsPlayer(person)
link = UserCard(pname)
Journal pname&" rules the Kingdom!",link,"There is "&phrase&" in Underworld:\n"&UserCardLink(person.name)&"!","news*kingdom*user:"&pname
pname = UserCardLink(pname)
End_If
Speak SYS,$WORLD,"We have " + phrase + ": "+pname+"!!!"
confidence=10
person.kingdays = 0
If person.scoretype <> scoretype
person.Score = 0
person.scoretype = scoretype
End_If
End_If
End_If
If Not(crowncreated) Or force=true
' First clean crown
Dim crown = getContainedType($WORLD,"crown")
If crown <> null
Kill crown
End_If
Call BroadcastOtherWorlds("kill_crown",null)
' make new crown
Dim crown = NewItem(person,"crown","The owner of this crown can rule the Kingdom",NewImage("crown.gif",40,40),"type=crown,pickable,showmode=2,icon=crown.gif")
AttachEvent crown,"whenPicked","crown_whenPicked"
If SetLen(getPeopleName($WORLD,"Morubar")) < 1
morubar = NewCharacter(seat,"Morubar","He's the King's treasure keeper.",NewImage("morubar.gif",39,100),"type=0,nohands,accepts=*")
AttachEvent morubar,"onHear","morubar_onHear"
AttachEvent morubar,"onLook","morubar_onLook"
AttachEvent morubar,"onReceiveItem","morubar_onReceiveItem"
End_If
richness=0
crowncreated=true
End_If
prevking = person.name
Call updFrontpageText()
End_Sub
Sub infect_SpecialCase
If Exists(asia) And infected = asia And infectype <> 16
'Special case
infected.type = 14
infected.Class = "Vampire Bride"
infected.yell = "roar2.wav"
infected.image = NewImage("vampirebride.gif",93,100)
Speak asia,infector,"My love, now we will be together for ever!!"
Goal infector.name + " turned the princess into his vampire bride."
If Not(crowncreated)
Call NewKing(infector,false)
End_If
infected = null
infector = null
End_If
End_Sub
'updates front page text
Sub updFrontpageText()
If mode=1
leftHours = Int((maxTicks-kingTicks)/120)
leftMins = Int((maxTicks-kingTicks)/2 - leftHours*60)
frontpagetext = "" + leftHours + " hours, " + leftMins + " minutes left before the fall of the kingdom"
If calcMonstersLeft() > 0
frontpagetext = frontpagetext + " - at least " + calcMonstersLeft() + " monsters haunt the castle."
End_If
End_If
If mode=2
leftHours = Int(kingTicks/120)
'leftMins = Int(kingTicks/2 - kingHours*60)
Dim crown = getContainedType($WORLD,"crown")
Dim tmp
If IsCharacter(crown.container)
Dim pname = crown.container.name
If IsPlayer(crown.container)
pname = UserCardLink(pname)
End_If
If crown.container.type < 10
If crown.container.gender = "F"
tmp = "The Queen is " + pname + "."
Else
tmp = "The king is " + pname + "."
End_If
humansPts = humansPts+1
Else
tmp = "The crown was stolen by " + pname + "."
monstersPts = monstersPts+1
End_If
Else
tmp = "The crown got lost."
End_If
If humansPts > monstersPts
tmp=tmp + " Humans ruled " + Int(100*humansPts/(humansPts+monstersPts+1)) + " % of time"
Else
tmp=tmp + " Monsters ruled " + Int(100*monstersPts/(humansPts+monstersPts+1)) + " % of time"
End_If
frontpagetext = "New Kingdom lives since " + leftHours + " days. " + tmp
End_If
End_Sub
Sub livePopulation(king)
Dim villains = getPeopleName($WORLD,"a villain")
'Print king,"Villains: " + villains
Dim existing = SetLen(villains)
Dim pop = Round(population / 10,0)
Dim diff = pop - existing
'Print king,"Live villains should be: " + pop + " there are: " + existing + " creating now: " + diff
If diff > 0
Dim i
Dim attrs
Dim place
Dim im
For i = 1 To diff
place = RndSet(setAll)
If debugtype=2
place = gateroom
End_If
If king.type < 10 Or debugtype=2
attrs = "type=7,gender=M,Class=Villain,Strength=2,pacific,balanceignore,accepts=*"
im = NewImage("paesant1.gif",37,96)
Else
attrs = "type=18,gender=M,Class=Villain,Strength=2,balanceignore,accepts=*"
im = NewImage("zombie.gif",74,96)
End_If
Dim new = NewCharacter(place,"a villain","",im,attrs)
If new.type=7
new.image("S") = NewImage("paesant1b.gif",37,96)
End_If
Print king,"A villain appears in: " + place.name
Next
End_If
End_Sub
Sub SaveContext()
saveSetting "ctx_kingTicks",kingTicks
saveSetting "ctx_guildkills",guildkills
saveSetting "ctx_guildavglvl",guildavglvl
If SetLen(garumir.accounts) > 0
saveSetting "ctx_accounts",garumir.accounts
Else
If SetLen(garumir.accounts) < 0
Debug "Error in current context - Restarting game" + getTime("dd/MM/yyyy HH:mm")
Reset
End_If
End_If
End_Sub
Sub LoadContext_Local()
If debugtype <> 1
mode = getSetting("ctx_mode",mode)
kingTicks = Int(getSetting("ctx_kingTicks",kingTicks))
End_If
If mode = 2
Kill asia
setAll("bedroom") = bedroom 'Add bedroom
Call NewKing(RndSet(getObjectsType($WORLD,11)),false)
Move key4, RndSet(setAll)
key4appeared = true
Move key1, RndSet(setAll)
Move key5, RndSet(setAll)
Move axe,armory
axe.seller = auron
End_If
garumir.accounts = getSetting("ctx_accounts","!set!")
Call MakeGuildIndex()
' Load playlist from database
Dim tracks = NewArray(getSetting("ctx_trackfiles","sndbackground08.mid|5.5,alchemist.mid|5.5"))
jukebox.trackfiles = NewArray()
jukebox.tracklen = NewArray()
Dim i
For i = 1 To SetLen(tracks)
Dim parts = Split(tracks(i),"|")
jukebox.trackfiles(i) = parts(1)
jukebox.tracklen(i) = parts(2)
Next
jukebox.tracklist = NewArray(getSetting("ctx_tracklist","Track 1,Track 2"))
'Journal "Restart",gameInfo("site"),"Game has been restarted."+Chr(13)+"You can connect and play now.","news"
End_Sub
Sub onKillRobot_local(loser,winner)
If loser = asia
Call diePrincess()
End_If
Dim tmp = winner.name + " " + RndSet(arrVerbs) + " " + loser.name + "!! "
If mode=1
Dim x = calcMonstersLeft()
If x > 0
tmp = tmp + x + " monsters left."
End_If
End_If
If mode=2
If loser.name = "a villain"
population = population - 1
If population < 0
population = 0
End_If
End_If
End_If
If SetLen(getPlayersIn($WORLD)) < 4
Speak SYS,$WORLD,tmp
End_If
End_Sub
Sub insurrection(king)
Speak SYS,$WORLD,king.name + " gets beaten down by furious crowd!"
Dim villains = getPeopleName($WORLD,"a villain")
For Each v in villains
Move v,king.container
Next
king.killer = v
Kill king
End_Sub
Function guildroom_description
Dim txt="This the room of the guards' captain. He knows about all existing Guilds."
txt = txt + "" + NewImage("panhelp.gif",16,16).html("Explain",$AGENT) + "Explain"
txt = txt + "
Guild Directory"
txt = txt + "
None currently." End_If txt = txt + "
None currently." End_If txt = txt + "
No war has ever been fought before." End_If txt = txt + "
Memorize this quick start now. If dropped, this scroll will self-destroy.
" newobj.description = newobj.description & "For whatever doubt click ["+htmlIcon("panhelp.gif","Help is on the commands panel!")+" Help] - the complete player's guide.
" newobj.description = newobj.description & "GOOD LUCK!!
" If $AGENT.type=1 SetPanel $AGENT, "pwarrior" End_If If $AGENT.type=2 SetPanel $AGENT, "pcleric" End_If If $AGENT.type=4 SetPanel $AGENT, "partisan" newobj.description = newobj.description + "