V0.1.9 Closes #423, #424, #427, #428, #426, #352, #419, #201, #378, #416, #295, #72, #217, #266, #214, #405, #409, #408, #404, and #297 See merge request Isleward/isleward!255tags/v0.1.9^0
@@ -2,14 +2,11 @@ | |||
A multiplayer, moddable, extensible roguelike built with NodeJS, JS, HTML and CSS | |||
[Play in Browser](http://play.isleward.com/) | [Discord](https://discord.gg/gnsn7ZP) | [Subreddit](https://www.reddit.com/r/isleward) | [Blog](http://blog.isleward.com/) | [Wiki](http://wiki.isleward.com/Main_Page) | [Twitter](https://twitter.com/bigbadwofl) | [Patreon](http://patreon.com/bigbadwaffle) | |||
### Installation | |||
1. Download and install NodeJS: `https://nodejs.org/en/download/` | |||
2. Open a new console window | |||
2. Get the code: `git clone https://gitlab.com/Isleward/isleward.git` | |||
3. Navigate to the server folder: `src/server` | |||
4. Install dependencies: `npm install` | |||
5. Run: `node --expose-gc index.js` | |||
[Play Now](http://play.isleward.com/) | [Discord](https://discord.gg/gnsn7ZP) | [Subreddit](https://www.reddit.com/r/isleward) | [Blog](http://blog.isleward.com/) | [Wiki](http://wiki.isleward.com/Main_Page) | [Twitter](https://twitter.com/bigbadwofl) | [Patreon](http://patreon.com/bigbadwaffle) | |||
### Installation and Usage | |||
* [Windows](https://gitlab.com/Isleward/isleward/wikis/installation-and-usage-(windows)) | |||
* [Linux](https://gitlab.com/Isleward/isleward/wikis/installation-and-usage-(linux)) | |||
* [MacOS](https://gitlab.com/Isleward/isleward/wikis/installation-and-usage-(macos)) | |||
![Ingame Screenshots](http://i.imgur.com/p4ktJ5O.png) |
@@ -0,0 +1,385 @@ | |||
{ "backgroundcolor":"#32222e", | |||
"height":4, | |||
"layers":[ | |||
{ | |||
"data":[377, 377, 337, 377, 337, 377, 377, 495, 495, 340, 377, 377, 377, 377, 337, 377], | |||
"height":4, | |||
"name":"tiles", | |||
"opacity":0.550000011920929, | |||
"properties": | |||
{ | |||
"tileset":"tiles" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":4, | |||
"name":"doodads", | |||
"opacity":1, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[29, 31, 0, 117, 0, 0, 0, 0, 0, 0, 0, 30, 30, 138, 0, 209], | |||
"height":4, | |||
"name":"walls", | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"tileset":"walls" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"mobs", | |||
"objects":[ | |||
{ | |||
"gid":314, | |||
"height":8, | |||
"id":824, | |||
"name":"", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":8, | |||
"x":8, | |||
"y":16 | |||
}], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"faction":"2", | |||
"tileset":"mobs" | |||
}, | |||
"propertytypes": | |||
{ | |||
"faction":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"objects", | |||
"objects":[], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"blocking":"1", | |||
"tileset":"objects" | |||
}, | |||
"propertytypes": | |||
{ | |||
"blocking":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"clientObjects", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"notices", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"rooms", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}], | |||
"nextobjectid":826, | |||
"orientation":"orthogonal", | |||
"properties": | |||
{ | |||
"instanced":"0", | |||
"name":"Test Zone", | |||
"spawn":"[{\"maxLevel\":1,\"x\":100,\"y\":186},{\"maxLevel\":999,\"x\":132,\"y\":118}]" | |||
}, | |||
"propertytypes": | |||
{ | |||
"instanced":"string", | |||
"name":"string", | |||
"spawn":"string" | |||
}, | |||
"renderorder":"right-down", | |||
"tileheight":8, | |||
"tilesets":[ | |||
{ | |||
"columns":8, | |||
"firstgid":1, | |||
"image":"..\/..\/src\/client\/images\/walls.png", | |||
"imageheight":256, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"walls", | |||
"spacing":0, | |||
"tilecount":256, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"2": | |||
{ | |||
"probability":0.600000023841858 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.800000011920929 | |||
}, | |||
"3": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"4": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"50": | |||
{ | |||
"probability":0.400000005960464 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.100000001490116 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":257, | |||
"image":"..\/..\/src\/client\/images\/mobs.png", | |||
"imageheight":80, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"mobs", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":8, | |||
"tileproperties": | |||
{ | |||
"19": | |||
{ | |||
"portal":"midgaard-inn-room_2,1" | |||
} | |||
}, | |||
"tilepropertytypes": | |||
{ | |||
"19": | |||
{ | |||
"portal":"string" | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":337, | |||
"image":"..\/..\/src\/client\/images\/tiles.png", | |||
"imageheight":192, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"tiles", | |||
"spacing":0, | |||
"tilecount":192, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":2 | |||
}, | |||
"11": | |||
{ | |||
"probability":4 | |||
}, | |||
"14": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"2": | |||
{ | |||
"probability":4 | |||
}, | |||
"23": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"24": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"3": | |||
{ | |||
"probability":7 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":10 | |||
}, | |||
"38": | |||
{ | |||
"probability":3 | |||
}, | |||
"39": | |||
{ | |||
"probability":3 | |||
}, | |||
"40": | |||
{ | |||
"probability":15 | |||
}, | |||
"41": | |||
{ | |||
"probability":2 | |||
}, | |||
"42": | |||
{ | |||
"probability":26 | |||
}, | |||
"47": | |||
{ | |||
"probability":10 | |||
}, | |||
"5": | |||
{ | |||
"probability":0.00999999977648258 | |||
}, | |||
"54": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"6": | |||
{ | |||
"probability":0.00499999988824129 | |||
}, | |||
"7": | |||
{ | |||
"probability":0.100000001490116 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"9": | |||
{ | |||
"probability":4 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":529, | |||
"image":"..\/..\/src\/client\/images\/objects.png", | |||
"imageheight":176, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"objects", | |||
"spacing":0, | |||
"tilecount":176, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"42": | |||
{ | |||
"probability":5 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":705, | |||
"image":"..\/..\/src\/client\/images\/bigObjects.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bigObjects", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":785, | |||
"image":"..\/..\/src\/client\/images\/bosses.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bosses", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}], | |||
"tilewidth":8, | |||
"type":"map", | |||
"version":"2017.05.26", | |||
"width":4 | |||
} |
@@ -0,0 +1,385 @@ | |||
{ "backgroundcolor":"#32222e", | |||
"height":4, | |||
"layers":[ | |||
{ | |||
"data":[340, 337, 377, 369, 340, 403, 403, 403, 370, 403, 403, 403, 377, 403, 403, 403], | |||
"height":4, | |||
"name":"tiles", | |||
"opacity":0.550000011920929, | |||
"properties": | |||
{ | |||
"tileset":"tiles" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":4, | |||
"name":"doodads", | |||
"opacity":1, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0], | |||
"height":4, | |||
"name":"walls", | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"tileset":"walls" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"mobs", | |||
"objects":[ | |||
{ | |||
"gid":2147484435, | |||
"height":24, | |||
"id":824, | |||
"name":"", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":24, | |||
"x":8, | |||
"y":32 | |||
}], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"faction":"2", | |||
"tileset":"mobs" | |||
}, | |||
"propertytypes": | |||
{ | |||
"faction":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"objects", | |||
"objects":[], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"blocking":"1", | |||
"tileset":"objects" | |||
}, | |||
"propertytypes": | |||
{ | |||
"blocking":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"clientObjects", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"notices", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"rooms", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}], | |||
"nextobjectid":826, | |||
"orientation":"orthogonal", | |||
"properties": | |||
{ | |||
"instanced":"0", | |||
"name":"Test Zone", | |||
"spawn":"[{\"maxLevel\":1,\"x\":100,\"y\":186},{\"maxLevel\":999,\"x\":132,\"y\":118}]" | |||
}, | |||
"propertytypes": | |||
{ | |||
"instanced":"string", | |||
"name":"string", | |||
"spawn":"string" | |||
}, | |||
"renderorder":"right-down", | |||
"tileheight":8, | |||
"tilesets":[ | |||
{ | |||
"columns":8, | |||
"firstgid":1, | |||
"image":"..\/..\/src\/client\/images\/walls.png", | |||
"imageheight":256, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"walls", | |||
"spacing":0, | |||
"tilecount":256, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"2": | |||
{ | |||
"probability":0.600000023841858 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.800000011920929 | |||
}, | |||
"3": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"4": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"50": | |||
{ | |||
"probability":0.400000005960464 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.100000001490116 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":257, | |||
"image":"..\/..\/src\/client\/images\/mobs.png", | |||
"imageheight":80, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"mobs", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":8, | |||
"tileproperties": | |||
{ | |||
"19": | |||
{ | |||
"portal":"midgaard-inn-room_2,1" | |||
} | |||
}, | |||
"tilepropertytypes": | |||
{ | |||
"19": | |||
{ | |||
"portal":"string" | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":337, | |||
"image":"..\/..\/src\/client\/images\/tiles.png", | |||
"imageheight":192, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"tiles", | |||
"spacing":0, | |||
"tilecount":192, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":2 | |||
}, | |||
"11": | |||
{ | |||
"probability":4 | |||
}, | |||
"14": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"2": | |||
{ | |||
"probability":4 | |||
}, | |||
"23": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"24": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"3": | |||
{ | |||
"probability":7 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":10 | |||
}, | |||
"38": | |||
{ | |||
"probability":3 | |||
}, | |||
"39": | |||
{ | |||
"probability":3 | |||
}, | |||
"40": | |||
{ | |||
"probability":15 | |||
}, | |||
"41": | |||
{ | |||
"probability":2 | |||
}, | |||
"42": | |||
{ | |||
"probability":26 | |||
}, | |||
"47": | |||
{ | |||
"probability":10 | |||
}, | |||
"5": | |||
{ | |||
"probability":0.00999999977648258 | |||
}, | |||
"54": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"6": | |||
{ | |||
"probability":0.00499999988824129 | |||
}, | |||
"7": | |||
{ | |||
"probability":0.100000001490116 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"9": | |||
{ | |||
"probability":4 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":529, | |||
"image":"..\/..\/src\/client\/images\/objects.png", | |||
"imageheight":176, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"objects", | |||
"spacing":0, | |||
"tilecount":176, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"42": | |||
{ | |||
"probability":5 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":705, | |||
"image":"..\/..\/src\/client\/images\/bigObjects.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bigObjects", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":785, | |||
"image":"..\/..\/src\/client\/images\/bosses.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bosses", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}], | |||
"tilewidth":8, | |||
"type":"map", | |||
"version":"2017.05.26", | |||
"width":4 | |||
} |
@@ -0,0 +1,385 @@ | |||
{ "backgroundcolor":"#32222e", | |||
"height":4, | |||
"layers":[ | |||
{ | |||
"data":[0, 0, 0, 0, 0, 402, 401, 341, 365, 401, 0, 470, 0, 403, 486, 401], | |||
"height":4, | |||
"name":"tiles", | |||
"opacity":0.550000011920929, | |||
"properties": | |||
{ | |||
"tileset":"tiles" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 684, 0, 0, 683, 0], | |||
"height":4, | |||
"name":"doodads", | |||
"opacity":1, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[342, 382, 343, 342, 383, 0, 0, 0, 0, 0, 0, 0, 382, 0, 0, 0], | |||
"height":4, | |||
"name":"walls", | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"tileset":"walls" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"mobs", | |||
"objects":[ | |||
{ | |||
"gid":2147483930, | |||
"height":8, | |||
"id":823, | |||
"name":"", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":8, | |||
"x":16, | |||
"y":24 | |||
}], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"faction":"2", | |||
"tileset":"mobs" | |||
}, | |||
"propertytypes": | |||
{ | |||
"faction":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"objects", | |||
"objects":[], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"blocking":"1", | |||
"tileset":"objects" | |||
}, | |||
"propertytypes": | |||
{ | |||
"blocking":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"clientObjects", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"notices", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"rooms", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}], | |||
"nextobjectid":824, | |||
"orientation":"orthogonal", | |||
"properties": | |||
{ | |||
"instanced":"0", | |||
"name":"Test Zone", | |||
"spawn":"[{\"maxLevel\":1,\"x\":100,\"y\":186},{\"maxLevel\":999,\"x\":132,\"y\":118}]" | |||
}, | |||
"propertytypes": | |||
{ | |||
"instanced":"string", | |||
"name":"string", | |||
"spawn":"string" | |||
}, | |||
"renderorder":"right-down", | |||
"tileheight":8, | |||
"tilesets":[ | |||
{ | |||
"columns":8, | |||
"firstgid":1, | |||
"image":"..\/..\/src\/client\/images\/walls.png", | |||
"imageheight":256, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"walls", | |||
"spacing":0, | |||
"tilecount":256, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"2": | |||
{ | |||
"probability":0.600000023841858 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.800000011920929 | |||
}, | |||
"3": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"4": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"50": | |||
{ | |||
"probability":0.400000005960464 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.100000001490116 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":257, | |||
"image":"..\/..\/src\/client\/images\/mobs.png", | |||
"imageheight":80, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"mobs", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":8, | |||
"tileproperties": | |||
{ | |||
"19": | |||
{ | |||
"portal":"midgaard-inn-room_2,1" | |||
} | |||
}, | |||
"tilepropertytypes": | |||
{ | |||
"19": | |||
{ | |||
"portal":"string" | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":337, | |||
"image":"..\/..\/src\/client\/images\/tiles.png", | |||
"imageheight":192, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"tiles", | |||
"spacing":0, | |||
"tilecount":192, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":2 | |||
}, | |||
"11": | |||
{ | |||
"probability":4 | |||
}, | |||
"14": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"2": | |||
{ | |||
"probability":4 | |||
}, | |||
"23": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"24": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"3": | |||
{ | |||
"probability":7 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":10 | |||
}, | |||
"38": | |||
{ | |||
"probability":3 | |||
}, | |||
"39": | |||
{ | |||
"probability":3 | |||
}, | |||
"40": | |||
{ | |||
"probability":15 | |||
}, | |||
"41": | |||
{ | |||
"probability":2 | |||
}, | |||
"42": | |||
{ | |||
"probability":26 | |||
}, | |||
"47": | |||
{ | |||
"probability":10 | |||
}, | |||
"5": | |||
{ | |||
"probability":0.00999999977648258 | |||
}, | |||
"54": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"6": | |||
{ | |||
"probability":0.00499999988824129 | |||
}, | |||
"7": | |||
{ | |||
"probability":0.100000001490116 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"9": | |||
{ | |||
"probability":4 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":529, | |||
"image":"..\/..\/src\/client\/images\/objects.png", | |||
"imageheight":176, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"objects", | |||
"spacing":0, | |||
"tilecount":176, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"42": | |||
{ | |||
"probability":5 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":705, | |||
"image":"..\/..\/src\/client\/images\/bigObjects.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bigObjects", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":785, | |||
"image":"..\/..\/src\/client\/images\/bosses.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bosses", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}], | |||
"tilewidth":8, | |||
"type":"map", | |||
"version":"2017.05.26", | |||
"width":4 | |||
} |
@@ -0,0 +1,385 @@ | |||
{ "backgroundcolor":"#32222e", | |||
"height":4, | |||
"layers":[ | |||
{ | |||
"data":[377, 377, 377, 337, 340, 495, 377, 377, 377, 0, 368, 0, 337, 0, 408, 408], | |||
"height":4, | |||
"name":"tiles", | |||
"opacity":0.550000011920929, | |||
"properties": | |||
{ | |||
"tileset":"tiles" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":4, | |||
"name":"doodads", | |||
"opacity":1, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 52, 0, 0, 0, 0, 0, 52, 52, 45, 0, 51, 0, 51, 0, 0], | |||
"height":4, | |||
"name":"walls", | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"tileset":"walls" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":4, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"mobs", | |||
"objects":[ | |||
{ | |||
"gid":2147483938, | |||
"height":8, | |||
"id":824, | |||
"name":"", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":8, | |||
"x":24, | |||
"y":32 | |||
}], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"faction":"2", | |||
"tileset":"mobs" | |||
}, | |||
"propertytypes": | |||
{ | |||
"faction":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"objects", | |||
"objects":[], | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"blocking":"1", | |||
"tileset":"objects" | |||
}, | |||
"propertytypes": | |||
{ | |||
"blocking":"string", | |||
"tileset":"string" | |||
}, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"clientObjects", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"notices", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"rooms", | |||
"objects":[], | |||
"opacity":1, | |||
"type":"objectgroup", | |||
"visible":true, | |||
"x":0, | |||
"y":0 | |||
}], | |||
"nextobjectid":825, | |||
"orientation":"orthogonal", | |||
"properties": | |||
{ | |||
"instanced":"0", | |||
"name":"Test Zone", | |||
"spawn":"[{\"maxLevel\":1,\"x\":100,\"y\":186},{\"maxLevel\":999,\"x\":132,\"y\":118}]" | |||
}, | |||
"propertytypes": | |||
{ | |||
"instanced":"string", | |||
"name":"string", | |||
"spawn":"string" | |||
}, | |||
"renderorder":"right-down", | |||
"tileheight":8, | |||
"tilesets":[ | |||
{ | |||
"columns":8, | |||
"firstgid":1, | |||
"image":"..\/..\/src\/client\/images\/walls.png", | |||
"imageheight":256, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"walls", | |||
"spacing":0, | |||
"tilecount":256, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"2": | |||
{ | |||
"probability":0.600000023841858 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.800000011920929 | |||
}, | |||
"3": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"4": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"50": | |||
{ | |||
"probability":0.400000005960464 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.100000001490116 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":257, | |||
"image":"..\/..\/src\/client\/images\/mobs.png", | |||
"imageheight":80, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"mobs", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":8, | |||
"tileproperties": | |||
{ | |||
"19": | |||
{ | |||
"portal":"midgaard-inn-room_2,1" | |||
} | |||
}, | |||
"tilepropertytypes": | |||
{ | |||
"19": | |||
{ | |||
"portal":"string" | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":337, | |||
"image":"..\/..\/src\/client\/images\/tiles.png", | |||
"imageheight":192, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"tiles", | |||
"spacing":0, | |||
"tilecount":192, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"0": | |||
{ | |||
"probability":2 | |||
}, | |||
"11": | |||
{ | |||
"probability":4 | |||
}, | |||
"14": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"2": | |||
{ | |||
"probability":4 | |||
}, | |||
"23": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"24": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"29": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"3": | |||
{ | |||
"probability":7 | |||
}, | |||
"30": | |||
{ | |||
"probability":0.200000002980232 | |||
}, | |||
"31": | |||
{ | |||
"probability":10 | |||
}, | |||
"38": | |||
{ | |||
"probability":3 | |||
}, | |||
"39": | |||
{ | |||
"probability":3 | |||
}, | |||
"40": | |||
{ | |||
"probability":15 | |||
}, | |||
"41": | |||
{ | |||
"probability":2 | |||
}, | |||
"42": | |||
{ | |||
"probability":26 | |||
}, | |||
"47": | |||
{ | |||
"probability":10 | |||
}, | |||
"5": | |||
{ | |||
"probability":0.00999999977648258 | |||
}, | |||
"54": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"6": | |||
{ | |||
"probability":0.00499999988824129 | |||
}, | |||
"7": | |||
{ | |||
"probability":0.100000001490116 | |||
}, | |||
"8": | |||
{ | |||
"probability":0.5 | |||
}, | |||
"9": | |||
{ | |||
"probability":4 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":529, | |||
"image":"..\/..\/src\/client\/images\/objects.png", | |||
"imageheight":176, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"objects", | |||
"spacing":0, | |||
"tilecount":176, | |||
"tileheight":8, | |||
"tiles": | |||
{ | |||
"42": | |||
{ | |||
"probability":5 | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":705, | |||
"image":"..\/..\/src\/client\/images\/bigObjects.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bigObjects", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":785, | |||
"image":"..\/..\/src\/client\/images\/bosses.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bosses", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}], | |||
"tilewidth":8, | |||
"type":"map", | |||
"version":"2017.05.26", | |||
"width":4 | |||
} |
@@ -32,6 +32,21 @@ $(function () { | |||
}, | |||
spritesheet: '../../src/client/images/items.png', | |||
sprite: [0, 4] | |||
}, { | |||
name: `Knight's Leather Glove`, | |||
type: 'Chainmail Glove', | |||
rqr: { | |||
level: 20, | |||
dex: 150 | |||
}, | |||
quality: 3, | |||
stats: { | |||
Vitality: '[20 - 35]', | |||
Dexterity: '[150 - 220]', | |||
'100% chance to be not owned by Entranog': null | |||
}, | |||
spritesheet: '../../src/client/images/items.png', | |||
sprite: [0, 3] | |||
}]; | |||
for (var i = 0; i < items.length - 1; i++) { | |||
@@ -1,6 +1,6 @@ | |||
define([ | |||
'js/rendering/renderer' | |||
], function( | |||
], function ( | |||
renderer | |||
) { | |||
var scale = 40; | |||
@@ -8,6 +8,9 @@ define([ | |||
var auras = { | |||
reflectDamage: 0, | |||
stealth: 1, | |||
regenHp: 9, | |||
regenMana: 10, | |||
swiftness: 11, | |||
holyVengeance: 8, | |||
rare: 16 | |||
}; | |||
@@ -25,14 +28,14 @@ define([ | |||
effects: [], | |||
init: function(blueprint) { | |||
init: function (blueprint) { | |||
var sprite = this.obj.sprite; | |||
this.effects = this.effects | |||
.filter(function(e) { | |||
.filter(function (e) { | |||
return (auras[e] != null); | |||
}, this) | |||
.map(function(e) { | |||
.map(function (e) { | |||
return { | |||
name: e, | |||
sprite: renderer.buildObject({ | |||
@@ -47,13 +50,13 @@ define([ | |||
} | |||
}, this); | |||
}, | |||
extend: function(blueprint) { | |||
extend: function (blueprint) { | |||
if (blueprint.addEffects) { | |||
blueprint.addEffects = blueprint.addEffects | |||
.filter(function(e) { | |||
.filter(function (e) { | |||
return (auras[e] != null); | |||
}) | |||
.map(function(e) { | |||
.map(function (e) { | |||
return { | |||
name: e, | |||
sprite: renderer.buildObject({ | |||
@@ -71,8 +74,8 @@ define([ | |||
this.effects.push.apply(this.effects, blueprint.addEffects || []); | |||
} | |||
if (blueprint.removeEffects) { | |||
blueprint.removeEffects.forEach(function(r) { | |||
var effect = this.effects.find(function(e) { | |||
blueprint.removeEffects.forEach(function (r) { | |||
var effect = this.effects.find(function (e) { | |||
return (e.name == r); | |||
}); | |||
@@ -84,14 +87,14 @@ define([ | |||
sprite: effect.sprite | |||
}); | |||
this.effects.spliceFirstWhere(function(e) { | |||
this.effects.spliceFirstWhere(function (e) { | |||
return (e.name == r); | |||
}); | |||
}, this); | |||
} | |||
}, | |||
update: function() { | |||
update: function () { | |||
this.alpha += this.alphaDir; | |||
if ((this.alphaDir > 0) && (this.alpha >= this.alphaMax)) { | |||
this.alpha = this.alphaMax; | |||
@@ -112,15 +115,15 @@ define([ | |||
useAlpha /= (this.alphaMax - this.alphaCutoff); | |||
} | |||
this.effects.forEach(function(e) { | |||
this.effects.forEach(function (e) { | |||
e.sprite.alpha = useAlpha; | |||
e.sprite.x = x; | |||
e.sprite.y = y; | |||
}, this); | |||
}, | |||
destroy: function() { | |||
this.effects.forEach(function(e) { | |||
destroy: function () { | |||
this.effects.forEach(function (e) { | |||
renderer.destroyObject({ | |||
layerName: 'effects', | |||
sprite: e.sprite | |||
@@ -128,4 +131,4 @@ define([ | |||
}); | |||
} | |||
}; | |||
}); | |||
}); |
@@ -47,7 +47,8 @@ define([ | |||
if (!rerender) { | |||
rerender = ( | |||
(findItem.pos != nItem.pos) || | |||
(findItem.eq != nItem.eq) | |||
(findItem.eq != nItem.eq) || | |||
(findItem.quantity != nItem.quantity) | |||
); | |||
} | |||
@@ -4,7 +4,7 @@ define([ | |||
'js/system/client', | |||
'js/input', | |||
'js/objects/objects' | |||
], function( | |||
], function ( | |||
events, | |||
renderer, | |||
client, | |||
@@ -30,18 +30,21 @@ define([ | |||
sprite: null, | |||
init: function() { | |||
init: function () { | |||
events.on('onUiHover', this.onUiHover.bind(this, true)); | |||
events.on('onUiLeave', this.onUiHover.bind(this, false)); | |||
this.sprite = renderer.buildObject({ | |||
layerName: 'effects', | |||
x: 0, | |||
y: 0, | |||
sheetName: 'ui', | |||
sheetName: 'ui', | |||
cell: 7 | |||
}); | |||
}, | |||
clearPath: function() { | |||
this.path.forEach(function(p) { | |||
clearPath: function () { | |||
this.path.forEach(function (p) { | |||
if (p.sprite) { | |||
renderer.destroyObject({ | |||
sprite: p.sprite, | |||
@@ -53,7 +56,14 @@ define([ | |||
this.path = []; | |||
}, | |||
showPath: function(e) { | |||
onUiHover: function (dunno, onUiHover) { | |||
if (!this.sprite) | |||
return; | |||
this.sprite.visible = !onUiHover; | |||
}, | |||
showPath: function (e) { | |||
if ((e.button != null) && (e.button != 0)) | |||
return; | |||
@@ -70,44 +80,8 @@ define([ | |||
this.sprite.x = (this.hoverTile.x * scale); | |||
this.sprite.y = (this.hoverTile.y * scale); | |||
return; | |||
if ((!e.down) && (!this.mouseDown)) | |||
return; | |||
this.mouseDown = true; | |||
var obj = this.obj; | |||
this.clearPath(); | |||
//We floor the position in case we're charging (subpixel position) | |||
var path = physics.getPath({ | |||
x: ~~this.obj.pather.pathPos.x, | |||
y: ~~this.obj.pather.pathPos.y | |||
}, { | |||
x: this.hoverTile.x, | |||
y: this.hoverTile.y | |||
}); | |||
this.path = path.map(function(p) { | |||
return { | |||
x: p.x, | |||
y: p.y, | |||
sprite: renderer.buildRectangle({ | |||
layerName: 'effects', | |||
x: (p.x * scale) + 4, | |||
y: (p.y * scale) + 4, | |||
w: 24, | |||
h: 24, | |||
color: '0x48edff', | |||
alpha: 0.2 | |||
}) | |||
}; | |||
}); | |||
}, | |||
queuePath: function(e) { | |||
queuePath: function (e) { | |||
this.mouseDown = false; | |||
if ((this.path.length == 0) || (e.down)) | |||
@@ -116,7 +90,7 @@ define([ | |||
client.request({ | |||
cpn: 'player', | |||
method: 'moveList', | |||
data: this.path.map(function(p) { | |||
data: this.path.map(function (p) { | |||
return { | |||
x: p.x, | |||
y: p.y | |||
@@ -128,18 +102,18 @@ define([ | |||
this.path = []; | |||
}, | |||
update: function() { | |||
update: function () { | |||
this.opacityCounter++; | |||
if (this.sprite) | |||
this.sprite.alpha = 0.35 + Math.abs(Math.sin(this.opacityCounter / 20) * 0.35); | |||
this.showPath(input.mouse); | |||
}, | |||
destroy: function() { | |||
destroy: function () { | |||
renderer.destroyObject({ | |||
sprite: this.sprite, | |||
layerName: 'effects' | |||
}); | |||
} | |||
}; | |||
}); | |||
}); |
@@ -81,10 +81,11 @@ define([ | |||
return; | |||
} | |||
if (this.spells.length - 1 >= s.id) | |||
this.spells.splice(s.id, 0, s); | |||
else | |||
this.spells.push(s); | |||
this.spells.push(s); | |||
this.spells = this.spells.sort(function (a, b) { | |||
return (a.id - b.id); | |||
}); | |||
}, this); | |||
events.emit('onGetSpells', this.spells); | |||
@@ -100,6 +101,8 @@ define([ | |||
spellNumber = 1; | |||
else if (number == 3) | |||
spellNumber = 2; | |||
else if (number == 4) | |||
spellNumber = 3; | |||
if (spellNumber == -1) | |||
return; | |||
@@ -193,7 +196,7 @@ define([ | |||
this.target = this.obj; | |||
} | |||
if ((!spell.targetGround) && (!spell.autoTargetFollower) && (!this.target)) | |||
if ((!spell.aura) && (!spell.targetGround) && (!spell.autoTargetFollower) && (!this.target)) | |||
return; | |||
var hoverTile = this.obj.mouseMover.hoverTile; | |||
@@ -15,7 +15,8 @@ define([ | |||
'armor': 'armor', | |||
'addCritChance': 'increased crit chance', | |||
'addCritMultiplier': 'increased crit multiplier', | |||
'magicFind': 'magic find', | |||
'magicFind': 'increased item quality', | |||
'itemQuantity': 'increased item quantity', | |||
'sprintChance': 'sprint chance', | |||
'dmgPercent': 'to all damage', | |||
'allAttributes': 'to all attributes', | |||
@@ -210,30 +210,13 @@ define([ | |||
alpha = Math.min(Math.max(0.15, alpha), 0.65); | |||
//Hack for xmas | |||
tile = 3; | |||
var min = Math.min( | |||
(i + j), | |||
(w - i + j), | |||
(i + h - j), | |||
(w - i + h - j) | |||
); | |||
var tree = false; | |||
var val = min + (Math.random() * 10); | |||
if (val < 23) { | |||
if (val < 18) | |||
tree = true; | |||
tile = 184; | |||
} | |||
if (Math.random() < 0.35) { | |||
tile = { | |||
'2': 7, | |||
'5': 6, | |||
'3': 0, | |||
'4': 1, | |||
'53': 54, | |||
'184': 185 | |||
'53': 54 | |||
}[tile]; | |||
} | |||
@@ -251,25 +234,6 @@ define([ | |||
} | |||
container.addChild(tile); | |||
if (tree) { | |||
var s = [216, 216, 217, 217, 217, 217, 217, 218, 219, 219, 219][~~(Math.random() * 11)]; | |||
s += 192; | |||
tile = new pixi.Sprite(this.getTexture('sprites', s)); | |||
tile.alpha = 0.7 + (Math.random() * 0.3); | |||
tile.position.x = i * scale; | |||
tile.position.y = j * scale; | |||
tile.width = scale; | |||
tile.height = scale; | |||
if (Math.random() < 0.5) { | |||
tile.position.x += scale; | |||
tile.scale.x = -scaleMult; | |||
} | |||
container.addChild(tile); | |||
} | |||
} | |||
} | |||
}, | |||
@@ -3,7 +3,7 @@ define([ | |||
'html!ui/templates/buffs/template', | |||
'css!ui/templates/buffs/styles', | |||
'html!ui/templates/buffs/templateBuff' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles, | |||
@@ -11,6 +11,9 @@ define([ | |||
) { | |||
var icons = { | |||
stunned: [4, 0], | |||
regenHp: [3, 1], | |||
regenMana: [4, 1], | |||
swiftness: [5, 1], | |||
stealth: [7, 0], | |||
reflectDamage: [2, 1], | |||
holyVengeance: [4, 0] | |||
@@ -21,12 +24,12 @@ define([ | |||
icons: {}, | |||
postRender: function() { | |||
this.onEvent('onGetBuff', this.onGetBuff.bind(this)); | |||
postRender: function () { | |||
this.onEvent('onGetBuff', this.onGetBuff.bind(this)); | |||
this.onEvent('onRemoveBuff', this.onRemoveBuff.bind(this)); | |||
}, | |||
onGetBuff: function(buff) { | |||
onGetBuff: function (buff) { | |||
var icon = icons[buff.type]; | |||
if (!icon) | |||
return; | |||
@@ -36,20 +39,21 @@ define([ | |||
var html = templateBuff; | |||
var el = $(html).appendTo(this.el) | |||
.find('.inner') | |||
.css({ | |||
background: 'url(../../../images/statusIcons.png) ' + imgX + 'px ' + imgY + 'px' | |||
}); | |||
this.icons[buff.id] = el; | |||
this.icons[buff.id] = el.parent(); | |||
}, | |||
onRemoveBuff: function(buff) { | |||
onRemoveBuff: function (buff) { | |||
var el = this.icons[buff.id]; | |||
if (!el) | |||
return; | |||
el.remove(); | |||
delete this.icons[buff.id]; | |||
} | |||
} | |||
}); | |||
}); |
@@ -6,10 +6,17 @@ | |||
top: 104px; | |||
.icon { | |||
width: 32px; | |||
height: 32px; | |||
background: url('../../../images/statusIcons.png') 0px 0px; | |||
width: 40px; | |||
height: 40px; | |||
padding: 4px; | |||
background-color: fade(@blackD, 75%); | |||
margin-right: 16px; | |||
float: left; | |||
.inner { | |||
width: 32px; | |||
height: 32px; | |||
background: url('../../../images/statusIcons.png') 0px 0px; | |||
} | |||
} | |||
} | |||
} |
@@ -1 +1,3 @@ | |||
<div class="icon buff"></div> | |||
<div class="icon buff"> | |||
<div class="inner"></div> | |||
</div> |
@@ -1,5 +1,5 @@ | |||
<div class="uiCharacters"> | |||
<img class="logo" src="server/mods/event-xmas/images/logo.png" alt=""> | |||
<img class="logo" src="images/logo_4.png"ii alt=""> | |||
<div class="left"> | |||
<div class="character">loading characters...</div> | |||
</div> | |||
@@ -128,9 +128,9 @@ define([ | |||
}, | |||
onCreate: function (result) { | |||
this.el.removeClass('disabled'); | |||
this.clear(); | |||
if (!result) { | |||
this.clear(); | |||
this.el.remove(); | |||
events.emit('onEnterGame'); | |||
} else | |||
@@ -1,5 +1,5 @@ | |||
<div class="uiCreateCharacter"> | |||
<img class="logo" src="server/mods/event-xmas/images/logo.png" alt=""> | |||
<img class="logo" src="images/logo_4.png" alt=""> | |||
<div class="box-left"> | |||
<div class="left"> | |||
<input type="text" class="el textbox txtName" placeholder="name" maxlength="12"> | |||
@@ -104,6 +104,12 @@ define([ | |||
el = $(el); | |||
var slot = el.attr('slot'); | |||
var newItems = window.player.inventory.items.some(function (i) { | |||
var checkSlot = slot; | |||
if (slot.indexOf('finger') == 0) | |||
slot = 'finger'; | |||
else if (slot == 'oneHanded') | |||
return ((['oneHanded', 'twoHanded'].indexOf(slot) > -1) && (i.isNew)); | |||
return ((i.slot == slot) && (i.isNew)); | |||
}); | |||
@@ -133,6 +139,8 @@ define([ | |||
var spritesheet = item.spritesheet || '../../../images/items.png'; | |||
slot = item.equipSlot || slot; | |||
var elSlot = this.find('[slot="' + slot + '"]'); | |||
elSlot | |||
.data('item', item) | |||
@@ -163,8 +171,13 @@ define([ | |||
.filter(function (item) { | |||
if (isRune) | |||
return ((!item.slot) && (item.spell) && (!item.eq)); | |||
else | |||
return ((item.slot == slot) && (!item.eq)); | |||
else { | |||
var checkSlot = (slot.indexOf('finger') == 0) ? 'finger' : slot; | |||
if (slot == 'oneHanded') | |||
return ((!item.eq) && ((item.slot == 'oneHanded') || (item.slot == 'twoHanded'))); | |||
return ((item.slot == checkSlot) && (!item.eq)); | |||
} | |||
}, this); | |||
items.splice(0, 0, { | |||
name: 'None', | |||
@@ -205,7 +218,7 @@ define([ | |||
equipItem: function (item, slot) { | |||
var isNew = window.player.inventory.items.some(function (i) { | |||
return ((i.slot == slot) && (i.isNew)); | |||
return ((i.equipSlot == slot) && (i.isNew)); | |||
}); | |||
if (!isNew) | |||
this.find('[slot="' + slot + '"] .info').html(''); | |||
@@ -239,6 +252,11 @@ define([ | |||
data.itemId = this.hoverCompare.id; | |||
} | |||
} | |||
} else if (item.slot == 'finger') { | |||
data = { | |||
itemId: item.id, | |||
slot: slot | |||
}; | |||
} | |||
client.request({ | |||
@@ -341,7 +359,8 @@ define([ | |||
'all resist': stats.elementAllResist | |||
}, | |||
misc: { | |||
'magic find': stats.magicFind, | |||
'item quality': stats.magicFind, | |||
'item quantity': stats.itemQuantity + '%', | |||
gap1: '', | |||
'sprint chance': (stats.sprintChance || 0) + '%', | |||
gap2: '', | |||
@@ -6,7 +6,7 @@ | |||
border: 5px solid @blackB; | |||
text-align: center; | |||
width: 474px; | |||
height: 534px; | |||
height: 622px; | |||
> .heading { | |||
color: @white; | |||
@@ -61,7 +61,7 @@ | |||
height: 440px; | |||
} | |||
.left, .right, .itemList, .runes { | |||
.left, .right, .itemList, .runes, .tools { | |||
width: 96px; | |||
padding: 8px; | |||
@@ -88,12 +88,14 @@ | |||
&[slot="neck"] .icon { background-position: -64px -448px; } | |||
&[slot="chest"] .icon { background-position: -128px -448px; } | |||
&[slot="hands"] .icon { background-position: -192px -448px; } | |||
&[slot="finger"] .icon { background-position: -256px -448px; } | |||
&[slot="finger-1"] .icon { background-position: -256px -448px; } | |||
&[slot="finger-2"] .icon { background-position: -256px -448px; } | |||
&[slot="waist"] .icon { background-position: -320px -448px; } | |||
&[slot="legs"] .icon { background-position: -384px -448px; } | |||
&[slot="feet"] .icon { background-position: -448px -448px; } | |||
&[slot="trinket"] .icon { background-position: -448px -384px; } | |||
&[slot="twoHanded"] .icon { background-position: -384px -384px; } | |||
&[slot="oneHanded"] .icon { background-position: -384px -384px; } | |||
&[slot="offHand"] .icon { background-position: -192px -384px; } | |||
&[slot="tool"] .icon { background-position: -256px -384px; } | |||
&[slot^="rune"] .icon { background-position: -320px -384px; } | |||
} | |||
@@ -141,7 +143,7 @@ | |||
.stats { | |||
width: 100%; | |||
padding-top: 16px; | |||
height: calc(440px - 80px); | |||
height: calc(440px - 88px); | |||
.stat { | |||
height: 22px; | |||
@@ -174,7 +176,7 @@ | |||
} | |||
} | |||
.runes { | |||
.runes, .tools { | |||
width: 100%; | |||
height: 80px; | |||
@@ -187,6 +189,12 @@ | |||
} | |||
} | |||
} | |||
.tools { | |||
clear: both; | |||
margin-bottom: 8px; | |||
padding-left: calc(50% - 40px); | |||
} | |||
} | |||
.itemList { | |||
@@ -26,7 +26,11 @@ | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="finger"> | |||
<div class="slot" slot="finger-1"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="finger-2"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -34,16 +38,22 @@ | |||
<div class="middle"> | |||
<div class="stats"> | |||
</div> | |||
<div class="tools"> | |||
<div class="slot" slot="tool"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
</div> | |||
<div class="runes"> | |||
<div class="slot" slot="rune-0"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="tool"> | |||
<div class="slot" slot="rune-1"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="rune-1"> | |||
<div class="slot" slot="rune-2"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -66,7 +76,11 @@ | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="twoHanded"> | |||
<div class="slot" slot="oneHanded"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
<div class="slot" slot="offHand"> | |||
<div class="icon"></div> | |||
<div class="info"></div> | |||
</div> | |||
@@ -2,7 +2,7 @@ define([ | |||
'js/system/events', | |||
'html!ui/templates/hud/template', | |||
'css!ui/templates/hud/styles' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles | |||
@@ -12,17 +12,17 @@ define([ | |||
stats: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetStats', this.onGetStats.bind(this)); | |||
this.onEvent('onGetPortrait', this.onGetPortrait.bind(this)); | |||
}, | |||
onGetStats: function(stats) { | |||
onGetStats: function (stats) { | |||
this.stats = stats; | |||
this.build(); | |||
}, | |||
onGetPortrait: function(portrait) { | |||
onGetPortrait: function (portrait) { | |||
var spritesheet = portrait.spritesheet || '../../../images/portraitIcons.png'; | |||
var x = portrait.x * -64; | |||
@@ -35,7 +35,7 @@ define([ | |||
}); | |||
}, | |||
build: function() { | |||
build: function () { | |||
var stats = this.stats; | |||
var boxes = this.find('.statBox'); | |||
@@ -44,13 +44,15 @@ define([ | |||
stats.hp / stats.hpMax, | |||
stats.mana / stats.manaMax, | |||
stats.xp / stats.xpMax | |||
].forEach(function(s, i) { | |||
].forEach(function (s, i) { | |||
boxes.eq(i).find('div:first-child').width(Math.max(0, Math.min(100, ~~(s * 100))) + '%'); | |||
}); | |||
this.find('.statManaReserve').width(Math.max(0, Math.min(100, ~~(stats.manaReservePercent * 100))) + '%'); | |||
boxes.eq(0).find('.text').html(Math.floor(stats.hp) + '/' + ~~stats.hpMax); | |||
boxes.eq(1).find('.text').html(Math.floor(stats.mana) + '/' + ~~stats.manaMax); | |||
boxes.eq(2).find('.text').html('level: ' + stats.level); | |||
} | |||
} | |||
}); | |||
}); |
@@ -43,6 +43,15 @@ | |||
height: 100%; | |||
} | |||
.statManaReserve { | |||
position: absolute; | |||
right: 0%; | |||
top: 0px; | |||
left: auto; | |||
height: 100%; | |||
background-color: @grayB; | |||
} | |||
.text { | |||
position: absolute; | |||
left: 0px; | |||
@@ -90,4 +99,4 @@ | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -9,6 +9,7 @@ | |||
</div> | |||
<div class="statBox"> | |||
<div class="statMana"></div> | |||
<div class="statManaReserve"></div> | |||
<div class="text"></div> | |||
</div> | |||
<div class="statBox"> | |||
@@ -16,4 +17,4 @@ | |||
<div class="text"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> |
@@ -65,6 +65,10 @@ define([ | |||
this.find('.grid') | |||
.on('mousemove', this.onMouseMove.bind(this)) | |||
.on('mouseleave', this.onMouseDown.bind(this, null, null, false)); | |||
this.find('.split-box .amount').on('mousewheel', this.onChangeStackAmount.bind(this)); | |||
this.find('.split-box').on('click', this.splitStackEnd.bind(this, true)); | |||
this.find('.split-box .button').on('click', this.splitStackEnd.bind(this)); | |||
}, | |||
build: function () { | |||
@@ -181,6 +185,8 @@ define([ | |||
events.emit('onHideItemTooltip', this.hoverItem); | |||
this.hoverItem = null; | |||
} else if (this.dragItem) { | |||
var method = 'moveItem'; | |||
if ((this.hoverCell) && (this.hoverCell[0] != this.dragItem[0])) { | |||
var placeholder = $('<div></div>') | |||
.insertAfter(this.dragItem); | |||
@@ -200,14 +206,22 @@ define([ | |||
var hoverCellItem = this.hoverCell.data('item'); | |||
if (hoverCellItem) { | |||
msgs.push({ | |||
id: hoverCellItem.id, | |||
pos: this.hoverCell.index() | |||
}); | |||
this.items.find(function (i) { | |||
return (i.id == hoverCellItem.id) | |||
}, this).pos = this.hoverCell.index(); | |||
if (hoverCellItem.name != this.dragItem.data('item').name) { | |||
msgs.push({ | |||
id: hoverCellItem.id, | |||
pos: this.hoverCell.index() | |||
}); | |||
this.items.find(function (i) { | |||
return (i.id == hoverCellItem.id) | |||
}, this).pos = this.hoverCell.index(); | |||
} else { | |||
method = 'combineStacks'; | |||
msgs = { | |||
fromId: this.dragItem.data('item').id, | |||
toId: hoverCellItem.id, | |||
}; | |||
} | |||
} | |||
client.request({ | |||
@@ -215,7 +229,7 @@ define([ | |||
method: 'performAction', | |||
data: { | |||
cpn: 'inventory', | |||
method: 'moveItem', | |||
method: method, | |||
data: msgs | |||
} | |||
}); | |||
@@ -286,6 +300,10 @@ define([ | |||
text: 'mail', | |||
callback: this.openMailUi.bind(this, item) | |||
}, | |||
split: { | |||
text: 'split stack', | |||
callback: this.splitStackStart.bind(this, item) | |||
}, | |||
divider: '----------' | |||
}; | |||
@@ -332,6 +350,9 @@ define([ | |||
config.push(menuItems.destroy); | |||
} | |||
if (item.quantity > 1) | |||
config.push(menuItems.split); | |||
if ((!item.noDrop) && (!item.quest)) | |||
config.push(menuItems.mail); | |||
@@ -342,6 +363,45 @@ define([ | |||
return false; | |||
}, | |||
splitStackStart: function (item) { | |||
var box = this.find('.split-box').show(); | |||
box.data('item', item); | |||
box.find('.amount').html(1); | |||
}, | |||
splitStackEnd: function (cancel, e) { | |||
var box = this.find('.split-box'); | |||
if ((!e) || (e.target != box.find('.button')[0])) | |||
return; | |||
box.hide(); | |||
client.request({ | |||
cpn: 'player', | |||
method: 'performAction', | |||
data: { | |||
cpn: 'inventory', | |||
method: 'splitStack', | |||
data: { | |||
itemId: box.data('item').id, | |||
stackSize: ~~this.find('.split-box .amount').html() | |||
} | |||
} | |||
}); | |||
}, | |||
onChangeStackAmount: function (e) { | |||
var item = this.find('.split-box').data('item'); | |||
var delta = (e.originalEvent.deltaY > 0) ? -1 : 1; | |||
if (this.shiftDown) | |||
delta *= 10; | |||
var amount = this.find('.split-box .amount'); | |||
amount.html(Math.max(1, Math.min(item.quantity - 1, ~~amount.html() + delta))); | |||
}, | |||
hideTooltip: function () { | |||
if (this.dragEl) { | |||
this.hoverCell = null; | |||
@@ -372,7 +432,7 @@ define([ | |||
if (el) { | |||
if (el.hasClass('new')) { | |||
el.removeClass('new'); | |||
el.find('.quantity').html(item.quantity || ''); | |||
el.find('.quantity').html((item.quantity > 1) ? item.quantity : ''); | |||
delete item.isNew; | |||
} | |||
@@ -416,6 +476,7 @@ define([ | |||
this.shown = !this.el.is(':visible'); | |||
if (this.shown) { | |||
this.find('.split-box').hide(); | |||
this.show(); | |||
this.build(); | |||
} else { | |||
@@ -116,6 +116,65 @@ | |||
} | |||
} | |||
.split-box { | |||
display: none; | |||
background-color: fade(@blackD, 85%); | |||
text-align: center; | |||
position: absolute; | |||
left: 0%; | |||
top: 0%; | |||
width: 100%; | |||
height: 100%; | |||
.inner { | |||
border: 5px solid @blackB; | |||
position: absolute; | |||
left: 50%; | |||
top: 50%; | |||
transform: translate(-50%, -50%); | |||
width: 200px; | |||
height: 143px; | |||
> .heading { | |||
color: @blueA; | |||
width: 100%; | |||
height: 36px; | |||
background-color: @blackB; | |||
.heading-text { | |||
padding-top: 8px; | |||
margin: auto; | |||
} | |||
} | |||
.bottom { | |||
height: calc(100% - 36px); | |||
background-color: @blackC; | |||
padding: 10px; | |||
.amount { | |||
color: @white; | |||
text-align: center; | |||
width: 100%; | |||
height: 36px; | |||
padding-top: 8px; | |||
} | |||
.button { | |||
width: 100%; | |||
height: 36px; | |||
margin-top: 5px; | |||
background-color: @blueC; | |||
color: @white; | |||
&:hover { | |||
background-color: @blueB; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
.tooltip { | |||
display: none; | |||
position: absolute; | |||
@@ -164,4 +223,4 @@ | |||
display: none; | |||
} | |||
} | |||
} | |||
} |
@@ -7,4 +7,15 @@ | |||
</div> | |||
<div class="grid"></div> | |||
<div class="tooltip"></div> | |||
</div> | |||
<div class="split-box"> | |||
<div class="inner"> | |||
<div class="heading"> | |||
<div class="heading-text">stack size</div> | |||
</div> | |||
<div class="bottom"> | |||
<div class="amount"></div> | |||
<div class="button">split</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> |
@@ -1,5 +1,5 @@ | |||
<div class="uiLogin"> | |||
<img class="logo" src="server/mods/event-xmas/images/logo.png" alt=""> | |||
<img class="logo" src="images/logo_4.png" alt=""> | |||
<div class="right"> | |||
<div class="label">username</div> | |||
<input type="text" class="el textbox txtUsername" placeholder="username"> | |||
@@ -11,11 +11,11 @@ | |||
</div> | |||
<div class="message"></div> | |||
</div> | |||
<div class="news" location="https://gitlab.com/Isleward/isleward/issues/368">[ New Seasonal Event: <a class="q4">Merrywinter</a> ]</div> | |||
<div class="news" location="https://gitlab.com/Isleward/isleward/issues/418">[ Latest release notes ]</div> | |||
<div class="extra"> | |||
<div class="el button btnPatreon" location="http://patreon.com/bigbadwaffle">Pledge on Patreon</div> | |||
<div class="el button btnPaypal" location="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BR2CC82WUAVEA">Donate on Paypal</div> | |||
<div class="el button btnWiki" location="http://wiki.isleward.com/Main_Page">Access the Wiki</div> | |||
</div> | |||
<div class="version" location="https://gitlab.com/Isleward/isleward/issues/368">v0.1.8</div> | |||
<div class="version" location="https://gitlab.com/Isleward/isleward/issues/418">v0.1.9</div> | |||
</div> |
@@ -86,6 +86,8 @@ define([ | |||
el.find('.quantity').html(item.quantity); | |||
} else | |||
el.find('.quantity').html(''); | |||
this.find('.txtRecipient').val(''); | |||
}, | |||
toggle: function () { | |||
@@ -53,6 +53,8 @@ define([ | |||
}, | |||
onJoinChannel: function (channel) { | |||
this.find('[filter="' + channel.trim() + '"]').remove(); | |||
var container = this.find('.filters'); | |||
var newFilter = $(tplTab) | |||
.appendTo(container) | |||
@@ -7,7 +7,7 @@ define([ | |||
'css!ui/templates/party/styles', | |||
'html!ui/templates/party/templateInvite', | |||
'html!ui/templates/party/templatePartyMember' | |||
], function( | |||
], function ( | |||
events, | |||
client, | |||
globals, | |||
@@ -23,7 +23,7 @@ define([ | |||
invite: null, | |||
party: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetInvite', this.onGetInvite.bind(this)); | |||
this.onEvent('onGetParty', this.onGetParty.bind(this)); | |||
this.onEvent('onPartyDisband', this.onPartyDisband.bind(this)); | |||
@@ -33,22 +33,22 @@ define([ | |||
this.onEvent('onGetPartyStats', this.onGetPartyStats.bind(this)); | |||
}, | |||
onGetConnectedPlayer: function(msg) { | |||
onGetConnectedPlayer: function (msg) { | |||
var party = this.party; | |||
if (!party) | |||
return; | |||
if (!(msg instanceof Array)) | |||
msg = [ msg ]; | |||
msg = [msg]; | |||
msg.forEach(function(m) { | |||
msg.forEach(function (m) { | |||
if (party.indexOf(m.id) == -1) | |||
return; | |||
var zone = m.zone; | |||
if (m.id == window.player.serverId) { | |||
party.forEach(function(p) { | |||
var player = globals.onlineList.find(function(o) { | |||
party.forEach(function (p) { | |||
var player = globals.onlineList.find(function (o) { | |||
return (o.id == p) | |||
}); | |||
@@ -70,7 +70,7 @@ define([ | |||
}, this); | |||
}, | |||
onGetPartyStats: function(id, stats) { | |||
onGetPartyStats: function (id, stats) { | |||
var party = this.party; | |||
if (!party) | |||
return; | |||
@@ -94,12 +94,12 @@ define([ | |||
} | |||
}, | |||
onPartyDisband: function() { | |||
onPartyDisband: function () { | |||
this.find('.party .list') | |||
.empty(); | |||
}, | |||
onGetParty: function(party) { | |||
onGetParty: function (party) { | |||
// Destroy invite frame if you join a party | |||
if (this.invite) | |||
this.destroyInvite(); | |||
@@ -111,11 +111,11 @@ define([ | |||
if (!party) | |||
return; | |||
party.forEach(function(p) { | |||
party.forEach(function (p) { | |||
if (p == window.player.serverId) | |||
return; | |||
var player = globals.onlineList.find(function(o) { | |||
var player = globals.onlineList.find(function (o) { | |||
return (o.id == p) | |||
}); | |||
var name = player ? player.name : 'unknown'; | |||
@@ -134,7 +134,7 @@ define([ | |||
el.addClass('differentZone'); | |||
//Find stats | |||
var memberObj = objects.objects.find(function(o) { | |||
var memberObj = objects.objects.find(function (o) { | |||
return (o.serverId == p); | |||
}); | |||
if ((memberObj) && (memberObj.stats)) | |||
@@ -142,7 +142,7 @@ define([ | |||
}, this); | |||
}, | |||
showContext: function(charName, id, e) { | |||
showContext: function (charName, id, e) { | |||
events.emit('onContextMenu', [{ | |||
text: 'whisper', | |||
callback: events.emit.bind(events, 'onDoWhisper', charName) | |||
@@ -158,11 +158,11 @@ define([ | |||
return false; | |||
}, | |||
onGetInvite: function(sourceId) { | |||
onGetInvite: function (sourceId) { | |||
if (this.invite) | |||
this.destroyInvite(); | |||
var sourcePlayer = globals.onlineList.find(function(o) { | |||
var sourcePlayer = globals.onlineList.find(function (o) { | |||
return (o.id == sourceId) | |||
}); | |||
@@ -182,7 +182,7 @@ define([ | |||
}; | |||
}, | |||
destroyInvite: function(e) { | |||
destroyInvite: function (e) { | |||
if (e) { | |||
if ($(e.target).hasClass('btnAccept')) | |||
this.acceptInvite(); | |||
@@ -192,16 +192,18 @@ define([ | |||
this.invite.el.remove(); | |||
this.invite = null; | |||
events.emit('onUiHover', false); | |||
}, | |||
acceptInvite: function() { | |||
acceptInvite: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'acceptInvite', | |||
id: this.invite.fromId | |||
}); | |||
}, | |||
declineInvite: function() { | |||
declineInvite: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'declineInvite', | |||
@@ -212,18 +214,18 @@ define([ | |||
}); | |||
}, | |||
removeFromParty: function(id) { | |||
removeFromParty: function (id) { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'removeFromParty', | |||
data: id | |||
}); | |||
}, | |||
leaveParty: function() { | |||
leaveParty: function () { | |||
client.request({ | |||
cpn: 'social', | |||
method: 'leaveParty' | |||
}); | |||
} | |||
} | |||
}); | |||
}); |
@@ -152,12 +152,19 @@ define([ | |||
return; | |||
} | |||
this.find('.selected').removeClass('selected'); | |||
this.find('[action="augment"]').addClass('selected'); | |||
this.action = 'augment'; | |||
var reforge = this.find('[action="reforge"]').addClass('disabled'); | |||
if (msg.item.spell) | |||
reforge.removeClass('disabled'); | |||
this.offEvent(this.eventClickInv); | |||
$('.uiInventory').data('ui').toggle(); | |||
this.el.show(); | |||
//events.emit('onShowOverlay', this.el); | |||
msg.success = false; | |||
@@ -288,12 +295,8 @@ define([ | |||
this.find('.actionButton').removeClass('disabled').addClass('disabled'); | |||
this.find('.chance').html(''); | |||
this.show(); | |||
//this.build(); | |||
//events.emit('onShowOverlay', this.el); | |||
} else { | |||
} else | |||
this.hide(); | |||
//events.emit('onHideOverlay', this.el); | |||
} | |||
}, | |||
onKeyDown: function (key) { | |||
if (key == 'm') | |||
@@ -10,7 +10,8 @@ | |||
<div class="col-btn col-half" action="reroll">reroll</div> | |||
<div class="col-btn col-half" action="relevel">relevel</div> | |||
<div class="col-btn col-half" action="reslot">reslot</div> | |||
<div class="col-btn" action="scour">scour</div> | |||
<div class="col-btn col-half" action="reforge">reforge</div> | |||
<div class="col-btn col-half" action="scour">scour</div> | |||
</div> | |||
</div> | |||
<div class="col"> | |||
@@ -4,7 +4,7 @@ define([ | |||
'css!ui/templates/spells/styles', | |||
'html!ui/templates/spells/templateSpell', | |||
'html!ui/templates/spells/templateTooltip' | |||
], function( | |||
], function ( | |||
events, | |||
template, | |||
styles, | |||
@@ -16,7 +16,7 @@ define([ | |||
spells: null, | |||
postRender: function() { | |||
postRender: function () { | |||
this.onEvent('onGetSpells', this.onGetSpells.bind(this)); | |||
this.onEvent('onGetSpellCooldowns', this.onGetSpellCooldowns.bind(this)); | |||
this.onEvent('onGetStats', this.onGetStats.bind(this)); | |||
@@ -24,7 +24,7 @@ define([ | |||
setInterval(this.update.bind(this), 100); | |||
}, | |||
onGetSpells: function(spells) { | |||
onGetSpells: function (spells) { | |||
this.el.empty(); | |||
this.spells = spells; | |||
@@ -57,7 +57,7 @@ define([ | |||
} | |||
}, | |||
onShowTooltip: function(el, spell) { | |||
onShowTooltip: function (el, spell) { | |||
var pos = el.offset(); | |||
pos = { | |||
x: pos.left + 56, | |||
@@ -66,16 +66,20 @@ define([ | |||
var cd = ~~((spell.cdMax * 350) / 1000); | |||
var values = Object.keys(spell.values).filter(function(v) { | |||
var values = Object.keys(spell.values).filter(function (v) { | |||
return ((v != 'damage') && (v != 'healing')); | |||
}).map(function(v) { | |||
}).map(function (v) { | |||
return v + ': ' + spell.values[v]; | |||
}).join('<br />'); | |||
var manaCost = spell.manaCost; | |||
if (spell.manaReserve) | |||
manaCost = ~~(spell.manaReserve.percentage * 100) + '% reserved'; | |||
var tooltip = templateTooltip | |||
.replace('$NAME$', spell.name) | |||
.replace('$DESCRIPTION$', spell.description) | |||
.replace('$MANA$', spell.manaCost) | |||
.replace('$MANA$', manaCost) | |||
.replace('$CD$', cd) | |||
.replace('$VALUES$', values) | |||
.replace('$ELEMENT$', spell.element); | |||
@@ -90,17 +94,17 @@ define([ | |||
events.emit('onShowTooltip', tooltip, el[0], pos, 200, false, true, this.el.css('z-index')); | |||
}, | |||
onHideTooltip: function(el) { | |||
onHideTooltip: function (el) { | |||
events.emit('onHideTooltip', el[0]); | |||
}, | |||
onGetSpellCooldowns: function(options) { | |||
onGetSpellCooldowns: function (options) { | |||
var spell = this.spells[options.spell]; | |||
spell.ttl = options.cd; | |||
spell.ttlStart = +new Date; | |||
}, | |||
onGetStats: function(stats) { | |||
onGetStats: function (stats) { | |||
var mana = stats.mana; | |||
var spells = this.spells; | |||
@@ -117,7 +121,7 @@ define([ | |||
} | |||
}, | |||
update: function() { | |||
update: function () { | |||
var spells = this.spells; | |||
if (!spells) | |||
return; | |||
@@ -149,4 +153,4 @@ define([ | |||
} | |||
} | |||
} | |||
}); | |||
}); |
@@ -19,6 +19,7 @@ define([ | |||
'xpIncrease', | |||
'attackSpeed', | |||
'castSpeed', | |||
'itemQuantity', | |||
'catchChance', | |||
'catchSpeed', | |||
'fishRarity', | |||
@@ -1,6 +1,6 @@ | |||
define([ | |||
'js/system/events' | |||
], function( | |||
], function ( | |||
events | |||
) { | |||
return { | |||
@@ -13,7 +13,7 @@ define([ | |||
eventCallbacks: {}, | |||
render: function() { | |||
render: function () { | |||
var container = '.ui-container'; | |||
if (this.container) | |||
container += ' > ' + this.container; | |||
@@ -22,6 +22,9 @@ define([ | |||
.appendTo(container) | |||
.data('ui', this); | |||
this.el.on('mouseenter', this.onMouseEnter.bind(this, true)); | |||
this.el.on('mouseleave', this.onMouseEnter.bind(this, false)); | |||
if (this.modal) | |||
this.el.addClass('modal'); | |||
@@ -37,26 +40,31 @@ define([ | |||
this.shown = this.el.is(':visible'); | |||
}, | |||
setOptions: function(options) { | |||
onMouseEnter: function (enter) { | |||
events.emit('onUiHover', enter); | |||
}, | |||
setOptions: function (options) { | |||
this.options = options; | |||
}, | |||
on: function(el, event, callback) { | |||
if (typeof(el) == 'string') | |||
on: function (el, event, callback) { | |||
if (typeof (el) == 'string') | |||
el = this.find(el); | |||
else | |||
el = $(el); | |||
el.on(event, function() { | |||
el.on(event, function () { | |||
var args = [].slice.call(arguments, 1); | |||
args.splice(0, 0, event); | |||
callback.apply(null, args); | |||
}); | |||
}, | |||
find: function(selector) { | |||
find: function (selector) { | |||
return this.el.find(selector); | |||
}, | |||
center: function(x, y) { | |||
center: function (x, y) { | |||
if (x == null) | |||
x = true; | |||
if (y == null) | |||
@@ -64,7 +72,7 @@ define([ | |||
this.centeredX = x; | |||
this.centeredY = y; | |||
var el = this.el; | |||
var pat = el.parent(); | |||
@@ -77,21 +85,21 @@ define([ | |||
if (y) | |||
el.css('top', posY); | |||
}, | |||
show: function() { | |||
show: function () { | |||
if (this.modal) | |||
$('.modal').hide(); | |||
this.shown = true; | |||
this.el.show(); | |||
}, | |||
hide: function() { | |||
hide: function () { | |||
if (this.beforeHide) | |||
this.beforeHide(); | |||
this.shown = false; | |||
this.el.hide(); | |||
}, | |||
destroy: function() { | |||
destroy: function () { | |||
this.offEvents(); | |||
if (this.beforeDestroy) | |||
@@ -99,18 +107,18 @@ define([ | |||
this.el.remove(); | |||
}, | |||
val: function(selector) { | |||
val: function (selector) { | |||
return this.find(selector).val(); | |||
}, | |||
setDisabled: function(isDisabled) { | |||
setDisabled: function (isDisabled) { | |||
this.el.removeClass('disabled') | |||
if (isDisabled) | |||
this.el.addClass('disabled'); | |||
}, | |||
onEvent: function(event, callback) { | |||
onEvent: function (event, callback) { | |||
var list = this.eventCallbacks[event] || (this.eventCallbacks[event] = []); | |||
var eventCallback = events.on(event, callback); | |||
list.push(eventCallback); | |||
@@ -118,21 +126,21 @@ define([ | |||
return eventCallback; | |||
}, | |||
offEvent: function(eventCallback) { | |||
offEvent: function (eventCallback) { | |||
for (var e in this.eventCallbacks) { | |||
this.eventCallbacks[e].forEach(function(c) { | |||
this.eventCallbacks[e].forEach(function (c) { | |||
if (c == eventCallback) | |||
events.off(e, c); | |||
}, this); | |||
} | |||
}, | |||
offEvents: function() { | |||
offEvents: function () { | |||
for (var e in this.eventCallbacks) { | |||
this.eventCallbacks[e].forEach(function(c) { | |||
this.eventCallbacks[e].forEach(function (c) { | |||
events.off(e, c); | |||
}, this); | |||
} | |||
} | |||
}; | |||
}); | |||
}); |
@@ -140,7 +140,7 @@ define([ | |||
return true; | |||
else if (target.aggro.faction != obj.aggro.faction) | |||
return true; | |||
else if (!!target.player == !!obj.player) | |||
else if (!!target.player != !!obj.player) | |||
return true; | |||
}, | |||
@@ -21,6 +21,9 @@ define([ | |||
}, | |||
talk: function(msg) { | |||
if (!msg) | |||
return false; | |||
var target = msg.target; | |||
if ((target == null) && (!msg.targetName)) | |||
@@ -197,6 +197,8 @@ define([ | |||
for (var i = 0; i < eLen; i++) { | |||
var effect = effects[i]; | |||
if (effect == checkEffect) { | |||
if (effect.destroy) | |||
effect.destroy(); | |||
this.syncRemove(effect.id, effect.type, noMsg || effect.noMsg); | |||
effects.splice(i, 1); | |||
return; | |||
@@ -53,6 +53,12 @@ define([ | |||
}, | |||
equip: function (itemId) { | |||
var slot = null; | |||
if (typeof (itemId) == 'object') { | |||
slot = itemId.slot; | |||
itemId = itemId.itemId; | |||
} | |||
var item = this.obj.inventory.findItem(itemId); | |||
if (!item) | |||
return; | |||
@@ -66,6 +72,23 @@ define([ | |||
} | |||
} | |||
if (!slot) | |||
slot = item.equipSlot || item.slot; | |||
if (slot == 'twoHanded') { | |||
var currentEqId = this.eq.offHand; | |||
if (currentEqId != null) | |||
this.unequip(currentEqId); | |||
slot = 'oneHanded'; | |||
} else if (slot == 'offHand') { | |||
var currentEqId = this.eq.oneHanded; | |||
if (currentEqId != null) { | |||
var currentEq = this.obj.inventory.findItem(currentEqId); | |||
if ((currentEq != null) && (currentEq.slot == 'twoHanded')) | |||
this.unequip(currentEqId); | |||
} | |||
} | |||
var equipMsg = { | |||
success: true, | |||
item: item | |||
@@ -87,8 +110,20 @@ define([ | |||
delete item.pos; | |||
this.obj.syncer.setArray(true, 'inventory', 'getItems', item); | |||
if (slot == 'finger') { | |||
var f1 = (this.eq['finger-1'] != null); | |||
var f2 = (this.eq['finger-2'] != null); | |||
if ((f1) && (f2)) | |||
slot = 'finger-1'; | |||
else if (!f1) | |||
slot = 'finger-1'; | |||
else if (!f2) | |||
slot = 'finger-2'; | |||
} | |||
var spellId = null; | |||
var currentEqId = this.eq[item.slot]; | |||
var currentEqId = this.eq[slot]; | |||
var currentEq = this.obj.inventory.findItem(currentEqId); | |||
if (currentEq == item) | |||
return; | |||
@@ -107,7 +142,8 @@ define([ | |||
} | |||
item.eq = true; | |||
this.eq[item.slot] = itemId; | |||
this.eq[slot] = itemId; | |||
item.equipSlot = slot; | |||
this.obj.spellbook.calcDps(); | |||
@@ -152,6 +188,11 @@ define([ | |||
}, | |||
unequip: function (itemId) { | |||
var item = itemId; | |||
var slot = null; | |||
if (typeof (itemId) == 'object') { | |||
slot = itemId.slot; | |||
itemId = itemId.itemId; | |||
} | |||
if (item.id == null) | |||
item = this.obj.inventory.findItem(itemId); | |||
@@ -169,7 +210,8 @@ define([ | |||
} | |||
delete item.eq; | |||
delete this.eq[item.slot]; | |||
delete this.eq[item.equipSlot]; | |||
delete item.equipSlot; | |||
this.obj.inventory.setItemPosition(itemId); | |||
@@ -1,6 +1,6 @@ | |||
define([ | |||
], function( | |||
], function ( | |||
) { | |||
return { | |||
@@ -8,7 +8,7 @@ define([ | |||
list: [], | |||
simplify: function(self) { | |||
simplify: function (self) { | |||
if (!self) | |||
return; | |||
@@ -27,13 +27,13 @@ define([ | |||
return result; | |||
}, | |||
save: function() { | |||
save: function () { | |||
return { | |||
type: 'events' | |||
}; | |||
}, | |||
unregisterEvent: function(event) { | |||
unregisterEvent: function (event) { | |||
this.list.spliceWhere(l => (l == event)); | |||
this.obj.syncer.setArray(true, 'events', 'removeList', { | |||
@@ -41,8 +41,8 @@ define([ | |||
}); | |||
}, | |||
syncList: function() { | |||
this.list.forEach(function(l) { | |||
syncList: function () { | |||
this.list.forEach(function (l) { | |||
this.obj.syncer.setArray(true, 'events', 'updateList', { | |||
id: l.id, | |||
name: l.config.name, | |||
@@ -52,13 +52,16 @@ define([ | |||
}, | |||
events: { | |||
afterMove: function() { | |||
afterMove: function () { | |||
var events = this.obj.instance.events; | |||
var closeEvents = events.getCloseEvents(this.obj); | |||
if (!closeEvents) | |||
return; | |||
closeEvents.forEach(function(c) { | |||
closeEvents.forEach(function (c) { | |||
if (this.list.some(l => (l == c))) | |||
return; | |||
this.list.push(c); | |||
this.obj.syncer.setArray(true, 'events', 'updateList', { | |||
@@ -70,4 +73,4 @@ define([ | |||
} | |||
} | |||
}; | |||
}); | |||
}); |
@@ -18,6 +18,7 @@ define([ | |||
var commandRoles = { | |||
join: 0, | |||
leave: 0, | |||
unEq: 0, | |||
getItem: 10, | |||
getGold: 10, | |||
setLevel: 10, | |||
@@ -176,6 +177,13 @@ define([ | |||
return character.auth.customChannels.some(c => (c == channel)); | |||
}, | |||
unEq: function () { | |||
var eq = this.obj.equipment; | |||
Object.keys(eq.eq).forEach(function (slot) { | |||
eq.unequip(eq.eq[slot]); | |||
}); | |||
}, | |||
clearInventory: function () { | |||
var inventory = this.obj.inventory; | |||
@@ -36,6 +36,24 @@ define([ | |||
if (firstNode.resourceNode.nodeType == 'fish') { | |||
var rod = this.obj.equipment.eq.tool; | |||
if (!rod) { | |||
process.send({ | |||
method: 'events', | |||
data: { | |||
'onGetAnnouncement': [{ | |||
obj: { | |||
msg: 'You need a fishing rod to fish' | |||
}, | |||
to: [this.obj.serverId] | |||
}] | |||
} | |||
}); | |||
this.gathering = null; | |||
return; | |||
} | |||
rod = this.obj.inventory.findItem(rod); | |||
var statCatchSpeed = Math.min(150, this.obj.stats.values.catchSpeed); | |||
@@ -170,6 +188,9 @@ define([ | |||
} | |||
this.obj.inventory.getItem(item); | |||
if (item.material) | |||
this.obj.fireEvent('afterGatherResource', gatherResult); | |||
}, this); | |||
if (!gatherResult.noChangeAmount) | |||
@@ -177,8 +198,6 @@ define([ | |||
this.obj.stats.getXp(gatherResult.xp); | |||
this.obj.fireEvent('afterGatherResource', gatherResult); | |||
if (gathering.destroyed) { | |||
if (isFish) { | |||
process.send({ | |||
@@ -234,9 +253,6 @@ define([ | |||
} | |||
}); | |||
if (!success) | |||
return; | |||
this.nodes.spliceWhere(n => (n == node)); | |||
this.nodes.push(node); | |||
}, | |||
@@ -287,10 +303,6 @@ define([ | |||
} | |||
}); | |||
nodes.splice(i, 1); | |||
i--; | |||
nLen--; | |||
if (this.gathering == node) { | |||
if (this.gathering.resourceNode.nodeType == 'fish') | |||
this.obj.syncer.set(true, 'gatherer', 'action', 'Fishing'); | |||
@@ -59,8 +59,10 @@ define([ | |||
i--; | |||
iLen--; | |||
continue; | |||
} else if ((item.slot != 'twoHanded') && (item.spell) && (!item.ability)) | |||
} else if (((item.slot != 'twoHanded') && (item.slot != 'oneHanded')) && (item.spell) && (!item.ability)) | |||
delete item.spell; | |||
else if (item.slot == 'mainHand') | |||
item.slot = 'oneHanded'; | |||
while (item.name.indexOf(`''`) > -1) { | |||
item.name = item.name.replace(`''`, `'`); | |||
@@ -73,7 +75,7 @@ define([ | |||
var item = items[i]; | |||
var pos = item.pos; | |||
var newItem = this.getItem(item, true); | |||
var newItem = this.getItem(item, true, true); | |||
newItem.pos = pos; | |||
} | |||
@@ -173,15 +175,35 @@ define([ | |||
return; | |||
} | |||
var learnMsg = { | |||
success: true, | |||
item: item | |||
}; | |||
this.obj.fireEvent('beforeLearnAbility', learnMsg); | |||
if (!learnMsg.success) { | |||
this.obj.instance.syncer.queue('onGetMessages', { | |||
id: this.obj.id, | |||
messages: [{ | |||
class: 'q0', | |||
message: learnMsg.msg || 'you cannot learn that ability', | |||
type: 'info' | |||
}] | |||
}, [this.obj.serverId]); | |||
return; | |||
} | |||
var spellbook = this.obj.spellbook; | |||
if (item.slot == 'twoHanded') | |||
if ((item.slot == 'twoHanded') || (item.slot == 'oneHanded')) | |||
runeSlot = 0; | |||
else if (runeSlot == null) { | |||
if (!this.items.some(i => (i.runeSlot == 2))) | |||
runeSlot = 2; | |||
else | |||
runeSlot = 1; | |||
for (var i = 1; i < 3; i++) { | |||
if (!this.items.some(j => (j.runeSlot == i))) { | |||
runeSlot = i; | |||
break; | |||
} | |||
} | |||
} | |||
var currentEq = this.items.find(i => (i.runeSlot == runeSlot)); | |||
@@ -214,6 +236,36 @@ define([ | |||
this.obj.syncer.setArray(true, 'inventory', 'getItems', item); | |||
}, | |||
splitStack: function (msg) { | |||
var item = this.findItem(msg.itemId); | |||
if (!item) | |||
return; | |||
else if ((!item.quantity) || (item.quantity <= msg.stackSize) || (msg.stackSize < 1)) | |||
return; | |||
var newItem = extend(true, {}, item); | |||
item.quantity -= msg.stackSize; | |||
newItem.quantity = msg.stackSize; | |||
this.getItem(newItem, true, true); | |||
this.obj.syncer.setArray(true, 'inventory', 'getItems', item); | |||
}, | |||
combineStacks: function (msg) { | |||
var fromItem = this.findItem(msg.fromId); | |||
var toItem = this.findItem(msg.toId); | |||
if ((!fromItem) || (!toItem)) | |||
return; | |||
else if ((!fromItem.quantity) || (!toItem.quantity)) | |||
return; | |||
toItem.quantity += fromItem.quantity; | |||
this.obj.syncer.setArray(true, 'inventory', 'getItems', toItem); | |||
this.destroyItem(fromItem.id, null, true); | |||
}, | |||
useItem: function (itemId) { | |||
var item = this.findItem(itemId); | |||
if (!item) | |||
@@ -274,7 +326,8 @@ define([ | |||
spellbook.removeSpellById(item.runeSlot); | |||
delete item.eq; | |||
delete item.runeSlot; | |||
this.setItemPosition(itemId); | |||
if (!item.slot) | |||
this.setItemPosition(itemId); | |||
this.obj.syncer.setArray(true, 'inventory', 'getItems', item); | |||
}, | |||
@@ -465,13 +518,12 @@ define([ | |||
(i.spell) && | |||
(i.spell.rolls) && | |||
(i.spell.rolls.damage != null) && | |||
(i.slot == 'twoHanded') | |||
((i.slot == 'twoHanded') || (i.slot == 'oneHanded')) | |||
); | |||
}); | |||
if (!hasWeapon) { | |||
var item = generator.generate({ | |||
slot: 'twoHanded', | |||
type: classes.weapons[this.obj.class], | |||
quality: 0, | |||
spellQuality: 'mid' | |||
@@ -554,7 +606,7 @@ define([ | |||
return true; | |||
}, | |||
getItem: function (item, hideMessage) { | |||
getItem: function (item, hideMessage, noStack) { | |||
events.emit('onBeforeGetItem', item, this.obj); | |||
//We need to know if a mob dropped it for quest purposes | |||
@@ -571,7 +623,7 @@ define([ | |||
var quantity = item.quantity; | |||
var exists = false; | |||
if (((item.material) || (item.quest) || (item.quantity)) && (!item.noStack) && (!item.uses)) { | |||
if (((item.material) || (item.quest) || (item.quantity)) && (!item.noStack) && (!item.uses) && (!noStack)) { | |||
var existItem = this.items.find(i => (i.name == item.name)); | |||
if (existItem) { | |||
exists = true; | |||
@@ -781,31 +833,16 @@ define([ | |||
if ((!blueprint.noRandom) || (blueprint.alsoRandom)) { | |||
var magicFind = (blueprint.magicFind || 0); | |||
var bonusMagicFind = killSource.stats.values.magicFind; | |||
for (var i = 0; i < blueprint.rolls; i++) { | |||
if (Math.random() * 100 >= (blueprint.chance || 35)) | |||
continue; | |||
/*var useItem = null; | |||
if (Math.random() < generator.spellChance) { | |||
useItem = instancedItems | |||
.filter(item => item.ability); | |||
if (useItem.length > 0) | |||
useItem = useItem[~~(Math.random() * useItem.length)]; | |||
} | |||
if (!useItem) { | |||
var slot = generator.pickRandomSlot(); | |||
var useItem = instancedItems.find(item => item.slot == slot); | |||
} | |||
var rolls = blueprint.rolls; | |||
var itemQuantity = killSource.stats.values.itemQuantity; | |||
rolls += ~~(itemQuantity / 100); | |||
if ((Math.random() * 100) < (itemQuantity * 100)) | |||
rolls++; | |||
if (!useItem) | |||
useItem = instancedItems[~~(Math.random() * iLen)]; | |||
iLen--; | |||
instancedItems.spliceWhere(item => item == useItem); | |||
//Spells don't have stats | |||
if (useItem.stats) | |||
delete useItem.stats.armor;*/ | |||
for (var i = 0; i < rolls; i++) { | |||
if (Math.random() * 100 >= (blueprint.chance || 35)) | |||
continue; | |||
var itemBlueprint = { | |||
level: this.obj.stats.values.level, | |||
@@ -845,7 +882,7 @@ define([ | |||
} | |||
} | |||
killSource.fireEvent('beforeTargetDeath', this.obj, this.items); | |||
playerObject.fireEvent('beforeTargetDeath', this.obj, this.items); | |||
events.emit('onBeforeDropBag', this.obj, this.items, killSource); | |||
if (this.items.length > 0) | |||
@@ -182,9 +182,18 @@ define([ | |||
physics.addObject(this.obj, this.obj.x, this.obj.y); | |||
this.obj.stats.die(source); | |||
} else | |||
} else { | |||
this.obj.stats.dead = true; | |||
process.send({ | |||
method: 'object', | |||
serverId: this.obj.serverId, | |||
obj: { | |||
permadead: true | |||
} | |||
}); | |||
} | |||
this.obj.fireEvent('onAfterDeath', source); | |||
this.obj.aggro.die(); | |||
@@ -1,13 +1,13 @@ | |||
define([ | |||
], function( | |||
], function ( | |||
) { | |||
return { | |||
type: 'quests', | |||
quests: [], | |||
init: function(blueprint) { | |||
init: function (blueprint) { | |||
var quests = blueprint.quests || []; | |||
var qLen = quests.length; | |||
for (var i = 0; i < qLen; i++) { | |||
@@ -20,25 +20,26 @@ define([ | |||
this.blueprint = blueprint; | |||
}, | |||
transfer: function() { | |||
var blueprint = { quests: this.quests }; | |||
transfer: function () { | |||
var blueprint = { | |||
quests: this.quests | |||
}; | |||
this.quests = []; | |||
this.init(blueprint); | |||
}, | |||
obtain: function(quest, hideMessage) { | |||
obtain: function (quest, hideMessage) { | |||
quest.active = (this.obj.zoneName == quest.zoneName); | |||
this.quests.push(quest); | |||
if (!quest.init(hideMessage)) { | |||
this.quests.spliceWhere(q => (q == quest)); | |||
return false; | |||
} | |||
else | |||
} else | |||
return true; | |||
}, | |||
complete: function(id) { | |||
complete: function (id) { | |||
var quest = this.quests.find(q => q.id == id); | |||
if ((!quest) || (!quest.isReady)) | |||
return; | |||
@@ -50,26 +51,7 @@ define([ | |||
this.obj.instance.questBuilder.obtain(this.obj); | |||
}, | |||
/*update: function() { | |||
var quests = this.quests; | |||
var qLen = quests.length; | |||
var completed = false; | |||
for (var i = 0; i < qLen; i++) { | |||
var q = quests[i]; | |||
if (q.isCompleted) { | |||
quests.splice(i, 1); | |||
q.ready(); | |||
completed = true; | |||
qLen--; | |||
i--; | |||
} | |||
} | |||
if (completed) | |||
questBuilder.obtain(this.obj); | |||
},*/ | |||
fireEvent: function(event, args) { | |||
fireEvent: function (event, args) { | |||
var quests = this.quests; | |||
var qLen = quests.length; | |||
for (var i = 0; i < qLen; i++) { | |||
@@ -77,8 +59,7 @@ define([ | |||
if (!q) { | |||
qLen--; | |||
continue; | |||
} | |||
else if (q.completed) | |||
} else if (q.completed) | |||
continue; | |||
var events = q.events; | |||
@@ -93,7 +74,7 @@ define([ | |||
} | |||
}, | |||
simplify: function(self) { | |||
simplify: function (self) { | |||
if (!self) | |||
return; | |||
@@ -111,4 +92,4 @@ define([ | |||
return result; | |||
} | |||
}; | |||
}); | |||
}); |
@@ -200,6 +200,14 @@ define([ | |||
var exists = this.spells.spliceFirstWhere(s => (s.id == id)); | |||
if (exists) { | |||
if ((exists.manaReserve) && (exists.active)) { | |||
var mana = this.obj.stats.values.mana; | |||
var reserve = exists.manaReserve; | |||
if (reserve.percentage) | |||
this.obj.stats.addStat('manaReservePercent', -reserve.percentage); | |||
} | |||
exists.unlearn && exists.unlearn(); | |||
this.obj.syncer.setArray(true, 'spellbook', 'removeSpells', id); | |||
@@ -256,7 +264,17 @@ define([ | |||
} | |||
} | |||
if (!spell.targetGround) { | |||
if ((!spell.aura) && (!spell.targetGround)) { | |||
//Did we pass in the target id? | |||
if ((action.target != null) && (action.target.id == null)) { | |||
action.target = this.objects.objects.find(o => o.id == action.target); | |||
if (!action.target) | |||
return false; | |||
} | |||
if ((action.target == this.obj) && (spell.noTargetSelf)) | |||
action.target = null; | |||
if ((action.target == null) || (!action.target.player)) { | |||
if (spell.autoTargetFollower) { | |||
action.target = this.spells.find(s => (s.minions) && (s.minions.length > 0)); | |||
@@ -267,13 +285,6 @@ define([ | |||
} | |||
} | |||
//Did we pass in the target id? | |||
if (action.target.id == null) { | |||
action.target = this.objects.objects.find(o => o.id == action.target); | |||
if (!action.target) | |||
return false; | |||
} | |||
if (spell.spellType == 'buff') { | |||
if (this.obj.aggro.faction != action.target.aggro.faction) | |||
return; | |||
@@ -284,7 +295,7 @@ define([ | |||
} | |||
} | |||
if ((!spell.targetGround) && (action.target) && (!action.target.aggro)) { | |||
if ((!spell.targetGround) && (action.target) && (!action.target.aggro) && (!spell.aura)) { | |||
this.sendAnnouncement("You don't feel like attacking that target"); | |||
return; | |||
} | |||
@@ -300,6 +311,20 @@ define([ | |||
if (!isAuto) | |||
this.sendAnnouncement('Insufficient mana to cast spell'); | |||
success = false; | |||
} else if (spell.manaReserve) { | |||
var mana = this.obj.stats.values.mana; | |||
var reserve = spell.manaReserve; | |||
if (reserve.percentage) { | |||
if (!spell.active) { | |||
if (1 - this.obj.stats.values.manaReservePercent < reserve.percentage) { | |||
this.sendAnnouncement('Insufficient mana to cast spell'); | |||
success = false; | |||
} else | |||
this.obj.stats.addStat('manaReservePercent', reserve.percentage); | |||
} else | |||
this.obj.stats.addStat('manaReservePercent', -reserve.percentage); | |||
} | |||
} else if (spell.range != null) { | |||
//Distance Check | |||
var fromX = this.obj.x; | |||
@@ -11,6 +11,9 @@ define([ | |||
values: { | |||
mana: 10, | |||
manaMax: 10, | |||
manaReservePercent: 0, | |||
hp: 5, | |||
hpMax: 5, | |||
xpTotal: 0, | |||
@@ -21,6 +24,7 @@ define([ | |||
int: 0, | |||
dex: 0, | |||
magicFind: 0, | |||
itemQuantity: 0, | |||
regenHp: 0, | |||
regenMana: 10, | |||
addCritChance: 0, | |||
@@ -104,6 +108,11 @@ define([ | |||
if (((this.obj.mob) && (!this.obj.follower)) || (this.dead)) | |||
return; | |||
var values = this.values; | |||
var manaMax = values.manaMax; | |||
manaMax -= (manaMax * values.manaReservePercent); | |||
var regen = { | |||
success: true | |||
}; | |||
@@ -111,7 +120,6 @@ define([ | |||
if (!regen.success) | |||
return; | |||
var values = this.values; | |||
var isInCombat = (this.obj.aggro.list.length > 0); | |||
if (this.obj.follower) { | |||
isInCombat = (this.obj.follower.master.aggro.list.length > 0); | |||
@@ -122,7 +130,7 @@ define([ | |||
var regenHp = 0; | |||
var regenMana = 0; | |||
regenMana = (values.manaMax / 200) + (values.regenMana / 200); | |||
regenMana = (manaMax / 200) + (values.regenMana / 200); | |||
if (!isInCombat) | |||
regenHp = values.hpMax / 100; | |||
@@ -139,7 +147,7 @@ define([ | |||
this.obj.syncer.setObject(false, 'stats', 'values', 'hp', values.hp); | |||
} | |||
if (values.mana < values.manaMax) { | |||
if (values.mana < manaMax) { | |||
values.mana += regenMana; | |||
//Show others what mana is? | |||
var onlySelf = true; | |||
@@ -148,8 +156,8 @@ define([ | |||
this.obj.syncer.setObject(onlySelf, 'stats', 'values', 'mana', values.mana); | |||
} | |||
if (values.mana > values.manaMax) { | |||
values.mana = values.manaMax; | |||
if (values.mana > manaMax) { | |||
values.mana = manaMax; | |||
if (this.obj.player) | |||
onlySelf = false; | |||
this.obj.syncer.setObject(onlySelf, 'stats', 'values', 'mana', values.mana); | |||
@@ -446,6 +454,10 @@ define([ | |||
if (amount == 0) | |||
return; | |||
var threatMult = heal.threatMult; | |||
if (!heal.hasOwnProperty('threatMult')) | |||
threatMult = 1; | |||
var values = this.values; | |||
var hpMax = values.hpMax; | |||
@@ -475,7 +487,7 @@ define([ | |||
} | |||
//Add aggro to all our attackers | |||
var threat = amount * 0.4; | |||
var threat = amount * 0.4 * threatMult; | |||
var aggroList = this.obj.aggro.list; | |||
var aLen = aggroList.length; | |||
for (var i = 0; i < aLen; i++) { | |||
@@ -0,0 +1,27 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'regenHp', | |||
amount: 1, | |||
init: function () { | |||
this.obj.stats.addStat('regenHp', this.amount * 3); | |||
}, | |||
destroy: function () { | |||
this.obj.stats.addStat('regenHp', -(this.amount * 3)); | |||
}, | |||
update: function () { | |||
}, | |||
events: { | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,27 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'regenMana', | |||
amount: 1, | |||
init: function () { | |||
this.obj.stats.addStat('regenMana', this.amount); | |||
}, | |||
destroy: function () { | |||
this.obj.stats.addStat('regenMana', -this.amount); | |||
}, | |||
update: function () { | |||
}, | |||
events: { | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,27 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'swiftness', | |||
amount: 1, | |||
init: function () { | |||
this.obj.stats.addStat('sprintChance', this.amount); | |||
}, | |||
destroy: function () { | |||
this.obj.stats.addStat('sprintChance', -this.amount); | |||
}, | |||
update: function () { | |||
}, | |||
events: { | |||
} | |||
}; | |||
}); |
@@ -1,6 +1,6 @@ | |||
define([ | |||
], function( | |||
], function ( | |||
) { | |||
return { | |||
@@ -9,11 +9,11 @@ define([ | |||
cd: 0, | |||
repeat: 0, | |||
init: function() { | |||
init: function () { | |||
this.update(); | |||
}, | |||
update: function() { | |||
update: function () { | |||
if (this.cd == 0) { | |||
if (this.state < this.config.length - 1) { | |||
this.state++; | |||
@@ -45,10 +45,9 @@ define([ | |||
}, | |||
events: { | |||
mobTalk: function(config) { | |||
mobTalk: function (config) { | |||
var mob = this.instance.objects.objects.find(o => (o.id == config.id)); | |||
var text = (config.text instanceof Array) ? config.text[config.oldRepeat - config.repeat - 1] : config.text; | |||
console.log(text); | |||
if (config.zone) { | |||
this.instance.syncer.queue('onGetMessages', { | |||
@@ -62,7 +61,7 @@ define([ | |||
mob.syncer.set(false, 'chatter', 'msg', text); | |||
} | |||
}, | |||
addComponents: function(config) { | |||
addComponents: function (config) { | |||
var objects = this.instance.objects.objects; | |||
var components = config.components; | |||
@@ -83,7 +82,7 @@ define([ | |||
} | |||
} | |||
}, | |||
removeComponents: function(config) { | |||
removeComponents: function (config) { | |||
var objects = this.instance.objects.objects; | |||
var components = config.components; | |||
@@ -105,4 +104,4 @@ define([ | |||
} | |||
} | |||
}; | |||
}); | |||
}); |
@@ -229,7 +229,7 @@ module.exports = { | |||
var crystals = inventory.items.find(i => (i.name == 'Digested Crystal')); | |||
if (!crystals) | |||
return; | |||
obj.reputation.getReputation('akarei', crystals.quantity * 15); | |||
obj.reputation.getReputation('akarei', (crystals.quantity || 1) * 15); | |||
inventory.destroyItem(crystals.id); | |||
} | |||
@@ -29,7 +29,8 @@ module.exports = { | |||
rare: { | |||
chance: 4, | |||
name: 'Steelclaw' | |||
name: 'Steelclaw', | |||
cell: 59 | |||
} | |||
} | |||
}, | |||
@@ -445,10 +445,10 @@ module.exports = { | |||
'mud crab': { | |||
level: 9 | |||
}, | |||
penguin: { | |||
frog: { | |||
level: 8, | |||
rare: { | |||
name: 'Tuckle' | |||
name: 'The Muck Prince' | |||
} | |||
}, | |||
hermit: { | |||
@@ -1,26 +1,33 @@ | |||
define([ | |||
], function( | |||
], function ( | |||
) { | |||
return { | |||
type: 'austere', | |||
init: function() { | |||
init: function () { | |||
}, | |||
simplify: function() { | |||
simplify: function () { | |||
return this.type; | |||
}, | |||
events: { | |||
beforeEquipItem: function(msg) { | |||
beforeEquipItem: function (msg) { | |||
if (msg.item.quality > 1) { | |||
msg.success = false; | |||
msg.msg = 'You shun fancy equipment'; | |||
} | |||
}, | |||
beforeLearnAbility: function (msg) { | |||
if (msg.item.quality > 1) { | |||
msg.success = false; | |||
msg.msg = 'You shun fancy equipment' | |||
msg.msg = 'You shun fancy equipment'; | |||
} | |||
} | |||
} | |||
}; | |||
}); | |||
}); |
@@ -16,7 +16,7 @@ define([ | |||
events: { | |||
afterEquipItem: function (item) { | |||
if (item.slot != 'twoHanded') | |||
if (['oneHanded', 'twoHanded'].indexOf(item.slot) == -1) | |||
return; | |||
var stats = item.stats; | |||
@@ -29,7 +29,7 @@ define([ | |||
} | |||
}, | |||
afterUnequipItem: function (item) { | |||
if (item.slot != 'twoHanded') | |||
if (['oneHanded', 'twoHanded'].indexOf(item.slot) == -1) | |||
return; | |||
var stats = item.stats; | |||
@@ -2,29 +2,28 @@ define([ | |||
'config/quests/templates/questTemplate', | |||
'config/questsBase', | |||
'misc/events' | |||
], function( | |||
], function ( | |||
questTemplate, | |||
globalQuests, | |||
events | |||
) { | |||
return { | |||
instance: null, | |||
init: function(instance) { | |||
init: function (instance) { | |||
this.instance = instance; | |||
}, | |||
obtain: function(obj, template) { | |||
obtain: function (obj, template) { | |||
var zoneName = template ? template.zoneName : obj.zoneName; | |||
var oQuests = obj.quests; | |||
if (oQuests.quests.filter(q => q.zoneName == zoneName).length > 0) | |||
return; | |||
return; | |||
var zoneTemplate = null; | |||
try { | |||
zoneTemplate = require('config/maps/' + zoneName + '/quests.js'); | |||
} | |||
catch (e) { | |||
} catch (e) { | |||
zoneTemplate = globalQuests; | |||
} | |||
@@ -39,13 +38,14 @@ define([ | |||
var pickQuest = null; | |||
if ((template) && (template.type)) | |||
pickQuest = config.infini.find(c => c.type == template.type); | |||
if (!pickQuest) | |||
pickQuest = config.infini[~~(Math.random() * config.infini.length)]; | |||
var pickType = pickQuest.type[0].toUpperCase() + pickQuest.type.substr(1); | |||
var questClass = require('config/quests/templates/quest' + pickType); | |||
var quest = extend(true, {}, pickQuest, questTemplate, questClass, template); | |||
if (template) | |||
quest.xp = template.xp; | |||
else | |||
@@ -68,4 +68,4 @@ define([ | |||
this.obtain(obj, template); | |||
} | |||
}; | |||
}); | |||
}); |
@@ -7,7 +7,7 @@ define([ | |||
type: 'gatherResource', | |||
need: null, | |||
type: null, | |||
gatherType: null, | |||
requiredQuality: 0, | |||
have: 0, | |||
@@ -15,9 +15,9 @@ define([ | |||
if (!this.need) { | |||
this.need = 2 + ~~(Math.random() * 3); | |||
this.type = ['herb', 'fish'][~~(Math.random() * 2)]; | |||
this.gatherType = ['herb', 'fish'][~~(Math.random() * 2)]; | |||
if (this.type == 'fish') { | |||
if (this.gatherType == 'fish') { | |||
this.name = 'Lure of the Sea'; | |||
var isQualityQ = (Math.random() < 0.3); | |||
@@ -28,10 +28,10 @@ define([ | |||
} | |||
} | |||
if (['herb', 'fish'].indexOf(this.type) == -1) | |||
this.type = 'herb'; | |||
if (['herb', 'fish'].indexOf(this.gatherType) == -1) | |||
this.gatherType = 'herb'; | |||
this.typeName = (this.type == 'herb') ? 'herbs' : 'fish'; | |||
this.typeName = (this.gatherType == 'herb') ? 'herbs' : 'fish'; | |||
this.updateDescription(); | |||
@@ -46,14 +46,14 @@ define([ | |||
var action = ({ | |||
herb: 'Gather', | |||
fish: 'Catch' | |||
})[this.type]; | |||
})[this.gatherType]; | |||
this.description = `${action} ${this.have}/${this.need} ${typeName}`; | |||
}, | |||
events: { | |||
afterGatherResource: function (gatherResult) { | |||
if (gatherResult.nodeType != this.type) | |||
if (gatherResult.nodeType != this.gatherType) | |||
return; | |||
else if ((this.requiredQuality) && (gatherResult.items[0].quality != this.requiredQuality)) | |||
return; | |||
@@ -28,7 +28,7 @@ define([ | |||
if (roll == 0) | |||
this.slotName = 'Magic Armor' | |||
else | |||
this.slotNames = 'Magic Accessory'; | |||
this.slotName = 'Magic Accessory'; | |||
this.slot = ([ | |||
[ | |||
@@ -37,7 +37,8 @@ define([ | |||
'hands', | |||
'waist', | |||
'legs', | |||
'feet' | |||
'feet', | |||
'offHand' | |||
], | |||
[ | |||
'trinket', | |||
@@ -339,6 +339,24 @@ define([ | |||
type: 'chainLightning', | |||
icon: [0, 1], | |||
animation: 'raiseStaff' | |||
}, { | |||
name: 'Innervation', | |||
description: 'Grants an aura that regenerates hp for you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 3] | |||
}, { | |||
name: 'Tranquility', | |||
description: 'Grants an aura that regenerates mana for you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 4] | |||
}, { | |||
name: 'Swiftness', | |||
description: 'Grants an aura that grants increased movement speed to you and your allies.', | |||
type: 'aura', | |||
spellType: 'aura', | |||
icon: [3, 5] | |||
} | |||
]; | |||
@@ -0,0 +1,111 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
type: 'aura', | |||
cdMax: 0, | |||
manaCost: 0, | |||
duration: 10, | |||
aura: true, | |||
active: false, | |||
effects: {}, | |||
cast: function (action) { | |||
this.active = !this.active; | |||
return true; | |||
}, | |||
update: function () { | |||
var active = this.active; | |||
if (active) | |||
this.updateActive(); | |||
else | |||
this.updateInactive(); | |||
}, | |||
unlearn: function () { | |||
this.updateInactive(); | |||
}, | |||
onAfterSimplify: function (values) { | |||
delete values.effects; | |||
}, | |||
updateActive: function () { | |||
var o = this.obj; | |||
var amount = 0; | |||
if (this.name == 'Innervation') | |||
amount = ~~((o.stats.values.hpMax / 100) * this.values.regenPercentage); | |||
else | |||
amount = this.values.regenPercentage || this.values.chance; | |||
var party = (o.social || {}).party || []; | |||
var members = [o.serverId, ...party]; | |||
var effects = this.effects; | |||
var objects = o.instance.objects.objects; | |||
var range = this.auraRange; | |||
members.forEach(function (m) { | |||
var effect = effects[m]; | |||
var obj = objects.find(o => (o.serverId === m)); | |||
if (!obj) { | |||
if (effect) | |||
delete effects[m]; | |||
return; | |||
} | |||
var distance = Math.max(Math.abs(o.x - obj.x), Math.abs(o.y - obj.y)); | |||
if (distance > range) { | |||
if (effect) { | |||
delete effects[m]; | |||
obj.effects.removeEffect(effect); | |||
} | |||
return; | |||
} | |||
if (effect) | |||
return; | |||
effects[obj.serverId] = obj.effects.addEffect({ | |||
type: this.effect, | |||
amount: amount, | |||
caster: this.obj, | |||
ttl: -1 | |||
}); | |||
}, this); | |||
}, | |||
updateInactive: function () { | |||
var o = this.obj; | |||
var effects = this.effects; | |||
var objects = o.instance.objects.objects; | |||
Object.keys(effects).forEach(function (m) { | |||
var effect = effects[m]; | |||
if (!effect) | |||
return; | |||
var obj = objects.find(o => (o.serverId == m)); | |||
if (!obj) { | |||
delete effects[m]; | |||
return; | |||
} | |||
obj.effects.removeEffect(effect); | |||
delete effects[m]; | |||
}, this); | |||
} | |||
}; | |||
}); |
@@ -54,10 +54,7 @@ define([ | |||
if ((!m.aggro) || (!m.effects)) | |||
continue; | |||
var isPlayer = !!this.obj.player; | |||
var isTargetPlayer = !!m.player; | |||
if ((!this.obj.aggro.canAttack(m)) && (isPlayer == isTargetPlayer)) | |||
if (!this.obj.aggro.canAttack(m)) | |||
continue; | |||
var targetEffect = m.effects.addEffect({ | |||
@@ -40,8 +40,7 @@ define([ | |||
var stats = this.caster.stats; | |||
var contents = this.contents; | |||
var cLen = contents.length; | |||
for (var i = 0; i < cLen; i++) { | |||
for (var i = 0; i < contents.length; i++) { | |||
var c = contents[i]; | |||
if (!c) { | |||
@@ -119,7 +119,7 @@ define([ | |||
continue; | |||
} else if (!m.aggro) | |||
continue; | |||
else if (!m.aggro.canAttack(this.obj)) | |||
else if (!this.obj.aggro.canAttack(m)) | |||
continue; | |||
var damage = this.getDamage(m); | |||
@@ -160,6 +160,48 @@ define([ | |||
negativeStats: [ | |||
'i_delay' | |||
] | |||
}, | |||
'innervation': { | |||
statType: ['str'], | |||
statMult: 0.0205, | |||
element: 'physical', | |||
manaReserve: { | |||
percentage: 0.25 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'regenHp', | |||
random: { | |||
regenPercentage: [0.1, 0.5] | |||
} | |||
}, | |||
'tranquility': { | |||
statType: ['int'], | |||
statMult: 0.0205, | |||
element: 'holy', | |||
manaReserve: { | |||
percentage: 0.25 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'regenMana', | |||
random: { | |||
regenPercentage: [5, 18] | |||
} | |||
}, | |||
'swiftness': { | |||
statType: ['dex'], | |||
statMult: 0.0205, | |||
element: 'fire', | |||
manaReserve: { | |||
percentage: 0.4 | |||
}, | |||
cdMax: 10, | |||
auraRange: 9, | |||
effect: 'swiftness', | |||
random: { | |||
chance: [5, 10] | |||
} | |||
} | |||
/*, | |||
'chain lightning': { | |||
@@ -293,6 +293,7 @@ define([ | |||
if (exists) { | |||
event.participators.spliceWhere(p => (p == exists)); | |||
event.participators.push(obj); | |||
result.push(event); | |||
continue; | |||
} | |||
@@ -300,6 +301,14 @@ define([ | |||
if (distance == -1) { | |||
event.participators.push(obj); | |||
result.push(event); | |||
var rList = [{ | |||
nameLike: 'Ancient Carp', | |||
removeAll: true | |||
}]; | |||
this.instance.mail.sendMail(obj.name, rList); | |||
continue; | |||
} | |||
@@ -1,12 +1,12 @@ | |||
define([ | |||
'extend', | |||
'security/connections', | |||
'misc/helpers', | |||
'misc/helpers', | |||
'items/lootRoller', | |||
'world/atlas', | |||
'leaderboard/leaderboard', | |||
'config/clientConfig' | |||
], function( | |||
], function ( | |||
extend, | |||
cons, | |||
helpers, | |||
@@ -16,8 +16,18 @@ define([ | |||
clientConfig | |||
) { | |||
return { | |||
init: function() { | |||
global.extend = extend; | |||
init: function () { | |||
var oldExtend = extend; | |||
global.extend = function () { | |||
try { | |||
oldExtend.apply(null, arguments); | |||
return arguments[1]; | |||
} catch (e) { | |||
console.log(arguments); | |||
throw e; | |||
} | |||
}; | |||
global.cons = cons; | |||
global._ = helpers; | |||
global.lootRoller = lootRoller; | |||
@@ -28,4 +38,4 @@ define([ | |||
clientConfig.init(); | |||
} | |||
}; | |||
}); | |||
}); |
@@ -28,13 +28,22 @@ define([ | |||
description: `Rerolls an item's slot`, | |||
material: true, | |||
sprite: [6, 8] | |||
}, | |||
"Brawler's Totem": { | |||
name: "Brawler's Totem", | |||
quantity: 1, | |||
quality: 3, | |||
description: `Rerolls a weapon's ability`, | |||
material: true, | |||
sprite: [7, 8] | |||
} | |||
}, | |||
chance: { | |||
'Unstable Totem': 37, | |||
'Ascendant Totem': 15, | |||
"Gambler's Totem": 5 | |||
"Gambler's Totem": 5, | |||
"Brawler's Totem": 6 | |||
} | |||
}; | |||
}); |
@@ -14,7 +14,9 @@ define([ | |||
'legs', | |||
'feet', | |||
'trinket', | |||
'oneHanded', | |||
'twoHanded', | |||
'offHand', | |||
'tool' | |||
], | |||
@@ -28,7 +30,9 @@ define([ | |||
legs: 100, | |||
feet: 90, | |||
trinket: 35, | |||
oneHanded: 60, | |||
twoHanded: 60, | |||
offHand: 40, | |||
tool: 0 | |||
}, | |||
@@ -42,7 +46,9 @@ define([ | |||
legs: 0.2, | |||
feet: 0.1, | |||
trinket: 0, | |||
oneHanded: 0, | |||
twoHanded: 0, | |||
offHand: 0, | |||
tool: 0 | |||
}, | |||
@@ -157,15 +157,11 @@ define([ | |||
sprite: [8, 4] | |||
} | |||
}, | |||
twoHanded: { | |||
oneHanded: { | |||
'Sword': { | |||
sprite: [9, 0], | |||
spellName: 'slash' | |||
}, | |||
'Gnarled Staff': { | |||
sprite: [9, 1], | |||
spellName: 'magic missile' | |||
}, | |||
'Dagger': { | |||
sprite: [9, 2], | |||
spellName: 'double slash' | |||
@@ -178,6 +174,12 @@ define([ | |||
'Mace': { | |||
sprite: [9, 4], | |||
spellName: 'smite' | |||
} | |||
}, | |||
twoHanded: { | |||
'Gnarled Staff': { | |||
sprite: [9, 1], | |||
spellName: 'magic missile' | |||
}, | |||
'Spear': { | |||
sprite: [9, 6], | |||
@@ -185,6 +187,14 @@ define([ | |||
range: 2 | |||
} | |||
}, | |||
offHand: { | |||
'Wooden Shield': { | |||
sprite: [13, 0] | |||
}, | |||
'Gilded Shield': { | |||
sprite: [13, 1] | |||
} | |||
}, | |||
tool: { | |||
'Fishing Rod': { | |||
sprite: [11, 0] | |||
@@ -2,6 +2,7 @@ define([ | |||
'items/generators/stats', | |||
'items/generators/slots', | |||
'items/generators/types', | |||
'items/generators/spellbook', | |||
'items/salvager', | |||
'items/config/currencies', | |||
'items/config/slots', | |||
@@ -10,6 +11,7 @@ define([ | |||
generatorStats, | |||
generatorSlots, | |||
generatorTypes, | |||
generatorSpells, | |||
salvager, | |||
configCurrencies, | |||
configSlots, | |||
@@ -47,7 +49,8 @@ define([ | |||
if (msg.action == 'reroll') { | |||
delete msg.addStatMsgs; | |||
if (item.stats.lvlRequire) { | |||
delete item.enchantedStats; | |||
if ((item.stats) && (item.stats.lvlRequire)) { | |||
item.level += item.stats.lvlRequire; | |||
delete item.originalLevel; | |||
} | |||
@@ -63,7 +66,7 @@ define([ | |||
}; | |||
generatorSlots.generate(item, bpt); | |||
generatorTypes.generate(item, bpt); | |||
generatorStats.generate(item, bpt, result); | |||
generatorStats.generate(item, bpt); | |||
} else if (msg.action == 'relevel') { | |||
var offset = ((~~(Math.random() * 2) * 2) - 1) * (1 + ~~(Math.random() * 2)); | |||
if (item.level == 1) | |||
@@ -74,13 +77,23 @@ define([ | |||
slot: configSlots.getRandomSlot(item.slot), | |||
level: item.level, | |||
quality: item.quality, | |||
stats: Object.keys(item.stats) | |||
stats: Object.keys(item.stats || {}) | |||
}); | |||
delete item.spritesheet; | |||
delete item.stats; | |||
delete item.spell; | |||
extend(true, item, newItem); | |||
} else if (msg.action == 'reforge') { | |||
if (!item.spell) | |||
return; | |||
var spellName = item.spell.name.toLowerCase(); | |||
delete item.spell; | |||
generatorSpells.generate(item, { | |||
spellName: spellName | |||
}); | |||
} else { | |||
var newPower = (item.power || 0) + 1; | |||
item.power = newPower; | |||
@@ -148,6 +161,9 @@ define([ | |||
} else if (action == 'reslot') { | |||
successChance = 100; | |||
result = [configCurrencies.currencies["Gambler's Totem"]]; | |||
} else if (action == 'reforge') { | |||
successChance = 100; | |||
result = [configCurrencies.currencies["Brawler's Totem"]]; | |||
} | |||
return { | |||
@@ -33,7 +33,8 @@ define([ | |||
if ((!blueprint.slot) && (!blueprint.noSpell)) { | |||
isSpell = blueprint.spell; | |||
if ((!isSpell) && ((!hadBlueprint) || ((!blueprint.type) && (!blueprint.slot) && (!blueprint.stats)))) { | |||
isCurrency = blueprint.currency; | |||
if ((!isCurrency) && (!isSpell) && ((!hadBlueprint) || ((!blueprint.type) && (!blueprint.slot) && (!blueprint.stats)))) { | |||
isSpell = Math.random() < this.spellChance; | |||
if (!isSpell) | |||
isCurrency = Math.random() < this.currencyChance; | |||
@@ -13,7 +13,13 @@ define([ | |||
var generator = { | |||
generate: function (item, blueprint) { | |||
var pick = chances[~~(Math.random() * chances.length)]; | |||
var pick = null; | |||
if (!blueprint.name) | |||
pick = chances[~~(Math.random() * chances.length)]; | |||
else | |||
pick = Object.keys(configCurrencies.currencies).find(c => (c.toLowerCase().indexOf(blueprint.name.toLowerCase()) > -1)); | |||
item.name = pick; | |||
extend(true, item, configCurrencies.currencies[pick]); | |||
@@ -1,7 +1,9 @@ | |||
define([ | |||
'../config/slots' | |||
], function( | |||
configSlots | |||
'../config/slots', | |||
'../config/types' | |||
], function ( | |||
configSlots, | |||
configTypes | |||
) { | |||
var chances = []; | |||
for (var c in configSlots.chance) { | |||
@@ -12,9 +14,11 @@ define([ | |||
} | |||
var generator = { | |||
generate: function(item, blueprint) { | |||
generate: function (item, blueprint) { | |||
if (blueprint.slot) | |||
item.slot = blueprint.slot; | |||
else if (blueprint.type) | |||
item.slot = Object.keys(configTypes.types).find(c => configTypes.types[c][blueprint.type]); | |||
else | |||
item.slot = chances[~~(Math.random() * chances.length)]; | |||
@@ -26,4 +30,4 @@ define([ | |||
}; | |||
return generator; | |||
}); | |||
}); |
@@ -6,7 +6,12 @@ define([ | |||
return { | |||
generators: { | |||
hpMax: function (item, level, blueprint, perfection) { | |||
var max = ((level * 15) + level) / 10; | |||
var div = 1 / 11; | |||
if (item.slot == 'twoHanded') | |||
div *= 2; | |||
if (item.slot) | |||
var max = ((level * 15) + level) * div; | |||
if (perfection == null) | |||
return random.norm(1, max) * (blueprint.statMult.hpMax || 1); | |||
@@ -14,8 +19,12 @@ define([ | |||
return max * perfection * (blueprint.statMult.hpMax || 1); | |||
}, | |||
mainStat: function (item, level, blueprint, perfection) { | |||
var min = ((level * 6.05) - ((level - 1) * 1.2)) / 10; | |||
var max = ((level * 14.9) + ((level - 1) * 31.49)) / 10; | |||
var div = 1 / 11; | |||
if (item.slot == 'twoHanded') | |||
div *= 2; | |||
var min = ((level * 6.05) - ((level - 1) * 1.2)) * div; | |||
var max = ((level * 14.9) + ((level - 1) * 31.49)) * div; | |||
if (perfection == null) | |||
return random.norm(min, max) * (blueprint.statMult.mainStat || 1); | |||
@@ -38,7 +47,11 @@ define([ | |||
return (1 + (6.5 * perfection)) * (blueprint.statMult.elementResist || 1); | |||
}, | |||
regenHp: function (item, level, blueprint, perfection) { | |||
var max = (((10 + (level * 200)) / 20) / 2) / 10; | |||
var div = 1 / 11; | |||
if (item.slot == 'twoHanded') | |||
div *= 2; | |||
var max = (((10 + (level * 200)) / 20) / 2) * div; | |||
if (perfection == null) | |||
return random.norm(1, max) * (blueprint.statMult.regenHp || 1); | |||
@@ -74,6 +87,9 @@ define([ | |||
}, | |||
lvlRequire: { | |||
level: { | |||
min: 2 | |||
}, | |||
generator: 'lvlRequire' | |||
}, | |||
@@ -172,6 +188,11 @@ define([ | |||
max: 15 | |||
}, | |||
itemQuantity: { | |||
min: 2, | |||
max: 27 | |||
}, | |||
xpIncrease: { | |||
min: 1, | |||
max: 6 | |||
@@ -318,7 +339,16 @@ define([ | |||
} | |||
if ((!stat) || (!statOptions[stat])) { | |||
var options = Object.keys(statOptions).filter(s => !statOptions[s].ignore); | |||
var options = Object.keys(statOptions).filter(function (s) { | |||
var o = statOptions[s]; | |||
if (o.ignore) | |||
return false; | |||
else if ((o.level) && (o.level.min) && (item.level < o.level.min)) | |||
return false; | |||
else | |||
return true; | |||
}); | |||
stat = options[~~(Math.random() * options.length)]; | |||
statBlueprint = statOptions[stat]; | |||
} else | |||
@@ -14,7 +14,7 @@ define([ | |||
return; | |||
item.type = type; | |||
item.sprite = blueprint.sprite || typeBlueprint.sprite; | |||
item.sprite = extend(true, [], blueprint.sprite || typeBlueprint.sprite); | |||
if (typeBlueprint.spritesheet) | |||
item.spritesheet = typeBlueprint.spritesheet; | |||