Neverquest
Elexxorine
19 Jan 2006, 11:27I'm currently making a game called neverquest, it's questnet. after 1 weeks of programming i have done: logging in/out, registering, talking to players, shops. so far it's going good and everything works. but there's a few things a wanted to ask:
1/ this there a battle code already, if not i'm going to have to sort mine out (which'll be horrific).
if anyone would like to join me in making it or be a tester etc... just ask.
1/ this there a battle code already, if not i'm going to have to sort mine out (which'll be horrific).
if anyone would like to join me in making it or be a tester etc... just ask.
lyteside
19 Jan 2006, 16:37I'd love to help out however i can, man. give me a holler on my aim or msn or something.
Elexxorine
20 Jan 2006, 13:40Anywawy cos i feel like it I'm posting version 2b, which isn't compltely finished. I've coded everything myself, and everything works.
' "neverquest"
' Created with QDK 3.53 - UNREGISTERED VERSION
!include <net.lib>
' Version history:
' 1: game created, rooms, player objects and log in scripts done.
' 2: admin room, interaction commands and register scripts done.
' 2a: shops added, buying done... to do: selling (need inventory first).
' 2b: inventory added, partially.
' to do: finish inv and do seeling thing. add to when given stuff,
' take when drop etc.. equiping items, and displaying them when
' looking at another player,
'
' problems/thoughts: how the fuck am i going to do this?
'
'
' future versions:
' 2c: finish all shops (including inn) in Xelenq and add all the items i
' can think off. add taking and dropping commands, inventory
' command (look at your inv), add shopkeepers with talk to functions.
' 3: add quest log (arg!) to players, make a few simple quests, finish guild
' hall and add guild features. expand wilderness and maybe add some
' villages.
' 3a: add battles, exp, leveling, and skills (arg!). (should have 3 page long
' player objects by now!). add loads of monsters, make a proper new town
' and a dungeon.
'
' times: 1=12/1, 2=14/1, 2a=17/1, 2b=18/1.
' hopefully: 2c by 22/1, 3 by 29, 3a by 5/2. HOPEFULLY!!!
define game <neverquest>
asl-version <350>
gametype multiplayer
start <menu>
game author <elexxorine>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
background <black>
foreground <white>
description {
msg <|cr|b#quest.formatroom[userid]#|cb|xb|n#quest.lookdesc[userid]#>
if ( #quest.currentroom[userid]# <> menu ) or ( #quest.currentroom[userid]# <> admin room ) then {
set numeric <numnum; 0>
for each object in <player_store> {
set <numnum; %numnum% + 1>
if ( #quest.thing# = #name[numnum]# ) then {
set string <location[numnum]; #quest.currentroom[numnum]#>
set string <flocation[numnum]; #quest.formatroom[numnum]#>
property <#name[numnum]#; l_room=#location[numnum]#>
property <#name[numnum]#; fl_room=#flocation[numnum]#> } } }
set numeric <health[userid]; 0>
set numeric <gold[userid]; 0> }
command <adminpass> {
if property <#name[userid]#; admin> then {
msg <Please type in password:>
enter <ad_pass>
if ( #ad_pass# = smeg ) then goto <admin room>
else msg <Incorrect password.>
}
else msg <You aren't allowed to do that.>
}
startscript msg <|s14|bPlease ingore errors to do with array indexing, not finding strings and lack of properties, esp. when just starting the game.|s0 |xb>
player startscript {
background <black>
foreground <white>
msg <|s20|jcWELCOME TO |clELEXXORINE'S|cr NEVERQUEST|cb.|n|s00|jlType '|crhelp|cb' at any time for help (if new it's suggested you do so now), or '|cr/tell elexxorine |imessage|xi|cb' to send a message to elexxorine.> }
command </who> {
for each object in <player_store> if property <#quest.thing#; loggedin> then msg <|b$displayname(#quest.thing#)$:|xb $objectproperty(#quest.thing#; fl_room)$> }
disconnect {
property <#name[userid]#; not loggedin> }
command </tell #person# #words#> {
msg <|cr|bYou tell $capfirst(#person#)$:|xb #words#|cb>
for each object in <player_store> {
if ( #quest.thing# = #person# ) then {
msgto <$objectproperty(#quest.thing#; userid)$; |cr|b$capfirst(#name[userid]#)$ tells you:|xb #words#|cb> } } }
command </say #words#; say #words#> {
set string <talker; #name[userid]#>
for each object in <#quest.currentroom[userid]#> {
if ( $objectproperty(#quest.thing#;alias)$ = #talker# ) then {
msgto <$objectproperty(#quest.thing#;userid)$; |b|clYou say:|xb #words#|cb> }
else {
msgto <$objectproperty(#quest.thing#;userid)$; |cl|b$capfirst(#talker#)$ says:|xb #words#|cb> } } }
command <log out> do <log out>
command </shop list> {
if property <#quest.currentroom[userid]#; shop> then do <shop_list> else msg <This is not a shop.> }
command <help; /help> do <help1disp>
define variable <health>
scope local
display <HP: $objectproperty(#name[userid]#;c_hp)$ / $objectproperty(#name[userid]#;max_hp)$>
value <0>
end define
define variable <money>
scope local
display <Gold: $objectproperty(#name[userid]#;gold)$.>
value <0>
end define
command </buy #num# #shopitem#> {
if property <#quest.currentroom[userid]#; shop> then {
set numeric <num; #num#>
if ( %num% = 0 ) then msg <"Fine..."> else {
if here <#shopitem#> then if property <#shopitem#; shopitem> then {
set numeric <num2; $objectproperty(#shopitem#; number)$>
if ( %num% > %num2% ) then msg <"We don't have that many..."> else {
set numeric <number; $objectproperty(#shopitem#;number)$>
set string <quest.thing; #shopitem#>
do <price_calc>
' set numeric <moneyi; $objectproperty(#shopitem#;s_price)$>
set numeric <moneyi; %sellprice% * %num%>
set numeric <moneys; $objectproperty(#name[userid]#; gold)$>
if ask <%num% #shopitem#(s) cost %moneyi%, you have %moneys%. Are you sure you want to buy?> then {
if ( %moneyi% > %moneys% ) then {
msg <"I'm sorry, but you don't seem to have enough money ..."> }
else {
set numeric <pprice; %moneys% - %moneyi%>
property <#name[userid]#; gold=%pprice%>
set <num2; %num2% - %num%>
property <#shopitem#; number=%num2%>
msg <You had over %moneyi% gold and receive %num% #shopitem#(s). |crNOTE: NOT FINISHED!!!|cb to do: add to inventory...> } }
else msg <"Fine..."> } }
else msg <"I'm sorry, but we don't sell that here."> } }
else msg <This isn't a shop.> }
end define
define options
login off
register off
end define
define synonyms
end define
define room <menu>
alias <Menu>
look <Welcome to |clElexxorine's |crNeverQuest|cb. Please type 'log in' or 'register'.>
command <log in> do <log_in>
command <register> do <register>
end define
define room <town1, bar>
alias <Leaky Drain Pipe, Xelenq>
prefix <The>
look <This is a small and dank pub, filled with people of all shapes and sizes. At the back of the room is the bar tender who can serve you drinks and you rent rooms from. There's also a message board on the wall with many notices about jobs, quests, and other random stuff.>
out <town1, street>
end define
define room <town1, street>
alias <Main Square, Xelenq>
look <You are standing in the main square of Xelenq, the largest city in NeverQuest, in fact I think it's the only one. There's a pub, a few shops and a guild hall, as well as an alley way behind the pub. To the east is the outside world. To the west is a street full of shops.>
north <town1, bar>
south <town1, guild1>
east <wild1, area1>
west <town1, street2>
northwest <town1, alley>
end define
define room <town1, street2>
alias <Shopping street, Xelenq>
look <On three side of you are shops: a weapon smith's, an armoury and a general store. Litter is sqattered about the place and a small black cat sits on a crate, staring at you. To the east is the main square of Xelenq.>
north <town1, shop1>
south <town1, shop3>
east <town1, street>
west <town1, shop2>
end define
define room <town1, alley>
alias <Alleyway, Xelenq>
look <It is dark in the alley and you cannot make much out. The floor is covered in rubbish and empty crates. As you enter a cat runs away and leeps over a fense to freedom. You can hear the sound of rats chattering and gnoring on the waste.>
southeast <town1, street>
end define
define room <town1, shop1>
alias <Weapon smith's, Xelenq>
look <Bast is sitting by the counter, waiting for a customer. There's an anvil near the wall and many tools and bits of metal hanging on the walls.|n|nType '|cr/shop list|cb' to see what's for sale.>
out <town1, street2>
properties <shop>
define object <knife>
properties <invisible; shopitem; number=5; m_price=15; s_price=0; b_price=0>
end define
define object <staff>
properties <invisible; shopitem; number=2; m_price=16; s_price=0; b_price=0>
end define
end define
define room <town1, shop2>
alias <Armour shop, Xelenq>
out <town1, street2>
end define
define room <town1, shop3>
alias <General store, Xelenq>
out <town1, street2>
end define
define room <town1, guild1>
alias <Guild hall, Xelenq>
out <town1, street>
end define
define room <wild1, area1>
alias <Misty Thicket>
west <town1, street>
end define
define room <player_store>
look <All player objects (the one's storing all the infomation about each player) are soted here.>
define object <Elexxorine>
look <Elexxorine is the creator of NeverQuest.>
displaytype <Admin>
properties <id=1; userid=; real; not loggedin; pass=hello; headadmin; admin; max_hp=100; c_hp=100; l_room=admin room; fl_room=admin room; gold=30000; wear_head=; wear_legs=fclothleg; wear_body=fclothtop; wear_boots=fleathboot; wear_back=furcloak; equip_body=mithcuirass; equip_shoulder=mithpauld; equip_legs=mithgreave; equip_weapon=banesword; item_knife=0; item_staff=0>
end define
define object <Tron>
displaytype <Player>
properties <id=2; userid=; real; not loggedin; pass=poopy; max_hp=10; c_hp=10; l_room=start; fl_room=start; gold=50; wear_head=; wear_legs=; wear_body=; wear_boots=; wear_back=; equip_body=; equip_shoulder=; equip_legs=; equip_weapon=; item_knife=0; item_staff=0>
end define
end define
define room <admin room>
alias <Admin Room>
look <Here you can control things about the game. A list of commands can be found by typing '/listc' and a list of real room names with '/listr'. The fomat for changing properties is as follows:|n|bValued:|xb Typing 'change USERNAME prop PROPERTY to VALUE' will change that person's property to the new value, where 'username' is their name, 'property' is the property to be changed, and 'value' is the new value.|n|bT/F:|xb Type 'change USERNAME prop PROPERTY |ion|xi/|ioff|xi' will set a non-value property to either true or false.|n|nYou can teleport by typing 'teleport PLACE', the place's name must be called by its coded name, a list of these can be found by typing '/listr'.>
command </listc> msg <Here is a list of commands and what they do:|n|bteleport PLACE|xb: This is a short form of typing 'change |iyour name|xi prop l_room to PLACE' then making it as if you typed 'leave'. The room's real name must be used. Typr '/listr' for the full list.>
command </listr> msg <Here is a list of the real room names:|n|bXelenq:|xball rooms in this town start 'town1, ' followed by their name: (just in Xelenq=street), the inn=bar, weaponshop=shop1.>
command <leave> if ask <Are you sure you want to leave the admin room?> then goto <$objectproperty(#name[userid]#; l_room)$>
command </teleport #place#> {
if ask <Are you sure you want to teleport to #place#?> then goto <#place#> }
command </change #person# prop #prop# to #value#> {
property <#person#; #prop#=#value#>
msg <you have changed #perosn#'s #prop# property to #value#> }
command <#person# #prop# to #value#> {
property <#person#; #prop#=#value#>
msg <you have changed #perosn#'s #prop# property to #value#> }
end define
define procedure <get_name>
for each object in <player_store> {
set numeric <idnum; $objectproperty(#quest.thing#;id)$>
if ( %idnum% = %num[userid]% ) then set string <name[userid]; $displayname(#quest.thing#)$>
}
end define
define room <item_storage>
define object <banesowrd>
alias <bane sword>
end define
define object <fclothtop>
alias <fine cloth shirt>
end define
define object <fclothleg>
alias <fine cloth legs>
end define
define object <fleathboot>
alias <fine leather boots>
end define
define object <furcloak>
alias <fur cloak>
end define
define object <mithpauld>
alias <mithrel pauldrons>
end define
define object <mithcuirass>
alias <mithrel cuirass>
end define
define object <mithgreave>
alias <mithrel greaves>
end define
end define
define procedure <log_in>
msg <Please enter your username:>
enter <user_name>
if property <#user_name#; real> then {
if property <#user_name#; loggedin> then msg <That player is already logged in.>
else {
msg <Please enter your password:>
enter <user_pass>
set numeric <num[userid]; $objectproperty(#user_name#;id)$>
do <get_name>
set string <password; $objectproperty(#name[userid]#;pass)$>
if ( #password# = #user_pass# ) then {
set <num[userid]; $objectproperty(#user_name#; id)$>
property <#name[userid]#; loggedin>
msg <Welcome, #name[userid]#, to Elexxorine's |crNeverQuest|cb.>
msg <You are player %userid%.>
property <player%userid%; alias=#name[userid]#>
property <player%userid%; look=$objectproperty(#name[userid]#;look)$>
property <player%userid%; userid=%userid%>
property <#name[userid]#; userid=%userid%>
wait <Press any key to enter the game.>
clear
goto <town1, street>
}
else msg <Sorry, incorrect password.>
}
}
else msg <User doesn't exist, please type 'register' to create a user.>
end define
define procedure <register>
msg <Please enter your chosen username.>
enter <user_name>
msg <Your name is #user_name#. Please enter your chosen password:>
enter <passw>
msg <Password is: #passw#>
for each object in <player_store> set numeric <scanid; $objectproperty(#quest.thing#;id)$>
inc <scanid>
create object <#user_name#; player_store>
property <#user_name#;real>
property <#user_name#; max_hp=10>
property <#user_name#; c_hp=10>
property <#user_name#; l_room=>
property <#user_name#; pass= #passw#>
property <#user_name#; id=%scanid%>
msg <Your new id number is $objectproperty(#user_name#;id)$>
end define
define procedure <log out>
if ask <Are you sure you want to log out?> then {
property <#name[userid]#; not loggedin>
disconnect <%userid%> }
end define
define procedure <shop_list>
for each object in <#quest.currentroom[userid]#> {
if property <#quest.thing#; shopitem> then {
set numeric <number; $objectproperty(#quest.thing#;number)$>
if ( %number% > 0 ) then {
do <price_calc>
msg <|b$capfirst(#quest.thing#)$:|xb|nBuy for: $objectproperty(#quest.thing#;s_price)$.|nSell for: $objectproperty(#quest.thing#;b_price)$.> }
else {
property <#quest.thing#; b_price=$objectproperty(#quest.thing#; m_price)$>
msg <|b$capfirst(#quest.thing#)$:|xbSOLD OUT!|nBuying for: $objectproperty(#quest.thing#;b_price)$.> } } }
msg <|crTo buy something type '/buy NUMBER ITEM', eg: '/buy 4 staff'.|cb>
end define
define procedure <price_calc>
set numeric <maxprice; $objectproperty(#quest.thing#;m_price)$>
set numeric <sellprice; %maxprice% / %number%>
property <#quest.thing#; s_price=%sellprice%>
set numeric <buyprice; %number% * 2>
set numeric <buyprice; %maxprice% / %buyprice%>
property <#quest.thing#; b_price=%buyprice%>
end define
define procedure <help1disp>
msg <|b|s12Quick help:|xb>
msg <|s00|bTalking to other players:|xb '|cr/say|cb' followed by a message will tell the message to everyone in the room.|n'|cr/tell|cb' followed by who you want to send the message to, then the message, will send it to just that person.|n>
msg <|bOther commands:|xb In Xelenq, all special commands are given to you when needed, for example when entering a shop it will tell you want to do each step of the way.|n>
msg <|bFew kinks and bugs:|xb Due to the coding you may notice a few odd happens, eg: your money display only updates after leaving a shop not right after buying something.|n>
msg <|bGrammar:|xb For those who really hate bad grammar, please do not haggle me about agreeing numbers, i have put '(s)' wherever the number may change. This problem is due to the asl way of coding, not me.|n>
msg <|bIf you notice a problem:|xb DONOT hesitate to tell me (Elexxorine) that something's not working, type '/tell elexxorine |imessage|xi' to tell me.>
msg <|bMore help:|xb For more help, you can ask Elexxorine or any other admin (type '/tell elexxorine |imessage|xi'), anybody else will also help you.|n>
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define