Skip to content

Commit

Permalink
Merge pull request #11 from wizguin/develop
Browse files Browse the repository at this point in the history
1.10.0-beta
  • Loading branch information
wizguin authored Oct 6, 2024
2 parents 5cc0f5f + 4e36ada commit a73f9bd
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 2 deletions.
104 changes: 104 additions & 0 deletions data/rooms.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
"game": 0,
"spawn": 1
},
{
"id": 210,
"name": "sport",
"member": 0,
"maxUsers": 80,
"game": 0,
"spawn": 0
},
{
"id": 220,
"name": "lodge",
Expand Down Expand Up @@ -143,6 +151,14 @@
"game": 0,
"spawn": 0
},
{
"id": 803,
"name": "agent",
"member": 0,
"maxUsers": 80,
"game": 0,
"spawn": 0
},
{
"id": 805,
"name": "berg",
Expand Down Expand Up @@ -223,6 +239,22 @@
"game": 1,
"spawn": 0
},
{
"id": 907,
"name": "mission1",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 908,
"name": "mission2",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 909,
"name": "thinice",
Expand All @@ -231,6 +263,14 @@
"game": 1,
"spawn": 0
},
{
"id": 911,
"name": "mission3",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 912,
"name": "waves",
Expand All @@ -239,6 +279,30 @@
"game": 1,
"spawn": 0
},
{
"id": 913,
"name": "mission4",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 914,
"name": "mission5",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 915,
"name": "mission6",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 916,
"name": "sub",
Expand All @@ -247,6 +311,46 @@
"game": 1,
"spawn": 0
},
{
"id": 920,
"name": "mission7",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 921,
"name": "mission8",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 922,
"name": "mission9",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 923,
"name": "mission10",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 927,
"name": "mission11",
"member": 0,
"maxUsers": 80,
"game": 1,
"spawn": 0
},
{
"id": 951,
"name": "sensei",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yukon-server",
"version": "1.9.0-beta",
"version": "1.10.0-beta",
"description": "A server for https://github.com/wizguin/yukon",
"scripts": {
"dev": "babel-watch ./src/World.js Login Blizzard",
Expand Down
32 changes: 31 additions & 1 deletion src/plugin/plugins/game/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default class Chat extends GamePlugin {
this.events = {
'send_message': this.sendMessage,
'send_safe': this.sendSafe,
'send_emote': this.sendEmote
'send_emote': this.sendEmote,
'send_joke': this.sendJoke,
'send_tour': this.sendTour
}

this.commands = {
Expand Down Expand Up @@ -82,6 +84,34 @@ export default class Chat extends GamePlugin {
user.room.send(user, 'send_emote', { id: user.id, emote: args.emote }, [user], true)
}

sendJoke(args, user) {
if (!hasProps(args, 'joke')) {
return
}

if (!isNumber(args.joke)) {
return
}

user.room.send(user, 'send_joke', { id: user.id, joke: args.joke }, [user], true)
}

sendTour(args, user) {
if (!hasProps(args, 'roomId')) {
return
}

if (!isNumber(args.roomId)) {
return
}

if (args.roomId !== user.room.id) {
return
}

user.room.send(user, 'send_tour', { id: user.id, roomId: args.roomId }, [user], true)
}

// Commands

bindCommands() {
Expand Down
13 changes: 13 additions & 0 deletions src/plugin/plugins/game/Item.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import GamePlugin from '@plugin/GamePlugin'


const tourItem = 428
const tourPostcard = 126
const agentItem = 800
const agentPostcard = 127

export default class Item extends GamePlugin {

constructor(handler) {
Expand Down Expand Up @@ -40,6 +45,14 @@ export default class Item extends GamePlugin {
const slot = this.db.slots[item.type - 1]
user.inventory.add(args.item)

if (args.item === tourItem) {
user.addSystemMail(tourPostcard)
}

if (args.item === agentItem) {
user.addSystemMail(agentPostcard)
}

user.updateCoins(-item.cost)
user.send('add_item', { item: args.item, name: item.name, slot: slot, coins: user.coins })
}
Expand Down

0 comments on commit a73f9bd

Please sign in to comment.