@@ -1,7 +1,7 @@ | |||
<!doctype html> | |||
<html> | |||
<head> | |||
<title>isleward</title> | |||
<title>test</title> | |||
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script> | |||
<script src="js/system/addons.js"></script> | |||
<script src="plugins/require.js" data-main="js/app"></script> | |||
@@ -31,24 +31,25 @@ var components = [ | |||
'prophecies', | |||
'reputation', | |||
'serverActions', | |||
'social' | |||
].map(function(c) { | |||
'social', | |||
'passives' | |||
].map(function (c) { | |||
return 'js/components/' + c; | |||
}); | |||
define(components, function() { | |||
define(components, function () { | |||
var templates = {}; | |||
[].forEach.call(arguments, function(t) { | |||
[].forEach.call(arguments, function (t) { | |||
templates[t.type] = t; | |||
}); | |||
return { | |||
getTemplate: function(type) { | |||
getTemplate: function (type) { | |||
if (type == 'lightpatch') | |||
type = 'lightPatch'; | |||
return templates[type]; | |||
} | |||
}; | |||
}); | |||
}); |
@@ -0,0 +1,47 @@ | |||
define([ | |||
'js/system/events' | |||
], function ( | |||
events | |||
) { | |||
return { | |||
type: 'passives', | |||
selected: [], | |||
points: 0, | |||
init: function () { | |||
events.emit('onGetPassives', this.selected); | |||
events.emit('onGetPassivePoints', this.points); | |||
}, | |||
extend: function (blueprint) { | |||
var rerender = false; | |||
if (blueprint.tickNodes) { | |||
blueprint.tickNodes.forEach(function (n) { | |||
this.selected.push(n); | |||
}, this); | |||
rerender = true; | |||
} | |||
if (blueprint.untickNodes) { | |||
blueprint.untickNodes.forEach(function (n) { | |||
this.selected.spliceWhere(function (s) { | |||
return (s == n); | |||
}); | |||
}, this); | |||
rerender = true; | |||
} | |||
if (rerender) | |||
events.emit('onGetPassives', this.selected); | |||
if (blueprint.points != null) { | |||
this.points = blueprint.points; | |||
events.emit('onGetPassivePoints', this.points); | |||
} | |||
} | |||
}; | |||
}); |
@@ -20,7 +20,8 @@ define([ | |||
'ui/templates/overlay/overlay', | |||
'ui/templates/tooltips/tooltips', | |||
'ui/templates/reputation/reputation', | |||
'ui/templates/death/death' | |||
'ui/templates/death/death', | |||
'ui/templates/passives/passives' | |||
], function ( | |||
client, | |||
uiFactory, | |||
@@ -46,12 +46,13 @@ define([ | |||
links: null | |||
}, | |||
hoverNode: null, | |||
postRender: function () { | |||
input.init(this.el); | |||
var data = JSON.parse(temp.json); | |||
this.data.nodes = data.nodes; | |||
this.data.links = data.links; | |||
this.data.nodes = temp.nodes; | |||
this.data.links = temp.links; | |||
//We need to be able to determine the size of elements | |||
this.el.css({ | |||
@@ -81,15 +82,16 @@ define([ | |||
this.onEvent('uiMouseMove', this.events.onPan.bind(this)); | |||
this.onEvent('uiMouseDown', this.events.onPanStart.bind(this)); | |||
this.onEvent('uiMouseUp', this.events.onPanEnd.bind(this)); | |||
this.onEvent('onGetPassives', this.events.onGetPassives.bind(this)); | |||
this.onEvent('onGetPassivePoints', this.events.onGetPassivePoints.bind(this)); | |||
//Calculate midpoint | |||
this.data.nodes.forEach(function (n) { | |||
this.pos.x += n.pos.x; | |||
this.pos.y += n.pos.y; | |||
}, this); | |||
var start = this.data.nodes.find(function (n) { | |||
return (n.spiritStart == window.player.class); | |||
}); | |||
this.pos.x = ~~(this.pos.x / this.data.nodes.length) * constants.gridSize; | |||
this.pos.y = ~~(this.pos.y / this.data.nodes.length) * constants.gridSize; | |||
this.pos.x = start.pos.x * constants.gridSize; | |||
this.pos.y = start.pos.y * constants.gridSize; | |||
this.pos.x -= ~~(this.canvas.width / 2); | |||
this.pos.y -= ~~(this.canvas.height / 2); | |||
@@ -103,8 +105,12 @@ define([ | |||
links.forEach(function (l) { | |||
var linked = ( | |||
nodes.find(n => (n.id == l.from.id)).selected && | |||
nodes.find(n => (n.id == l.to.id)).selected | |||
nodes.find(function (n) { | |||
return (n.id == l.from.id); | |||
}).selected && | |||
nodes.find(function (n) { | |||
return (n.id == l.to.id); | |||
}).selected | |||
); | |||
this.renderers.line.call(this, l.from, l.to, linked); | |||
}, this); | |||
@@ -140,16 +146,22 @@ define([ | |||
node: function (node) { | |||
var color = (node.color >= 0) ? (node.color + 1) : -1; | |||
if ((!node.stats) || (Object.keys(node.stats).length == 0)) | |||
if (((!node.stats) || (Object.keys(node.stats).length == 0)) && (!node.spiritStart)) | |||
color = 0; | |||
if (node.spiritStart) { | |||
color = 6; | |||
node.size = 1; | |||
} | |||
this.ctx.fillStyle = ([ | |||
'#69696e', | |||
'#c0c3cf', | |||
'#3fa7dd', | |||
'#4ac441', | |||
'#d43346', | |||
'#a24eff' | |||
'#a24eff', | |||
'#fafcfc' | |||
])[color]; | |||
var size = ([ | |||
constants.blockSize, | |||
@@ -159,22 +171,44 @@ define([ | |||
var x = (node.pos.x * constants.gridSize) - ((size - constants.blockSize) / 2) - this.pos.x; | |||
var y = (node.pos.y * constants.gridSize) - ((size - constants.blockSize) / 2) - this.pos.y; | |||
this.ctx.fillRect(x, y, size, size); | |||
var linked = this.data.links.some(function (l) { | |||
if ((l.from.id != node.id) && (l.to.id != node.id)) | |||
return false; | |||
this.ctx.strokeStyle = ([ | |||
'#69696e', | |||
'#69696e', | |||
'#42548d', | |||
'#386646', | |||
'#763b3b', | |||
'#533399' | |||
])[color]; | |||
this.ctx.strokeRect(x, y, size, size); | |||
return this.data.nodes.some(function (n) { | |||
return ( | |||
((n.id == l.from.id) && (n.selected)) || | |||
((n.id == l.to.id) && (n.selected)) | |||
); | |||
}); | |||
}, this); | |||
if (!linked) | |||
this.ctx.globalAlpha = 0.25; | |||
this.ctx.fillRect(x, y, size, size); | |||
if (node.selected) { | |||
this.ctx.strokeStyle = '#fafcfc'; | |||
if (linked) { | |||
this.ctx.strokeStyle = ([ | |||
'#69696e', | |||
'#69696e', | |||
'#42548d', | |||
'#386646', | |||
'#763b3b', | |||
'#533399', | |||
'#fafcfc' | |||
])[color]; | |||
this.ctx.strokeRect(x, y, size, size); | |||
if (node.selected) { | |||
this.ctx.strokeStyle = '#fafcfc'; | |||
this.ctx.strokeRect(x, y, size, size); | |||
} | |||
} | |||
if (!linked) | |||
this.ctx.globalAlpha = 1; | |||
}, | |||
line: function (fromNode, toNode, linked) { | |||
@@ -187,12 +221,26 @@ define([ | |||
var toX = (toNode.pos.x * constants.gridSize) + halfSize - this.pos.x; | |||
var toY = (toNode.pos.y * constants.gridSize) + halfSize - this.pos.y; | |||
fromNode = this.data.nodes.find(function (n) { | |||
return (n.id == fromNode.id); | |||
}); | |||
toNode = this.data.nodes.find(function (n) { | |||
return (n.id == toNode.id); | |||
}); | |||
if ((!linked) && (!fromNode.selected) && (!toNode.selected)) | |||
this.ctx.globalAlpha = 0.25; | |||
ctx.strokeStyle = linked ? '#fafcfc' : '#69696e'; | |||
ctx.beginPath(); | |||
ctx.moveTo(fromX, fromY); | |||
ctx.lineTo(toX, toY); | |||
ctx.closePath(); | |||
ctx.stroke(); | |||
if ((!linked) && (!fromNode.selected) && (!toNode.selected)) | |||
this.ctx.globalAlpha = 1; | |||
} | |||
}, | |||
@@ -211,7 +259,7 @@ define([ | |||
y: ~~((this.pos.y + this.mouse.y) / constants.gridSize) | |||
}; | |||
var node = this.data.nodes.find(function (n) { | |||
var node = this.hoverNode = this.data.nodes.find(function (n) { | |||
return ( | |||
(n.pos.x == cell.x) && | |||
(n.pos.y == cell.y) | |||
@@ -239,37 +287,34 @@ define([ | |||
var text = Object.keys(node.stats) | |||
.map(function (s) { | |||
console.log(s); | |||
var statName = statTranslations.translate(s); | |||
var statValue = node.stats[s]; | |||
var negative = ((statValue + '')[0] == '-'); | |||
if (percentageStats.indexOf(s) > -1) | |||
statValue += '%'; | |||
return ('+' + statValue + ' ' + statName); | |||
return ((negative ? '' : '+') + statValue + ' ' + statName); | |||
}) | |||
.join('<br />'); | |||
events.emit('onShowTooltip', text, this.el[0], this.mouse); | |||
if (node.spiritStart == window.player.class) | |||
text = 'Your starting node'; | |||
else if (node.spiritStart) | |||
text = 'Starting node for ' + node.spiritStart + ' spirits'; | |||
var pos = { | |||
x: input.mouse.raw.clientX + 15, | |||
y: input.mouse.raw.clientY | |||
}; | |||
events.emit('onShowTooltip', text, this.el[0], pos); | |||
} else | |||
events.emit('onHideTooltip', this.el[0]); | |||
}, | |||
onPanStart: function (e) { | |||
var cell = { | |||
x: ~~((this.pos.x + e.raw.offsetX) / constants.gridSize), | |||
y: ~~((this.pos.y + e.raw.offsetY) / constants.gridSize) | |||
}; | |||
var node = this.data.nodes.find(function (n) { | |||
return ( | |||
(n.pos.x == cell.x) && | |||
(n.pos.y == cell.y) | |||
); | |||
}); | |||
if (node) { | |||
node.selected = !node.selected; | |||
this.renderNodes(); | |||
if (this.hoverNode) { | |||
this.events.onTryClickNode.call(this, this.hoverNode); | |||
return; | |||
} | |||
@@ -308,6 +353,38 @@ define([ | |||
onPanEnd: function (e) { | |||
this.panOrigin = null; | |||
}, | |||
onTryClickNode: function (node) { | |||
if (node.spiritStart) | |||
return; | |||
client.request({ | |||
cpn: 'player', | |||
method: 'performAction', | |||
data: { | |||
cpn: 'passives', | |||
method: node.selected ? 'untickNode' : 'tickNode', | |||
data: { | |||
nodeId: node.id | |||
} | |||
} | |||
}); | |||
}, | |||
onGetPassives: function (selected) { | |||
this.data.nodes.forEach(function (n) { | |||
n.selected = selected.some(function (s) { | |||
return (s == n.id); | |||
}); | |||
}); | |||
this.renderNodes(); | |||
}, | |||
onGetPassivePoints: function (points) { | |||
var el = this.find('.points') | |||
.html('Points Available: ' + points); | |||
} | |||
} | |||
} | |||
@@ -2,7 +2,7 @@ | |||
.uiPassives { | |||
display: none; | |||
z-index: 2; | |||
z-index: 3; | |||
border: 5px solid @blackB; | |||
text-align: center; | |||
height: 100%; | |||
@@ -22,7 +22,19 @@ | |||
} | |||
.bottom { | |||
height: calc(100% - 36px); | |||
height: calc(100% - 36px - 36px); | |||
background-color: @blackC; | |||
} | |||
.status { | |||
width: 100%; | |||
height: 36px; | |||
background-color: @blackB; | |||
.points { | |||
padding-top: 8px; | |||
margin: auto; | |||
color: @blueA; | |||
} | |||
} | |||
} |
@@ -5,4 +5,7 @@ | |||
<div class="bottom"> | |||
<canvas class="canvas"></canvas> | |||
</div> | |||
<div class="status"> | |||
<div class="points"></div> | |||
</div> | |||
</div> |
@@ -1,11 +1,11 @@ | |||
@import "../../../css/ui.less"; | |||
.uiTooltips { | |||
z-index: 3; | |||
z-index: 4; | |||
.tooltip { | |||
display: none; | |||
z-index: 3; | |||
z-index: 4; | |||
background-color: fade(#3a3b4a, 85%); | |||
position: absolute; | |||
padding: 8px; | |||
@@ -0,0 +1,127 @@ | |||
define([ | |||
'config/passiveTree' | |||
], function ( | |||
passiveTree | |||
) { | |||
return { | |||
type: 'passives', | |||
selected: [], | |||
points: 0, | |||
init: function (blueprint) { | |||
this.selected = ((blueprint || {}).selected || []); | |||
this.selected.spliceWhere(s => (passiveTree.nodes.some(n => ((n.id == s) && (n.spiritStart))))); | |||
this.selected.push(passiveTree.nodes.find(n => (n.spiritStart == this.obj.class)).id); | |||
this.points = this.obj.stats.values.level - this.selected.length + 1; | |||
blueprint.points = this.points; | |||
var stats = this.obj.stats; | |||
this.selected.forEach(function (id) { | |||
var node = passiveTree.nodes.find(n => (n.id == id)); | |||
if (node) { | |||
for (var p in node.stats) { | |||
stats.addStat(p, node.stats[p]); | |||
} | |||
} | |||
}); | |||
}, | |||
applyPassives: function () { | |||
var stats = this.obj.stats; | |||
this.selected.forEach(function (id) { | |||
var node = passiveTree.nodes.find(n => (n.id == id)); | |||
if (node) { | |||
for (var p in node.stats) { | |||
stats.addStat(p, node.stats[p]); | |||
} | |||
} | |||
}); | |||
}, | |||
tickNode: function (msg) { | |||
if (this.points <= 0) | |||
return; | |||
else if (this.selected.some(s => (s == msg.nodeId))) | |||
return; | |||
var nodeId = msg.nodeId; | |||
var node = passiveTree.nodes.find(n => (n.id == nodeId)); | |||
if (node.spiritStart) | |||
return; | |||
var linked = passiveTree.links.some(function (l) { | |||
if ((l.from.id != node.id) && (l.to.id != node.id)) | |||
return false; | |||
return ( | |||
(this.selected.indexOf(l.from.id) > -1) || | |||
(this.selected.indexOf(l.to.id) > -1) | |||
); | |||
}, this); | |||
if (!linked) | |||
return; | |||
this.points--; | |||
this.obj.syncer.set(true, 'passives', 'points', this.points); | |||
this.selected.push(nodeId); | |||
this.obj.syncer.setArray(true, 'passives', 'tickNodes', nodeId); | |||
var stats = this.obj.stats; | |||
if (node) { | |||
for (var p in node.stats) { | |||
stats.addStat(p, node.stats[p]); | |||
} | |||
} | |||
}, | |||
untickNode: function (msg) { | |||
var nodeId = msg.nodeId; | |||
if (!this.selected.some(s => (s == msg.nodeId))) | |||
return; | |||
var node = passiveTree.nodes.find(n => (n.id == nodeId)); | |||
if (node.spiritStart) | |||
return; | |||
this.points++; | |||
this.obj.syncer.set(true, 'passives', 'points', this.points); | |||
this.selected.spliceWhere(id => (id == nodeId)); | |||
this.obj.syncer.setArray(true, 'passives', 'untickNodes', nodeId); | |||
var node = passiveTree.nodes.find(n => (n.id == nodeId)); | |||
var stats = this.obj.stats; | |||
if (node) { | |||
for (var p in node.stats) { | |||
stats.addStat(p, -node.stats[p]); | |||
} | |||
} | |||
}, | |||
simplify: function (self) { | |||
if (!self) | |||
return; | |||
return { | |||
type: 'passives', | |||
selected: this.selected, | |||
points: this.points | |||
}; | |||
}, | |||
events: { | |||
onLevelUp: function (level) { | |||
this.points = level - this.selected.length + 1; | |||
this.obj.syncer.set(true, 'passives', 'points', this.points); | |||
} | |||
} | |||
}; | |||
}); |
@@ -70,6 +70,7 @@ define([ | |||
obj.addComponent('dialogue'); | |||
obj.addComponent('trade', character.components.find(c => c.type == 'trade')); | |||
obj.addComponent('reputation', character.components.find(c => c.type == 'reputation')); | |||
obj.addComponent('passives', character.components.find(c => c.type == 'passives')); | |||
var social = character.components.find(c => c.type == 'social'); | |||
if (social) | |||
@@ -256,6 +256,8 @@ define([ | |||
else | |||
values.level++; | |||
this.obj.fireEvent('onLevelUp', (this.originalValues || this.values).level); | |||
if ((this.originalValues || this.values).level == 20) | |||
values.xp = 0; | |||
@@ -672,6 +674,8 @@ define([ | |||
this.addStat(statName, addStats[p]); | |||
} | |||
this.obj.passives.applyPassives(); | |||
if (resetHp) | |||
newValues.hp = newValues.hpMax; | |||
@@ -0,0 +1,185 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
name: 'Ranger Class', | |||
extraScripts: [], | |||
mapFile: null, | |||
mapW: null, | |||
mapH: null, | |||
mapOffset: { | |||
x: 197, | |||
y: 119 | |||
}, | |||
init: function () { | |||
this.mapFile = require.nodeRequire('../../../mods/iwd-ranger/maps/fjolarok/map'); | |||
this.mapW = this.mapFile.width; | |||
this.mapH = this.mapFile.height; | |||
this.events.on('onBeforeGetSpellsInfo', this.beforeGetSpellsInfo.bind(this)); | |||
this.events.on('onBeforeGetSpellsConfig', this.beforeGetSpellsConfig.bind(this)); | |||
this.events.on('onBeforeGetSpellTemplate', this.beforeGetSpellTemplate.bind(this)); | |||
this.events.on('onBeforeGetResourceList', this.beforeGetResourceList.bind(this)); | |||
this.events.on('onAfterGetZone', this.onAfterGetZone.bind(this)); | |||
this.events.on('onAfterGetLayerObjects', this.onAfterGetLayerObjects.bind(this)); | |||
this.events.on('onBeforeGetDialogue', this.onBeforeGetDialogue.bind(this)); | |||
}, | |||
onBeforeGetDialogue: function (zone, config) { | |||
try { | |||
var modDialogue = require(this.relativeFolderName + '/maps/' + zone + '/dialogues.js'); | |||
extend(true, config, modDialogue); | |||
} catch (e) { | |||
} | |||
}, | |||
onAfterGetZone: function (zone, config) { | |||
try { | |||
var modZone = require(this.relativeFolderName + '/maps/' + zone + '/zone.js'); | |||
extend(true, config, modZone); | |||
} catch (e) { | |||
} | |||
}, | |||
onAfterGetLayerObjects: function (info) { | |||
if (info.map != 'fjolarok') | |||
return; | |||
var layer = this.mapFile.layers.find(l => (l.name == info.layer)); | |||
if (layer) { | |||
var offset = this.mapOffset; | |||
var mapScale = this.mapFile.tilesets[0].tileheight; | |||
layer.objects.forEach(function (l) { | |||
var newO = extend(true, {}, l); | |||
newO.x += (offset.x * mapScale); | |||
newO.y += (offset.y * mapScale); | |||
info.objects.push(newO); | |||
}, this); | |||
} | |||
}, | |||
beforeGetResourceList: function (list) { | |||
list.push(`${this.folderName}/images/items.png`); | |||
list.push(`${this.folderName}/images/mobs.png`); | |||
}, | |||
beforeGetSpellTemplate: function (spell) { | |||
return; | |||
if (spell.type == 'PoisonArrow') | |||
spell.template = require(`${this.relativeFolderName}/spells/spellPoisonArrow`); | |||
else if (spell.type == 'Vanish') | |||
spell.template = require(`${this.relativeFolderName}/spells/spellVanish`); | |||
}, | |||
beforeGetSpellsConfig: function (spells) { | |||
return; | |||
spells['poison arrow'] = { | |||
statType: ['dex'], | |||
statMult: 1, | |||
cdMax: 12, | |||
manaCost: 5, | |||
range: 1, | |||
random: { | |||
damage: [3, 11], | |||
dotDuration: [10, 30], | |||
dotDamage: [1, 5] | |||
} | |||
}; | |||
spells['vanish'] = { | |||
statType: ['dex'], | |||
statMult: 0.27, | |||
cdMax: 7, | |||
manaCost: 5, | |||
range: 9, | |||
random: { | |||
duration: [5, 15], | |||
regen: [1, 5] | |||
} | |||
}; | |||
}, | |||
beforeGetSpellsInfo: function (spells) { | |||
return; | |||
spells.push({ | |||
name: 'Poison Arrow', | |||
description: 'An arrow that poisons.', | |||
type: 'poisonArrow', | |||
icon: [0, 0], | |||
animation: 'melee', | |||
particles: { | |||
color: { | |||
start: ['ff4252', 'b34b3a'], | |||
end: ['b34b3a', 'ff4252'] | |||
}, | |||
scale: { | |||
start: { | |||
min: 2, | |||
max: 14 | |||
}, | |||
end: { | |||
min: 0, | |||
max: 8 | |||
} | |||
}, | |||
lifetime: { | |||
min: 1, | |||
max: 3 | |||
}, | |||
alpha: { | |||
start: 0.7, | |||
end: 0 | |||
}, | |||
randomScale: true, | |||
randomColor: true, | |||
chance: 0.6 | |||
} | |||
}); | |||
spells.push({ | |||
name: 'Vanish', | |||
description: `You can't see me.`, | |||
type: 'vanish', | |||
icon: [1, 0], | |||
animation: 'magic', | |||
particles: { | |||
color: { | |||
start: ['ff4252', 'b34b3a'], | |||
end: ['b34b3a', 'ff4252'] | |||
}, | |||
scale: { | |||
start: { | |||
min: 2, | |||
max: 14 | |||
}, | |||
end: { | |||
min: 0, | |||
max: 8 | |||
} | |||
}, | |||
lifetime: { | |||
min: 1, | |||
max: 3 | |||
}, | |||
alpha: { | |||
start: 0.7, | |||
end: 0 | |||
}, | |||
randomScale: true, | |||
randomColor: true, | |||
chance: 0.6 | |||
} | |||
}); | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,19 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
'finn elderbow': { | |||
'1': { | |||
msg: [{ | |||
msg: `Please...leave me be. I can bring you only sorrow.`, | |||
options: [] | |||
}], | |||
options: { | |||
} | |||
} | |||
} | |||
}; | |||
}); |
@@ -0,0 +1,410 @@ | |||
{ "backgroundcolor":"#32222e", | |||
"height":10, | |||
"infinite":false, | |||
"layers":[ | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":10, | |||
"name":"tiles", | |||
"opacity":0.550000011920929, | |||
"properties": | |||
{ | |||
"tileset":"tiles" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":10, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":10, | |||
"name":"doodads", | |||
"opacity":1, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":10, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |||
"height":10, | |||
"name":"walls", | |||
"opacity":1, | |||
"properties": | |||
{ | |||
"tileset":"walls" | |||
}, | |||
"propertytypes": | |||
{ | |||
"tileset":"string" | |||
}, | |||
"type":"tilelayer", | |||
"visible":true, | |||
"width":10, | |||
"x":0, | |||
"y":0 | |||
}, | |||
{ | |||
"draworder":"topdown", | |||
"name":"mobs", | |||
"objects":[ | |||
{ | |||
"gid":257, | |||
"height":8, | |||
"id":862, | |||
"name":"finn", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":8, | |||
"x":0, | |||
"y":8 | |||
}, | |||
{ | |||
"gid":593, | |||
"height":8, | |||
"id":869, | |||
"name":"finn's stash", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":8, | |||
"x":8, | |||
"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":[ | |||
{ | |||
"height":24, | |||
"id":870, | |||
"name":"talkfinn", | |||
"rotation":0, | |||
"type":"", | |||
"visible":true, | |||
"width":24, | |||
"x":-8, | |||
"y":-8 | |||
}], | |||
"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":871, | |||
"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", | |||
"tiledversion":"1.1.3", | |||
"tileheight":8, | |||
"tilesets":[ | |||
{ | |||
"columns":8, | |||
"firstgid":1, | |||
"image":"..\/..\/..\/..\/..\/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":"..\/..\/..\/..\/..\/client\/images\/mobs.png", | |||
"imageheight":88, | |||
"imagewidth":64, | |||
"margin":0, | |||
"name":"mobs", | |||
"spacing":0, | |||
"tilecount":88, | |||
"tileheight":8, | |||
"tileproperties": | |||
{ | |||
"19": | |||
{ | |||
"portal":"midgaard-inn-room_2,1" | |||
} | |||
}, | |||
"tilepropertytypes": | |||
{ | |||
"19": | |||
{ | |||
"portal":"string" | |||
} | |||
}, | |||
"tilewidth":8 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":345, | |||
"image":"..\/..\/..\/..\/..\/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":537, | |||
"image":"..\/..\/..\/..\/..\/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":713, | |||
"image":"..\/..\/..\/..\/..\/client\/images\/bigObjects.png", | |||
"imageheight":240, | |||
"imagewidth":192, | |||
"margin":0, | |||
"name":"bigObjects", | |||
"spacing":0, | |||
"tilecount":80, | |||
"tileheight":24, | |||
"tilewidth":24 | |||
}, | |||
{ | |||
"columns":8, | |||
"firstgid":793, | |||
"image":"..\/..\/..\/..\/..\/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":1, | |||
"width":10 | |||
} |
@@ -0,0 +1,64 @@ | |||
define([ | |||
], function ( | |||
) { | |||
return { | |||
mobs: { | |||
finn: { | |||
cron: '0 */4 * * *', | |||
lifetime: 1717, | |||
walkDistance: 0, | |||
rare: { | |||
chance: 100, | |||
count: 1, | |||
sheetName: 'server/mods/iwd-ranger/images/mobs.png', | |||
cell: 0, | |||
attackable: false, | |||
name: 'Finn Elderbow' | |||
} | |||
} | |||
}, | |||
objects: { | |||
"finn's stash": { | |||
name: '', | |||
cron: '0 */4 * * *', | |||
lifetime: 1717, | |||
properties: { | |||
cpnChest: {}, | |||
cpnInventory: { | |||
items: [{ | |||
name: 'Broken Elderbow', | |||
spritesheet: 'server/mods/iwd-ranger/images/items.png', | |||
sprite: [0, 0], | |||
noSalvage: true | |||
}] | |||
} | |||
} | |||
}, | |||
talkfinn: { | |||
properties: { | |||
cpnNotice: { | |||
actions: { | |||
enter: { | |||
cpn: 'dialogue', | |||
method: 'talk', | |||
args: [{ | |||
targetName: 'finn elderbow' | |||
}] | |||
}, | |||
exit: { | |||
cpn: 'dialogue', | |||
method: 'stopTalk' | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
}; | |||
}); |
@@ -27,7 +27,8 @@ define([ | |||
stash: ['withdraw'], | |||
trade: ['buySell'], | |||
door: ['lock', 'unlock'], | |||
wardrobe: ['open', 'apply'] | |||
wardrobe: ['open', 'apply'], | |||
passives: ['tickNode', 'untickNode'] | |||
}; | |||
return ((secondaryAllowed[msg.data.cpn]) && (secondaryAllowed[msg.data.cpn].indexOf(msg.data.method) > -1)); | |||