SAMPLE COMBAT SYSTEM

I think Im Dead
16 Dec 2003, 00:20
The SAMPLE COMBAT SYSTEM(as it will be known now) is provided for open use and modification by all and may freely be used in whatever project/game/etc. without any recognition. All that is asked is that you contritbute your modifications to the public in the form of guides, further sample code, tutorials, help or whatever on these forums in the future. A quick "cheat sheet" can be found at the bottom, and for further reference you can find a somewhat-original copy of this file at http://s88880570.onlinehome.us/asl/qnetbat.asl. Blah blah blah.

The following was written quite a while ago, and while other modified inclinations of it exist, this has proven to be the most stable and balanced. That said, you are still offerered no assurance that it in it's entirety will work for you in your present situation. At most it is to be seen as a learning text to be modified and improved upon by any and all. This code has been heavily modified out of my game, and into this text and as such provides no guarantees, but merely is a base to work from with a minimal of "filling in the blanks" to figure out and do. I'm not looking for any recognition or criticism, aim any praise or code picking directly towards anyone else who chooses to learn from or use this code in the form of advice and contributions.

The first step of adding this code to an ASL file is understanding it, but as that is no fun, here's a simple guide of what you need to copy and paste(the why and where will be discussed as well).


"The First Bit of Code"

This combat engine utilizes time(or a "game tick"; "tick") to bring combat to life. Players receive
a roundtime for any combat action taken from attempting to strike an opponent to taking a defensive
stance preparing to block an enemy. This roundtime is by default calculated by a crude math funciton
derived from a player's dexterity(DEX). The game tick controls combat actions and is meant to be
used to control other basic player functions as well, once you get used to the system structure, you
will find it easy to incorporate it all over as well.


CODE EXPLAINED

startscript { 'This is defining our servers startscript, it sets initial variables for time and such'
set numeric <second-time; 00>'This is all self-explanatory the game stores time intervals in '
property <game.info; second-time=00>'numeric variables and rights them to a game.info object. '
set numeric <minute-time; 00>'This is basically cosmetic, it helps to format the time, and '
property <game.info; minute-time=00>'follows along the building structure of objects storing '
set numeric <hour-time; 00>'properties. '
property <game.info; hour-time=00>' '
set numeric <player.count; 0>'These aren't implemented yet, but were going to be expanded. '
set numeric <object.count; 0>' NOT IMPLEMENTED '
set string <player.list; null>' NOT IMPLEMENTED '
set string <format.objects; null>' NOT IMPLEMENTED '
}
player startscript {
panes off 'This is a preference of mine, can be on or off.'
background <black> 'Again preference, can be set to any
foreground <white> 'available color. '
create room <player%userid%-r-hand>'These give the player the ability to hold objects in'
property <player%userid%-r-hand; held=null>'hands, it is left open for some definition '
property <player%userid%-r-hand; held-name=null>'eventually support ambidexterity as well'
property <player%userid%-r-hand; held-short=a bare fist>'as choosing to be left or right'
property <player%userid%-r-hand; held-display=nothing>'handed'
create room <player%userid%-l-hand> 'Same as above'
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
set string <name; $name(%userid%)$> 'Defines display name variable as the entered Quest name'
set numeric <age; $rand(16;35)$> 'Defines a random age for the player(novelty)'
property <player%userid%; name=$capfirst(#name#)$> 'Formats the name and gives to player object'
property <player%userid%; alias=$capfirst(#name#)$> 'Sets the display name'
property <player%userid%; race=Human> 'Sets the player's race(novelty)'
property <player%userid%; sex=Male> 'Sets the player's sex(novelty)'
property <player%userid%; level=0> 'Sets the player's level(novelty for now, but can be expanded)'
property <player%userid%; age=%age%> 'Applies the afore mentioned random age'
property <player%userid%; sexdesc=him> 'Provides accurate description when using actions'
property <player%userid%; sexposs=his> 'Same as above'
property <player%userid%; visibility=1> 'Implemented for future use in redefining the "look" command'
property <player%userid%; look=You see $objectproperty(player%userid%; name)$ the $objectproperty(player%userid%; race)$.|n> 'Defines a default look description to override Quest default'
property <player%userid%; stance=5> 'Puts the player by default in a defensive stance'
property <player%userid%; stance-display=defensive> 'Describes the above'
property <player%userid%; offhand=player%userid%-l-hand> 'Implemented for future support of choosing left-handed or right-handed'
property <player%userid%; mainhand=player%userid%-r-hand> 'Same as above'
property <player%userid%; readied=null> 'Set as null(empty handed)'
property <player%userid%; wielded=null> 'Same as above'
property <player%userid%; as-boost=0> 'Set to zero(no boost) property given for object/spells that provide generic attack boost'
property <player%userid%; ds-boost=0> 'Same as above but for generic defense boost'
property <player%userid%; player> 'Defines as a human controlled object'
property <player%userid%; STR=$rand(20;100)$> 'Supplies random STRENGTH(STR) stat to initially start off with'
property <player%userid%; CON=$rand(20;100)$> 'Supplies random CONSTITUTION(CON) stat to initially start off with'
property <player%userid%; DEX=$rand(20;100)$> 'Supplies random DEXTERITY(DEX) stat to initially start off with'
property <player%userid%; INT=$rand(20;100)$> 'Supplies random INTELLIGENCE(INT) stat to initially start off with'
property <player%userid%; WIS=$rand(20;100)$> 'Supplies random WISDOM(WIS) stat to initially start off with'
property <player%userid%; AUR=$rand(20;100)$> 'Supplies random AURA(AUR) stat to initially start off with'
property <player%userid%; CHA=$rand(20;100)$> 'Supplies random CHARISMA(CHA) stat to initially start off with'
property <player%userid%; DIS=$rand(20;100)$> 'Supplies random DISCIPLINE(DIS) stat to initially start off with'
property <player%userid%; engaged=no> 'Set to no(not engaged in combat) used by combat system'
property <player%userid%; enemies=0> 'Not engaged to any enemies so set to zero, used by combat system'
property <player%userid%; attacking=null> 'Not currently attacking anybody or thing, set to null'
property <player%userid%; stealth=0> 'A factor included for integration with a hiding system, ie; for redefined LOOK command'
property <player%userid%; visibility=1> 'Included for integration with a hiding system, ie; for redefined LOOK command'
property <player%userid%; spotted=0> 'Included for integration with a hiding system, ie; for redefined LOOK command'
set numeric <HP-temp; $objectproperty(player%userid%; CON)$ + $objectproperty(player%userid%; AUR)$> 'Step in stat-based Hit Point calculation'
set numeric <HP; %HP-temp% /4> 'step in stat-based Hit Point calculation'
property <player%userid%; HP-MAX=%HP%> 'Assigns stat-based Hit Point maximum'
property <player%userid%; HP=%HP%> 'Assigns current Hit Points out of maximum possible'
set numeric <player%userid%; 0> 'Not documented yet'
property <player%userid%; rt=0> 'Defines a natural zero roundtime property, a player can only act with a roundtime of zero'

}


Those two pieces of code are the server and player startscripts, they define properties and variables necessary for the engine to work properly. As you can see from the code,
we are assigning properties to an object called, player%userid%, this is the name of the default player object and literally translates to player1, player2, or whatever the
players ID generated by QuestNet is. Object properties are a bit easier to work with than status variables, and as this engine was created before scoping status variables were
implemented, it widely uses object properties, for players and most things alike. By definition the games infrastructure is "object-oriented" in the sense that, there are
"MASTER OBJECTS" that control all objects of their type. The current damage system is a good example(though in later versions was redefined, this manner will be easiest for
beginners to learn). Objects such as 'a broadsword' are tied to a master weapon-type of broadsword. This allows you to have all subsequent broadswords adopt the properties and
actions of the master object. This could be done in a manner using ASL's type properties, but instead was done through a literal sense so once in game, commands could be used
to create an entirely new type of object with it's own changable properties from within the environment. The ASL type properties would not be as easily modified, so the decision
was made. A broadsword does for example does swinging, stabbing and slashing damage, and has linked damage scales and damage messages in the master object. Eventually this was
updated to a more "on the fly" and random system, but that turned into a d20 based battle system entirely unrelated. Less talky more codey.



disconnect {
set string <disconnecting.player; player%userid%>
for each object in <player%userid%-l-hand> move <#quest.thing#; arena>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
for each object in <player%userid%-r-hand> move <#quest.thing#; arena>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
for <local.enemies; 1; $objectproperty(player%userid%; enemies)$> {
set string <disengage.enemy; $objectproperty(player%userid%; enemy-%local.enemies%)$>
set numeric <enemy.subtract; $objectproperty(#disengage.enemy#; enemies)$ - 1>
set numeric <local.subtract; $objectproperty(player%userid%; enemies)$ - 1>
property <player%userid%; enemy-%enemies%=null>
for <enemy.enemies; 1; $objectproperty(#disengage.enemy#; enemies)$> if ( $objectproperty(#disengage.enemy#; enemy-%enemy.enemies%)$ = #disconnecting.player# ) then {
property <#disengage.enemy#; enemy-%enemy.enemies%=null>
property <#disengage.enemy#; enemy-%enemy.enemies%-distance=null>
property <#disengage.enemy#; enemies=%enemy.subtract%>
if ( $objectproperty(#disengaged.enemy#; enemies)$ = 0 ) then property <#disengaged.enemy#; engaged=no>
}
property <player%userid%; enemy-%enemies%-distance=null>
property <player%userid%; enemies=%enemy.subtract%>
if ( $objectproperty(player%userid%; enemies)$ = 0 ) then property <player%userid%; engaged=no>
}
}


This is the disconnect string, it places all objects in a player's hands in the arena room(can easily be changed to #quest.currentroom[userid]#) and disengages from any combat situations
on both attack and defender ends. Speaking of hands lets put out the procedure and command to use the new take implemented.



define procedure <take-check> if here <#target-object#> then {
if property <#target-object#; take> then exec <take-do> else msg <You cannot take that.|n>}
else msg <I could not find what you were referring to.|n>
end define

'AT THE TIME THIS WAS MADE QUEST DIDN'T ALWAYS ALLOW A PROCEDURE CALLING ANOTHER PROCEDURE AND THUSLY THE TAKE PROCEDURE WAS FORCED TO CALL A COMMAND "TAKE-DO" HERE IT IS'
'IT CAN EASILY BE UPDATED TO BE MORE COHESIVE IF ONE WERE TO LOOK INTO IT'

command <take-do> if ( $objectproperty(player%userid%-r-hand; held)$ = null ) then {
set string <target-object; $getobjectname(#target-object#)$>
move <#target-object#; player%userid%-r-hand>
property <player%userid%-r-hand; held=#target-object#>
property <player%userid%-r-hand; held-name=$displayname(#target-object#)$>
property <player%userid%-r-hand; held-short=$objectproperty(#target-object#; short)$>
if property <#target-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$>
if property <#target-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$$objectproperty(#target-object#; suffix)$>
msg <You pick up the $displayname(#target-object#)$ with your right hand.|n>
}
else {
if ( $objectproperty(player%userid%-l-hand; held)$ = null ) then {
move <#target-object#; player%userid%-l-hand>
property <player%userid%-l-hand; held=#target-object#>
property <player%userid%-l-hand; held-name=$displayname(#target-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#target-object#; short)$>
if property <#target-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$>
if property <#target-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$$objectproperty(#target-object#; suffix)$>
msg <You pick up the $displayname(#target-object#)$ with your left hand.|n>
}
else msg <Both of your hands are full.|n>
}



Of course a way to drop objects from the newly created hands had to be created so here's the procedure


define procedure <drop>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to drop anything.|n> else {
if ( $objectproperty(player%userid%-r-hand; held-name)$ = #target-object# ) or ( $objectproperty(player%userid%-l-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%-r-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) then property <player%userid%; wielded=null>
set string <target-object; $objectproperty(player%userid%-r-hand; held)$>
move <#target-object#; #quest.currentroom[userid]#>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
msg <You drop $objectproperty(#target-object#; short)$ from your right hand.|n>
}
if ( $objectproperty(player%userid%-l-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <target-object; $objectproperty(player%userid%-l-hand; held)$>
move <#target-object#; #quest.currentroom[userid]#>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
msg <You drop $objectproperty(#target-object#; short)$ from your left hand.|n>
}
}
else msg <You are not holding that.|n>
}
}
end define


Eventually it came to mind that people would get confused having to wield what is in their left hand and ready what is in their right, and having to pick things up with the right hand, so a way to check the contents of your hands was created as well as a way to switch the contents of your hands, here are the procedures for that


define procedure <glance>
msg <You have $objectproperty(player%userid%-r-hand; held-display)$ in your right hand and $objectproperty(player%userid%-l-hand; held-display)$ in your left hand.|n>
end define
'
' SwAP PROCEDURES
'
define procedure <swap-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to swap your hands.|n> else {
set string <r-held; $objectproperty(player%userid%-r-hand; held)$>
set string <l-held; $objectproperty(player%userid%-l-hand; held)$>
if exists <#r-held#> and exists <#l-held#> then do <swap-both> else {
if exists <#r-held#> and not exists <#l-held#> then do <swap-right> else {
if exists <#l-held#> and not exists <#r-held#> then do <swap-left> else msg <You fidget with your hands.|n>
}
}
}
}
end define
define procedure <swap-right>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) then property <player%userid%; wielded=null>
set string <r-object; $objectproperty(player%userid%-r-hand; held)$>
move <#r-object#; player%userid%-l-hand>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
property <player%userid%-l-hand; held=#r-object#>
property <player%userid%-l-hand; held-name=$displayname(#r-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#r-object#; short)$>
if property <#r-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$>
if property <#r-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$$objectproperty(#r-object#; suffix)$>
msg <Ok.|n>
end define
define procedure <swap-left>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <l-object; $objectproperty(player%userid%-l-hand; held)$>
move <#l-object#; player%userid%-r-hand>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
property <player%userid%-r-hand; held=#l-object#>
property <player%userid%-r-hand; held-name=$displayname(#l-object#)$>
property <player%userid%-r-hand; held-short=$objectproperty(#l-object#; short)$>
if property <#l-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$>
if property <#l-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$$objectproperty(#l-object#; suffix)$>
msg <Ok.|n>
end define
define procedure <swap-both>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) or ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) or ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <r-object; $objectproperty(player%userid%-r-hand; held)$>
set string <l-object; $objectproperty(player%userid%-l-hand; held)$>
move <#r-object#; player%userid%-l-hand>
move <#l-object#; player%userid%-r-hand>
property <player%userid%-l-hand; held=#r-object#>
property <player%userid%-r-hand; held=#l-object#>
property <player%userid%-l-hand; held-name=$displayname(#r-object#)$>
property <player%userid%-r-hand; held-name=$displayname(#l-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#r-object#; short)$>
property <player%userid%-r-hand; held-short=$objectproperty(#l-object#; short)$>
if property <#l-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$>
if property <#l-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$$objectproperty(#l-object#; suffix)$>
if property <#r-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$>
if property <#r-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$$objectproperty(#r-object#; suffix)$>
msg <Ok.|n>
end define


!!!MORE CODE!!!


define room <arena>
properties <title=The Arena; sanct=0; look=Massive stone walls surround you on all sides forming the octagon you stand in. The dirt beneath your feet is hard packed and riddled with traces of footsteps, all around you see remnants of skin and bones.>
define object <item1>
alias <falchion>
properties <visibility=1; range=1; take; object; weapon; type=broadsword; weight=3; speed=0; bonus=5; prefix=an engraved mithril; short=an engraved mithril falchion; look=The sword appears to be well-crafted and the intricate elven markings engraved into it only increase it's alure.>
end define
define object <item2>
alias <club>
properties <visibility=1; range=1; take; object; weapon; weight=3; type=club; speed=0; bonus=5; prefix=a heavy iron; suffix=with a leather handle; short=a heavy iron club; look=The club is crudely crafted of oak and wrapped with a few strips of leather at the bottom for increased grip.>
end define
define object <item3>
alias <shield>
properties <visibility=1; take; object; shield; bonus=5; prefix=a small; short=a small shield; look=The small shield is covered with dents and scratches, it appears to have survived more than a few battles.|n>
end define
end define

define room <vault>
properties <title=The Vault; sanct=0; look=This is the most sacred area of the game, the items found here contain properties all other items in the game use during the many complicated procedures that are run.>
define object <game.info>
alias <game.info>
properties <look=null; hour-time=00; minute-time=00; second-time=00>
end define
define object <game.temp>
alias <game.temp>
properties <look=null; player.count=0; object.count=0; format.objects=null; format.players=null; player.list; object.list>
end define
define object <broadsword>
alias <broadsword>
properties <look=null; short=the broadsword; weight=3; speed=0; types=3; 1=swing; 1-plural=swings; 2=stab; 2-plural=stabs; 3=slash; 3-plural=slashes; 1-1=Light swing clips the shoulder!; 1-2=Well-aimed shot bruises the leg!; 1-3=Solid blow to the stomach... Those ribs might be broken!; 1-4=Huge swing breaks the spinal cord!; 1-5=Massive strike to the head caves in the skull!; 2-1=Weak jab to the leg, stop it that tickles!; 2-2=Quick stab to the chest draws blood!; 2-3=Skillfull strike to the leg... That should slow 'em down!; 2-4=Powerful lunge to the stomach leaves quite a mess!; 2-5=Perfect attack impales opponent on blade!; 3-1=Flick of the wrist leaves a few scratches on the face!; 3-2=Quick slash to the leg exposes some muscle!; 3-3=Solid strike to the left arm digs into the bone!; 3-4=Deep swipe to the stomach reveals the insides!; 3-5=Incredible slash to the neck removes the head!>
end define
define object <club>
alias <club>
properties <look=null; short=the club; weight=1; speed=0; types=1; 1=swing; 1-plural=swings; 1-1=Off-balance swing taps the shin. That might bruise!; 1-2=Sturdy shot to the forearm sprains the wrist!; 1-3=Strong blow to the shoulder knocks it out of the socket; 1-4=Powerful strike breaks both kneecaps!; 1-5=Enormous swing shatters the spine and ribcage to pieces!>
end define
define object <fist>
alias <fist>
properties <range=1; look=null; short=the fist weight=0; speed=0; types=1; 1=swing; 1-plural=swings; 1-1=Weak swing taps the forearm!; 1-2=Firm punch leaves the ribs sore!; 1-3=Quick jab to the face breaks the nose!; 1-4=Uppercut to the jaw breaks it!; 1-5=Two-handed hammer to the skull caves in the temples!>
end define
end define

define room <accounts>
properties <title=Account Administration; sanct=1; look=This is the area of the game where player accounts are stored.>
end define


These our default rooms, included in some, such as the vault and arena are objects. In the vault, these objects are all critical to game running, they are master objects and can be changed to effect the effects of all objects they control. Players should never enter this room. In the ARENA room you see working examples of the objects being controlled by the master objects. Weapons
are to be wielded(WIELD) before using, as shields are to be readied(READY). Eventually these commands would be extended to apply to whatever is in the wield(mainhand or default right) hand and ready(offhand or default left) hand, but as they stand they only effect weapons.



define procedure <ready>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to ready anything.|n> else {
set string <offhand; $objectproperty(player%userid%; offhand)$>
if ( $objectproperty(#offhand#; held)$ <> null ) then {
if property <$objectproperty(#offhand#; held)$; weapon> or property <$objectproperty(#offhand#; held)$; shield> then {
set string <readied; $objectproperty(#offhand#; held)$>
property <player%userid%; readied=#readied#>
msg <You ready $objectproperty(#readied#; short)$.|n>
}
else msg <You cannot ready that.|n>
}
else msg <You are not carrying anything to ready in your left hand.|n>
}
}
end define
define procedure <wield>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to wield anything.|n> else {
set string <mainhand; $objectproperty(player%userid%; mainhand)$>
if ( $objectproperty(#mainhand#; held)$ <> null ) then {
if property <$objectproperty(#mainhand#; held)$; weapon> then {
set string <wielded; $objectproperty(#mainhand#; held)$>
property <player%userid%; wielded=#wielded#>
msg <You wield $objectproperty(#wielded#; short)$.|n>
}
else msg <You cannot wield that.|n>
}
else msg <You are not carrying anything to wield.|n>
}
}
end define


That is the procedures that must be placed into your file to enable using of the commands WIELD and READY which call those procedures.


define procedure <stance defensive>
property <player%userid%; stance=5>
property <player%userid%; stance-display=defensive>
msg <You move into a defensive stance.|n>
end define
define procedure <stance guarded>
property <player%userid%; stance=4>
property <player%userid%; stance-display=guarded>
msg <You move into a guarded stance.|n>
end define
define procedure <stance neutral>
property <player%userid%; stance=3>
property <player%userid%; stance-display=neutral>
msg <You move into a neutral stance.|n>
end define
define procedure <stance forward>
property <player%userid%; stance=2>
property <player%userid%; stance-display=forward>
msg <You move into a forward stance.|n>
end define
define procedure <stance offensive>
property <player%userid%; stance=1>
property <player%userid%; stance-display=offensive>
msg <You move into a offensive stance.|n>
end define
define procedure <defensive-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance defensive> else msg <You haven't recovered enough from your last action to take a defensive stance.|n>
}
end define
define procedure <guarded-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance guarded> else msg <You haven't recovered enough from your last action to take a guarded stance.|n>
}
end define
define procedure <neutral-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance neutral> else msg <You haven't recovered enough from your last action to take a neutral stance.|n>
}
end define
define procedure <forward-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance forward> else msg <You haven't recovered enough from your last action to take a forward stance.|n>
}
end define
define procedure <offensive-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance offensive> else msg <You haven't recovered enough from your last action to take an offensive stance.|n>
}
end define


Before fighting you will want to understand your stances. Stances are how readied for attacking or defensding you are and modify your overall Attack Strength(AS) and Defense Strength(DS).
Gemstone fans may recognize those terms. After stances comes engagement. Engagement is basically challenging a foe, putting you in combat with it. You do not get a chance to decline an
engagement but you can retreat from your opponent and disengage when able. From being engaged in combat you can advance and retreat from your enemy to give you a tactical edge or use
weapons more effective at certain range as you see fit.



define procedure <engage-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to engage anything.|n> else {
if here <#target-object#> then {
if property <#target-object#; mob> or property <#target-object#; player> then {
if ( #target-object# = player%userid% ) then msg <You cannot engage yourself.|n> else {
if ( $objectproperty(#target-object#; hp)$ <= 0 ) then msg <That is already dead.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = yes ) then msg <You are already engaged.|n> else do <engage-detect>
}
else msg <You cannot engage that.|n>
}
else msg <I could not find what you were referring to.|n>
}
}
}
}
end define

define procedure <engage-detect>
if property <#target-object#; mob> then do <engage-mob>
if property <#target-object#; player> then do <engage-player>
end define

define procedure <engage-player>
set string <engager; $objectproperty(player%userid%; name)$>
set string <engagee; $objectproperty(#target-object#; name)$>
set numeric <engager.add.enemy; $objectproperty(player%userid%; enemies)$ + 1>
set numeric <engagee.add.enemy; $objectproperty(#target-object#; enemies)$ + 1>
property <player%userid%; enemies=%engager.add.enemy%>
property <#target-object#; enemies=%engagee.add.enemy%>
property <player%userid%; enemy-%engager.add.enemy%=#target-object#>
property <#target-object#; enemy-%engagee.add.enemy%=player%userid%>
property <player%userid%; enemy-%engager.add.enemy%-distance=5>
property <#target-object#; enemy-%engagee.add.enemy%-distance=5>
property <player%userid%; engaged=yes>
property <#target-object#; engaged=yes>
msg <You engage #engagee# in combat.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #engager# ) and ( $objectproperty(#quest.thing#; name)$ <> #engagee#) then msgto <#quest.thing#; #engager# engages #engagee# in combat.|n>
}
msgto <#target-object#; #engager# engages you in combat.|n>
end define

define procedure <engage-mob>
set string <engager; $objectproperty(player%userid%; name)$>
if property <#target-object#; prefix> then set string <engagee; $objectproperty(#target-object#; prefix)$ $objectproperty(#target-object#; name)$> else set string <engagee; $objectproperty(#target-object#; name)$>
set numeric <engager.add.enemy; $objectproperty(player%userid%; enemies)$ + 1>
set numeric <engagee.add.enemy; $objectproperty(#target-object#; enemies)$ + 1>
property <player%userid%; enemies=%engager.add.enemy%>
property <#target-object#; enemies=%engagee.add.enemy%>
property <player%userid%; enemy-%engager.add.enemy%=#target-object#>
property <#target-object#; enemy-%engagee.add.enemy%=player%userid%>
property <player%userid%; enemy-%engager.add.enemy%-distance=5>
property <#target-object#; enemy-%engagee.add.enemy%-distance=5>
property <player%userid%; engaged=yes>
property <player%userid%; engaged=yes>
msg <You engage #engagee# in combat.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #engager# ) then msgto <#quest.thing#; #engager# engages #engagee# in combat.|n>
}
end define

define procedure <disengage-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to disengage from combat.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <disengage>
}
}
end define

define procedure <disengage>
set string <disengager; player%userid%>
set string <disengager.name; $objectproperty(player%userid%; name)$>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You are not engaged.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ = 5 ) then {
set string <disengaged; $objectproperty(player%userid%; enemy-%enemies%)$>
if property <#disengaged#; prefix> then set string <disengaged.enemy; $objectproperty(#disengaged#; prefix)$ $objectproperty(#disengaged#; name)$> else set string <disengaged.enemy; $objectproperty(#disengaged#; name)$>
set numeric <disengager.enemies; $objectproperty(player%userid%; enemies)$ - 1>
set numeric <disengaged.enemies; $objectproperty(#disengaged#; enemies)$ - 1>
for <disengaging.enemy; 1; $objectproperty(#disengaged#; enemies)$> if ( $objectproperty(#disengaged#; enemy-%disengaging.enemy%)$ = #disengager# ) then {
property <#disengaged#; enemy-%disengaging.enemy%=null>
property <#disengaged#; enemy-%disengaging.enemy%-distance=null>
}
property <player%userid%; enemies=%disengager.enemies%>
property <#disengaged#; enemies=%disengaged.enemies%>
property <player%userid%; enemy-%enemies%-distance=null>
property <player%userid%; enemy-%enemies%=null>
property <player%userid%; attacking=null>
if ( $objectproperty(player%userid%; enemies)$ = 0 ) then property <player%userid%; engaged=no>
if ( $objectproperty(#disengaged#; enemies)$ = 0 ) then property <#disengaged#; engaged=no>
msg <You disengage from combat with #disengaged.enemy#.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #disengager.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #disengaged.enemy#) then msgto <#quest.thing#; #disengager.name# disengages from combat with #disengaged.enemy#.|n>
}
if property <#disengaged#; player> then msgto <#disengaged#; #disengager.name# disengages from combat with you.|n>
}
else {
for <engaged.enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%engaged.enemies%-distance)$ <= 4 ) then {
set string <engaged; $objectproperty(player%userid%; enemy-%engaged.enemies%)$>
if property <#engaged#; prefix> then set string <engaged.enemy; $objectproperty(#enaged#; prefix)$ $objectproperty(#engaged#; name)$> else set string <engaged.enemy; $objectproperty(#engaged#; name)$>
msg <You must retreat further in order to disengage from #engaged.enemy#.|n>
}
}
}
end define

define procedure <advance-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to advance.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <advance>
}
}
end define

define procedure <advance>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You must engage an enemy before you can advance.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ <= 1 ) then msg <You cannot advance any closer to your opponent.|n> else {
set string <advancee; $objectproperty(player%userid%; enemy-%enemies%)$>
set string <advancer; player%userid%>
set string <advancer.name; $objectproperty(player%userid%; name)$>
set string <advancee.name; $objectproperty(#advancee#; name)$>
set numeric <enemy.distance; $objectproperty(player%userid%; enemy-%enemies%-distance)$ - 1>
property <player%userid%; enemy-%enemies%-distance=%enemy.distance%>
for <advancee.enemies; 1; $objectproperty(#advancee#; enemies)$> if ( $objectproperty(#advancee#; enemy-%advancee.enemies%)$ = #advancer# ) then {
property <#advancee#; enemy-%advancee.enemies%-distance=%enemy.distance%>
}
if ( %enemy.distance% = 1 ) then {
property <#advancer#; rt= 1>
msg <You close in on #advancee.name#, coming within melee range.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# closes in on you, coming within melee range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# closes in on #advancee.name#, coming within melee range.|n>
}
}
if ( %enemy.distance% = 2 ) then {
property <#advancer#; rt= 2>
msg <You move within polearm range of #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# moves in on you, coming within polearm range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# moves to polearm range of #advancee.name#.|n>
}
}
if ( %enemy.distance% = 3 ) then {
property <#advancer#; rt= 2>
msg <You advance closer to #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# advances closer towards you.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# advances closer towards #advancee.name#.|n>
}
}
if ( %enemy.distance% = 4 ) then {
property <#advancer#; rt= 3>
msg <You begin advancing towards #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# begins advancing towards you.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# begins advancing on #advancee.name#.|n>
}
}
}
}
end define

define procedure <retreat-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to retreat.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <retreat>
}
}
end define

define procedure <retreat>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You must engage an enemy before you can advance.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ = 5 ) then msg <You cannot retreat any further without disengaging.|n> else {
set string <retreatee; $objectproperty(player%userid%; enemy-%enemies%)$>
set string <retreater; player%userid%>
set string <retreater.name; $objectproperty(player%userid%; name)$>
set string <retreatee.name; $objectproperty(#retreatee#; name)$>
set numeric <enemy.distance; $objectproperty(player%userid%; enemy-%enemies%-distance)$ + 1>
property <player%userid%; enemy-%enemies%-distance=%enemy.distance%>
for <retreatee.enemies; 1; $objectproperty(#retreatee#; enemies)$> if ( $objectproperty(#retreatee#; enemy-%retreatee.enemies%)$ = #retreater# ) then {
property <#retreatee#; enemy-%retreatee.enemies%-distance=%enemy.distance%>
}
if ( %enemy.distance% = 2 ) then {
property <#retreater#; rt= 1>
msg <You back away from #retreatee.name# to polearm range.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# backs away to polearm range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# backs away from #retreatee.name# to polearm range.|n>
}
}
if ( %enemy.distance% = 3 ) then {
property <#retreater#; rt= 2>
msg <You fall back a bit from #retreatee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# falls back a bit.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# falls back from #retreatee.name#.|n>
}
}
if ( %enemy.distance% = 4 ) then {
property <#retreater#; rt= 2>
msg <You withdraw, putting some distance between you and #retreatee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# withdraws, putting some distance between you.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# withdraws, putting distance between $objectproperty(player%userid%; sexdesc)$self and #retreatee.name#.|n>
}
}
if ( %enemy.distance% = 5 ) then {
property <#retreater#; rt= 3>
msg <You retreat from #retreatee.name# to a safe distance.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# retreats to a safe distance.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# retreats to a safe distance from #retreatee.name#.|n>
}
}
}
}
end define



The actual combat system, simply checks if your current weapon is acceptable to attack an enemy with at your current range(which changes when you advance or retreat), checks if you have a weapon to do so with, and then does the math and executes it. You want your total roll to equal over one hundred in order to successfully hit a target, it's determined by your attack strength, weapon enchantment, weapon bonus, and a d100 roll. The output is displayed and then a roundtime is figured and applied to the attacker. It's hard to explain, here's some archaic code to reference.


define procedure <range-check>
if ( $objectproperty(player%userid%; wielded)$ <> null ) then set string <weapon; $objectproperty(player%userid%; wielded)$> else set string <weapon; fist>
for <enemy.range; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemy.range%)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; enemy-%enemy.range%-distance)$ <= $objectproperty(#weapon#; range)$ ) then do <combat-info> else msg <You must advance within range of your target.|n>
}
end define

define procedure <engaged-check>
if ( $objectproperty(player%userid%; engaged)$ <> yes ) then msg <You are not engaged in combat.|n> else {
for <enemies.engaged; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies.engaged%)$ <> #target-object# ) then msg <You must engage your target first.|n> else do <range-check>
}
end define

define procedure <combat-check>
if ( player%userid% = #target-object# ) then msg <You cannot attack yourself.|n> else {
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to attack anything.|n> else {
if here <#target-object#> then {
if property <#target-object#; object> then msg <You cannot attack that.|n> else {
if property <#target-object#; mob> or property <#target-object#; player> then {
if ( $objectproperty(#target-object#; hp)$ <= 0 ) then msg <That is already dead.|n> else {
set string <mainhand; $objectproperty(player%userid%; mainhand)$>
if ( $objectproperty(player%userid%; wielded)$ = null ) and ( $objectproperty(#mainhand#; held)$ <> null ) then msg <You must wield a weapon or empty your hand before attacking.|n> else do <engaged-check>
}
}
}
else msg <I could not find what you were referring to.|n>
}
}
}
}
end define

define procedure <combat-info>
property <player%userid%; attacking=#target-object#>
set string <attacker; player%userid%>
set string <attacker-name; $objectproperty(player%userid%; name)$>
set string <defender; #target-object#>
set string <defender-name; $objectproperty(#defender#; name)$>
set numeric <defender-con; $objectproperty(#defender#; CON)$>
set numeric <defender-con-factor; %defender-con% / 10>
set string <attacker-wielded; $objectproperty(#attacker#; wielded)$>
if ( $objectproperty(#attacker#; wielded)$ <> null ) then set string <weapon-type; $objectproperty(#attacker-wielded#; type)$> else set string <weapon-type; fist>
set numeric <types; $objectproperty(#weapon-type#; types)$>
set numeric <attack-type-number; $rand(1;%types%)$>
set string <attack-type; $objectproperty(#weapon-type#; %attack-type-number%)$>
set string <attack-type-plural; $objectproperty(#weapon-type#; %attack-type-number%-plural)$>
set string <attacker-readied; $objectproperty(#attacker#; readied)$>
if ( #attacker-wielded# <> null ) then set string <attacker-wielded-short; $objectproperty(#attacker-wielded#; short)$> else set string <attacker-wielded-short; a bare fist>
set string <defender-wielded; $objectproperty(#defender#; wielded)$>
set string <defender-readied; $objectproperty(#defender#; readied)$>
set numeric <attacker-bonus; $objectproperty(#attacker#; as-boost)$>
set numeric <attacker-base-strength; $objectproperty(#attacker#; STR)$ / 4>
set numeric <attacker-base-speed; $objectproperty(#attacker#; DEX)$ / 20>
if ( #attacker-wielded# = null ) then set numeric <attacker-wielded-weight; 0> else {
if property <#attacker-wielded#; weight> then set numeric <attacker-wielded-weight; $objectproperty(#attacker-wielded#; weight)$> else set numeric <attacker-wielded-weight; $objectproperty(#weapon-type#; weight)$>
}
if ( #attacker-wielded# = null ) then set numeric <attacker-wielded-speed; 0> else {
if property <#attacker-wielded#; speed> then set numeric <attacker-wielded-speed; $objectproperty(#attacker-wielded#; speed)$> else set numeric <attacker-wielded-speed; $objectproperty(#weapon-type#; speed)$>
}
set numeric <attacker-wielded-rt; %attacker-wielded-weight% + %attacker-wielded-speed%>
set numeric <attacker-skill-rt; 10 - %attacker-base-speed%>
set numeric <attacker-rt; %attacker-wielded-rt% + %attacker-skill-rt%>
if ( #attacker-wielded# <> null ) then set numeric <attacker-wielded-bonus; $objectproperty(#attacker-wielded#; bonus)$> else set numeric <attacker-wielded-bonus; 0>
set numeric <attacker-stance; $objectproperty(#attacker#; stance)$>
set numeric <attacker-stance-base; %attacker-base-strength% / %attacker-stance%>
set numeric <defender-base-defense; $objectproperty(#defender#; DEX)$ / 4>
set numeric <defender-stance; $objectproperty(#defender#; stance)$>
set numeric <defender-stance-base; %defender-base-defense% * %defender-stance%>
if ( #defender-wielded# <> null ) then set numeric <defender-wielded-bonus; $objectproperty(#defender-wielded#; bonus)$ / 2> else set numeric <defender-wielded-bonus; 0>
if ( #defender-wielded# <> null ) then set numeric <defender-readied-bonus; $objectproperty(#defender-readied#; bonus)$> else set numeric <defender-readied-bonus; 0>
set numeric <defender-equip-bonus; %defender-wielded-bonus% + %defender-readied-bonus%>
set numeric <weapon-attack-strength; %attacker-stance-base% + %attacker-wielded-bonus%>
set numeric <attack-strength; %weapon-attack-strength% + %attacker-bonus%>
set numeric <defense-strength; %defender-stance-base% + %defender-equip-bonus%>
set numeric <d100; $rand(1;100)$>
set numeric <as-ds; %attack-strength% - %defense-strength%>
set numeric <endroll; %as-ds% + %d100%>
set numeric <endnum; %endroll% - 100>
if ( %endroll% <= 100 ) then set string <combat-message; A clean miss!> else {
set numeric <damage-num; %endnum% - %defender-con-factor%>
if ( %damage-num% <= 0 ) then set numeric <damage; 1> else set numeric <damage; %damage-num%>
set numeric <new-hp; $objectproperty(#defender#; hp)$ - %damage%>
if ( %endnum% >= 1 ) and ( %endnum% <= 20 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-1)$ %damage% damage!>
if ( %endnum% >= 20 ) and ( %endnum% <= 40 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-2)$ %damage% damage!>
if ( %endnum% >= 40 ) and ( %endnum% <= 60 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-3)$ %damage% damage!>
if ( %endnum% >= 60 ) and ( %endnum% <= 80 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-4)$ %damage% damage!>
if ( %endnum% >= 80 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-5)$ %damage% damage!>
property <#defender#; hp=%new-hp%>
}
if ( $objectproperty(#defender#; hp)$ <= 0 ) then set string <combat-message; #combat-message#|n#defender-name# slumps to the ground and ceases living!>
msg <You #attack-type# at #defender-name# with #attacker-wielded-short#!|nAS: %attack-strength% vs DS: %defense-strength% + d100 roll: %d100% = %endroll%|n#combat-message#|nRoundtime: %attacker-rt% seconds|n|n>
if not property <#defender#; mob> then msgto <#defender#; #attacker-name# #attack-type-plural# at you with #attacker-wielded-short#!|nAS: %attack-strength% vs DS: %defense-strength% + d100 roll: %d100% = %endroll%|n#combat-message#|n|n>
do <activate-rt>
end define


Now the RT procedure


define procedure <activate-rt>
property <player%userid%; rt=%attacker-rt%>
end define

I think Im Dead
16 Dec 2003, 00:24
The time running script makes all this come together, and it's a procedure to be included as well.


define procedure <time>
'
'Basic time running part of the script, goes through 24 hours of each day... Note: expand to include days, months, and years for wider range of use.
'
set numeric <second-time; $objectproperty(game.info; second-time)$ + 01>
if ( %second-time% >= 60 ) then {
set numeric <minute-time; $objectproperty(game.info; minute-time)$ +01>
set numeric <second-time; 0>
set string <s-format; %second-time%>
if ( $lengthof(#s-format#)$ = 1 ) then set string <second-time; 0%second-time%> else set string <second-time; %second-time%>
if ( %minute-time% >= 60 ) then {
set numeric <hour-time; $objectproperty(game.info; hour-time)$ +01>
set numeric <minute-time; 0>
set string <m-format; %minute-time%>
if ( $lengthof(#m-format#)$ = 1 ) then set string <minute-time; 0%minute-time%> else set string <minute-time; %minute-time%>
if ( %hour-time% >= 24 ) then {
set numeric <hour-time; 0>
set string <h-format; %hour-time%>
if ( $lengthof(#h-format#)$ = 1 ) then set string <hour-time; 0%hour-time%> else set string <hour-time; %hour-time%>
}
else set string <h-format; %hour-time%>
if ( $lengthof(#h-format#)$ = 1 ) then set string <hour-time; 0%hour-time%> else set string <hour-time; %hour-time%>
property <game.info; hour-time=#hour-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
}
else set string <m-format; %minute-time%>
if ( $lengthof(#m-format#)$ = 1 ) then set string <minute-time; 0%minute-time%> else set string <minute-time; %minute-time%>
property <game.info; minute-time=#minute-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
}
else set string <s-format; %second-time%>
if ( $lengthof(#s-format#)$ = 1 ) then set string <second-time; 0%second-time%> else set string <second-time; %second-time%>
property <game.info; second-time=#second-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
'
'Roundtime modifying part of the script.
'
for each object in game {
if property <#quest.thing#; rt> then {
if ( $objectproperty(#quest.thing#; rt)$ <> 0 ) then {
set numeric <#quest.thing#-rt; $objectproperty(#quest.thing#; rt)$ - 1>
property <#quest.thing#; rt=%#quest.thing#-rt%>
if ( $objectproperty(#quest.thing#; rt)$ = 0 ) then msgto <#quest.thing#; You feel ready to move again.|n>
}
}
}
'
'
'
timeron <time>
end define


And also the timer needs to be placed in the code for the time procedure to function.


define timer <time>
interval <1>
action do <time>
enabled
end define


In a cosmetic factor, you may want the timer to give off the actual time, you can set this with the following commands. They contain IF situations, I used user levels(usrlvl) as a way, ie; admins are a high user level, super admin can set clock, you can easily change this to something like if the $name(player%userid%)$ is equal to your usual name or whatever.


command <set-hour #new-hour#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-hour#)$ = 1 ) then set string <hour-time; 0#new-hour#> else set string <hour-time; #new-hour#>
property <game.info; hour-time=#hour-time#>
msg <You set the current hour to #new-hour#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}
command <set-minute #new-minute#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-minute#)$ = 1 ) then set string <minute-time; 0#new-minute#> else set string <minute-time; #new-minute#>
property <game.info; minute-time=#minute-time#>
msg <You set the current minute to #new-minute#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}
command <set-second #new-second#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-second#)$ = 1 ) then set string <second-time; 0#new-second#> else set string <second-time; #new-second#>
property <game.info; second-time=#second-time#>
msg <You set the current second to #new-second#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}


At the time this was made, Quest had a few more glitches than it does now, and wouldn't let one procedure reference another procedure at times, and other such inconveniences, so a cheat guide has been included of everything flat out that needs to be added. Also commands to properly call all the functions are needed, so they are included as well


PROCEDURES

define procedure <login>
property <player%userid%; name=$objectproperty(#login-name#-charsheet; name)$>
property <player%userid%; race=$objectproperty(#login-name#-charsheet; race)$>
property <player%userid%; look=$objectproperty(#login-name#-charsheet; look)$>
property <player%userid%; stance=$objectproperty(#login-name#-charsheet; stance)$>
property <player%userid%; readied=$objectproperty(#login-name#-charsheet; readied)$>
property <player%userid%; wielded=$objectproperty(#login-name#-charsheet; wielded)$>
property <player%userid%; STR=$objectproperty(#login-name#-charsheet; STR)$>
property <player%userid%; CON=$objectproperty(#login-name#-charsheet; CON)$>
property <player%userid%; DEX=$objectproperty(#login-name#-charsheet; DEX)$>
property <player%userid%; INT=$objectproperty(#login-name#-charsheet; INT)$>
property <player%userid%; WIS=$objectproperty(#login-name#-charsheet; WIS)$>
property <player%userid%; AUR=$objectproperty(#login-name#-charsheet; AUR)$>
property <player%userid%; CHA=$objectproperty(#login-name#-charsheet; CHA)$>
property <player%userid%; DIS=$objectproperty(#login-name#-charsheet; DIS)$>
property <player%userid%; HP-MAX=$objectproperty(#login-name#-charsheet; HP-MAX)$>
property <player%userid%; HP=$objectproperty(#login-name#-charsheet; HP)$>
property <player%userid%; rt=$objectproperty(#login-name#-charsheet; rt)$>
end define
define procedure <take-check> if here <#target-object#> then {
if property <#target-object#; take> then exec <take-do> else msg <You cannot take that.|n>}
else msg <I could not find what you were referring to.|n>
end define
define procedure <take-do> if ( $objectproperty(player%userid%-r-hand; held)$ = null ) then {
move <#target-object#; player%userid%-r-hand>
property <player%userid%-r-hand; held=#target-object#>
msg <You pick up the $displayname(#target-object# with your right hand.|n>
}
else {
if ( $objectproperty(player%userid%-l-hand; held)$ = null ) then {
move <#target-object#; player%userid%-l-hand>
property <player%userid%-l-hand; held=#target-object#>
msg <You pick up the #target-object# with your left hand.|n>
}
else msg <Both of your hands are full.|n>
}

end define
define procedure <look> if here <#target-object#> then {
if ( $objectproperty(#target-object#;look)$ <> null ) then msg <$objectproperty(#target-object#; look)$|n> else {
msg <You notice nothing in particular about $objectproperty(#target-object#; short)$.|n>
}
else msg <I could not find what you were referring to.|n>
}
end define
define procedure <drop>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to drop anything.|n> else {
if ( $objectproperty(player%userid%-r-hand; held-name)$ = #target-object# ) or ( $objectproperty(player%userid%-l-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%-r-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) then property <player%userid%; wielded=null>
set string <target-object; $objectproperty(player%userid%-r-hand; held)$>
move <#target-object#; #quest.currentroom[userid]#>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
msg <You drop $objectproperty(#target-object#; short)$ from your right hand.|n>
}
if ( $objectproperty(player%userid%-l-hand; held-name)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <target-object; $objectproperty(player%userid%-l-hand; held)$>
move <#target-object#; #quest.currentroom[userid]#>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
msg <You drop $objectproperty(#target-object#; short)$ from your left hand.|n>
}
}
else msg <You are not holding that.|n>
}
}
end define
define procedure <glance>
msg <You have $objectproperty(player%userid%-r-hand; held-display)$ in your right hand and $objectproperty(player%userid%-l-hand; held-display)$ in your left hand.|n>
end define
'
' SwAP PROCEDURES
'
define procedure <swap-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to swap your hands.|n> else {
set string <r-held; $objectproperty(player%userid%-r-hand; held)$>
set string <l-held; $objectproperty(player%userid%-l-hand; held)$>
if exists <#r-held#> and exists <#l-held#> then do <swap-both> else {
if exists <#r-held#> and not exists <#l-held#> then do <swap-right> else {
if exists <#l-held#> and not exists <#r-held#> then do <swap-left> else msg <You fidget with your hands.|n>
}
}
}
}
end define
define procedure <swap-right>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) then property <player%userid%; wielded=null>
set string <r-object; $objectproperty(player%userid%-r-hand; held)$>
move <#r-object#; player%userid%-l-hand>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
property <player%userid%-l-hand; held=#r-object#>
property <player%userid%-l-hand; held-name=$displayname(#r-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#r-object#; short)$>
if property <#r-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$>
if property <#r-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$$objectproperty(#r-object#; suffix)$>
msg <Ok.|n>
end define
define procedure <swap-left>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <l-object; $objectproperty(player%userid%-l-hand; held)$>
move <#l-object#; player%userid%-r-hand>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
property <player%userid%-r-hand; held=#l-object#>
property <player%userid%-r-hand; held-name=$displayname(#l-object#)$>
property <player%userid%-r-hand; held-short=$objectproperty(#l-object#; short)$>
if property <#l-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$>
if property <#l-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$$objectproperty(#l-object#; suffix)$>
msg <Ok.|n>
end define
define procedure <swap-both>
if ( $objectproperty(player%userid%; offhand)$ = player%userid%-r-hand ) or ( $objectproperty(player%userid%; offhand)$ = player%userid%-l-hand ) then property <player%userid%; readied=null>
if ( $objectproperty(player%userid%; mainhand)$ = player%userid%-r-hand ) or ( $objectproperty(player%userid%; mainhand)$ = player%userid%-l-hand ) then property <player%userid%; wielded=null>
set string <r-object; $objectproperty(player%userid%-r-hand; held)$>
set string <l-object; $objectproperty(player%userid%-l-hand; held)$>
move <#r-object#; player%userid%-l-hand>
move <#l-object#; player%userid%-r-hand>
property <player%userid%-l-hand; held=#r-object#>
property <player%userid%-r-hand; held=#l-object#>
property <player%userid%-l-hand; held-name=$displayname(#r-object#)$>
property <player%userid%-r-hand; held-name=$displayname(#l-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#r-object#; short)$>
property <player%userid%-r-hand; held-short=$objectproperty(#l-object#; short)$>
if property <#l-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$>
if property <#l-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#l-object#; prefix)$ $displayname(#l-object#)$$objectproperty(#l-object#; suffix)$>
if property <#r-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$>
if property <#r-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#r-object#; prefix)$ $displayname(#r-object#)$$objectproperty(#r-object#; suffix)$>
msg <Ok.|n>
end define
define procedure <ready>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to ready anything.|n> else {
set string <offhand; $objectproperty(player%userid%; offhand)$>
if ( $objectproperty(#offhand#; held)$ <> null ) then {
if property <$objectproperty(#offhand#; held)$; weapon> or property <$objectproperty(#offhand#; held)$; shield> then {
set string <readied; $objectproperty(#offhand#; held)$>
property <player%userid%; readied=#readied#>
msg <You ready $objectproperty(#readied#; short)$.|n>
}
else msg <You cannot ready that.|n>
}
else msg <You are not carrying anything to ready in your left hand.|n>
}
}
end define
define procedure <wield>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to wield anything.|n> else {
set string <mainhand; $objectproperty(player%userid%; mainhand)$>
if ( $objectproperty(#mainhand#; held)$ <> null ) then {
if property <$objectproperty(#mainhand#; held)$; weapon> then {
set string <wielded; $objectproperty(#mainhand#; held)$>
property <player%userid%; wielded=#wielded#>
msg <You wield $objectproperty(#wielded#; short)$.|n>
}
else msg <You cannot wield that.|n>
}
else msg <You are not carrying anything to wield.|n>
}
}
end define

define procedure <stance defensive>
property <player%userid%; stance=5>
property <player%userid%; stance-display=defensive>
msg <You move into a defensive stance.|n>
end define
define procedure <stance guarded>
property <player%userid%; stance=4>
property <player%userid%; stance-display=guarded>
msg <You move into a guarded stance.|n>
end define
define procedure <stance neutral>
property <player%userid%; stance=3>
property <player%userid%; stance-display=neutral>
msg <You move into a neutral stance.|n>
end define
define procedure <stance forward>
property <player%userid%; stance=2>
property <player%userid%; stance-display=forward>
msg <You move into a forward stance.|n>
end define
define procedure <stance offensive>
property <player%userid%; stance=1>
property <player%userid%; stance-display=offensive>
msg <You move into a offensive stance.|n>
end define
define procedure <defensive-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance defensive> else msg <You haven't recovered enough from your last action to take a defensive stance.|n>
}
end define
define procedure <guarded-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance guarded> else msg <You haven't recovered enough from your last action to take a guarded stance.|n>
}
end define
define procedure <neutral-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance neutral> else msg <You haven't recovered enough from your last action to take a neutral stance.|n>
}
end define
define procedure <forward-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance forward> else msg <You haven't recovered enough from your last action to take a forward stance.|n>
}
end define
define procedure <offensive-stance-rt-check>
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ = 0 ) then do <stance offensive> else msg <You haven't recovered enough from your last action to take an offensive stance.|n>
}
end define
'
' ENGAGEMENT SYSTEM
'
define procedure <engage-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to engage anything.|n> else {
if here <#target-object#> then {
if property <#target-object#; mob> or property <#target-object#; player> then {
if ( #target-object# = player%userid% ) then msg <You cannot engage yourself.|n> else {
if ( $objectproperty(#target-object#; hp)$ <= 0 ) then msg <That is already dead.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = yes ) then msg <You are already engaged.|n> else do <engage-detect>
}
else msg <You cannot engage that.|n>
}
else msg <I could not find what you were referring to.|n>
}
}
}
}
end define

define procedure <engage-detect>
if property <#target-object#; mob> then do <engage-mob>
if property <#target-object#; player> then do <engage-player>
end define

define procedure <engage-player>
set string <engager; $objectproperty(player%userid%; name)$>
set string <engagee; $objectproperty(#target-object#; name)$>
set numeric <engager.add.enemy; $objectproperty(player%userid%; enemies)$ + 1>
set numeric <engagee.add.enemy; $objectproperty(#target-object#; enemies)$ + 1>
property <player%userid%; enemies=%engager.add.enemy%>
property <#target-object#; enemies=%engagee.add.enemy%>
property <player%userid%; enemy-%engager.add.enemy%=#target-object#>
property <#target-object#; enemy-%engagee.add.enemy%=player%userid%>
property <player%userid%; enemy-%engager.add.enemy%-distance=5>
property <#target-object#; enemy-%engagee.add.enemy%-distance=5>
property <player%userid%; engaged=yes>
property <#target-object#; engaged=yes>
msg <You engage #engagee# in combat.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #engager# ) and ( $objectproperty(#quest.thing#; name)$ <> #engagee#) then msgto <#quest.thing#; #engager# engages #engagee# in combat.|n>
}
msgto <#target-object#; #engager# engages you in combat.|n>
end define

define procedure <engage-mob>
set string <engager; $objectproperty(player%userid%; name)$>
if property <#target-object#; prefix> then set string <engagee; $objectproperty(#target-object#; prefix)$ $objectproperty(#target-object#; name)$> else set string <engagee; $objectproperty(#target-object#; name)$>
set numeric <engager.add.enemy; $objectproperty(player%userid%; enemies)$ + 1>
set numeric <engagee.add.enemy; $objectproperty(#target-object#; enemies)$ + 1>
property <player%userid%; enemies=%engager.add.enemy%>
property <#target-object#; enemies=%engagee.add.enemy%>
property <player%userid%; enemy-%engager.add.enemy%=#target-object#>
property <#target-object#; enemy-%engagee.add.enemy%=player%userid%>
property <player%userid%; enemy-%engager.add.enemy%-distance=5>
property <#target-object#; enemy-%engagee.add.enemy%-distance=5>
property <player%userid%; engaged=yes>
property <player%userid%; engaged=yes>
msg <You engage #engagee# in combat.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #engager# ) then msgto <#quest.thing#; #engager# engages #engagee# in combat.|n>
}
end define

define procedure <disengage-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to disengage from combat.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <disengage>
}
}
end define

define procedure <disengage>
set string <disengager; player%userid%>
set string <disengager.name; $objectproperty(player%userid%; name)$>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You are not engaged.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ = 5 ) then {
set string <disengaged; $objectproperty(player%userid%; enemy-%enemies%)$>
if property <#disengaged#; prefix> then set string <disengaged.enemy; $objectproperty(#disengaged#; prefix)$ $objectproperty(#disengaged#; name)$> else set string <disengaged.enemy; $objectproperty(#disengaged#; name)$>
set numeric <disengager.enemies; $objectproperty(player%userid%; enemies)$ - 1>
set numeric <disengaged.enemies; $objectproperty(#disengaged#; enemies)$ - 1>
for <disengaging.enemy; 1; $objectproperty(#disengaged#; enemies)$> if ( $objectproperty(#disengaged#; enemy-%disengaging.enemy%)$ = #disengager# ) then {
property <#disengaged#; enemy-%disengaging.enemy%=null>
property <#disengaged#; enemy-%disengaging.enemy%-distance=null>
}
property <player%userid%; enemies=%disengager.enemies%>
property <#disengaged#; enemies=%disengaged.enemies%>
property <player%userid%; enemy-%enemies%-distance=null>
property <player%userid%; enemy-%enemies%=null>
property <player%userid%; attacking=null>
if ( $objectproperty(player%userid%; enemies)$ = 0 ) then property <player%userid%; engaged=no>
if ( $objectproperty(#disengaged#; enemies)$ = 0 ) then property <#disengaged#; engaged=no>
msg <You disengage from combat with #disengaged.enemy#.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #disengager.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #disengaged.enemy#) then msgto <#quest.thing#; #disengager.name# disengages from combat with #disengaged.enemy#.|n>
}
if property <#disengaged#; player> then msgto <#disengaged#; #disengager.name# disengages from combat with you.|n>
}
else {
for <engaged.enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%engaged.enemies%-distance)$ <= 4 ) then {
set string <engaged; $objectproperty(player%userid%; enemy-%engaged.enemies%)$>
if property <#engaged#; prefix> then set string <engaged.enemy; $objectproperty(#enaged#; prefix)$ $objectproperty(#engaged#; name)$> else set string <engaged.enemy; $objectproperty(#engaged#; name)$>
msg <You must retreat further in order to disengage from #engaged.enemy#.|n>
}
}
}
end define

define procedure <advance-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to advance.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <advance>
}
}
end define

define procedure <advance>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You must engage an enemy before you can advance.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ <= 1 ) then msg <You cannot advance any closer to your opponent.|n> else {
set string <advancee; $objectproperty(player%userid%; enemy-%enemies%)$>
set string <advancer; player%userid%>
set string <advancer.name; $objectproperty(player%userid%; name)$>
set string <advancee.name; $objectproperty(#advancee#; name)$>
set numeric <enemy.distance; $objectproperty(player%userid%; enemy-%enemies%-distance)$ - 1>
property <player%userid%; enemy-%enemies%-distance=%enemy.distance%>
for <advancee.enemies; 1; $objectproperty(#advancee#; enemies)$> if ( $objectproperty(#advancee#; enemy-%advancee.enemies%)$ = #advancer# ) then {
property <#advancee#; enemy-%advancee.enemies%-distance=%enemy.distance%>
}
if ( %enemy.distance% = 1 ) then {
property <#advancer#; rt= 1>
msg <You close in on #advancee.name#, coming within melee range.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# closes in on you, coming within melee range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# closes in on #advancee.name#, coming within melee range.|n>
}
}
if ( %enemy.distance% = 2 ) then {
property <#advancer#; rt= 2>
msg <You move within polearm range of #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# moves in on you, coming within polearm range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# moves to polearm range of #advancee.name#.|n>
}
}
if ( %enemy.distance% = 3 ) then {
property <#advancer#; rt= 2>
msg <You advance closer to #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# advances closer towards you.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# advances closer towards #advancee.name#.|n>
}
}
if ( %enemy.distance% = 4 ) then {
property <#advancer#; rt= 3>
msg <You begin advancing towards #advancee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#advancee#; #advancer.name# begins advancing towards you.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #advancer.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #advancee.name#) then msgto <#quest.thing#; #advancer.name# begins advancing on #advancee.name#.|n>
}
}
}
}
end define

define procedure <retreat-check>
if not ( $objectproperty(player%userid%; hp)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to retreat.|n> else {
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You aren't engaged.|n> else do <retreat>
}
}
end define

define procedure <retreat>
if ( $objectproperty(player%userid%; engaged)$ = no ) then msg <You must engage an enemy before you can advance.|n> else {
for <enemies; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies%-distance)$ = 5 ) then msg <You cannot retreat any further without disengaging.|n> else {
set string <retreatee; $objectproperty(player%userid%; enemy-%enemies%)$>
set string <retreater; player%userid%>
set string <retreater.name; $objectproperty(player%userid%; name)$>
set string <retreatee.name; $objectproperty(#retreatee#; name)$>
set numeric <enemy.distance; $objectproperty(player%userid%; enemy-%enemies%-distance)$ + 1>
property <player%userid%; enemy-%enemies%-distance=%enemy.distance%>
for <retreatee.enemies; 1; $objectproperty(#retreatee#; enemies)$> if ( $objectproperty(#retreatee#; enemy-%retreatee.enemies%)$ = #retreater# ) then {
property <#retreatee#; enemy-%retreatee.enemies%-distance=%enemy.distance%>
}
if ( %enemy.distance% = 2 ) then {
property <#retreater#; rt= 1>
msg <You back away from #retreatee.name# to polearm range.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# backs away to polearm range.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# backs away from #retreatee.name# to polearm range.|n>
}
}
if ( %enemy.distance% = 3 ) then {
property <#retreater#; rt= 2>
msg <You fall back a bit from #retreatee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# falls back a bit.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# falls back from #retreatee.name#.|n>
}
}
if ( %enemy.distance% = 4 ) then {
property <#retreater#; rt= 2>
msg <You withdraw, putting some distance between you and #retreatee.name#.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# withdraws, putting some distance between you.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# withdraws, putting distance between $objectproperty(player%userid%; sexdesc)$self and #retreatee.name#.|n>
}
}
if ( %enemy.distance% = 5 ) then {
property <#retreater#; rt= 3>
msg <You retreat from #retreatee.name# to a safe distance.|nRoundtime: $objectproperty(player%userid%; rt)$ seconds|n>
msgto <#retreatee#; #retreater.name# retreats to a safe distance.|n>
for each object in <#quest.currentroom#> if property <#quest.thing#; player> then {
if ( $objectproperty(#quest.thing#; name)$ <> #retreater.name# ) and ( $objectproperty(#quest.thing#; name)$ <> #retreatee.name#) then msgto <#quest.thing#; #retreater.name# retreats to a safe distance from #retreatee.name#.|n>
}
}
}
}
end define

define procedure <range-check>
if ( $objectproperty(player%userid%; wielded)$ <> null ) then set string <weapon; $objectproperty(player%userid%; wielded)$> else set string <weapon; fist>
for <enemy.range; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemy.range%)$ = #target-object# ) then {
if ( $objectproperty(player%userid%; enemy-%enemy.range%-distance)$ <= $objectproperty(#weapon#; range)$ ) then do <combat-info> else msg <You must advance within range of your target.|n>
}
end define

define procedure <engaged-check>
if ( $objectproperty(player%userid%; engaged)$ <> yes ) then msg <You are not engaged in combat.|n> else {
for <enemies.engaged; 1; $objectproperty(player%userid%; enemies)$> if ( $objectproperty(player%userid%; enemy-%enemies.engaged%)$ <> #target-object# ) then msg <You must engage your target first.|n> else do <range-check>
}
end define

define procedure <combat-check>
if ( player%userid% = #target-object# ) then msg <You cannot attack yourself.|n> else {
if not ( $objectproperty(player%userid%; HP)$ >= 0 ) then msg <You are dead.|n> else {
if ( $objectproperty(player%userid%; rt)$ <> 0 ) then msg <You haven't recovered enough from your last action to attack anything.|n> else {
if here <#target-object#> then {
if property <#target-object#; object> then msg <You cannot attack that.|n> else {
if property <#target-object#; mob> or property <#target-object#; player> then {
if ( $objectproperty(#target-object#; hp)$ <= 0 ) then msg <That is already dead.|n> else {
set string <mainhand; $objectproperty(player%userid%; mainhand)$>
if ( $objectproperty(player%userid%; wielded)$ = null ) and ( $objectproperty(#mainhand#; held)$ <> null ) then msg <You must wield a weapon or empty your hand before attacking.|n> else do <engaged-check>
}
}
}
else msg <I could not find what you were referring to.|n>
}
}
}
}
end define

define procedure <combat-info>
property <player%userid%; attacking=#target-object#>
set string <attacker; player%userid%>
set string <attacker-name; $objectproperty(player%userid%; name)$>
set string <defender; #target-object#>
set string <defender-name; $objectproperty(#defender#; name)$>
set numeric <defender-con; $objectproperty(#defender#; CON)$>
set numeric <defender-con-factor; %defender-con% / 10>
set string <attacker-wielded; $objectproperty(#attacker#; wielded)$>
if ( $objectproperty(#attacker#; wielded)$ <> null ) then set string <weapon-type; $objectproperty(#attacker-wielded#; type)$> else set string <weapon-type; fist>
set numeric <types; $objectproperty(#weapon-type#; types)$>
set numeric <attack-type-number; $rand(1;%types%)$>
set string <attack-type; $objectproperty(#weapon-type#; %attack-type-number%)$>
set string <attack-type-plural; $objectproperty(#weapon-type#; %attack-type-number%-plural)$>
set string <attacker-readied; $objectproperty(#attacker#; readied)$>
if ( #attacker-wielded# <> null ) then set string <attacker-wielded-short; $objectproperty(#attacker-wielded#; short)$> else set string <attacker-wielded-short; a bare fist>
set string <defender-wielded; $objectproperty(#defender#; wielded)$>
set string <defender-readied; $objectproperty(#defender#; readied)$>
set numeric <attacker-bonus; $objectproperty(#attacker#; as-boost)$>
set numeric <attacker-base-strength; $objectproperty(#attacker#; STR)$ / 4>
set numeric <attacker-base-speed; $objectproperty(#attacker#; DEX)$ / 20>
if ( #attacker-wielded# = null ) then set numeric <attacker-wielded-weight; 0> else {
if property <#attacker-wielded#; weight> then set numeric <attacker-wielded-weight; $objectproperty(#attacker-wielded#; weight)$> else set numeric <attacker-wielded-weight; $objectproperty(#weapon-type#; weight)$>
}
if ( #attacker-wielded# = null ) then set numeric <attacker-wielded-speed; 0> else {
if property <#attacker-wielded#; speed> then set numeric <attacker-wielded-speed; $objectproperty(#attacker-wielded#; speed)$> else set numeric <attacker-wielded-speed; $objectproperty(#weapon-type#; speed)$>
}
set numeric <attacker-wielded-rt; %attacker-wielded-weight% + %attacker-wielded-speed%>
set numeric <attacker-skill-rt; 10 - %attacker-base-speed%>
set numeric <attacker-rt; %attacker-wielded-rt% + %attacker-skill-rt%>
if ( #attacker-wielded# <> null ) then set numeric <attacker-wielded-bonus; $objectproperty(#attacker-wielded#; bonus)$> else set numeric <attacker-wielded-bonus; 0>
set numeric <attacker-stance; $objectproperty(#attacker#; stance)$>
set numeric <attacker-stance-base; %attacker-base-strength% / %attacker-stance%>
set numeric <defender-base-defense; $objectproperty(#defender#; DEX)$ / 4>
set numeric <defender-stance; $objectproperty(#defender#; stance)$>
set numeric <defender-stance-base; %defender-base-defense% * %defender-stance%>
if ( #defender-wielded# <> null ) then set numeric <defender-wielded-bonus; $objectproperty(#defender-wielded#; bonus)$ / 2> else set numeric <defender-wielded-bonus; 0>
if ( #defender-wielded# <> null ) then set numeric <defender-readied-bonus; $objectproperty(#defender-readied#; bonus)$> else set numeric <defender-readied-bonus; 0>
set numeric <defender-equip-bonus; %defender-wielded-bonus% + %defender-readied-bonus%>
set numeric <weapon-attack-strength; %attacker-stance-base% + %attacker-wielded-bonus%>
set numeric <attack-strength; %weapon-attack-strength% + %attacker-bonus%>
set numeric <defense-strength; %defender-stance-base% + %defender-equip-bonus%>
set numeric <d100; $rand(1;100)$>
set numeric <as-ds; %attack-strength% - %defense-strength%>
set numeric <endroll; %as-ds% + %d100%>
set numeric <endnum; %endroll% - 100>
if ( %endroll% <= 100 ) then set string <combat-message; A clean miss!> else {
set numeric <damage-num; %endnum% - %defender-con-factor%>
if ( %damage-num% <= 0 ) then set numeric <damage; 1> else set numeric <damage; %damage-num%>
set numeric <new-hp; $objectproperty(#defender#; hp)$ - %damage%>
if ( %endnum% >= 1 ) and ( %endnum% <= 20 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-1)$ %damage% damage!>
if ( %endnum% >= 20 ) and ( %endnum% <= 40 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-2)$ %damage% damage!>
if ( %endnum% >= 40 ) and ( %endnum% <= 60 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-3)$ %damage% damage!>
if ( %endnum% >= 60 ) and ( %endnum% <= 80 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-4)$ %damage% damage!>
if ( %endnum% >= 80 ) then set string <combat-message; $objectproperty(#weapon-type#; %attack-type-number%-5)$ %damage% damage!>
property <#defender#; hp=%new-hp%>
}
if ( $objectproperty(#defender#; hp)$ <= 0 ) then set string <combat-message; #combat-message#|n#defender-name# slumps to the ground and ceases living!>
msg <You #attack-type# at #defender-name# with #attacker-wielded-short#!|nAS: %attack-strength% vs DS: %defense-strength% + d100 roll: %d100% = %endroll%|n#combat-message#|nRoundtime: %attacker-rt% seconds|n|n>
if not property <#defender#; mob> then msgto <#defender#; #attacker-name# #attack-type-plural# at you with #attacker-wielded-short#!|nAS: %attack-strength% vs DS: %defense-strength% + d100 roll: %d100% = %endroll%|n#combat-message#|n|n>
do <activate-rt>
end define
define procedure <activate-rt>
property <player%userid%; rt=%attacker-rt%>
end define

define procedure <time>
'
'Basic time running part of the script, goes through 24 hours of each day... Note: expand to include days, months, and years for wider range of use.
'
set numeric <second-time; $objectproperty(game.info; second-time)$ + 01>
if ( %second-time% >= 60 ) then {
set numeric <minute-time; $objectproperty(game.info; minute-time)$ +01>
set numeric <second-time; 0>
set string <s-format; %second-time%>
if ( $lengthof(#s-format#)$ = 1 ) then set string <second-time; 0%second-time%> else set string <second-time; %second-time%>
if ( %minute-time% >= 60 ) then {
set numeric <hour-time; $objectproperty(game.info; hour-time)$ +01>
set numeric <minute-time; 0>
set string <m-format; %minute-time%>
if ( $lengthof(#m-format#)$ = 1 ) then set string <minute-time; 0%minute-time%> else set string <minute-time; %minute-time%>
if ( %hour-time% >= 24 ) then {
set numeric <hour-time; 0>
set string <h-format; %hour-time%>
if ( $lengthof(#h-format#)$ = 1 ) then set string <hour-time; 0%hour-time%> else set string <hour-time; %hour-time%>
}
else set string <h-format; %hour-time%>
if ( $lengthof(#h-format#)$ = 1 ) then set string <hour-time; 0%hour-time%> else set string <hour-time; %hour-time%>
property <game.info; hour-time=#hour-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
}
else set string <m-format; %minute-time%>
if ( $lengthof(#m-format#)$ = 1 ) then set string <minute-time; 0%minute-time%> else set string <minute-time; %minute-time%>
property <game.info; minute-time=#minute-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
}
else set string <s-format; %second-time%>
if ( $lengthof(#s-format#)$ = 1 ) then set string <second-time; 0%second-time%> else set string <second-time; %second-time%>
property <game.info; second-time=#second-time#>
set string <time; $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$>
'
'Roundtime modifying part of the script.
'
for each object in game {
if property <#quest.thing#; rt> then {
if ( $objectproperty(#quest.thing#; rt)$ <> 0 ) then {
set numeric <#quest.thing#-rt; $objectproperty(#quest.thing#; rt)$ - 1>
property <#quest.thing#; rt=%#quest.thing#-rt%>
if ( $objectproperty(#quest.thing#; rt)$ = 0 ) then msgto <#quest.thing#; You feel ready to move again.|n>
}
}
}
'
'
'
timeron <time>
end define



TIMERS

define timer <time>
interval <1>
action do <time>
enabled
end define


STARTSCRIPTS

startscript {
msg <TO DO LIST:|n----------------------|nCreate clothing/armor/inventory system.|nFigure out an automated merchant system.|nOverride traveling system and connect/disconnect.|nRevamp combat system...|nie: balance, attack verbs, ranged/dual/two-handed weapons, etc.|n>
set numeric <second-time; 00>
property <game.info; second-time=00>
set numeric <minute-time; 00>
property <game.info; minute-time=00>
set numeric <hour-time; 00>
property <game.info; hour-time=00>
set numeric <player.count; 0>
set numeric <object.count; 0>
set string <player.list; null>
set string <format.objects; null >
}
player startscript {
panes off 'This is a preference of mine, can be on or off.'
background <black> 'Again preference, can be set to any
foreground <white> 'available color. '
create room <player%userid%-r-hand>'These give the player the ability to hold objects in'
property <player%userid%-r-hand; held=null>'hands, it is left open for some definition '
property <player%userid%-r-hand; held-name=null>'eventually support ambidexterity as well'
property <player%userid%-r-hand; held-short=a bare fist>'as choosing to be left or right'
property <player%userid%-r-hand; held-display=nothing>'handed'
create room <player%userid%-l-hand> 'Same as above'
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
set string <name; $name(%userid%)$> 'Defines display name variable as the entered Quest name'
set numeric <age; $rand(16;35)$> 'Defines a random age for the player(novelty)'
property <player%userid%; name=$capfirst(#name#)$> 'Formats the name and gives to player object'
property <player%userid%; alias=$capfirst(#name#)$> 'Sets the display name'
property <player%userid%; race=Human> 'Sets the player's race(novelty)'
property <player%userid%; sex=Male> 'Sets the player's sex(novelty)'
property <player%userid%; level=0> 'Sets the player's level(novelty for now, but can be expanded)'
property <player%userid%; age=%age%> 'Applies the afore mentioned random age'
property <player%userid%; sexdesc=him> 'Provides accurate description when using actions'
property <player%userid%; sexposs=his> 'Same as above'
property <player%userid%; visibility=1> 'Implemented for future use in redefining the "look" command'
property <player%userid%; look=You see $objectproperty(player%userid%; name)$ the $objectproperty(player%userid%; race)$.|n> 'Defines a default look description to override Quest default'
property <player%userid%; stance=5> 'Puts the player by default in a defensive stance'
property <player%userid%; stance-display=defensive> 'Describes the above'
property <player%userid%; offhand=player%userid%-l-hand> 'Implemented for future support of choosing left-handed or right-handed'
property <player%userid%; mainhand=player%userid%-r-hand> 'Same as above'
property <player%userid%; readied=null> 'Set as null(empty handed)'
property <player%userid%; wielded=null> 'Same as above'
property <player%userid%; as-boost=0> 'Set to zero(no boost) property given for object/spells that provide generic attack boost'
property <player%userid%; ds-boost=0> 'Same as above but for generic defense boost'
property <player%userid%; player> 'Defines as a human controlled object'
property <player%userid%; STR=$rand(20;100)$> 'Supplies random STRENGTH(STR) stat to initially start off with'
property <player%userid%; CON=$rand(20;100)$> 'Supplies random CONSTITUTION(CON) stat to initially start off with'
property <player%userid%; DEX=$rand(20;100)$> 'Supplies random DEXTERITY(DEX) stat to initially start off with'
property <player%userid%; INT=$rand(20;100)$> 'Supplies random INTELLIGENCE(INT) stat to initially start off with'
property <player%userid%; WIS=$rand(20;100)$> 'Supplies random WISDOM(WIS) stat to initially start off with'
property <player%userid%; AUR=$rand(20;100)$> 'Supplies random AURA(AUR) stat to initially start off with'
property <player%userid%; CHA=$rand(20;100)$> 'Supplies random CHARISMA(CHA) stat to initially start off with'
property <player%userid%; DIS=$rand(20;100)$> 'Supplies random DISCIPLINE(DIS) stat to initially start off with'
property <player%userid%; engaged=no> 'Set to no(not engaged in combat) used by combat system'
property <player%userid%; enemies=0> 'Not engaged to any enemies so set to zero, used by combat system'
property <player%userid%; attacking=null> 'Not currently attacking anybody or thing, set to null'
property <player%userid%; stealth=0> 'A factor included for integration with a hiding system, ie; for redefined LOOK command'
property <player%userid%; visibility=1> 'Included for integration with a hiding system, ie; for redefined LOOK command'
property <player%userid%; spotted=0> 'Included for integration with a hiding system, ie; for redefined LOOK command'
set numeric <HP-temp; $objectproperty(player%userid%; CON)$ + $objectproperty(player%userid%; AUR)$> 'Step in stat-based Hit Point calculation'
set numeric <HP; %HP-temp% /4> 'step in stat-based Hit Point calculation'
property <player%userid%; HP-MAX=%HP%> 'Assigns stat-based Hit Point maximum'
property <player%userid%; HP=%HP%> 'Assigns current Hit Points out of maximum possible'
set numeric <player%userid%; 0> 'Not documented yet'
property <player%userid%; rt=0> 'Defines a natural zero roundtime property, a player can only act with a roundtime of zero'

}


I think Im Dead
16 Dec 2003, 00:27
COMMANDS

command <advance> do <advance-check>
command <advanc> do <advance-check>
command <advan> do <advance-check>
command <adva> do <advance-check>
command <adv> do <advance-check>
command <retreat> do <retreat-check>
command <retrea> do <retreat-check>
command <retre> do <retreat-check>
command <retr> do <retreat-check>
command <ret> do <retreat-check>
command <engage #@target-object#> do <engage-check>
command <engag #@target-object#> do <engage-check>
command <enga #@target-object#> do <engage-check>
command <eng #@target-object#> do <engage-check>
command <disengage> do <disengage-check>
command <disengag> do <disengage-check>
command <disenga> do <disengage-check>
command <diseng> do <disengage-check>
command <disen> do <disengage-check>
command <time> msg <The current time is #time# PST.|n>
command <stance> msg <Your current stance is $objectproperty(player%userid%; stance-display)$.|n|nAvailable stances are:|nDefensive|nGuarded|nNeutral|nForward|nOffensive|n>
command <stance defensive> do <defensive-stance-rt-check>
command <stance defensiv> do <defensive-stance-rt-check>
command <stance defensi> do <defensive-stance-rt-check>
command <stance defens> do <defensive-stance-rt-check>
command <stance defen> do <defensive-stance-rt-check>
command <stance defe> do <defensive-stance-rt-check>
command <stance def> do <defensive-stance-rt-check>
command <stance de> do <defensive-stance-rt-check>
command <stance d> do <defensive-stance-rt-check>
command <stance guarded> do <guarded-stance-rt-check>
command <stance guarde> do <guarded-stance-rt-check>
command <stance guard> do <guarded-stance-rt-check>
command <stance guar> do <guarded-stance-rt-check>
command <stance gua> do <guarded-stance-rt-check>
command <stance gu> do <guarded-stance-rt-check>
command <stance g> do <guarded-stance-rt-check>
command <stance neutral> do <neutral-stance-rt-check>
command <stance neutra> do <neutral-stance-rt-check>
command <stance neutr> do <neutral-stance-rt-check>
command <stance neut> do <neutral-stance-rt-check>
command <stance neu> do <neutral-stance-rt-check>
command <stance ne> do <neutral-stance-rt-check>
command <stance n> do <neutral-stance-rt-check>
command <stance forward> do <forward-stance-rt-check>
command <stance forwar> do <forward-stance-rt-check>
command <stance forwa> do <forward-stance-rt-check>
command <stance forw> do <forward-stance-rt-check>
command <stance for> do <forward-stance-rt-check>
command <stance fo> do <forward-stance-rt-check>
command <stance f> do <forward-stance-rt-check>
command <stance offensive> do <offensive-stance-rt-check>
command <stance offensiv> do <offensive-stance-rt-check>
command <stance offensi> do <offensive-stance-rt-check>
command <stance offens> do <offensive-stance-rt-check>
command <stance offen> do <offensive-stance-rt-check>
command <stance offe> do <offensive-stance-rt-check>
command <stance off> do <offensive-stance-rt-check>
command <stance of> do <offensive-stance-rt-check>
command <stance o> do <offensive-stance-rt-check>
command <attack> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Attack what?|n>
command <attac> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Attack what?|n>
command <atta> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Attack what?|n>
command <att> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Attack what?|n>
command <kill> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Kill what?|n>
command <kil> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Kill what?|n>
command <hit> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Hit what?|n>
command <hi> if ( $objectproperty(player%userid%; attacking)$ <> null ) then {
set string <target-object; $objectproperty(player%userid%; attacking)$>
do <combat-check>
}
else msg <Hit what?|n>
command <attac> do <combat-check>
command <atta> do <combat-check>
command <attack #@target-object#> do <combat-check>
command <attac #@target-object#> do <combat-check>
command <atta #@target-object#> do <combat-check>
command <att #@target-object#> do <combat-check>
command <at #@target-object#> do <combat-check>
command <kill #@target-object#> do <combat-check>
command <kil #@target-object#> do <combat-check>
command <hit #@target-object#> do <combat-check>
command <hi #@target-object#> do <combat-check>
command <ready> do <ready>
command <wield> do <wield>
command <swap> do <swap-check>
command <swa> do <swap-check>
command <sw> do <swap-check>
command <look #@target-object#> do <look>
command <loo #@target-object#> do <look>
command <lo #@target-object#> do <look>
command <l #@target-object#> do <look>
command <look at #@target-object#> do <look>
command <loo at #@target-object#> do <look>
command <lo at #@target-object#> do <look>
command <l at #@target-object#> do <look>
command <take #@target-object#> do <take-check>
command <get #@target-object#> do <take-check>
command <grab #@target-object#> do <take-check>
command <drop #target-object#> do <drop>
command <glance> do <glance>
command <as-boost #boost-number#> if ( $objectproperty(player%userid%; usrlvl)$ >= 2 ) then msg <I don't understand what you typed.|n> else {
set numeric <as-boost; $objectproperty(player%userid%; as-boost)$ + #boost-number#>
property <player%userid%; as-boost=%as-boost%>
msg <You feel stronger.|n>
}
command <ds-boost #boost-number#> if ( $objectproperty(player%userid%; usrlvl)$ >= 2 ) then msg <I don't understand what you typed.|n> else {
set numeric <ds-boost; $objectproperty(player%userid%; ds-boost)$ + #boost-number#>
property <player%userid%; ds-boost=%ds-boost%>
msg <You feel stronger.|n>
}
command <act> if ( $objectproperty(player%userid%; usrlvl)$ >= 2 ) then msg <I don't understand what you typed.|n> else {
property <player%userid%; rt=0>
msg <You feel ready to move again.|n>
}
command <stats> {
property <player%userid%; STR=$rand(20;100)$>
property <player%userid%; CON=$rand(20;100)$>
property <player%userid%; DEX=$rand(20;100)$>
property <player%userid%; INT=$rand(20;100)$>
property <player%userid%; WIS=$rand(20;100)$>
property <player%userid%; AUR=$rand(20;100)$>
property <player%userid%; CHA=$rand(20;100)$>
property <player%userid%; DIS=$rand(20;100)$>
set numeric <HP-temp; $objectproperty(player%userid%; CON)$ + $objectproperty(player%userid%; AUR)$>
set numeric <HP; %HP-temp% /4>
property <player%userid%; HP-MAX=%HP%>
property <player%userid%; HP=%HP%>
set numeric <player%userid%; 0>
msg <Your Stats are now...|n|nStrength - $objectproperty(player%userid%; STR)$|nConstitution - $objectproperty(player%userid%; CON)$|nDexterity - $objectproperty(player%userid%; DEX)$|nIntelligence - $objectproperty(player%userid%; INT)$|nWisdom - $objectproperty(player%userid%; WIS)$|nAura - $objectproperty(player%userid%; AUR)$|nCharisma - $objectproperty(player%userid%; CHA)$|nDiscipline - $objectproperty(player%userid%; DIS)$|n>
}
command <info> {
msg <Name: $objectproperty(player%userid%; name)$ Level: $objectproperty(player%userid%; level)$|nRace: $objectproperty(player%userid%; race)$ Age: $objectproperty(player%userid%; age)$|nHealth: $objectproperty(player%userid%; hp)$/$objectproperty(player%userid%; hp-max)$|n-----------------|nStrength - $objectproperty(player%userid%; STR)$|nConstitution - $objectproperty(player%userid%; CON)$|nDexterity - $objectproperty(player%userid%; DEX)$|nIntelligence - $objectproperty(player%userid%; INT)$|nWisdom - $objectproperty(player%userid%; WIS)$|nAura - $objectproperty(player%userid%; AUR)$|nCharisma - $objectproperty(player%userid%; CHA)$|nDiscipline - $objectproperty(player%userid%; DIS)$|n>
}
command <inf> {
msg <Name: $objectproperty(player%userid%; name)$ Level: $objectproperty(player%userid%; level)$|nRace: $objectproperty(player%userid%; race)$ Age: $objectproperty(player%userid%; age)$|nHealth: $objectproperty(player%userid%; hp)$/$objectproperty(player%userid%; hp-max)$|n-----------------|nStrength - $objectproperty(player%userid%; STR)$|nConstitution - $objectproperty(player%userid%; CON)$|nDexterity - $objectproperty(player%userid%; DEX)$|nIntelligence - $objectproperty(player%userid%; INT)$|nWisdom - $objectproperty(player%userid%; WIS)$|nAura - $objectproperty(player%userid%; AUR)$|nCharisma - $objectproperty(player%userid%; CHA)$|nDiscipline - $objectproperty(player%userid%; DIS)$|n>
}
command <warp to #target-room#> if ( $objectproperty(player%userid%; usrlvl)$ >= 2 ) then msg <I don't understand what you typed.|n> else {
msg <You focus intently on your destination and begin to plane shift.|n>
goto <#target-room#>
}
command <show info> displaytext <info>
command <take-do> if ( $objectproperty(player%userid%-r-hand; held)$ = null ) then {
set string <target-object; $getobjectname(#target-object#)$>
move <#target-object#; player%userid%-r-hand>
property <player%userid%-r-hand; held=#target-object#>
property <player%userid%-r-hand; held-name=$displayname(#target-object#)$>
property <player%userid%-r-hand; held-short=$objectproperty(#target-object#; short)$>
if property <#target-object#; prefix> then property <player%userid%-r-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$>
if property <#target-object#; suffix> then property <player%userid%-r-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$$objectproperty(#target-object#; suffix)$>
msg <You pick up the $displayname(#target-object#)$ with your right hand.|n>
}
else {
if ( $objectproperty(player%userid%-l-hand; held)$ = null ) then {
move <#target-object#; player%userid%-l-hand>
property <player%userid%-l-hand; held=#target-object#>
property <player%userid%-l-hand; held-name=$displayname(#target-object#)$>
property <player%userid%-l-hand; held-short=$objectproperty(#target-object#; short)$>
if property <#target-object#; prefix> then property <player%userid%-l-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$>
if property <#target-object#; suffix> then property <player%userid%-l-hand; held-display=$objectproperty(#target-object#; prefix)$ $displayname(#target-object#)$$objectproperty(#target-object#; suffix)$>
msg <You pick up the $displayname(#target-object#)$ with your left hand.|n>
}
else msg <Both of your hands are full.|n>
}
'
'OBJECT-EDITING IMMORTAL COMMANDS
'
command <set-hour #new-hour#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-hour#)$ = 1 ) then set string <hour-time; 0#new-hour#> else set string <hour-time; #new-hour#>
property <game.info; hour-time=#hour-time#>
msg <You set the current hour to #new-hour#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}
command <set-minute #new-minute#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-minute#)$ = 1 ) then set string <minute-time; 0#new-minute#> else set string <minute-time; #new-minute#>
property <game.info; minute-time=#minute-time#>
msg <You set the current minute to #new-minute#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}
command <set-second #new-second#> if ( $objectproperty(player%userid%; usrlvl)$ >= 5 ) then msg <I don't understand what you typed.|n> else {
if ( $lengthof(#new-second#)$ = 1 ) then set string <second-time; 0#new-second#> else set string <second-time; #new-second#>
property <game.info; second-time=#second-time#>
msg <You set the current second to #new-second#. The current time is now $objectproperty(game.info; hour-time)$:$objectproperty(game.info; minute-time)$:$objectproperty(game.info; second-time)$ PST.|n>
}


DISCONNECT


disconnect {
set string <disconnecting.player; player%userid%>
for each object in <player%userid%-l-hand> move <#quest.thing#; arena>
property <player%userid%-l-hand; held=null>
property <player%userid%-l-hand; held-name=null>
property <player%userid%-l-hand; held-short=a bare fist>
property <player%userid%-l-hand; held-display=nothing>
for each object in <player%userid%-r-hand> move <#quest.thing#; arena>
property <player%userid%-r-hand; held=null>
property <player%userid%-r-hand; held-name=null>
property <player%userid%-r-hand; held-short=a bare fist>
property <player%userid%-r-hand; held-display=nothing>
for <local.enemies; 1; $objectproperty(player%userid%; enemies)$> {
set string <disengage.enemy; $objectproperty(player%userid%; enemy-%local.enemies%)$>
set numeric <enemy.subtract; $objectproperty(#disengage.enemy#; enemies)$ - 1>
set numeric <local.subtract; $objectproperty(player%userid%; enemies)$ - 1>
property <player%userid%; enemy-%enemies%=null>
for <enemy.enemies; 1; $objectproperty(#disengage.enemy#; enemies)$> if ( $objectproperty(#disengage.enemy#; enemy-%enemy.enemies%)$ = #disconnecting.player# ) then {
property <#disengage.enemy#; enemy-%enemy.enemies%=null>
property <#disengage.enemy#; enemy-%enemy.enemies%-distance=null>
property <#disengage.enemy#; enemies=%enemy.subtract%>
if ( $objectproperty(#disengaged.enemy#; enemies)$ = 0 ) then property <#disengaged.enemy#; engaged=no>
}
property <player%userid%; enemy-%enemies%-distance=null>
property <player%userid%; enemies=%enemy.subtract%>
if ( $objectproperty(player%userid%; enemies)$ = 0 ) then property <player%userid%; engaged=no>
}
}


ROOMS


define room <arena>
properties <title=The Arena; sanct=0; look=Massive stone walls surround you on all sides forming the octagon you stand in. The dirt beneath your feet is hard packed and riddled with traces of footsteps, all around you see remnants of skin and bones.>
define object <item1>
alias <falchion>
properties <visibility=1; range=1; take; object; weapon; type=broadsword; weight=3; speed=0; bonus=5; prefix=an engraved mithril; short=an engraved mithril falchion; look=The sword appears to be well-crafted and the intricate elven markings engraved into it only increase it's alure.>
end define
define object <item2>
alias <club>
properties <visibility=1; range=1; take; object; weapon; weight=3; type=club; speed=0; bonus=5; prefix=a heavy iron; suffix=with a leather handle; short=a heavy iron club; look=The club is crudely crafted of oak and wrapped with a few strips of leather at the bottom for increased grip.>
end define
define object <item3>
alias <shield>
properties <visibility=1; take; object; shield; bonus=5; prefix=a small; short=a small shield; look=The small shield is covered with dents and scratches, it appears to have survived more than a few battles.|n>
end define
end define

define room <vault>
properties <title=The Vault; sanct=0; look=This is the most sacred area of the game, the items found here contain properties all other items in the game use during the many complicated procedures that are run.>
define object <game.info>
alias <game.info>
properties <look=null; hour-time=00; minute-time=00; second-time=00>
end define
define object <game.temp>
alias <game.temp>
properties <look=null; player.count=0; object.count=0; format.objects=null; format.players=null; player.list; object.list>
end define
define object <broadsword>
alias <broadsword>
properties <look=null; short=the broadsword; weight=3; speed=0; types=3; 1=swing; 1-plural=swings; 2=stab; 2-plural=stabs; 3=slash; 3-plural=slashes; 1-1=Light swing clips the shoulder!; 1-2=Well-aimed shot bruises the leg!; 1-3=Solid blow to the stomach... Those ribs might be broken!; 1-4=Huge swing breaks the spinal cord!; 1-5=Massive strike to the head caves in the skull!; 2-1=Weak jab to the leg, stop it that tickles!; 2-2=Quick stab to the chest draws blood!; 2-3=Skillfull strike to the leg... That should slow 'em down!; 2-4=Powerful lunge to the stomach leaves quite a mess!; 2-5=Perfect attack impales opponent on blade!; 3-1=Flick of the wrist leaves a few scratches on the face!; 3-2=Quick slash to the leg exposes some muscle!; 3-3=Solid strike to the left arm digs into the bone!; 3-4=Deep swipe to the stomach reveals the insides!; 3-5=Incredible slash to the neck removes the head!>
end define
define object <club>
alias <club>
properties <look=null; short=the club; weight=1; speed=0; types=1; 1=swing; 1-plural=swings; 1-1=Off-balance swing taps the shin. That might bruise!; 1-2=Sturdy shot to the forearm sprains the wrist!; 1-3=Strong blow to the shoulder knocks it out of the socket; 1-4=Powerful strike breaks both kneecaps!; 1-5=Enormous swing shatters the spine and ribcage to pieces!>
end define
define object <fist>
alias <fist>
properties <range=1; look=null; short=the fist weight=0; speed=0; types=1; 1=swing; 1-plural=swings; 1-1=Weak swing taps the forearm!; 1-2=Firm punch leaves the ribs sore!; 1-3=Quick jab to the face breaks the nose!; 1-4=Uppercut to the jaw breaks it!; 1-5=Two-handed hammer to the skull caves in the temples!>
end define
end define

define room <accounts>
properties <title=Account Administration; sanct=1; look=This is the area of the game where player accounts are stored.>
end define


AND IF ALL ELSE FAILS YOU CAN REFERENCE A COPY OF THE SOMEWHAT-ORIGINAL FILE AT http://s88880570.onlinehome.us/asl/qnetbat.asl

paul_one
16 Dec 2003, 08:51
DAMN YOU ITID!!!! :lol:

Anyway, yeah. Loads of things that can be fixed and stuff...

My curiosity is why the multiple stances atc instead of parsing the first 3 letters after "stance " which would be easier (and I believe is used alot in TADS games).

And why the multiple attacks? Surely you would have done exactly what you'd done with the multiple stances - just point them to the same procedure...

Anyway, I'll have a look in some free time (probably at work most of the time) and contribute some stuff... You got any preferences over what is to be done? Like submit an e-mail to you or whatever? Produce several diversions of your file (like I have one, Ste has another and *you* have another).

I think Im Dead
16 Dec 2003, 15:59
Eh, I'm setting up an alternate section on my ftp space for asl and I'll make it public so you could create your own folder there and update a "nightly" whenever you make any modifications and put your own little readme in the folder with it stating what you've improved upon if that seems easy enough to everyone.

Also, at the time, I believe I was just like, eh, "multiple commands for people who don't want to type it out all the way", parsing would have been smarter but instead... a bout of complete laziness.

Cryophile
16 Dec 2003, 18:27
Hmmm, kind of similar to how my script was going to be :shock:

My magic system and map system are probably going to end up that large. :? That's not including the battle system and my other systems.

Very complex to the newbies lol. You'll have them confused after the third line.

Cryophile
16 Dec 2003, 20:01
I hate to say this, but maybe I'll just incorporate ITID's combat system into The Sh4d0w Pr0j3kt (which has been halted for a while).

I think I'm going to scrap the single-player version and not enter it in the IF Comp 2004. I'll start work on the multiplayer version as well as my client. Anyone got any ideas for a name?

I may start on the single-player again some time, but I feel that a huge single-player RPG is somewhat boring. It was a good storyline and idea, but I know I won't get a good score in the competition because it's too long and involving. Since you can only play the game for two hour before voting, the players will only vaguely understand the plot before they are required to vote.

The multiplayer will sport a modified, as well as extended, version of ITID's script. Since it's got many of the features I was planning to add, why bother writing it myself?

I think Im Dead
17 Dec 2003, 03:46
Though it's pretty straight forward after looking at the code, I'll type up a quick tutorial on what properties player's need to use this, and perhaps a bit more, for now, I'd suggest to anyone that wants to use this for whatever reasons, to download the file and run it in QuestNet, then log on to their localhost and get a feel for it all. Eventually it needs to be put in a library, but for now, get used to running it and post away with any questions.

It's a beast but once you get aquainted, tame and easy going.

paul_one
17 Dec 2003, 08:36
.... It's actually about 4x larger than my current RPG battle system code.... :oops:

Mine's currently 15K, but is still missing loads of stuff I need to add. Plus I parse some stuff instead of using the loads of method's you used in that file :P .

.... Could you please re-explain what that game-tick thing is again?
I remember you explained it in a private chat we had but I have forgotten and just need it re-explained. :D

kingmorgoth99
08 Jan 2004, 21:29
THATS A SMALL SAMPLE CODE?!??!!?!?!?!!!?!!

GameBoy
09 Jan 2004, 13:32
there is probably an even more advanced one he could do. like adding experience charts, attribute charts, skill charts. he could have is so depending on the weapon you have effects EVERYTHING you do in battle.

Cryophile
09 Jan 2004, 20:09
I was going to make an AD&D game once... I never got around to it lol.

endymion
07 Feb 2004, 15:22
wow my battle system is nowhere near that complex...then again im only on the first 1/4 of my first game so im using workarounds and tossing the rand(#;#) function liberally around.

I need to learn ASL i guess...use real coding so all the battles arent scripted.