Showing off what I have

Rainbow Dash
09 Jun 2014, 08:13
Hi guys, long time no speak. So, I havent given up, just had RL things to do. Ive still been learning and here is a look at what I have thus far:

<!--Saved by Quest 5.5.5173.27901-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Into the Unknown">
<gameid>a34c0789-173c-4d08-a256-59b6ae4c4a67</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<feature_limitinventory />
<feature_lightdark />
<feature_asktell />
<defaultbackground>Black</defaultbackground>
<defaultforeground>Wheat</defaultforeground>
</game>
<object name="The Darkness">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<alias>The Darkness.</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<enter type="script"><![CDATA[
PrintCentered ("<br/>The darkness, it is all around you and is seems as though it is all you have ever known. You know not who you are, where you are from or even where you are now. You are frightened, floating in a seemingly endless void of utter nothingness, only your thoughts and fears accompany you. Are you dead? No, that cant be right, you wouldnt be thinking these thoughts of that were true...but, are you? A lump of sheer terror rises in what would have been your throat, had you a body. You begin to panic, trying to thrash against the darkness, but it is fruitless without a physical form. This, this is what oblivion is like?<br/><br/>You try desperately to remain calm. You feel that by giving yourself some sort of identity, you can help to ease the terror that has crept into your mind.<br/><br/>What is your name?<br/><br/>")
get input {
player.alias = result
ClearScreen
PrintCentered ("So your name is " + player.alias + ".")
playergender = NewStringList()
list add (playergender, "Male")
list add (playergender, "Female")
PrintCentered ("<br/>Slowly, the terror settles, though you are still afraid. You have a name for yourself now, but you remember nothing before this vast, empty and terrifying darkness. The terror will return unless you continue to define who you are. By doing so, you may give yourself a sense of purpose. And that way, even if you are stuck in this place, wherever it may be, forever...you will have yourself and who you are.<br/><br/>You need to decide if you are...were...male or female.<br/><br/>")
ShowMenu ("Are you Male or Female?", playergender, false) {
player.gender = result
ClearScreen
PrintCentered ("There, calm returns for now. You have a sense of who you are now, though the name and gender you have chosen for yourself are entirely made up, they comfort you. You know now that your self hasnt been obliterated by...whatever brought you to this place. For the time being, you are content in this dark place, though still frightened by what led you here.<br/><br/>But fortunately for you, all things come to an end...even oblivion.<br/><br/>")
wait {
ClearScreen
MoveObject (player, A Forest Clearing)
}
}
}
]]></enter>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>alias</key>
<value>Name: !</value>
</item>
<item>
<key>gender</key>
<value>Gender: !</value>
</item>
<item>
<key>attack</key>
<value>Attack: !</value>
</item>
<item>
<key>defence</key>
<value>Defence: !</value>
</item>
<item>
<key>armour</key>
<value>Armour Class: !</value>
</item>
<item>
<key>hitpoints</key>
<value>Hit Points: !</value>
</item>
<item>
<key>equippedstatus</key>
<value>Weapon: !</value>
</item>
<item>
<key>wornstatus</key>
<value>Armour Worn: !</value>
</item>
<item>
<key>shieldstatus</key>
<value>Shield: !</value>
</item>
<item>
<key>playergold</key>
<value>Gold: !</value>
</item>
</statusattributes>
<attack type="int">1</attack>
<defence type="int">1</defence>
<armour type="int">0</armour>
<hitpoints type="int">20</hitpoints>
<equippedstatus>Fists</equippedstatus>
<wornstatus>Tatty Rags</wornstatus>
<shieldstatus>None</shieldstatus>
<volume type="int">20</volume>
<containerfullmessage>You cannot carry anymore items.</containerfullmessage>
<playergold type="int">0</playergold>
<object name="Fists">
<inherit name="editor_object" />
<inherit name="weapon" />
<displayverbs type="stringlist" />
<inventoryverbs type="stringlist">
<value>Equip</value>
</inventoryverbs>
<listalias>Fists</listalias>
<alias>Fists</alias>
<take type="boolean">false</take>
<drop type="boolean">false</drop>
</object>
</object>
</object>
<object name="A Forest Clearing">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<enter type="script"><![CDATA[
play sound ("Redwood Forest HD Nature Relaxation Video Just Nature Sounds 1080p HD.mp3", false, true)
TextFX_Typewriter ("\"Even Death does not last forever, nothing does.\" ~Unknown", 100)
PrintCentered ("<br/>You feel something against your back as you float in the darkness. It is soft, warm and comfortable. You can smell the sweet smell of plants, of vegetation. Wait, what!?<br/><br/>You snap your eyes open and for a moment, there is nothing but searing white light. You cover your eyes with a hand, a hand that you did not have just a moment ago. You can hear...you can hear birds!! And wind! <br/><br/>It takes a few minutes for your eyes to get adjusted to the light enough for you to look around and you smile at what you see. You are in a clearing in a forest! Its beautiful! You never thought for a moment that you would see something so wonderful. And while you cannot remember the last time that you were in one, you know just what it is. You spend many minutes looking around the clearing. Rabbits!! You spotted some rabbits! They are adorable. They snuffle around the edge of the clearing that you are in, looking in your direction cautiously from time to time as they rustle through the undergrowth looking for food.<br/><br/>You seem to be sat on a rock covered in a soft, green carpet of moss. It feels wonderful as you run your fingers through it. The rock can barely been seen at all the moss is so thick. You slump back onto the mossy bed, laughing in relief as you lay there, enjoying the sounds of the forest as they caress your ears, savouring every little smell, sight and sensation.<br/><br/>")
wait {
ClearScreen
PrintCentered ("You could happily lay here for a very long time, but you once again find yourself in a place that you do not know, though atleast this time you have a body and its not so dark. You certainly dont know if where you are is dangerous, though this clearing seems nice enough for now, but you cant stay, as much as you would like to.<br/><br/>You carefully pull yourself up to your feet, wobbling slightly as you look around the clearing. There seems to be a path heading off into the forest. Its been worn into the forest floor through years of semi-regular use. Seems there are people living...well...wherever it is that you have ended up. With a sigh, you leave the peace of the clearing behind you and head out into the forest.<br/><br/>You hope you find civilization soon, you wont last long out here in just the rags you are wearing. Where did they come from?")
wait {
ClearScreen
MoveObject (player, The Forest)
}
}
]]></enter>
</object>
<object name="The Forest">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<description><![CDATA[{img:powerclan oak tree.jpg}<br/><br/>You are in the forest. There is a spear lying on the ground here.]]></description>
<object name="Spear">
<inherit name="editor_object" />
<inherit name="weapon" />
<listalias>Spear</listalias>
<alias>Spear</alias>
</object>
</object>
<verb>
<property>equip</property>
<pattern>equip;draw;wear</pattern>
<defaultexpression>"You can't draw " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>unequip</property>
<pattern>unequip;sheathe;remove</pattern>
<defaultexpression>"You can't sheathe " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>attack</property>
<pattern>attack;fight;strike;kill</pattern>
<defaultexpression>"You can't attack " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>defend</property>
<pattern>dodge;defend;parry</pattern>
<defaultexpression>"You cannot dodge " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>flee</property>
<pattern>flee;run;run away;escape</pattern>
<defaultexpression>"You cannot run away from " + object.article + "."</defaultexpression>
</verb>
<type name="weapon">
<attackbonus type="int">0</attackbonus>
<damagebonus type="int">0</damagebonus>
<damagedicenumber type="int">1</damagedicenumber>
<damagedicesides type="int">4</damagedicesides>
<take />
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<equip type="script">
if (this.parent = game.pov) {
if (not game.pov.equipped = Fists and not game.pov.equipped = null) {
msg ("You put away your " + game.pov.equipped.alias + " and draw your " + this.alias + ".")
}
else {
msg ("You draw your " + this.alias + ".")
}
game.pov.equipped = this
this.inventoryverbs = Split ("Look at;Drop;Unequip", ";")
game.pov.equippedstatus = this.alias
}
else {
msg ("You don't have it.")
}
</equip>
<unequip type="script">
if (this.parent = game.pov) {
msg ("You put away your " + game.pov.equipped.alias + ".")
game.pov.equipped = Fists
this.inventoryverbs = Split ("Look at;Drop;Equip", ";")
game.pov.equippedstatus = "nothing"
}
else {
msg ("You don't have it.")
}
</unequip>
</type>
<type name="monster">
<defence type="int">0</defence>
<armour type="int">0</armour>
<hitpoints type="int">10</hitpoints>
<take type="boolean">false</take>
<attack type="script"><![CDATA[
if (not HasAttribute (player, "equipped")) {
player.equipped = fists
}
attackroll = GetRandomInt (1, 20) - this.defence + player.attack
attackroll = attackroll + player.equipped.attackbonus
if (attackroll > 10) {
damage = player.equipped.damagebonus
for (i, 1, player.equipped.damagedicenumber) {
damage = damage + GetRandomInt (1, player.equipped.damagedicesides) - this.armour
}
this.hitpoints = this.hitpoints - damage
if (this.hitpointsyour > 0) {
msg ("You swing " + player.equipped.alias + " and hit, doing " + damage + " points of damage; " + this.hurt)
}
else {
msg ("You swing your " + player.equipped.alias + " and hit, doing " + damage + " points of damage; " + this.death)
Death (this)
}
}
else {
msg ("You swing your " + player.equipped.alias + " and miss.")
}
]]></attack>
</type>
</asl>


Im working on figuring out how to add armour as I used the combat how to on the wiki for the monster and the weapons types. Trying to get a handle of the CDATA so that I can have it tell if you are already wearing armour, etc, etc. Let me know what you think.

Rainbow Dash
09 Jun 2014, 09:08
LOL. Im stuck. I created a object of the weapon type and gave it an attackbonus of 2.I then added to the scrips for weapons to add the attackbonus to the players attack attribute, however, its not updating on the status attributes. Any idea what I am doing wrong?

  <type name="weapon">
<attackbonus type="int">0</attackbonus>
<damagebonus type="int">0</damagebonus>
<damagedicenumber type="int">1</damagedicenumber>
<damagedicesides type="int">4</damagedicesides>
<take />
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<equip type="script">
if (this.parent = game.pov) {
if (not game.pov.equipped = Fists and not game.pov.equipped = null) {
msg ("You put away your " + game.pov.equipped.alias + " and draw your " + this.alias + ".")
attack = attack + player.equipped.attackbonus
}
else {
msg ("You draw your " + this.alias + ".")
}
game.pov.equipped = this
this.inventoryverbs = Split ("Look at;Drop;Unequip", ";")
game.pov.equippedstatus = this.alias
}
else {
msg ("You don't have it.")
}
</equip>
<unequip type="script">
if (this.parent = game.pov) {
msg ("You put away your " + game.pov.equipped.alias + ".")
game.pov.equipped = Fists
this.inventoryverbs = Split ("Look at;Drop;Equip", ";")
game.pov.equippedstatus = "nothing"
attack = attack - player.equipped.attackbonus
}
else {
msg ("You don't have it.")
}
</unequip>
</type>


Heh, never mind. I had the script in one of the 'else' statements but not in the others.

jaynabonne
09 Jun 2014, 12:12
Try "player.attack" instead of just "attack". The latter just creates a local variable that disappears when the script exits.

Rainbow Dash
09 Jun 2014, 12:43
jaynabonne wrote:Try "player.attack" instead of just "attack". The latter just creates a local variable that disappears when the script exits.


Nope, I tried that and it kept telling me that it was an invalid attribute name. As it stands now, the code below is working perfectly and updating as it should. I have even tested out the combat. And apart from a small bug where a negative damage number from an enemy would heal the player...its all doing what its supposed to.

<!--Saved by Quest 5.5.5173.27901-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="StackLibrary.aslx" />
<include ref="combat_lib.aslx" />
<include ref="inlinemenu_lib.aslx" />
<game name="Into the Unknown">
<gameid>a34c0789-173c-4d08-a256-59b6ae4c4a67</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<feature_limitinventory />
<feature_lightdark />
<feature_asktell />
<defaultbackground>Black</defaultbackground>
<defaultforeground>Wheat</defaultforeground>
</game>
<object name="The Darkness">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<alias>The Darkness.</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<enter type="script"><![CDATA[
PrintCentered ("<br/>The darkness, it is all around you and is seems as though it is all you have ever known. You know not who you are, where you are from or even where you are now. You are frightened, floating in a seemingly endless void of utter nothingness, only your thoughts and fears accompany you. Are you dead? No, that cant be right, you wouldnt be thinking these thoughts of that were true...but, are you? A lump of sheer terror rises in what would have been your throat, had you a body. You begin to panic, trying to thrash against the darkness, but it is fruitless without a physical form. This, this is what oblivion is like?<br/><br/>You try desperately to remain calm. You feel that by giving yourself some sort of identity, you can help to ease the terror that has crept into your mind.<br/><br/>What is your name?<br/><br/>")
get input {
player.alias = result
ClearScreen
PrintCentered ("So your name is " + player.alias + ".")
playergender = NewStringList()
list add (playergender, "Male")
list add (playergender, "Female")
PrintCentered ("<br/>Slowly, the terror settles, though you are still afraid. You have a name for yourself now, but you remember nothing before this vast, empty and terrifying darkness. The terror will return unless you continue to define who you are. By doing so, you may give yourself a sense of purpose. And that way, even if you are stuck in this place, wherever it may be, forever...you will have yourself and who you are.<br/><br/>You need to decide if you are...were...male or female.<br/><br/>")
ShowMenu ("Are you Male or Female?", playergender, false) {
player.gender = result
ClearScreen
PrintCentered ("There, calm returns for now. You have a sense of who you are now, though the name and gender you have chosen for yourself are entirely made up, they comfort you. You know now that your self hasnt been obliterated by...whatever brought you to this place. For the time being, you are content in this dark place, though still frightened by what led you here.<br/><br/>But fortunately for you, all things come to an end...even oblivion.<br/><br/>")
wait {
ClearScreen
MoveObject (player, A Forest Clearing)
}
}
}
]]></enter>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>alias</key>
<value>Name: !</value>
</item>
<item>
<key>gender</key>
<value>Gender: !</value>
</item>
<item>
<key>attack</key>
<value>Attack: !</value>
</item>
<item>
<key>defence</key>
<value>Defence: !</value>
</item>
<item>
<key>armour</key>
<value>Armour Class: !</value>
</item>
<item>
<key>hitpoints</key>
<value>Hit Points: !</value>
</item>
<item>
<key>equippedstatus</key>
<value>Weapon: !</value>
</item>
<item>
<key>wornstatus</key>
<value>Armour: !</value>
</item>
<item>
<key>shieldstatus</key>
<value>Shield: !</value>
</item>
<item>
<key>playergold</key>
<value>Gold: !</value>
</item>
</statusattributes>
<attack type="int">0</attack>
<defence type="int">1</defence>
<armour type="int">0</armour>
<hitpoints type="int">20</hitpoints>
<maxhitpoints type="int">20</maxhitpoints>
<equippedstatus>Fists</equippedstatus>
<wornstatus>Rags</wornstatus>
<shieldstatus>None</shieldstatus>
<volume type="int">20</volume>
<containerfullmessage>You cannot carry anymore items.</containerfullmessage>
<playergold type="int">0</playergold>
</object>
</object>
<object name="A Forest Clearing">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<enter type="script"><![CDATA[
play sound ("Redwood Forest HD Nature Relaxation Video Just Nature Sounds 1080p HD.mp3", false, true)
TextFX_Typewriter ("\"Even Death does not last forever, nothing does.\" ~Unknown", 100)
PrintCentered ("<br/>You feel something against your back as you float in the darkness. It is soft, warm and comfortable. You can smell the sweet smell of plants, of vegetation. Wait, what!?<br/><br/>You snap your eyes open and for a moment, there is nothing but searing white light. You cover your eyes with a hand, a hand that you did not have just a moment ago. You can hear...you can hear birds!! And wind! <br/><br/>It takes a few minutes for your eyes to get adjusted to the light enough for you to look around and you smile at what you see. You are in a clearing in a forest! Its beautiful! You never thought for a moment that you would see something so wonderful. And while you cannot remember the last time that you were in one, you know just what it is. You spend many minutes looking around the clearing. Rabbits!! You spotted some rabbits! They are adorable. They snuffle around the edge of the clearing that you are in, looking in your direction cautiously from time to time as they rustle through the undergrowth looking for food.<br/><br/>You seem to be sat on a rock covered in a soft, green carpet of moss. It feels wonderful as you run your fingers through it. The rock can barely be seen at all the moss is so thick. You slump back onto the mossy bed, laughing in relief as you lay there, enjoying the sounds of the forest as they caress your ears, savouring every little smell, sight and sensation.<br/><br/>")
wait {
ClearScreen
PrintCentered ("You could happily lay here for a very long time, but you once again find yourself in a place that you do not know, though atleast this time you have a body and its not so dark. You certainly dont know if where you are is dangerous, though this clearing seems nice enough for now, but you cant stay, as much as you would like to.<br/><br/>You carefully pull yourself up to your feet, wobbling slightly as you look around the clearing. There seems to be a path heading off into the forest. Its been worn into the forest floor through years of semi-regular use. Seems there are people living...well...wherever it is that you have ended up. With a sigh, you leave the peace of the clearing behind you and head out into the forest.<br/><br/>You hope you find civilization soon, you wont last long out here in just the rags you are wearing. Where did they come from?")
wait {
ClearScreen
MoveObject (player, The Forest)
}
}
]]></enter>
</object>
<object name="The Forest">
<inherit name="editor_room" />
<descprefix type="string"></descprefix>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<description><![CDATA[{img:powerclan oak tree.jpg}<br/><br/>You have left the clearing long behind you, travelling down the path that leads to gods knows where. You havent seen anyone or anything apart from woodland wildlife and they give you a wide birth. But this track had to be made by someone, or something at least man sized. After about an hour of walking, you come to a fork in the path. A large oak tree stands at the fork, the trail splitting at its base, one heading left, the other heading off to the right.<br/><br/>At the base of the tree you are able to spot something. Looks like a body. Oh...great. As you keep your distance, it doesnt appear that anyone else is around. ]]></description>
<object name="Dead Body">
<inherit name="editor_object" />
<inherit name="container_open" />
<alias>Dead Body</alias>
<listalias>Dead Body</listalias>
<drop type="boolean">false</drop>
<look>You take a closer look at the body and can see that it is clearly human, and has been dead for quite some time now as only a skeleton clothed in armour remains. Several of the teeth have been smashed out and the left side of the skull has been crushed. Well, he isnt using his equipment now is he?</look>
<feature_container />
<close type="boolean">false</close>
<open type="boolean">false</open>
<hidechildren />
<displayverbs type="stringlist">
<value>Look at</value>
</displayverbs>
<inventoryverbs type="stringlist">
<value>Look at</value>
</inventoryverbs>
<object name="Rusty Dagger">
<inherit name="editor_object" />
<inherit name="weapon" />
<take />
<alias>Rusty Dagger</alias>
<usedefaultprefix />
<attackbonus type="int">1</attackbonus>
<listalias>Rusty Dagger</listalias>
<look>Its old, chipped and rusty. However, it will still hurt if you ram it into someone...or something.</look>
</object>
<object name="Tatty Leather Armour">
<inherit name="editor_object" />
<inherit name="armour" />
<take />
<alias>Tatty Leather Armour</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<look>This armour is old, worn and torn in several places. It doesnt provide a great deal of protection, but its better than nothing.</look>
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<armourbonus type="int">1</armourbonus>
</object>
</object>
<exit alias="northwest" to="Taking the Left Path">
<inherit name="northwestdirection" />
<look>The path winds off into the left and the forest seems to get thicker as the path progresses.</look>
</exit>
<exit alias="northeast" to="Taking the Right Path">
<inherit name="northeastdirection" />
<look>You cant be sure, but you think that the forest starts to thin out in this direction.</look>
</exit>
</object>
<verb>
<property>equip</property>
<pattern>equip;draw;wear</pattern>
<defaultexpression>"You can't draw " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>unequip</property>
<pattern>unequip;sheathe;remove</pattern>
<defaultexpression>"You can't sheathe " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>attack</property>
<pattern>attack;fight;strike;kill</pattern>
<defaultexpression>"You can't attack " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>defend</property>
<pattern>dodge;defend;parry</pattern>
<defaultexpression>"You cannot dodge " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>flee</property>
<pattern>flee;run;run away;escape</pattern>
<defaultexpression>"You cannot run away from " + object.article + "."</defaultexpression>
</verb>
<turnscript name="attacktheplayerturnscript">
<enabled />
<script>
foreach (attacker, element_struct.attackers) {
do (attacker, "attackplayer")
}
</script>
</turnscript>
<object name="element_struct">
<attackers type="objectlist"></attackers>
</object>
<object name="Taking the Left Path">
<inherit name="editor_room" />
<alias>Woodland Path</alias>
<descprefix>You are on a </descprefix>
<exit alias="southeast" to="The Forest">
<inherit name="southeastdirection" />
</exit>
</object>
<object name="Taking the Right Path">
<inherit name="editor_room" />
<alias>Woodland Path</alias>
<descprefix>You are on a </descprefix>
<exit alias="southwest" to="The Forest">
<inherit name="southwestdirection" />
</exit>
</object>
<type name="weapon">
<attackbonus type="int">0</attackbonus>
<damagebonus type="int">0</damagebonus>
<damagedicenumber type="int">1</damagedicenumber>
<damagedicesides type="int">4</damagedicesides>
<take />
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<equip type="script">
if (this.parent = game.pov) {
if (not game.pov.equipped = null) {
msg ("You put away your " + game.pov.equipped.alias + " and draw your " + this.alias + ".")
player.attack = player.attack + this.attackbonus
}
else {
msg ("You draw your " + this.alias + ".")
player.attack = player.attack + this.attackbonus
}
game.pov.equipped = this
this.inventoryverbs = Split ("Look at;Drop;Unequip", ";")
game.pov.equippedstatus = this.alias
}
else {
msg ("You don't have one of them.")
}
</equip>
<unequip type="script">
if (this.parent = game.pov) {
msg ("You put away your " + game.pov.equipped.alias + ".")
this.inventoryverbs = Split ("Look at;Drop;Equip", ";")
game.pov.equippedstatus = "nothing"
player.attack = player.attack - this.attackbonus
}
else {
msg ("You don't have one of them.")
}
</unequip>
</type>
<type name="armour">
<armourbonus type="int">0</armourbonus>
<take />
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<equip type="script">
if (this.parent = game.pov) {
if (not game.pov.worn = null) {
msg ("You take off your " + game.pov.worn.alias + " and put on your " + this.alias + ".")
player.armour = player.armour + this.armourbonus
}
else {
msg ("You put on your " + this.alias + ".")
player.armour = player.armour + this.armourbonus
}
game.pov.worn = this
this.inventroyverbs = Split ("Look at;Drop;Unequip", ";")
game.pov.wornstatus = this.alias
}
else {
msg ("You do not have any of that.")
}
</equip>
<unequip type="script">
if (this.parent = game.pov) {
msg ("You take off your " + game.pov.worn.alias + ".")
game.pov.worn = Clothes
this.inventoryverbs = Split ("Look at;Drop;Equip", ";")
game.pov.wornstatus = "Clothes"
player.armour = player.armour - this.armourbonus
}
else {
msg ("You don't have any of that.")
}
</unequip>
</type>
<type name="shield">
<defencebonus type="int">0</defencebonus>
<take />
<inventoryverbs type="stringlist">
<value>Look at</value>
<value>Drop</value>
<value>Equip</value>
</inventoryverbs>
<equip type="script">
if (this.parent = game.pov) {
if (not game.pov.carried = null) {
msg ("You take off your " + game.pov.carried.alias + " and put on your " + this.alias + ".")
player.defence = player.defence + this.defencebonus
}
else {
msg ("You put on your " + this.alias + ".")
player.defence = player.defence + this.defencebonus
}
game.pov.carried = this
this.inventroyverbs = Split ("Look at;Drop;Unequip", ";")
game.pov.wornstatus = this.alias
}
else {
msg ("You do not have one of them.")
}
</equip>
<unequip type="script">
if (this.parent = game.pov) {
msg ("You take off your " + game.pov.carried.alias + ".")
this.inventoryverbs = Split ("Look at;Drop;Equip", ";")
game.pov.wornstatus = "None"
player.defence = player.defence - this.defencebonus
}
else {
msg ("You don't have one of them.")
}
</unequip>
</type>
<type name="monster">
<inherit name="weapon" />
<defence type="int">0</defence>
<armour type="int">0</armour>
<hitpoints type="int">10</hitpoints>
<take type="boolean">false</take>
<displayverbs type="stringlist">
<value>Look at</value>
<value>Attack</value>
</displayverbs>
<makedead type="script">
if (not GetBoolean (this, "dead")) {
this.alias = this.alias + " (dead)"
if (HasString (this, "lookwhendead")) {
monster.look = this.lookwhendead
}
else {
this.look = this.look + "It is quite clearly a dead " + this.alias + "."
}
this.dead = True
list remove (element_struct.attackers, this)
}
</makedead>
<attack type="script"><![CDATA[
if (not HasAttribute (game.pov, "equipped")) {
game.pov.equipped = Fists
}
do (this, "settoattack")
attackroll = GetRandomInt (1, 20) - this.defence + game.pov.attack
if (attackroll > 10) {
damage = game.pov.equipped.damagebonus
for (i, 1, game.pov.equipped.damagedicenumber) {
damage = damage + GetRandomInt (1, game.pov.equipped.damagedicesides) - this.armour
}
this.hitpoints = this.hitpoints - damage
if (this.hitpoints > 0) {
msg ("You swing " + game.pov.equipped.alias + " and hit, doing " + damage + " points of damage; " + this.hurt)
}
else {
msg ("You swing your " + game.pov.equipped.alias + " and hit, doing " + damage + " points of damage. It dies horribly." + this.death)
do (this, "makedead")
}
}
else {
msg ("You swing your " + game.pov.equipped.alias + " and miss.")
}
]]></attack>
<attackplayer type="script"><![CDATA[
attackroll = GetRandomInt (1, 20) - game.pov.defence + this.attackbonus
if (attackroll > 10) {
damage = this.damagebonus
for (i, 1, this.damagedicenumber) {
damage = damage + GetRandomInt (1, this.damagedicesides) - game.pov.armour
if (damage < 0) {
damage = 0
}
}
game.pov.hitpoints = game.pov.hitpoints - damage
msg (this.alias + " swings at you and hits, doing " + damage + " points of damage.")
if (this.hitpoints <= 0) {
msg ("You are dead!")
finish
}
}
else {
msg (this.alias + " swings at you and misses.")
}
]]></attackplayer>
<settoattack type="script">
if (not ListContains (element_struct.attackers, this) and not GetBoolean (this, "dead")) {
list add (element_struct.attackers, this)
}
</settoattack>
</type>
<type name="monsterarcher">
<inherit name="monster" />
<attackplayer type="script"><![CDATA[
attackroll = GetRandomInt (1, 20) - game.pov.defence + this.attackbonus
if (attackroll > 10) {
damage = this.damagebonus
for (i, 1, this.damagedicenumber) {
damage = damage + GetRandomInt (1, this.damagedicesides) - game.pov.armour
}
game.pov.hitpoints = game.pov.hitpoints - damage
msg (this.alias + " shoots an arrow at you and hits, doing " + damage + " points of damage.")
if (this.hitpoints <= 0) {
msg ("You are dead!")
finish
}
}
else {
msg (this.alias + " shoots an arrow at you and misses.")
}
]]></attackplayer>
</type>
</asl>


What I would really like to be able to do though, is have items on the monsters that are killed. Like, gold coins or potions.

Nevermind again, I figured that out using scripts to open the monster on its death and then have scripted objects using the monster as the parent.