Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeldruck committed Jan 3, 2024
2 parents 81ccbdf + 2d85d0a commit 7dd3fc7
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 294 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,9 @@ dist

## OURS
images/
# All the json config files
config/

# IDE
.idea/
.vscode/
5 changes: 1 addition & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

const express = require('express');
const session = require('express-session');
const bodyParser = require('body-parser');
const mysql = require('mysql');
const ejs = require('ejs');
const path = require('path');
const dotenv = require('dotenv');
const PhotonParser = require('./scripts/classes/PhotonPacketParser');
var Cap = require('cap').Cap;
var decoders = require('cap').decoders;
Expand Down Expand Up @@ -97,6 +93,7 @@ app.use('/scripts/Utils', express.static(__dirname + '/scripts/Utils'));;
app.use('/images/Resources', express.static(__dirname + '/images/Resources'));
app.use('/images/Maps', express.static(__dirname + '/images/Maps'));
app.use('/images/Items', express.static(__dirname + '/images/Items'));
app.use('/config', express.static(__dirname + '/config'));



Expand Down
106 changes: 2 additions & 104 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
{
"name": "nodeproject",
"name": "albion-zqradar",
"version": "1.0.0",
"description": "",
"main": "app.js",
"pkg": {
"scripts": ["scripts/**/*.js"],
"assets": ["views/**/*" ]

},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "nexe -b app.js --resource \"views/**/*\" --resource \"scripts/**/*\" --verbose"
"build": "nexe -b app.js --resource \"views/**/*\" --resource \"scripts/**/*\" --verbose"
},
"author": "",
"author": "Zeldruck",
"license": "ISC",
"dependencies": {
"buffercursor": "^0.0.12",
"cap": "^0.2.1",
"dotenv": "^16.3.1",
"ejs": "^3.1.9",
"express": "^4.18.2",
"express-session": "^1.17.3",
"ip": "^2.0.0",
"mysql": "^2.18.1",
"nan": "^2.18.0",
"node-gyp": "^10.0.1",
"node-sass": "^9.0.0",
Expand Down
27 changes: 9 additions & 18 deletions scripts/Drawings/MobsDrawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export class MobsDrawing extends DrawingUtils {
else if (mobOne.type == 4) {
this.drawImageCustom(ctx, point.x, point.y, "droneicon" , 40);
}
else {
else
{


if (mobOne.enchantmentLevel == 1) {
Expand All @@ -129,11 +130,10 @@ export class MobsDrawing extends DrawingUtils {
this.drawFilledCircle(ctx, point.x, point.y, 15, "yellow");

}

this.drawFilledCircle(ctx, point.x, point.y, 10, "#4169E1");



else
{
this.drawFilledCircle(ctx, point.x, point.y, 10, "#4169E1");
}
}


Expand All @@ -144,20 +144,11 @@ export class MobsDrawing extends DrawingUtils {

this.drawTextItems(point.x - textWidth /2, point.y + 24, mobOne.health, ctx, "12px", "yellow");
}
if (this.settings.mobDevMode) {


if (this.settings.mobDevMode)
{
this.drawText(point.x, point.y - 20, mobOne.typeId, ctx);
}










}

for (const mistsOne of mists) {
Expand Down
51 changes: 27 additions & 24 deletions scripts/Handlers/MobsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class MobsHandler {
}

NewMobEvent(parameters) {
const id = parseInt(parameters[0]);
let typeId = parseInt(parameters[1]);

const id = parseInt(parameters[0]); // entity id
let typeId = parseInt(parameters[1]); // real type id


const loc = parameters[7];
Expand Down Expand Up @@ -110,41 +109,45 @@ class MobsHandler {
rarity = 1;
}

if (name != null ) {
if (name != null )
{
if (this.mistList.some(mist => mist.id === id))
return;

this.addMist(id, posX, posY, name, enchant);
}
else {
this.addMob(id, typeId, posX, posY, exp, 0, rarity, exp);
else
{
if (this.mobsList.some(mob => mob.id === id))
return;

this.addMob(id, typeId, posX, posY, exp, 0, rarity);
}


}


addMob(id, typeId, posX, posY, health, enchant, rarity) {

const h = new Mob(id, typeId, posX, posY, health, enchant, rarity);
addMob(id, typeId, posX, posY, health, enchant, rarity)
{
const h = new Mob(id, typeId, posX, posY, health, enchant, rarity);

if (this.mobinfo[typeId]!=null) {
const mobsInfo = this.mobinfo[typeId];
h.tier = mobsInfo[0];
h.type = mobsInfo[1];
h.name = mobsInfo[2];
}
if (this.mobinfo[typeId]!=null) {
const mobsInfo = this.mobinfo[typeId];

h.tier = mobsInfo[0];
h.type = mobsInfo[1];
h.name = mobsInfo[2];
}

if (!this.mobsList.includes(h)) {
this.mobsList.push(h);
}

this.mobsList.push(h);
}

addMist(id, posX, posY, name, enchant) {
addMist(id, posX, posY, name, enchant)
{
const d = new Mist(id, posX, posY, name, enchant);

if (!this.mistList.some(mist => mist.id === d.id)) {
this.mistList.push(d);
}
this.mistList.push(d);
}

removeMist(id) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/Utils/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ function onEvent(Parameters)


}
else if (eventCode == 118) {

else if (eventCode == 118)
{
mobsHandler.NewMobEvent(Parameters);
}

Expand Down Expand Up @@ -180,7 +180,7 @@ function onRequest(Parameters)
lpY = Parameters[1][1];

//console.log("X: " + lpX + ", Y: " + lpY);
}
}
};

function onResponse(Parameters)
Expand Down
Loading

0 comments on commit 7dd3fc7

Please sign in to comment.