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



















MUTING 1 GUI SCENE SIZE 400x230 SCREEN SIZE 800x600 LOGOSRC http://www.underworld-game.net/images/splashen.jpg MSGLISTSIZE 4 COMPASS true SKINS bloody.txt 'PAGE flash flash.htm MAP map_uw1.gif HOOKS findobj=doFindObj,viewitem=doViewItem,expertswitch=doExpertSwitch Include "uwpanels.dxl" PANEL pjukebox BUTTON dothis, "Play: ", "Command", doCommand DROPDOWN trackselector, "jukebox.tracklist", 0 PANEL pgetmoneyjb BUTTON withdraw, "Get coins", "Get coins", doWithdraw, T PANEL pmarriage BUTTON dothis, "Do this: ", "Command", doCommand DROPDOWN partnerselector, "getPartners($AGENT)", 0 PANEL pbuydrink BUTTON dothis, "Get: ", "Command", doCommand DROPDOWN drinkselector, arrDrinks, 0 PANEL pbank BUTTON withdraw, "Withdraw", "Withdraw money", doWithdraw, T TEXTBOX PANEL pthrone BUTTON tax, "New taxes", "Set new taxes to be: ... coins", doNewTax, T TEXTBOX LABEL "
" BUTTON withdraw, "Withdraw", "Withdraw credits", doWithdraw, T PANEL pguilds BUTTON guildcmd, "I want to: ", "Command", doCommand DROPDOWN guildop, guildOps, "$AGENT.__lastcmd" LABEL "" TEXTBOX LABEL " guild: " DROPDOWN guildsel, guildnames, "guildSubscribed($AGENT)" PANEL pwar BUTTON dothis, "Do this: ", "Command", doCommand DROPDOWN warop, warOps, 1wardecl LABEL "" DROPDOWN guildsel, "getWarriorGuilds($OWNER)", 0 PANEL pextract BUTTON gather, "Extract rock", "Gather resources", onGather ICON pangather.gif PANEL pprivacy LABEL "@privacytext()" BUTTON dothis, " OK, I accept these terms, let me in ", "Confirm", doCommand PANEL pcraftsman BUTTON craftcmd, "Do this: ", "Command", doCommand, "TO" DROPDOWN craftop, craftOps, "$AGENT.__lastcmd" LABEL "" TEXTBOX END_GUI ROOMS ROOM pre1 DEFAULT NAME Arrival DESCRIPTION You are entering the Reign of Graiel.

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 + "

" txt = txt + PanelHtml("pguilds") Return txt End_Function Function doGuildOperation(input) 'Speak guildOps(input("guildOp")) Dim changes = false Dim tmp = $AGENT.name Dim guildowner = input("guildsel") Dim persname = input("txtBox") Dim cmd = input("guildOp") If Int(tmp) > 0 tmp = "_" + tmp ' fix for number nicks End_If If cmd = "0new" If input("txtBox") <> "" If guildnames(tmp) <> null Speak guilford,$AGENT,"You already own a guild, sir." Return End_If If $AGENT.Level < 3 Speak guilford,$AGENT,"To start a guild you need to be at least Level 3." Return End_If Dim s = guildSubscribed($AGENT) If s <> null Speak guilford,$AGENT,"You have to leave " + guildnames(s) + " first." Return End_If guildnames(tmp) = input("txtBox") guildwebs(tmp) = urlGuilds + "/" + input("txtBox") guildsubscribers(tmp) = "" guildrequests(tmp) = "" guilddelegates(tmp) = "" guildfounded(tmp) = getTime("MM-dd-yyyy") guildkills(tmp) = getKillTotal($AGENT) Call MakeGuildIndex() Speak guilford,$AGENT,"The guild " + guildnames(tmp) + " has been created." Journal $AGENT.name&" has founded a guild",UserCard($AGENT.name),UserCardLink($AGENT.name)&" has just founded a new guild: "&persname&"!","news*user:"&$AGENT.name&"*guild:"&persname changes = true Else Speak guilford,$AGENT,"How do you want it to be named? Write it down." Return End_If End_If If cmd = "8del" If guildnames(tmp) = null And Not($AGENT.master) Speak guilford,$AGENT,"You don't own any Guild, sir." Return End_If If $AGENT.master ' Choose from dropdown tmp = input("guildsel") End_If If war_engaged(tmp) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If If input("txtBox") <> "YES" Speak guilford,$AGENT,"Delete: " + guildnames(tmp) + " Are you sure? Type YES and redo." Else Speak guilford,$AGENT,"The guild " + guildnames(tmp) + " has been deleted." SetRemove guildnames,tmp SetRemove guildlogos,tmp SetRemove guildwebs,tmp SetRemove guildfounded,tmp SetRemove guildkills,tmp SetRemove guildsubscribers,tmp SetRemove guildrequests,tmp changes = true End_If End_If If cmd = "1edt_logo" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If $AGENT.master ' Choose from dropdown tmp = input("guildsel") End_If If input("txtBox") = "" Speak guilford,$AGENT,"Type logo URL and redo." Else Speak guilford,$AGENT,"Ok, sir. New logo for your guild!" guildlogos(tmp) = input("txtBox") changes = true End_If End_If If cmd = "2edt_web" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If input("txtBox") = "" Speak guilford,$AGENT,"Type web page's URL and redo." Else Speak guilford,$AGENT,"Ok, " + $AGENT.name + ". Make that page to describe your guild's mission." guildwebs(tmp) = input("txtBox") changes = true End_If End_If If cmd = "4info" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If persname = "" Speak guilford,$AGENT,"Type the name of the member and redo." Else If InStr(guildsubscribers(tmp),persname+";",1) Or InStr(guildrequests(tmp),persname+";",1) Or $AGENT.master Speak guilford,$AGENT,getPeopleInfo(persname,false) Else Speak guilford,$AGENT,"-" + persname + "- is not a member of your own guild, sir." End_If End_If End_If If cmd = "5appr" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If guildnames(tmp) = null And $AGENT.master tmp = input("guildsel") End_If If guildnames(tmp) = null And GuildHasDelegate(guildSubscribed($AGENT),tmp) tmp = guildSubscribed($AGENT) End_If If war_engaged(tmp) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If If guildmoney(tmp) < guildmemberprice*getGuildCount(tmp) Speak guilford,$AGENT,"To allow a new member, richness must be increased: "+(getGuildCount(tmp)*guildmemberprice-guildmoney(tmp))+" coins needed." Return End_If If persname = "" Speak guilford,$AGENT,"Type the name of the person and repeat the command." Else If Not(InStr(guildrequests(tmp),persname+";")) Speak guilford,$AGENT,"-" + persname + "- did not request to join your own guild, sir." Else guildsubscribers(tmp) = "" + guildsubscribers(tmp) + persname + ";" Call ClearGuildRequests(persname) Speak guilford,$AGENT,persname + " is now a member of " + guildnames(tmp) link = UserCard(persname) Journal persname&" has joined a guild",link,UserCardLink(persname)&" is now an approved member of the guild: "&guildnames(tmp)&"!","news*user:"&persname&"*guild:"&guildnames(tmp) changes = true End_If End_If End_If If cmd = "5ban" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If $AGENT.master tmp = input("guildsel") End_If If guildnames(tmp) = null And GuildHasDelegate(guildSubscribed($AGENT),tmp) tmp = guildSubscribed($AGENT) End_If If war_engaged(tmp) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If If input("txtBox") = "" Speak guilford,$AGENT,"Type the name of the member and redo." Else If Not(GuildUnsubscribe2(tmp,persname)) Speak guilford,$AGENT,"-" + persname + "- is not a member of your guild, nor has a pending request." Else Speak guilford,$AGENT,"Done, sir." changes = true End_If End_If End_If If cmd = "5purge" If guildnames(tmp) = null And Not($AGENT.master) Speak guilford,$AGENT,"You don't own any guild, sir." Return End_If If $AGENT.master tmp = input("guildsel") End_If If war_engaged(tmp) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If Dim s,w For Each s In Split(guildsubscribers(tmp),";") w = getSetting(CookName(s) + "_when","") If w = "" Print "Removing " + s + getSetting(CookName(s) + "_properties","") Call GuildUnsubscribe2(tmp,s) changes = true End_If Next End_If If cmd = "3fund" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If tmp = input("guildsel") Dim value = Int(input("txtBox")) If value <= 0 Speak guilford,$AGENT,"Write how much you want to give to: "+guildnames(tmp) Return End_If If getMoneyFrom($AGENT,value) guildmoney(tmp) = value+guildmoney(tmp) Speak guilford,$AGENT,"Done, sir: "+value+" coins stored for guild: "+guildnames(tmp) changes = true Else Speak guilford,$AGENT,"You don't own that money." End_If End_If If cmd = "8type" If guildnames(tmp) = null And Not($AGENT.master Or GuildHasDelegate(guildSubscribed($AGENT),tmp)) Speak guilford,$AGENT,msgNOCHIEF Return End_If If $AGENT.master tmp = input("guildsel") Else tmp = guildSubscribed($AGENT) End_If If war_engaged(tmp) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If If guildmoney(tmp) >= 5000 guildmoney(tmp) = guildmoney(tmp)-5000 If guildtypes(tmp) = "p" SetRemove guildtypes,tmp Else guildtypes(tmp)="p" End_If Speak guilford,$AGENT,"Done." changes = true Else Speak guilford,$AGENT,"It takes 5000 coins on guild's account for the type switching." End_If End_If If cmd = "join" If guildnames(tmp) <> null Speak guilford,$AGENT,"Thou shalt not join a guild when leading one." Else If Not(ProfileExists($AGENT.name)) Speak guilford,$AGENT,"You have to click on [SAVE] to save your game. Then retry." Return End_If Dim s = guildSubscribed($AGENT) If s <> null Speak guilford,$AGENT,"Thou have to leave " + guildnames(s) + " first." Return End_If If $AGENT.guildrequest <> null And InStr(guildrequests(guildowner),$AGENT.name+";") Speak guilford,$AGENT,"Thy request was already recorded." Return End_If If tournament=2 Speak guilford,$AGENT,"Not allowed during tournament." Return End_If Call ClearGuildRequests($AGENT.name) guildrequests(guildowner) = guildrequests(guildowner) + $AGENT.name + ";" $AGENT.guildrequest = guildowner Speak guilford,$AGENT,"Your request for " + guildnames(input("guildsel")) + " has now to await approval from " + guildowner changes = true End_If End_If If cmd = "leave" Dim s = guildSubscribed($AGENT) If s = null Speak guilford,$AGENT,"You are not a member of any guild, sir." Return End_If If war_engaged(s) Speak guilford,$AGENT,"This guild is currently engaged in a conflict." Return End_If If tournament=2 Speak guilford,$AGENT,"Not allowed during tournament." Return End_If If LCase(tmp) = LCase(s) Speak guilford,$AGENT,"You own the guild you belong to, sir, perhaps you want to delete it." Return Else Speak guilford,$AGENT,GuildUnsubscribe(s,$AGENT) $AGENT.guild = null changes = true End_If End_If If cmd = "6status" If Not($AGENT.master) guildowner = $AGENT.guild End_If changes = doGuildStatus(guildowner,$AGENT,guilford) End_If If cmd = "7delegate" If guildnames(tmp) = null And Not($AGENT.master) Speak guilford,$AGENT,"You don't own any guild, sir." Return End_If If $AGENT.master tmp = input("guildsel") End_If If persname = "" Speak guilford,$AGENT,"Type the name of the person and repeat the command." Else If Not(GuildDelegate(tmp,persname)) Speak guilford,$AGENT,"It's not possible to delegate powers to -" + persname + "-" Else Speak guilford,$AGENT,"Done, sir." changes = true End_If End_If End_If If cmd = "8deldele" If guildnames(tmp) = null And Not($AGENT.master) Speak guilford,$AGENT,"You don't own any guild, sir." Return End_If If $AGENT.master tmp = input("guildsel") End_If If input("txtBox") = "" Speak guilford,$AGENT,"Type the name of the delegate and redo." Else If Not(GuildUndelegate(tmp,persname)) Speak guilford,$AGENT,"-" + persname + "- is not a delegate of this guild." Else Speak guilford,$AGENT,"Done, sir." changes = true End_If End_If End_If If Not(changes) Return End_If saveSetting "ctx_guildnames",guildnames saveSetting "ctx_guildlogos",guildlogos saveSetting "ctx_guildsubscribers",guildsubscribers saveSetting "ctx_guildrequests",guildrequests saveSetting "ctx_guildwebs",guildwebs saveSetting "ctx_guildfounded",guildfounded saveSetting "ctx_guildkills",guildkills saveSetting "ctx_guildmoney",guildmoney saveSetting "ctx_guilddelegates",guilddelegates saveSetting "ctx_guildtypes",guildtypes Dim new = NewItem(null,"msg",null,null,"type=msg,cmd=guilds_update") new.guildnames = guildnames new.guildlogos = guildlogos new.guildsubscribers = guildsubscribers new.guildmoney = guildmoney new.guildtypes = guildtypes MoveOutside new,"Underworld2" Dim new = NewItem(null,"msg",null,null,"type=msg,cmd=guilds_update") new.guildnames = guildnames new.guildlogos = guildlogos new.guildsubscribers = guildsubscribers new.guildmoney = guildmoney new.guildtypes = guildtypes MoveOutside new,"Underworld3" If uw4up Dim new = NewItem(null,"msg",null,null,"type=msg,cmd=guilds_update") new.guildnames = guildnames new.guildlogos = guildlogos new.guildsubscribers = guildsubscribers new.guildmoney = guildmoney new.guildtypes = guildtypes MoveOutside new,"Underworld4" End_If END_Function Function doWarOperation(input) 'Speak guildOps(input("warop")) Dim changes = false Dim agentname = $AGENT.name Dim myguild = guildSubscribed($AGENT) Dim guildowner = input("guildsel") Dim txtbox = input("txtBox") Dim cmd = input("warop") If Int(agentname) > 0 agentname = "_" + agentname ' fix for number nicks End_If If cmd = "1wardecl" If GuildPacific(myguild) Speak SYS,$AGENT,"A pacific guild can not declare any wars." Return End_If If getGuildCount(myguild) < 3 Speak SYS,$AGENT,"Your guild must have at least 3 members." Return End_If If guildnames(agentname) = null And Not(GuildHasDelegate(myguild,agentname)) Speak SYS,$AGENT,msgNOCHIEF Return End_If If war_engaged(myguild) Speak SYS,$AGENT,"Your guild is already engaged in a conflict." Return End_If If war_engaged(guildowner) Speak SYS,$AGENT,"The guild "+guildnames(guildowner)+" is already engaged in a conflict." Return End_If If guildowner = myguild Speak SYS,$AGENT,"You cannot fight against yourselves..." Return End_If If guildmoney(myguild) >= guildwar_cost guildmoney(myguild) = guildmoney(myguild)-guildwar_cost Else Speak SYS,$AGENT,"It takes "+guildwar_cost+" coins on guild's account for declaring a war!" End_If Dim w = war_enqueue(myguild,guildowner,guildwar_duration) Speak SYS,$AGENT,"So let there be war!" Call war_possiblynotify(w) If war_possiblynotify(w) Speak SYS,$AGENT,"Notification sent!" End_If changes = true End_If If cmd = "2warcancel" If Not($AGENT.master) Speak SYS,$AGENT,"Only a master can cancel an ongoing war." Return End_If If AreInWar(myguild,guildowner) SetRemove guildwars,myguild+"*"+guildowner SetRemove guildwars,guildowner+"*"+myguild Speak SYS,$AGENT,"Fatto." changes = true Else If SetContainsKey(guildwarsqueue,myguild+"*"+guildowner) Or SetContainsKey(guildwarsqueue,guildowner+"*"+myguild) SetRemove guildwarsqueue,myguild+"*"+guildowner SetRemove guildwarsqueue,guildowner+"*"+myguild Speak SYS,$AGENT,"Done." changes = true Else Speak SYS,$AGENT,"You are not fighting with: " + guildnames(guildowner) End_If End_If End_If If cmd = "6guildstatus" If $AGENT.master And myguild=null myguild = guildowner End_If changes = doGuildStatus(myguild,$AGENT,SYS) End_If If cmd = "del" 'Print "DELLL " & input("war") SetRemove pastwars,input("war") saveSetting "ctx_pastwars",pastwars End_If If Not(changes) Return End_If saveSetting "ctx_guildwars",guildwars saveSetting "ctx_guildwarsqueue",guildwarsqueue END_Function Function warroom_description Dim txt = "" + NewImage("panhelp.gif",16,16).html("Explain",$AGENT) + "Explain" txt = txt + "

Ongoing Guild Wars

" txt = txt + "

Wars in preparation

" txt = txt + war_indications() txt = txt + "

Past wars

" txt = txt + PanelHtml("pwar") txt = txt + "
Guilds directory" Return txt END_Function ' Unsubscribes a person from the guild owned by the ' specified guildowner. ' Returns a message to be diplayed to the user Function GuildUnsubscribe(guildowner,person) If GuildUnsubscribe2(guildowner,person.name) Return "You just left " + guildnames(guildowner) Else Return "You are not in that guild." End_If End_Function ' Unsubscribes a person from the guild owned by the ' specified guildowner. ' Returns a message to be diplayed to the user Function GuildUnsubscribe2(guildowner,personname) If InStr(guildsubscribers(guildowner),personname+";") Or InStr(guildrequests(guildowner),personname+";") guildsubscribers(guildowner) = Replace(guildsubscribers(guildowner),personname + ";","") guilddelegates(guildowner) = Replace(guilddelegates(guildowner),personname + ";","") guildrequests(guildowner) = Replace(guildrequests(guildowner),personname+";","") Return True End_If Return False End_Function ' Delegates chief powers on a person ' for the guild owned by the specified guildowner. ' Returns TRUE or FALSE Function GuildDelegate(guildowner,personname) If InStr(guildsubscribers(guildowner),personname+";") > 0 And Not(GuildHasDelegate(guildowner,personname)) guilddelegates(guildowner) = "" + guilddelegates(guildowner)+personname + ";" Return True End_If Return False End_Function ' UN-delegates chief powers on a person ' for the guild owned by the specified guildowner. ' Returns a message to be displayed to the user Function GuildUndelegate(guildowner,personname) If GuildHasDelegate(guildowner,personname) guilddelegates(guildowner) = Replace(guilddelegates(guildowner),personname + ";","") Return True End_If Return False End_Function Sub popMonster_Local(new) If mode=1 ' Appearence of Bronze Key If mkilled >= (targkilled * 0.20) And key5.container=null Move key5, new End_If ' Appearence of Copper Key If mkilled >= (targkilled * 0.60) And key1.container=null Move key1, new End_If End_If End_Sub Sub ClearGuildRequests(persname) Dim tmp For Each tmp in SetKeys(guildrequests) guildrequests(tmp) = Replace(guildrequests(tmp),persname+";","") Next End_Sub Function bank_description() Dim txt="This is Garumir's room.
" txt=txt+PanelHtml("pbank") If $AGENT.master txt = txt + "" txt = txt + "Total: " + sum txt = txt + "
Average: " + Int(sum/SetLen(garumir.accounts)) End_If Return txt End_Function Sub bank_onReceiveSorted If $AGENT.master Dim txt="" txt = txt + "" txt = txt + "Total: " + sum txt = txt + "
Average: " + Int(sum/SetLen(garumir.accounts)) Print $AGENT,txt End_If END_Sub EVENT gateroom.onLoose If $TARGET = c1 ' Teleport comers from other areas to correct places If IsPlayer($AGENT) And Not($AGENT.master) And $AGENT.Level > 1 Print $AGENT,"I cannot go across that gate. That area is reserved to those having Level=1." Return False End_If ' User is exiting to Area 3 MoveOutside $AGENT,"Underworld3" Return False End_If End_EVENT EVENT lake.onLoose If uw4up And $TARGET = wboat Dim item = getContainedType($AGENT,"bottle.antidote") ' Teleport comers from other areas to correct places If IsPlayer($AGENT) And Not($AGENT.master) And item = null Print $AGENT,"I cannot go cross the lake without some antidote, the whereabouts are haunted by snakes!" Return False End_If If item <> null Call drinkPotion($AGENT,item) End_If ' User is exiting to Area 4 MoveOutside $AGENT,"Underworld4" Return False End_If End_EVENT Sub getBranch(plant,person) If plant.branches > 0 Print "I'll take a branch." plant.branches = plant.branches-1 Call NewItem(person,"cymbidium","a branch of Cymbidium Goeringii",NewImage("cymbidium.gif",100,100),"pickable,showmode=2,icon=cymbidium.gif") Else Print person,"There's only one branch left, better not to torture this poor plant any more." End_If End_Sub ' At each new game day... Sub onNewDay_Local() If mode=2 Call updateKingdom("FULL") End_If Call MakeGuildIndex() Call saveContext() End_Sub ' Builds guildindex for sorting, by removing non-existent ' guilds, adding guilds with no kills Sub MakeGuildIndex() If SetLen(guildavglvl) < 0 Debug "Error in current context: guildavglvl empty - Restarting game" + getTime("dd/MM/yyyy HH:mm") Reset End_If Dim newgkset = NewSet() For Each k In SetKeys(guildnames) If SetContainsKey(guildavglvl,k) newgkset(k) = guildavglvl(k) Else newgkset(k) = 0 End_If Next guildindex = SetBuildIndex(newgkset,">") End_Sub Function KingdomStats() Dim tmp = "" tmp = tmp + "" + NewImage("panhelp.gif",16,16).html("Explain") + "Explain" Dim king = null Dim crown = getContainedType($WORLD,"crown") If Exists(crown) king = crown.container If IsCharacter(king) Dim kname = king.name If IsPlayer(king) kname = UserCardLink(kname) End_If tmp = tmp + ""+msgKingQueen(king.gender)+" in charge: "+kname tmp = tmp + "
Reign duration: " + king.kingdays + " days" Else tmp = tmp + "Nobody is currently governing at the castle." End_If Else tmp = tmp + "Nobody is currently governing at the castle." End_If tmp = tmp + "
Population: " + population + " villains" tmp = tmp + "
Richness: " + richness + " coins" tmp = tmp + "
Daily tax: " + taxes + " coins per person" If king.type < 10 killfriend = hkilled killenemy = mkilled Else killenemy = hkilled killfriend = mkilled End_If tmp = tmp + "
Kill ratio Enemies/Citizens: " + killenemy + ":" + killfriend tmp = tmp + "
Starved to death: " + starved + " (referred to yesterday)" tmp = tmp + "
"+msgKingQueen(king.gender)+"'s reputation: " + confidence + " out of 10" If $AGENT=king tmp = tmp + "
"+msgKingQueen(king.gender)+"'s Commands" tmp = tmp + PanelHtml("pthrone") tmp = tmp + "
" End_If Return tmp End_Function ' Taxes current players ' returns the gathered amount Function TaxPlayers(king,tax) Dim p Dim amount Dim tot = 0 For Each p In getPlayersIn($WORLD) amount = garumir.accounts(p.name) If p<>king And amount > tax garumir.accounts(p.name) = amount-tax tot = tot + tax End_If Next Return tot End_Function 'Unexpected Events Sub unexpectedEvents_Local() Dim n = RndInt(800) Dim i If n < 10 Dim monoset = NewSet() Dim myroom = RndSet(monstersPopupSet) monoset(myroom.id) = myroom Speak SYS,$WORLD,"Monsters invasion in " + monoset(1).name + "!!" For i = 1 to 10 Call popMonster(avgPowerHumans,monoset) Next Return End_If If n < 14 Speak SYS,$WORLD,"Villains have been poisoned!!" Dim villains = getPeopleName($WORLD,"a villain") For Each i In villains i.Health = -10 Next Return End_If If n < 16 Speak SYS,$WORLD,"Earthquake!!" Dim bombs = getObjectsType($WORLD,"bomb") For Each i In bombs If i.seller = null Call bombExplode(i,i.container,null) End_If Next Dim people = getCharactersIn($WORLD) For Each i In people If Right(i.container.id,7) <> "_myroom" 'Not in master ops! DropItems i End_If Next Return End_If If n < 10 Dim monoset = NewSet() Dim myroom = RndSet(monstersPopupSet) monoset(myroom.id) = myroom Speak SYS,$WORLD,"A legion of soldiers has arrived in " + monoset(1).name + "!!" For i = 1 to 10 Call popHuman(avgPowerMonsters,monoset) Next Return End_If End_Sub Function FormatTs(timestamp) Return Mid(timestamp,5,2) + "-" + Mid(timestamp,7,2) + ", " + Left(timestamp,4) + " at " + Mid(timestamp,9,2) + ":" + Right(timestamp,2) End Function Function FormatTimeInterval(timestamp) Return ""+Int(Mid(timestamp,7,2)) + " days, " + Int(Mid(timestamp,9,2)) + " hours, " + Int(Right(timestamp,2))+" minutes" End Function Function war_data(war) Dim owners = Split(war,"*") If guildwars(war) = null Return null End_If If guildnames(owners(1)) <> "" And guildnames(owners(2)) <> "" Dim data = NewSet(Replace(guildwars(war),";",",")) 'Update stats If guildmutualkills(owners(1)+"*"+owners(2))=null 'Speak SYS,$WORLD,"Updating stats for guild "+guildnames(owners(1)) Call getGuildKillStats(owners(1),false) End_If If guildmutualkills(owners(2)+"*"+owners(1))=null 'Speak SYS,$WORLD,"Updating stats for guild "+guildnames(owners(2)) Call getGuildKillStats(owners(2),false) End_If Dim diff = guildmutualkills(owners(1)+"*"+owners(2))-guildmutualkills(owners(2)+"*"+owners(1)) data("actdiff") = diff data("comp1") = owners(1) data("comp2") = owners(2) data("name") = guildnames(owners(1)) + " vs. " + guildnames(owners(2)) Return data Else Debug "ERROR - No more existing fighting Guilds : " + war Return null End_If End_Function Function war_queue_data(war) Dim owners = Split(war,"*") If guildwarsqueue(war) = null Return null End_If If guildnames(owners(1)) <> "" And guildnames(owners(2)) <> "" Dim data = NewSet(Replace(guildwarsqueue(war),";",",")) data("comp1") = owners(1) data("comp2") = owners(2) data("name") = guildnames(owners(1)) + " vs. " + guildnames(owners(2)) Return data Else Debug "ERROR - No more existing fighting Guilds : " + war Return null End_If End_Function 'Increments a Timestamp with another timestamp, 'interpreted as an offset of years,months,days,horus and mins 'Returns ts1+ts2 'Both timestamps must be in format yyyyMMddHHmm Function incTimeStamp(ts1,ts2) Dim y = Int(Left(ts1,4)) Dim m = Int(Mid(ts1,5,2)) Dim d = Int(Mid(ts1,7,2)) Dim h = Int(Mid(ts1,9,2)) Dim min = Int(Right(ts1,2)) Dim y2 = Int(Left(ts2,4)) Dim m2 = Int(Mid(ts2,5,2)) Dim d2 = Int(Mid(ts2,7,2)) Dim h2 = Int(Mid(ts2,9,2)) Dim min2 = Int(Right(ts2,2)) Dim monthlen = NewArray("31,28,31,30,31,30,31,31,30,31,30,31") Dim incr min = min + min2 If min >= 60 incr = Int((min-1)/60) h = h + incr min = min - incr * 60 End_If h = h + h2 If h >= 24 incr = Int((h-1)/24) d = d + incr h = h - incr * 24 End_If d = d + d2 Dim mdays = monthlen(m) If d >= mdays incr = Int((d-1)/mdays) m = m + incr d = d - incr * mdays End_If m = m + m2 If m >= 12 incr = Int((m-1)/12) y = y + incr m = m - incr * 12 End_If y = y + y2 Return "" + y + LeadingZero(m,"00") + LeadingZero(d,"00") + LeadingZero(h,"00") + LeadingZero(min,"00") End_Function ' Returns dividend MOD divisor ' will always be: 0 < result < divisor ' eg. 8 mod 7 = 1 ' 15 mod 7 = 1 Function Mod(dividend,divisor) If dividend < divisor Return dividend End_If divisor = Int(divisor) Dim x = Int(dividend / divisor) If x > 1 Return Mod(dividend-divisor,divisor) Else Return Int(dividend) - divisor * x End_If End_Function 'Returns a comment on the specified result Function WarComment(data,owner1,owner2,itsover) Dim var1 = guildmutualkills(owner1+"*"+owner2)-data("kills12") Dim var2 = guildmutualkills(owner2+"*"+owner1)-data("kills21") Dim rel1 = proportion_guild_kills(var1,owner1) Dim rel2 = proportion_guild_kills(var2,owner2) Dim txt If rel1 > guildwar_mindiff Or rel2 > guildwar_mindiff Dim phrase = " is winning " If itsover phrase = " has won " End_If If rel1 > rel2 txt = guildnames(owner1) + " " + phrase + " war with a difference of " + rel1 + " kills per player" Else txt = guildnames(owner2) + " " + phrase + " war with a difference of " + rel2 + " kills per player" End_If Else txt = "Even situation (difference of " + rel1 + "-" + rel2 + " kills per player)" End_If Return txt End_Function Function doUse_Local(person,item) If item.type = "book2" And mode=1 If person.type < 10 If asia.container = person.container And person.gender = "M" Display "- Well, here is my poem for you dear princess (reading from the book)...
...ehm....
...In the Arms of Love,
Heaven is Just a Heartbeat Away...
I'll be your Light in the Dark,
Your Shelter from the Rain..." asia.status = 2 asia.image = "asiabride.gif" person.hooked = asia asia.inlovewith = person.name Speak asia,person,"Ooooohhhhhh.... what a romantic man... let's go making our dreams come true!" Else Display "Hmmm... lots of nice poems here." End_If Return true Else Display "Can't use this thing. Rotfl!" End_If End_If If item.type = "gem.affinity" Kill item Call chooseAffinity(person,person.container) Return true End_If Return false End_Function Function doBite_Local(attacker,victim) If attacker.type=16 And victim = asia Display "I have to kill her. it's my doom." Return true 'Managed End_If Return false End_Function Function onAboutDie(person) If person.type = 7 Or person.type = 18 population = population-1 End_If If person = asia Call diePrincess() 'Die of princess - will work in main area only End_If End_Function Function onAboutAttack(attacker,victim,weapon) ' Humans cannot fight the princess If victim = asia And attacker.type < 9 Print "No, I don't think it's a good idea." Return True ' Cancel! End_If Return false ' Not cancelled End_Function EVENT jukebox.onLook() Print PanelHtml("pjukebox") If getContainedType($AGENT,"crown") <> null ' Is king? Print PanelHtml("pgetmoneyjb") End_If If ($AGENT.master) Print $AGENT,"Playlist" If SetLen(playlist) < 1 Print "No playlist." Else Dim x Dim msg = "<< Now Playing!" For Each x In playlist Print getTitle(x) + msg msg = "" Next End_If End_If $AGENT.__clearfocus = true End_EVENT ' doCommand ' multi-purpose event, catches command from ' context-sensitive menus and triggers an action EVENT doCommand_Local(input) cmd = input("guildop") If (cmd <> null) $AGENT.__lastcmd = cmd Return doGuildOperation(input) End_If Dim cmd = input("trackselector") If (cmd <> null) Return jukebox_play(cmd) End_If cmd = input("partnerselector") If (cmd <> null) Return start_marriage(cmd) End_If cmd = input("warop") If (cmd <> null) Return doWarOperation(input) End_If cmd = input("drinkselector") If (cmd <> null) Return doBuyDrink(input) End_If If input("affi") = 1 Return finishAffinity() End_If If input("privacyform") cmd = input("accept") If cmd = 1 $AGENT.privacyok = $AGENT.remoteAddr $AGENT.created = getTime("yyyyMMddHHmm") Else Print "Please read below and check the box to confirm you did it..." End_If End_If Return False END_EVENT Function jukebox_play(track) track = Int(track) If jukebox.Credits < 1 Print "Perhaps I should insert a coin first..." Return false End_If jukebox.Credits = jukebox.Credits-1 ' play! If SetLen(playlist) > 0 playlist(SetLen(playlist)+1) = Replace(jukebox.trackfiles(track),"$dir$",gameInfo("site")+"downloads") playlistLen(SetLen(playlistLen)+1) = jukebox.tracklen(track) Print "The song has been put in the queue." Else playlist = NewArray() playlistLen = NewArray() playlist(1) = Replace(jukebox.trackfiles(track),"$dir$",gameInfo("site")+"downloads") playlistLen(1) = jukebox.tracklen(track) Call doMusic(playlist(1),playlistLen(1)) End_If Return True End_Function EVENT jukebox.onReceiveItem If $TARGET.Cash < 1 Print "Better not." Return False Else $OWNER.Credits = $TARGET.Cash+$OWNER.Credits $OWNER.contents = $TARGET.Cash+$OWNER.contents Kill $TARGET Call $OWNER.onLook() End_If End_EVENT EVENT priest_onLook Print PanelHtml("pmarriage") $AGENT.__clearFocus=true $OWNER.__clearInfo=true End_EVENT ' Returns the possible partners for the specified person Function getPartners(person) Dim setpartners = NewSet() Dim p If person.married = null For Each p In getCharactersIn(person.container) If p.married = null If IsPlayer(p) Or p = asia setpartners(p.id) = "Marry " + p.name End_If End_If Next Else setpartners("clear") = "Clear previous wedding" End_If Return setpartners End_Function Function start_marriage(person) If Not(Exists(priest)) Print "Where is the priest?!?" Return false End_If If person = "clear" If reallyMarried($AGENT.name,$AGENT.married) Or ($AGENT.married = "Asia" And Exists(asia)) Speak priest,$AGENT,"Marriage is a holy binding. You will be bound until death will tear you apart." Else Speak chapel,$AGENT,"Be free. The binding had lost its value." End_If $AGENT.married=null Return End_If If Not(Exists(person)) Print "Where is who I was about to marry?!?" Return false End_If If agent.married <> null Speak priest,$AGENT,"Cannot be done. You seem to be married with " + $AGENT.married Return false End_If priest.marry2 = getObject(person) If debugmode=0 And $AGENT.remoteAddr = priest.marry2.remoteAddr Speak priest,$AGENT,"Hey! Find yourself a REAL partner!" Return false End_If priest.marry1 = $AGENT priest.step=1 Call doMusic("wedding.mid",7) Call priest_celebrate() End_Function Function priest_onHear(what,from) Dim myset 'Speak priest,chapel,"Said " + from +": " + what If priest.step=1 And (from<>priest.marry1 Or from.id<>priest.marry2.id) 'Identify witness myset = getPeopleName(chapel,what) If SetLen(myset) <> 1 Speak priest,chapel,"Bring here a witness and tell me his name" Else priest.witness = myset(1) If priest.witness = priest.marry1 Or priest.witness = priest.marry2 Or priest.witness.remoteAddr = priest.marry2.remoteAddr Or priest.witness.remoteAddr = priest.marry1.remoteAddr Speak priest,chapel,"No no, we need another person!" Else Speak priest,chapel,"So " + what + " will be your marraige's witness." priest.step=2 Call priest_celebrate() End_If Return End_If End_If If priest.step=2 And from=priest.marry1 'YES person1 If UCase(what) = "YES" priest.step=3 Call priest_celebrate() Return Else Speak priest,chapel,"Please no ambiguous answers, just say YES or NO!" End_If End_If If priest.step=3 And from=priest.marry2 'YES person2 If UCase(what) = "YES" priest.step=4 Call priest_celebrate() Return Else Speak priest,chapel,"Please no ambiguous answers, just say YES or NO!" End_If End_If End_Function Function priest_celebrate If priest.step < 1 Return End_If If Not(Exists(priest.marry1)) Speak priest,chapel,"I was celebrating a wedding, but one of the two just died." priest.step = 0 Return false End_If If priest.marry1.container <> chapel Speak priest,chapel,"I was celebrating a wedding. Where did " + priest.marry1.name + " go?" Return false End_If If Not(Exists(priest.marry2)) Speak priest,chapel,"I was celebrating a wedding, but one of the two just died." priest.step = 0 Return false End_If If priest.marry2.container <> chapel Speak priest,chapel,"I was celebrating a wedding. Where did " + priest.marry2.name + " go?" Return false End_If If priest.step > 1 And Not(Exists(priest.witness)) Speak priest,chapel,"I was celebrating a wedding, but the witness just died." priest.step = 0 Return false End_If If priest.step > 1 And priest.witness.container <> chapel Speak priest,chapel,"I was celebrating a wedding. Where did the witness " + priest.witness.name + " go?" Return false End_If If priest.step=1 Speak priest,chapel,"We are here together to celebrate the wedding between " + priest.marry1.name + " and " + priest.marry2.name + "... Who is the witness?" End_If If priest.step=2 Speak priest,chapel,"Would you " + priest.marry1.name + " marry " + priest.marry2.name + "?" End_If If priest.step=3 Speak priest,chapel,"Would you " + priest.marry2.name + " marry " + priest.marry1.name + "?" If priest.marry2 = asia Speak asia,chapel,"YES" priest.step=4 End_If End_If If priest.step=4 Speak priest,chapel,"" + priest.marry1.name + " give to " + priest.marry2.name + " the wedding ring!" End_If Return true End_Function EVENT whenPicked_Local() Dim type=MainType($OWNER) If type="sand" Print "It slips through my hands!" Kill $OWNER Return false End_If If type="ring" If IsCharacter($TARGET) And $TARGET.container=chapel And Exists(priest) ' Marriage If priest.step=4 And priest.marry2=$TARGET priest.step=5 If Not(priest_celebrate()) Return End_If If priest.step=5 Speak priest,$WORLD,"Just married!! " + priest.marry1.name + " and " + priest.marry2.name + "!!" priest.step=0 priest.marry1.married = priest.marry2.name priest.marry2.married = priest.marry1.name Call doMusic("wedding-procession.mid",2) chapel.effect = NewImage("flyingdoves.gif",400,200) Dim link=gameinfo("site")&"?page_id=40" Dim text = "The Reign of Graiel rejoices: "&UserCardLink(priest.marry1.name)&" and "&UserCardLink(priest.marry2.name)&" have realized their love dreams!"&Chr(13)&"The witness "&UserCardLink(priest.witness.name)&" with the priest and the villains altogether spread this happy announce! Long live!!" Journal "Just married: "&priest.marry1.name&" e "&priest.marry2.name & "!!",link,text,"news*utente:"&priest.marry2.name&"*utente:"&priest.marry1.name&"*utente:"&priest.witness.name End_If End_If End_If End_If End_EVENT Function reallyMarried(person,name) If LookupProfileDB(person,"married") = name Return true Else Return false End_If End_Function Sub priest_onDie() chapel.effect = null End_Sub Function doGuildStatus(guildowner,person,speaker) Dim changes = false If guildnames(guildowner) = null And Not(person.master Or GuildHasDelegate(guildSubscribed(person),guildowner)) Speak speaker,person,"You don't master any guild nor you have any delegation, sir, I can't tell you." Return false End_If If Not(person.master) And guildstatsgenwhen(guildowner) = getTime("hh") Speak speaker,person,"I cannot process all these numbers so often, please come back tomorrow." Return false End_If If guildowner = "" Speak speaker,person,"There's nothing to say about." Else Dim new = NewItem(person,"situation "+ guildnames(guildowner),"...",NewImage("pergamena.gif",100,100),"icon=scroll.gif,showmode=2,vanishing,pickable,volume=0") new.description = getGuildKillStats(guildowner,false) guildstatsgenwhen(guildowner) = getTime("hh") changes = true End_If Return changes End_Function ' gets title of a track Function getTitle(track) Dim i For i=1 To SetLen(jukebox.trackfiles) If track = Replace(jukebox.trackfiles(i),"$dir$",gameInfo("site")+"downloads") Return jukebox.tracklist(i) End_If Next Return "Unknown: " + track End_Function 'Updates the winners/losers profiles upon war result Sub war_result(data,owner1,owner2,person) Dim var1 = guildmutualkills(owner1+"*"+owner2)-data("kills12") Dim var2 = guildmutualkills(owner2+"*"+owner1)-data("kills21") Dim txt = "

End of War Report

" txt = txt + ""+guildnames(owner1) + " versus "+guildnames(owner2) + ""+Chr(13)+Chr(10) txt = txt + getTime("MM-dd, yyyy HH:mm") +Chr(13)+Chr(10) txt = txt + "

Recyprocal kills

" txt = txt + "Initially: " + data("kills12") + " - " + data("kills21") txt = txt + "
At end of war: " + guildmutualkills(owner1+"*"+owner2) + " - " + guildmutualkills(owner2+"*"+owner1) txt = txt + "
" Dim winners,losers Dim rel1 = proportion_guild_kills(var1,owner1) Dim rel2 = proportion_guild_kills(var2,owner2) Dim diffchange If rel1 > guildwar_mindiff Or rel2 > guildwar_mindiff If rel1 > rel2 winners = owner1 losers = owner2 diffchange = rel1 Else winners = owner2 losers = owner1 diffchange = rel2 End_If txt = txt + "

War's outcome

" txt = txt + ""+guildnames(winners) + " has won the war agains "+guildnames(losers) + " with a difference of " + diffchange + " kills per player over the enemy." txt = txt + "

War prize gathering

" txt = txt + "Base prize: "+guildwar_cost+" "+setDict("money")+"

" Dim money = harvestGoods("money",losers,guildwar_prizeperc) txt = txt + money(2) txt = txt + "
" Dim lev = harvestGoods("exp",losers,10*guildwar_prizeperc) txt = txt + lev(2) txt = txt + "

War Prize

" money(1)=money(1)+guildwar_cost ' Add base prize txt = txt + "
  • "+setDict("money")+": " + money(1) txt = txt + "
  • "+setDict("exp")+": " + lev(1) txt = txt + "

    War prize sharing

    " txt = txt + shareGoods("money",winners,money(1)) txt = txt + shareGoods("exp",winners,lev(1)) 'Debug txt Else txt = txt + "

    War's outcome

    " txt = txt + "No winner (difference of " + rel1 + "-" + rel2 + " kills per player)" End_If Dim new = NewItem(person,"war finish report",txt,NewImage("pergamena.gif",100,100),"icon=scroll.gif,showmode=2,pickable,volume=0") End_Sub 'Harvests the specified good from the specified guild 'according to the specified percentage 'what: "money"/"exp" 'guild: guild to be searched for goods 'perc: number from 0 to 1 - 0=harvest nothing 1=all Function harvestGoods(what,guild,perc) Dim txt = "" Dim res=0 Dim tmp = guildsubscribers(guild) If Not(InStr(tmp,guild)) tmp = guild + ";" + tmp End_If Dim subs = Split(tmp,";") Dim x Dim w txt = txt + "War prize gathering: " + setDict(what) + " from " + guildnames(guild) + "" +Chr(13)+Chr(10) 'Debug "---harvestGoods: " + guildnames(guild) + " for " + what For Each x In subs w = 0 If what="money" If garumir.accounts(x) > 0 w = Round(perc*garumir.accounts(x),0) res = res + w garumir.accounts(x) = garumir.accounts(x)-w End_If End_If If what="exp" Dim lev = LookupProfileDB(x,cstLEVEL) Dim esp = LookupProfileDB(x,cstEXP) Dim g = 10*lev+esp 'txt = txt + "g before:"+g w = Round(perc*g,1) res = res + w g = g-w 'txt = txt + "g after:"+g Call SaveProperty(x,cstLEVEL,Int(g/10),true) Call SaveProperty(x,cstEXP,Int(g-10*Int(g/10)),true) End_If txt = txt + "
  • " + x + " loses "+setDict(what)+": " + w +Chr(13)+Chr(10) 'Debug ". " + x + "("+what+"):" + w Next Dim retarr = NewArray() retarr(1)=Round(res,2) retarr(2)=txt Return retarr End_Function 'Shares the specified amount of specified good 'to the subscribers of the specified guild 'what: "money"/"exp" 'guild: guild to give the goods 'amount: amount of good Function shareGoods(what,guild,amount) Dim txt = "" Dim res=amount Dim tmp = guildsubscribers(guild) If Not(InStr(tmp,guild)) tmp = guild + ";" + tmp End_If Dim subs = Split(tmp,";") Dim x Dim w txt = txt + "Sharing war prize on " + guildnames(guild) + ": " + amount + " " + setDict(what) +Chr(13)+Chr(10) 'Debug "---shareGoods: " + guildnames(guild) + " for " + amount + " " + what Dim n = SetLen(subs) For Each x In subs If what="money" w = Round(amount/n,0) garumir.accounts(x) = garumir.accounts(x)+w amount = amount-w End_If If what="exp" w = Round(10*amount/n,2) Dim lev = LookupProfileDB(x,cstLEVEL) Dim esp = LookupProfileDB(x,cstEXP) Dim g = 10*lev+esp 'txt = txt + "g before:"+g g = g+w 'txt = txt + "g after:"+g Call SaveProperty(x,cstLEVEL,Int(g/10),true) Call SaveProperty(x,cstEXP,Int(g-10*Int(g/10)),true) w = Round(w/10,2) amount = amount-w End_If txt = txt + "
  • " + x + " wins "+setDict(what)+": " + w +Chr(13)+Chr(10) 'Debug ". " + x + " got ("+what+"):" + w n=n-1 Next Return txt End_Function EVENT bar.onHear If InStr($TARGET,"innkeeper") If Not(Exists(barman)) barman = NewCharacter(bar,"innkeeper","",NewImage("barman.gif",50,45),"type=3,pacific,nohands,steady,noteleport,showX=320,showY=104") Speak barman,barman.container,"Ready!!" AttachEvent barman,"onLook","barman_onLook" End_If Return End_If If Exists(barman) And barman.step > 0 Return barman_onHear($TARGET,$AGENT) End_If End_EVENT EVENT barman_onLook If getTime("dd/MM/yyyy")=smDay Speak $OWNER,$AGENT,"Oggi è il Sottomondo Day. Scegli qualcosa da bere, non si paga nulla!!" Else Speak $OWNER,$AGENT,"Some drink? Here we have fixed price: 4 coins for each drink" End_If Print PanelHtml("pbuydrink") $AGENT.__clearFocus=true $OWNER.__clearInfo=true End_EVENT EVENT doBuyDrink(input) Dim drink = input("drinkselector") If Not(Exists(barman)) Print $AGENT,"No more innkeper..." Return End_If If getTime("dd/MM/yyyy")=smDay Speak barman,$AGENT,"Quindi vuoi: " + arrDrinks(drink) + "... Arriva!","Pronti!","Ecco qua!","Occhio a non esagerare... eh eh eh!" newobj = NewItem($AGENT,arrDrinks(drink),arrDrinks(drink),NewImage("beer.gif",106,159),"pickable,showmode=2,icon=icodrink.gif,type=jar.beverage."+drink+",uses=3") AttachEvent newobj,"onUse","drink_onUse" Return End_If If getMoneyFrom($AGENT,4) Speak barman,$AGENT,"So you want: " + arrDrinks(drink) + "... Coming!","Ready!","Here it is!","Beware not to exaggerate... heh heh heh!" newobj = NewItem($AGENT,arrDrinks(drink),arrDrinks(drink),NewImage("beer.gif",106,159),"pickable,showmode=2,icon=icodrink.gif,type=jar.beverage."+drink+",uses=3") AttachEvent newobj,"onUse","drink_onUse" Else Speak barman,$AGENT,arrDrinks(drink)+"? It costs 4 coins!","and want to drink for free? Har! Har!","Tell me, you got the money?" End_If END_EVENT EVENT drink_onUse If $OWNER.uses <= 0 Return false End_If $OWNER.uses = $OWNER.uses-1 Print $AGENT,"Ahhhhhhh! I needed it." Dim sound = "bubblegurggle.wav" Dim effect = 0 If Right($OWNER.type,1) = "1" effect = 1 If RndInt(20)=1 Speak $AGENT,$AGENT.container,"*BURP!*" Print $AGENT,"*BURP!*" sound="burp.wav" End_If End_If If Right($OWNER.type,1) = "2" effect = 2 End_If If RndInt(2)=1 $AGENT.Health = $AGENT.Health+effect Else $AGENT.Health = $AGENT.Health-effect End_If Call levelParams($AGENT) PlaySound $AGENT,sound If $OWNER.uses = 0 Kill $OWNER End_If End_EVENT Function onUseWith_Local Dim success = false ' If $AGENT.type=4 ' Craftsman operations If ($OWNER = pot And $TARGET = fire) Or ($OWNER = fire And $TARGET = pot) If containsType(pot,"stone",false) pot.image = NewImage("potfull.gif",32,32) Dim x = getContainedType(pot,"stone") x.type = "metal" x.image = NewImage("fire.gif",32,32) x.icon = "fire.gif" x.name = "liquid metal" x.description = x.name x.pickable = false pot.description = "Is filled with burning hot metal." PlaySound $AGENT.container,"bubblegurggle.wav" $AGENT.__clearFocus=true Return true End_If If containsType(pot,"sand",false) pot.image = NewImage("potfull.gif",32,32) Dim x = getContainedType(pot,"sand") x.type = "glass" x.image = NewImage("fire.gif",32,32) x.icon = "fire.gif" x.name = "liquid glass" x.description = x.name pot.description = "Is filled with liquid fuso." PlaySound $AGENT.container,"bubblegurggle.wav" $AGENT.__clearFocus=true Return true End_If Return false End_If If ($OWNER = pot And $TARGET = martello) Or ($OWNER = martello And $TARGET = pot) If containsType(pot,"metal",false) Kill getContainedType(pot,"metal") pot.image = NewImage("pot.gif",32,32) pot.description = "A pot, iron build, so heavy." PlaySound $AGENT.container,"hitmetal1.wav" Dim new If $AGENT.Level < 3 new = NewItem($AGENT.container,"dagger","An ordinary dagger.",NewImage("sword1.gif",30,30),"type=weapon.01.01.0000.dagger,pickable,Power=1,Value=10,sound=sword1.wav,icon=sword1.gif,showmode=1,Level=1") End_If If $AGENT.Level >= 3 And $AGENT.Level < 5 new = MakeItem("weapon.02.02.0000.sword",$AGENT) Move new,$AGENT.container End_If If $AGENT.Level >= 5 new = MakeItem("weapon.03.03.0000.axe",$AGENT) Move new,$AGENT.container End_If If new <> null new.affinity = $AGENT.affinity new.material = "iron" new.designer = $AGENT.name success=true End_If Else Print "I think it's not the right thing to do. If only it was filled of burning metal..." End_If End_If If $OWNER = pot And (MainType($TARGET) = "armour" Or MainType($TARGET) = "shield" Or MainType($TARGET) = "helmet") If containsType(pot,"metal",false) Kill getContainedType(pot,"metal") pot.image = NewImage("pot.gif",32,32) pot.description = "A pot, iron build, so heavy." PlaySound $AGENT.container,"hitmetal1.wav" Dim new = NewItem($AGENT.container,$TARGET.name,$TARGET.description,$TARGET.image("N"),"pickable") new.Protection = $TARGET.Protection new.Level = $TARGET.Level new.Value = $TARGET.Value new.icon = $TARGET.icon new.showmode = $TARGET.showmode new.affinity = $AGENT.affinity new.material = $TARGET.material new.designer = $AGENT.name success=true Else Print "I think it's not the right thing to do. If only it was filled of burning metal..." End_If End_If If ($OWNER = pot And $TARGET = mould) Or ($OWNER = mould And $TARGET = pot) If containsType(pot,"glass",false) Kill getContainedType(pot,"glass") pot.image = NewImage("pot.gif",32,32) pot.description = "A pot, iron build, so heavy." PlaySound $AGENT.container,"hitmetal1.wav" Call NewItem($AGENT.container,"empty bottle","The bottle is now empty.",NewImage("bottlempty.gif",60,90),"pickable,Value=1,icon=bottlempty.gif,uses=0,showmode=2,type=bottle.empty") success=true Else Print "I think it's not the right thing to do. If only it was filled of liquid glass..." End_If End_If ' End_If If success Call advanceCheck($AGENT,"crafts",1) End_If Return success END_Function Sub chooseAffinity(person,nextroom) Dim tmp_room_id = person.id + "*affinity" NewRoom tmp_room_id Dim tmp_room = getObject(tmp_room_id) If tmp_room <> NULL tmp_room.name = "Affinity choice" tmp_room.image("N") = NewImage("castlemid.png",pre2.image("N").width,pre2.image("N").height) tmp_room.introductory = true tmp_room.dark = true SetPanel tmp_room,"paffinity" If person.affinity=null Call SetAffinity(person,"0/0/0/0") End_If Call doAffinity(person,0,0,0,0) person.__nextroom = nextroom person.Health=10 DropItems person Move person,tmp_room AttachEvent tmp_room,"onLoose","affinityRoom_onLoose" End_If End_Sub Sub doAffinity(person,e1,e2,e3,e4) Dim tot = 0+person.affinity(1)+person.affinity(2)+person.affinity(3)+person.affinity(4) Dim left = 4-tot If (left < 1) And ((e1+e2+e3+e4)>0) Print "
    No more points to place. You can decrease one parameter and move points onto another one.
    " Else If (e1>0 And person.affinity(1)<4) Or (e1<0 And person.affinity(1)>=-e1) person.affinity(1)=Int(person.affinity(1)+e1) End_If If (e2>0 And person.affinity(2)<4) Or (e2<0 And person.affinity(2)>=-e2) person.affinity(2)=Int(person.affinity(2)+e2) End_If If (e3>0 And person.affinity(3)<4) Or (e3<0 And person.affinity(3)>=-e3) person.affinity(3)=Int(person.affinity(3)+e3) End_If If (e4>0 And person.affinity(4)<4) Or (e4<0 And person.affinity(4)>=-e4) person.affinity(4)=Int(person.affinity(4)+e4) End_If End_If Print htmlAffinities(person) Dim tot = 0+person.affinity(1)+person.affinity(2)+person.affinity(3)+person.affinity(4) Dim left = 4-tot Print "Available affinity points: "+ left End_Sub Sub finishAffinity() Dim tot = 0+$AGENT.affinity(1)+$AGENT.affinity(2)+$AGENT.affinity(3)+$AGENT.affinity(4) If tot <> 4 Print "You must distribute exactly 4 affinity points!" Print htmlAffinities($AGENT) Return End_If person = $AGENT If person.__nextroom = "Start" person.__startnow = true End_If Move person,person.__nextroom ' Dim tmp_room_id = person.id + "*affinity" ' Kill tmp_room_id End_Sub EVENT Start.onReceive If Not($AGENT.__startnow) ' Normal operation Return onReceive() End_If $AGENT.__startnow = null Speak frontpagetext If $AGENT.type < 10 Display "Your adventure begins!" Else Display "The hunt for humans begins." End_If PlaySound $WORLD,"connect.wav" Speak "You have received a "+htmlIcon("scroll.gif","hints")+" paper scroll with precious hints - click it now to read it!" 'Speak "Click ["+htmlIcon("pansave.gif","Save")+"SAVE] to save your game and ["+htmlIcon("panmap.gif","Map")+" MAP] to see your position on the map. ["+htmlIcon("panhelp.gif","Help is in the commands panel!")+" Help] for the guide!" Dim newobj newobj = NewItem($AGENT,"important hints","

    Quick Start

    ",NewImage("pergamena.gif",100,100),"type=scroll.hints,pickable,showmode=2,icon=scroll.gif,vanishing") newobj.description = newobj.description & "
    1. Try to stay alive!
    2. " newobj.description = newobj.description & "
    3. Click ["+htmlIcon("pansave.gif","Save")+" SAVE] to save your game status, so that you don't have to restart from scratch if something bad happens. (Try now)
    4. " newobj.description = newobj.description & "
    5. If you cannot understand where you are, click ["+htmlIcon("panmap.gif","Map")+" MAP].
    6. " newobj.description = newobj.description & "
    7. As new player, you have got a 100 gold coins cerdit. Go get your coins at Garumir's bank. Find it on the south-east corner of the court.
    8. " newobj.description = newobj.description & "
    9. When you've got your money coins, spend it for buying something useful: Never hang around without a healing potion and buy yourself a weapon or spell and a shield!
    10. " newobj.description = newobj.description & "
    11. Remember: in the castle's catacombs you will find weak enemies to do some practice and increase Experience and Level.
    12. " newobj.description = newobj.description & "
    13. The main purpose of the game is to keep the control of the kingdom. There are many more secondary objectives: Discover them!
    14. " newobj.description = newobj.description & "
    15. If somebody bugs you, don't hesitate to tell the admin by posting on our Facebook page or our Forum
    16. " newobj.description = newobj.description & "
    " newobj.description = newobj.description & "

    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 + "

    Additional instructions for craftsmen

    " newobj.description = newobj.description + "

    Crafting a weapon

    " newobj.description = newobj.description + "a) Extract rock (one tablet is enough)
    b) Go to the blacksmith cell
    c) Put rock tablet into pot
    d) Place pot on fire (USE pot WITH fire): pot's contents become burning hot.
    e) Forge metal with the hammer (USE hammer WITH pot)" newobj.description = newobj.description + "

    Crafting a bottle

    " newobj.description = newobj.description + "a) Get sand (one bowl is enough)
    b) Go to the blacksmith cell
    c) Drop sand into pot
    d) Place pot on fire (USE fire WITH pot): pot's contents turns to liquid glass.
    e) Pour liquid glass into mould (USE pot WITH mould)" End_If If $AGENT.type=19 SetPanel $AGENT, "pdarken" End_If If $AGENT.type=14 Or $AGENT.type = 16 SetPanel $AGENT, "pvampire" If $AGENT.type = 14 ' If vampire start from 1st floor Move $AGENT,upstairs Return false End_If End_If If debugtype=1 Move book2, bedroom Move $AGENT, bedroom door1.open = 1 door1.locked = false Move silvering, $AGENT Return false End_If If debugtype=3 mode=1 Move $AGENT, cave7 Move cross, cave7 Move silvering, cave7 Call NewItem(cave7,"bomb","A bomb.",NewImage("bomb.gif",40,40),"type=bomb,pickable,Value=10,sound=match.wav,icon=bomb.gif,showmode=2") End_If If debugtype="gem" mode=1 Move gemini, $AGENT Move windspell, $AGENT 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=3") End_If Dim x = "him" Dim y = "him" If $AGENT.gender = "F" x = "her" y = "her" End_If Speak $WORLD,"There is a new visitor in the kingdom: "&$AGENT.name&"! Let's welcome "&x&" and help "&x&" find "&x&" way in this new world!" End_EVENT EVENT helpAffi Print "Need help regarding elements?" Print htmlAffinities($AGENT) END_EVENT EVENT affinityRoom_onLoose Kill $OWNER END_EVENT ' Enqueues a guild war Function war_enqueue(guild1,guild2,duration) Dim timestamp = getTime("yyyyMMddHHmm") guildwarsqueue(guild1 + "*" + guild2) = "timestamp=" + timestamp+";duration="+duration Return war_queue_data(guild1 + "*" + guild2) End_Function ' Starts a guild war Function war_start(guild1,guild2,duration,warname) 'Update stats Call getGuildKillStats(guild1,false) Call getGuildKillStats(guild2,false) Dim diff = guildmutualkills(guild1+"*"+guild2)-guildmutualkills(guild2+"*"+guild1) Dim timestamp = getTime("yyyyMMddHHmm") guildwars(guild1 + "*" + guild2) = "timestamp=" + timestamp + ";diff=" + diff + ";finishes=" + incTimeStamp(timestamp,duration)+";kills12="+Int(guildmutualkills(guild1+"*"+guild2))+";kills21="+Int(guildmutualkills(guild2+"*"+guild1)) saveSetting "ctx_guildwars",guildwars SetRemove guildwarsqueue,guild1+"*"+guild2 saveSetting "ctx_guildwarsqueue",guildwarsqueue Speak SYS,$WORLD,"The war "+warname+" HAS STARTED!!!" Return True End_Function ' Schedules a guild war Function war_schedule(guild1,guild2,declared,duration,notificationint) Dim now = getTime("yyyyMMddHHmm") guildwarsqueue(guild1 + "*" + guild2) = "timestamp="+declared+";notified=" + now+";duration="+duration+";starting=" + incTimeStamp(now,notificationint) 'incTimeStamp(now,"000000010000") saveSetting "ctx_guildwarsqueue",guildwarsqueue Return True End_Function ' Returns a set of the warrior guilds ' for the guild war operations Function getWarriorGuilds(person) Dim guilds = Copy(guildnames) Dim k If Not(person.master) For Each k In SetKeys(guilds) If guildtypes(k)="p" ' Pacific guild - remove from list SetRemove guilds,k End_If If getGuildCount(k) < 3 ' Too small guilds - remove SetRemove guilds,k End_If Next End_If k = guildSubscribed(person) If k <> null SetRemove guilds,k End_If Return guilds End_Function ' Is the specified guild owner menaced of war? ' If so, returns the war data, otherwise returns NULL Function war_menaced(guildowner) If guildowner = null Return false End_If Dim war Dim s = "*"+guildowner For Each war In SetKeys(guildwarsqueue) If InStr(war,s) > 0 Return war_queue_data(war) End_If Next Return null End_Function ' Is the specified guild owner running a war? ' If so, returns the war data, otherwise returns NULL Function war_running(guildowner) Dim war Dim s = "*"+guildowner Dim s1 = guildowner+"*" For Each war In SetKeys(guildwars) If InStr(war,s) > 0 Or InStr(war,s1) = 1 Return war_data(war) End_If Next Return null End_Function ' Is the specified guild owner ABOUT running a war? ' If so, returns the war data, otherwise returns NULL Function war_starting(guildowner) Dim war Dim s = "*"+guildowner Dim s1 = guildowner+"*" For Each war In SetKeys(guildwarsqueue) If InStr(war,s) > 0 Or InStr(war,s1) = 1 Return war_queue_data(war) End_If Next Return null End_Function ' Notifies the specified war to person ' w must not be null ' person must exist and must be of guild "comp2" Function war_notify(w,person) Dim link=gameinfo("site")&"?page_id=32" Dim text = "The guild "&guildnames(w("comp1"))&" has declared WAR to guild "&guildnames(w("comp2"))&". Notification has been received by "&UserCardLink(person.name)&" and now the fight will be unavoidable."&Chr(13)&"For further info read: Guilds War!" Journal ""&guildnames(w("comp1"))&" dichiara guerra a "&guildnames(w("comp2"))&"!",link,text,"news*utente:"&person.name&"*gilda:"&guildnames(tmp) Speak SYS,person,"The guild "+guildnames(w("comp1"))+" has declared war against you! ADVISE YOUR ALLIES!" If w("starting") <> null ' Starting time already defined If w("starting") > getTime("yyyyMMddHHmm") Speak SYS,$WORLD,"The war "+w("name")+" will start on "+FormatTs(w("starting"))+"!" Else ' Start now Call war_start(w("comp1"),w("comp2"),w("duration"),w("name")) End_If Else If war_schedule(w("comp1"),w("comp2"),w("timestamp"),w("duration"),notifyinterval) Speak SYS,$WORLD,"The war "+w("name")+" will start "+FormatTimeInterval(notifyinterval)+" from now!!!" Else Speak SYS,person,"Impossible to prepare the war." End_If End_If End_Function 'Tries to notify specified war 'Returns True if success, False otherwise ' w must not be null Function war_possiblynotify(w) Dim guild2 guild2=w("comp2") Dim p For Each p In getPlayersIn($WORLD) If p.guild=guild2 Call war_notify(w,p) Return True End_If Next Return False End_Function 'Tries to start preparing war 'Returns True if success, False otherwise ' w must not be null Function war_possiblystart() If SetLen(guildwarsqueue) > 0 Dim war For Each war In SetKeys(guildwarsqueue) Dim w = war_queue_data(war) If w("starting") <> null ' Starting time already defined If w("starting") <= getTime("yyyyMMddHHmm") ' Start now Call war_start(w("comp1"),w("comp2"),w("duration"),w("name")) Return True End_If End_If Next End_If Return False End_Function ' Returns some indications text for guilds war Function war_indications() Dim txt="

    Current rules

    " If Int(guildwar_mindiff)>0 txt = txt + "
    To win a war a guild must totalize at least "&Int(guildwar_mindiff)&" recyprocal kills more than competitors." Else txt = txt + "
    The guild with more recyprocal kills wins, even a single kill is decisive." End_If txt = txt + "
    The war prize for the winners is set to "&Round(100*guildwar_prizeperc,2)&"% of Levels, of Experience and of gold coins of losers." txt = txt + "
    The cost required for declaring a war is set to "&guildwar_cost&" gold coins." Return txt End_Function Function proportion_guild_kills(kills,guildowner) Dim n = getGuildCount(guildowner) If n > 0 Return Round(kills/n,2) End_If Return null End_Function ' Is the specified guild war-engaged? ' If so, returns 1=menaced 2=war running ' Else returns 0 Function war_engaged(guildowner) If war_starting(guildowner) <> null Return 1 End_If If war_running(guildowner) <> null Return 2 End_If Return 0 End_Function Sub Hints(person) Dim txt = "" If getContainedType(person,"scroll.hints") <> null ' Already has hints Return End_If If Not(ProfileExists(name)) txt = "Save your game now so that you can come back later and restart with your acquired Experience. Click [SAVE] now." End_If If txt = "" And person.Credits = 100 txt = "Perhaps you don't know, but at the beginning of the game you get 100 gold coins to be spent in equipment and useful items.
    Go to the Bank (south-east tower) and ask to Garumir your money. If you can't find the Bank, use the [MAP] to see its location." End_If If txt = "" And getContainedType(person,"bottle.potion") = null txt = "Don't go around without a healing potion...The castle is a dangerous place!!
    You can buy one at the castle's armory.

    If you can't find it, use the [MAP]." End_If If txt = "" And person.weapon = null txt = "You go around without weapons: brave or fool? Come on, get a weapon.
    If you are magician or dark entity you have to get an attack spell. Set weapons for default use with the [USE],[INFO] commands." End_If If txt = "" Dim pass = getSetting(CookName(person.name)+"_pass","") If pass = "" txt = "Protect your saved game with a password!
    To do so, just click [SAVE AND EXIT] at least once.
    When done you can log back in and, from that moment, you can use [SAVE] regularly to save your progresses.
    Come on, don't wait, do it now! [SAVE AND EXIT]" End_If End_If If txt <> "" txt = txt + "

    DROP this scroll on the floor for more useful hints." Dim new = NewItem(person,"Useful hints",null,NewImage("pergamena.gif",100,100),"type=scroll.hints,icon=scroll.gif,showmode=2,vanishing,pickable,volume=0") new.description = txt End_If End_Sub ' The following function is used just in the Italian version ' Please ignore it Function privacy() Dim txt Dim cr cr = "
    "&Chr(13) If True '$AGENT.privacyok <> null txt = "OK - You have read and accepted the Rules of the Game."&cr&cr txt = txt&"
    You should know that this game has got unique and hidden features, it brings many opportunities to have fun and meet new online friends: but it takes some time to explore all the potentials and really appreciate it!"&cr&cr txt = txt&"Please follow the precious hints you will receive upon entering the castle - a quick start for enjoying the game!
    "&cr&cr txt = txt&"Now click the FORWARD ARROW ICON to proceed into your new adventure, thank you."&cr&cr Else txt = panelhtml("pprivacy") End_If return txt End_Function ' The following function is used just in the Italian version ' Please ignore it Function privacytext() Dim txt Dim cr cr = "
    "&Chr(13) Dim infpr = "http://www.underworld-game.net/?page_id=337" Dim regol = "http://www.underworld-game.net/?page_id=63" txt = "This is a free game. "&cr txt = txt & "Before entering, however, you should be informed about the Rules of the game/terms of service."&cr&cr 'txt = txt & "Furthermore, you should read our privacy policy."&cr&cr txt = txt & "Please read this information now (each link opens a new tab), then check the box below and click on the button to continue."&cr 'txt = txt & ""&cr txt = txt & " By checking this box I declare I have read and accepted the rules of the game/terms of service."&cr&cr return txt End_Function ' The following function is used just in the Italian version ' Please ignore it EVENT pre1a.onLoose If $TARGET = p0a ' Check that we are have accepted privacy statement If False '$AGENT.privacyok=null Print "In order to enter the game, you must accept the rules of the game/terms of service." Return 0 End_If End_If End_EVENT END_SCRIPTS END_WORLD