A high fantasy MORPG inspired by the MUDs of olde.
- Node.js (recommended: 8.0.0+)
- npm (needed: 5.x+)
- MongoDB (recommended: 3.4.4+, or a hosted service, like MLab)
- Redis (or a hosted redis service, like Redis Lab)
npm install
npm run setup
npm start
(or runnpm run start:client
andnpm run start:server
separately)
First, create a .env
file in the root. Then, populate it with these values:
MONGODB_URI
- the URI that leads to a mongodb instance (for example:mongodb://localhost:27017/rair
)REDIS_URL
- a URI that leads to a redis cache (for example:redis://localhost:6379
)
If you want to use Auth0, you can set this value (if you don't, see the section Authenticating Locally below):
AUTH0_SECRET
- Auth0 server secret
If you want strict validation of users (ie, if you're doing anything sensitive like taking payments), set these values:
AUTH0_JWKS_URI
- the URI that leads to the Auth0 JWKS JSON file
If you want to test Discord integration, you can also add:
DISCORD_SECRET
- the discord secret for your discord botDISCORD_GUILD
- the discord guild for your discord botDISCORD_WATCHER_ROLE
- the watcher role for your discord bot (default: "Event Watcher")DISCORD_VERIFIED_ROLE
- the role for a user to get when they connect their discord (default: "Verified")DISCORD_MUTED_ROLE
- the role for a user who is muted in game (default: "Muted")DISCORD_SUBSCRIBER_ROLE
- the role for a user to get when they subscribe (default: "Subscriber")DISCORD_ONLINE_ROLE
- the role for a user who is "always online" (default: Online In Lobby)DISCORD_CHANNEL
- the id of the channel for your discord bot to talk inDISCORD_BOT_CHANNEL
- the id of the channel for your discord bot to listen for commands inDISCORD_BOT_NAME
- the name of the bot as it was set up (default: "LandOfTheRairLobby")
Also, your bot will need a role that can assign roles.
If you want to test Stripe, you need to add:
STRIPE_TOKEN
- the Stripe secret key
If you want to test GameAnalytics, you need to add:
GAMEANALYTICS_GAME_KEY
- the GameAnalytics game keyGAMEANALYTICS_SECRET_KEY
- the GameAnalytics secret key
For initial setup, run this:
npm run setup
For subsequent updates and specific changes, you can run these instead:
npm run seed:items
- this will populate the database with itemsnpm run seed:npcs
- this will populate the database with npc datanpm run seed:drops
- this will populate the database with drop table datanpm run seed:recipes
- this will populate the database with recipe datanpm run task:macros
- this will generate the macro icon metadata. If you add new icons, please only take from my repository.
If you do not want to use Auth0 for some particular reason, you can bypass it by adding ?username=myusername
to the URL. This does not work in production mode.
If you want to do any debugging, you'll need to make yourself a GM. To do that, you'll want to set your account to be a GM. Open up a mongo shell or run this query through an external tool:
db.accounts.update({ username: 'YOUR_ACCOUNT_NAME' }, { $set: { isGM: true } });
You only need to do this once.
By default, the client is configured to connect to localhost
. If you want to connect somewhere else (say, you're using a VM), you can change src/client/environments/environment.ts
to reflect the location of your server. For example, if you're developing in a VM, you probably want to change the two instances of localhost
to be the IP of the VM.
Some routes are enabled for debugging purposes and are otherwise unused. You can visit:
/server
for server stats/premium-stats
for premium buying stats/item-stats
for avg. item stats/item-csv
for the item database dumped to a CSV/logs
for server logs (log entries expire after 6h)/maps
to see all of the maps in the game presently
Some commands are hidden and don't really need to be used by players, but should be used when testing out moderation features. Commands have varying prefixes, such as:
~
- an internal command used by the UI~~
- a debugging command for players^
- a command for testers (and GMs)@
- a command for GMs
~clear
- clear the command buffer~drink
- drink a potion from your potion slot~interact
- called when clicking on something interactable~look
- look at the ground (only used by~search
)~move
- called when clicking on the map to move~restore
- be dead no more~say
- talk to other players nearby~search
- search corpses on the ground, then look~talk
- called automatically when doingxxx, message
- will trigger appropriate dialog for an npc if it has any~trait
- buy traits~unapply
- unapply a buff by name~use
- use an item
~~bonuses
- see the current map bonuses~~pos
- get your current x, y, and map~~reset
- reset your buffs and additionalStats~~items
- count the number of items in the world~~mobs
- count the number of mobs in the world~~ping
- check your ping~~flagged
- check your flagged skills~~lag
- runpos
,items
,mobs
, andping
~~combatlogstart <maxentries=1000>
- start logging combat data (this will clear any existing combat log data) - more than 1000 entries is not recommended~~combatlogstop
- stop logging combat data~~combatlogdownload
- download a CSV of your combat log data~~togglefov
- toggle the FOV (dark spaces) on/off
Certain accounts designated as testers get access to several in game commands:
^gold <gold>
- gain<gold>
gold^loadout <level>
- generate a loadout for your class level^level <level>
- set your level to<level>
^owts <boost>
- increase all of your worn/held gear with an Owts enchantment by<boost>
^hp <newhp>
- set your hp to<newhp>
^mp <newmp>
- set your mp to<newmp>
^regen <newregen>
- set your hp/mp regen to<newregen>
^skills <level>
- set your skills to<level>
^stats <level>
set your stats to<level>
^traits
- reset your traits and gain 1000 TP
As a GM, you get access to several commands in the lobby:
/motd <motd>
- set the MOTD in the lobby/resetmotd
- unset the MOTD/alert <msg>
- alert every player with a certain message (very annoying!)/subscribe <period> <account>
- set the account on a trial subscription lasting forperiod
days/unsubscribe <account>
- remove the accounts subscription/silver <silver> <account>
- givesilver
silver to the target account/tester <account>
- makeaccount
a test account/kick <account>
- kickaccount
from the lobby/festival <festivalish>
- update the global festival data using festivalish (settings that can be changed areGameSettings
, see below)
You also get access to some commands in-game:
@allegiance <allegiance>
- change your allegiance toallegiance
. IfGM
is specified, then you will be non-hostle to everything, and they will be non-hostile to you@gold <num>
- create gold on your tile@currency <type> <num>
- give yourselfnum
oftype
currency@item <item name>
- create a particular item on your tile@itemdupe
- copy your right hand to your left hand@copyplayer <name>
- copy the stats, skills, gear, and traits ofplayer
@examine <nothing|npcish> <nothing|prop>
- ifnpcish
is specified, will examine an npc (ifprop
is specified, it will print only that prop). Otherwise, it'll examine your right hand item@itemforge propsish
- create an item using props syntax, for example:sprite=1 type=Hammer stats.str=1
@mapnpcstat propsish
- modify the stats of all NPCs on the map bypropsish
@skill <skillname> <xpgain>
- gainxpgain
skill forskillname
@tp <tpgain>
- gaintpgain
trait points@axp <axpgain>
gainaxp
AXP@xp <xp>
- gainxp
XP@intercept <target>
- you will see log messages as this target (as well as your own).@kill <target>
- will instantly killtarget
@lootvortex <radius>
- pull every item inradius
tiles to the current one@itemmod propsish
- modify your rightHand item based on props specified, for example:ounces=10
@npcmod npcish propsish
- modify the npc based on propsish@partyjoin partyname
- automatically joinpartyname
if it exists, regardless of leader visibility@respawn lairname
- respawnlairname
on the current map@searchitems itemname
- search all the items for itemname@searchnpcs npcname
- search all the items for npcname@spawnnpc npc.npcId="NPC Internal ID" spawner.*=*
- spawn a monster of the given id, with optional spawner props@summon playerish
- summon any player who matches playerish@teleport <x> <y> [map]
- teleport to X,Y, and if map is specified, you'll also change maps@teleporttile <x> <y> <map>
- create a teleport tile to X, Y, Map that anyone can use@teleportto npcish
- teleport to an npc matching a name like npcish@sight
- give yourself the ability to see through walls
Internally, there are a large handful of game settings that control how players gain anything. They are pretty self-explanatory:
xpMult
- the xp multiplier, default 1axpMult
- the ancient xp multiplier, default 1skillMult
- the skill multiplier, default 1goldMult
- the gold multiplier, default 1itemFindMult
- the item find multiplier, default 1numberOfRandomStatsForItems
- the number of random stats an item can generate with, default 0randomStatMaxValue
- the max value a random stat can be on an item, default 0randomStatChance
- the chance of an item generating with a random stat (1-1000000), default 0