Initial commit

This commit is contained in:
2026-08-24 22:20:36 +02:00
commit 62f7b1278a
251 changed files with 16670 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
const AdmiralCounter = require("../Game/AdmiralCounter");
const admiralTable = new AdmiralCounter({
2: {
2: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
4: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
6: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
8: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
10: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
12: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
14: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
16: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
18: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
20: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
22: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
24: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
26: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
28: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
30: { childToBeKilledCount: 2, maximumAdmiralCount: 2 }
},
3: {
2: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
4: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
6: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
8: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
10: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
12: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
14: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
16: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
18: { childToBeKilledCount: 2, maximumAdmiralCount: 2 },
20: { childToBeKilledCount: 2, maximumAdmiralCount: 2 }
}
});
module.exports = admiralTable;
+15
View File
@@ -0,0 +1,15 @@
const ammunitions = {
1: { damage: 1 },
2: { damage: 2 },
3: { damage: 3 },
4: { damage: 4 },
5: { damage: 5 },
6: { damage: 6 },
7: { damage: 7, overtimeHealthEffectID: 1 },
8: { damage: 8, chanceToTerminateMovement: 20 },
9: { damage: -9 },
10: { damage: -10 },
11: { damage: 11 }
};
module.exports = ammunitions;
+5
View File
@@ -0,0 +1,5 @@
const DoubleLinkedList = require("../Utility/DoubleLinkedList");
const saveLists = [new DoubleLinkedList(), new DoubleLinkedList()];
module.exports = saveLists;
+34
View File
@@ -0,0 +1,34 @@
const cannons = {
1: {
range: 150, damage: 1, reload: 6500, scatter: 0
},
2: {
range: 200, damage: 3, reload: 5750, scatter: 0
},
3: {
range: 250, damage: 5, reload: 5000, scatter: 0
},
4: {
range: 300, damage: 8, reload: 4500, scatter: 0
},
5: {
range: 350, damage: 11, reload: 4000, scatter: 0
},
6: {
range: 400, damage: 10, reload: 4000, scatter: 0
},
7: {
range: 400, damage: 11, reload: 3500, scatter: 0
},
8: {
range: 450, damage: 11, reload: 3500, scatter: 0
},
9: {
range: 350, damage: 4, reload: 1000, scatter: 0
},
10: {
range: 500, damage: 15, reload: 3000, scatter: 0
}
};
module.exports = cannons;
+70
View File
@@ -0,0 +1,70 @@
const cannonsSchemeNPC = {
1: [
[1, 20]
],
2: [
[1, 1],
[4, 2],
[8, 3],
[10, 400]
],
3: [
[10, 30]
],
4: [
[1, 10],
[4, 5],
[8, 15],
[10, 300]
],
5: [
[1, 10],
[4, 5],
[8, 15],
[10, 3]
],
6: [
[1, 10],
[4, 5],
[8, 15],
[10, 300]
],
7: [
[1, 10],
[4, 5],
[8, 15],
[10, 3]
],
8: [
[1, 10],
[4, 5],
[8, 15],
[10, 300]
],
9: [
[1, 10],
[4, 5],
[8, 15],
[10, 30]
],
10: [
[1, 10],
[4, 5],
[8, 15],
[10, 30]
],
11: [
[1, 10],
[4, 5],
[8, 15],
[10, 3]
],
12: [
[1, 10],
[4, 5],
[8, 15],
[10, 30]
]
};
module.exports = cannonsSchemeNPC;
+316
View File
@@ -0,0 +1,316 @@
/*
MAXIMUM VALUES, DO NOT CHANGE AT ALL
*/
const MAX_SAFE_INTEGER = Math.pow(2, 32) - 1;
const MAX_LEVEL_ELITE = 18;
const MAX_GUILD_TAX_RATE_GOLD = 30;
const MAX_GUILD_TAX_RATE_EMERALD = 10;
/*
TYPE OF ENTITES
*/
const ENTITY_TYPE_PLAYER = 1;
const ENTITY_TYPE_NPC = 2;
const ENTITY_TYPE_MONSTER = 3;
const ENTITY_TYPE_TOWER = 4;
const ENTITY_TYPE_COLLECTABLE = 5;
/*
ECONOMY
*/
const ECONOMY_GOLD = 1;
const ECONOMY_EMERALD = 2;
/*
UNATTACKABLE ENTITIES
*/
const UNATTACKABLE_ENTITY_TYPES = [ENTITY_TYPE_COLLECTABLE];
/*
EVENTS
*/
const EVENT_DISCONNECT = "disconnect";
const EVENT_DISCONNECT_CANCEL = "disconnectCancel"
const EVENT_DISCONNECT_IDLE = "disconnectIdle"
const EVENT_RESPAWN = "respawn";
const EVENT_MAP_CHANGED = "mapChanged";
const EVENT_PROPERTY_CHANGED = "propertyChanged";
const EVENT_ATTACK_STARTED = "attackStarted";
const EVENT_ATTACKING = "attacking";
const EVENT_DIE = "die";
const EVENT_LEVEL_UP = "levelUp";
const EVENT_SPEED_UPDATE = "speedUpdate";
const EVENT_ATTACK_ABORTED_BY_USER = "attackAbortedByUser";
const EVENT_STOP_MOVEMENT = "stopMovement";
const EVENT_CANCEL_STATE_CHANGE_TIMEOUT = "cancelStateChangeTimeout";
const EVENT_ABLE_TO_JUMP = "ableToJump";
const EVENT_UNABLE_TO_JUMP = "unableToJump";
const EVENT_LEVEL_IS_LOW = "levelIsLow";
const EVENT_UPDATE_VISIBILITY = "updateVisibility";
const EVENT_DESTINATION_REACHED = "destinationReached";
const EVENT_DESTINATION_NEW = "newDestination";
const EVENT_SEEK_TARGET = "seekTarget";
const EVENT_ADD_EVENTS = "addEvents";
const EVENT_READY = "ready";
const EVENT_DISTRIBUTE_REWARD = "distributeReward";
const EVENT_DAMAGE = "damage";
const EVENT_ITEM_USED = "itemUsed";
const EVENT_CANNONS_USED = "cannonsUsed";
const EVENT_HARPOONERS_USED = "harpoonersUsed";
const EVENT_QUEST_DONE = "questDone";
const EVENT_EFFECT_ADD = "effectAdd";
const EVENT_DESINATION_NEW = "newDestination";
const EVENT_ATTACK_BAR = "attackBar";
const EVENT_PATH_READY = "scheduledPathReady"
const EVENT_SPAWN_ADMIRAL = "admiralSpawnNotification";
const EVENT_HEALTH_CHANGED = "healthChanged";
const EVENT_HEALTH_CHANGED_AUTHORLESS = "healthChangedAuthorless";
const EVENT_GUILD_ISLAND_CAPTURE = "guildIslandCapture";
const EVENT_GUILD_ISLAND_TOWER_BUILT = "guildDataIslandTowerBuilt";
const EVENT_GUILD_ISLAND_TOWER_HEALTH_CHANGED = "guildDataIslandTowerHealthChanged";
/*
BEHAVIOUR
*/
const BEHAVIOUR_AGGRESSIVE = "aggressive";
const BEHAVIOUR_STOP_IF_ATTACKED = "stopIfAttacked";
/*
MODE OF MAPS
*/
const MAP_MODE_PVE = "PvE";
const MAP_MODE_PVP = "PvP";
/*
LOGOUT TIMEOUTS
*/
const LOGOUT_TIME_BASIC = 30 * 1000;
const LOGOUT_TIME_PREMIUM = 10 * 1000;
const LOGOUT_TIME_IDLE = 10 * 60 * 10000;
/*
BASE VALUES FOR CALCULATIONS
*/
const BASE_REPAIR_AMOUNT_MINIMUM = 1000;
const BASE_REPAIR_AMOUNT_MAXIMUM = 2000;
const BASE_SPEED_PLAYER_REPAIR = 1500;
const BASE_SPEED_PLAYER = 100;
/*
TASKS
*/
const TASK_TYPE_DEAL_DAMAGE = 1;
const TASK_TYPE_DESTROY = 2;
/*
TIMING EVENTS
*/
const TIMING_EVENT_CANNON_ATTACK = 1;
const TIMING_EVENT_HARPOONER_ATTACK = 2;
const TIMING_EVENT_REPAIR = 3;
const TIMING_EVENT_DISCONNECT = 4;
const TIMING_EVENT_DISCONNECT_IDLE = 5;
const TIMING_EVENT_MAP_CHANGE = 6;
const TIMING_EVENT_MOVE = 7;
const TIMING_EVENT_RESPAWN = 8;
const TIMING_EVENT_OVERTIME_DECREASE_HITPOINT = 9;
const TIMING_EVENT_OVERTIME_INCREASE_HITPOINT = 10;
const TIMING_EVENT_DIE = 11;
const TIMING_EVENT_OVERTIME_DECREASE_HITPOINT_2 = 12;
/*
ACQUIRABLE ITEM CATEGORIES
*/
const CATEGORY_ECONOMY = 1;
const CATEGORY_ITEM = 2;
const CATEGORY_AMMUNITION = 3;
const CATEGORY_HARPOON = 4;
const CATEGORY_DESIGN = 5;
const CATEGORY_STATUS = 6;
const CATEGORY_CANNON = 7;
const CATEGORY_HARPOONER = 8;
const CATEGORY_SAIL = 9;
const CATEGORY_PIRATE = 10;
const CATEGORY_RANKING_POINTS = 11;
/*
QUEST STATUS
*/
const QUEST_STATE_ACTIVE = 0;
const QUEST_STATE_COMPLETED = 0;
/*
PROPERTY ALTERING CATEGORIES
*/
const AFFECT_CANNON_DAMAGE = 1;
const AFFECT_HARPOONER_DAMAGE = 2;
const AFFECT_PROTECTION = 3;
const AFFECT_SAILING_SPEED = 4;
const AFFECT_HITPOINT = 5;
/*
GUILD PERMISSION BITS
*/
const GUILD_PERMISSION_KICK = 1;
const GUILD_PERMISSION_ACCEPT_JOIN_REQUEST = 2;
const GUILD_PERMISSION_EDIT_IDENTITY = 4;
const GUILD_PERMISSION_EDIT_TAX = 8;
const GUILD_PERMISSION_EDIT_ISLAND = 16;
/*
LEADERBOARD TYPES
*/
const LEADERBOARD_EXPERIENCE_POINTS = 1;
const LEADERBOARD_NPC_SINK = 2;
const LEADERBOARD_MONSTER_SINK = 3;
const LEADERBOARD_PLAYER_SINK = 4;
const LEADERBOARD_ELITE_POINTS = 5;
const LEADERBOARD_FISHING_POINTS = 6;
/*
GUILD COOLDOWN TIMES
*/
const GUILD_COOLDOWN_EDIT_TAX_RATES = 60000;
const GUILD_COOLDOWN_EDIT_TAG = 60000;
const GUILD_COOLDOWN_EDIT_NAME = 60000;
const GUILD_COOLDOWN_EDIT_DESCRIPTION = 60000;
const COLLECTIBLE_CURRENCIES_BY_ID = {
1: "gold",
2: "emerald",
3: "draconicScales",
4: "corsaireCoins"
};
const COLLECTIBLE_CURRENCIES_BY_NAME = {
gold: 1,
emerald: 2,
draconicScales: 3,
corsaireCoins: 4
};
const ENTITY_TYPES_BY_ID = {
1: ENTITY_TYPE_PLAYER,
2: ENTITY_TYPE_NPC,
3: ENTITY_TYPE_MONSTER,
4: ENTITY_TYPE_TOWER,
5: ENTITY_TYPE_COLLECTABLE
};
const TIMING_EVENTS_BY_ID = {
1: "attackWithCannon",
2: "attackWithHarpooner",
3: "repair",
4: "disconnect",
5: "disconnect",
6: "isChangeMapAvailable",
7: "move",
8: "respawn",
9: "overtimeDecreaseCurrentHitpoint",
10: "overtimeIncreaseCurrentHitpoint",
11: "die",
12: "overtimeDecreaseCurrentHitpoint",
13: "overtimeDecreaseCurrentHitpoint",
14: "respawn",
15: "changeMap",
16: "abortAttack",
17: "effectRemove",
97: "attackWithCannon",
98: "attackWithCannon",
99: "attackWithCannon",
100: "attackWithCannon",
101: "attackWithCannon",
102: "attackWithCannon",
103: "attackWithCannon",
104: "attackWithCannon",
105: "attackWithCannon",
106: "attackWithCannon",
197: "attackWithHarpooner",
198: "attackWithHarpooner",
199: "attackWithHarpooner",
200: "attackWithHarpooner",
201: "attackWithHarpooner",
202: "attackWithHarpooner",
299: "changeSpeed",
300: "changeSpeed",
999: "refreshVisibilities"
};
const EVENTS_BY_TIMING_EVENTS_ID = {
1: EVENT_ATTACKING,
2: EVENT_ATTACKING
};
const EFFECTS_TERMINATE_MOVEMENT = [1];
module.exports.MAXIMUM = {
MAX_SAFE_INTEGER, MAX_LEVEL_ELITE, MAX_GUILD_TAX_RATE_GOLD, MAX_GUILD_TAX_RATE_EMERALD
};
module.exports.TYPES = {
ENTITY_TYPE_PLAYER, ENTITY_TYPE_NPC, ENTITY_TYPE_MONSTER, ENTITY_TYPE_TOWER, ENTITY_TYPE_COLLECTABLE
};
module.exports.UNATTACKABLE_ENTITY_TYPES = UNATTACKABLE_ENTITY_TYPES;
module.exports.EVENTS = {
EVENT_DISCONNECT, EVENT_DISCONNECT_CANCEL, EVENT_DISCONNECT_IDLE, EVENT_RESPAWN, EVENT_MAP_CHANGED, EVENT_PROPERTY_CHANGED, EVENT_ATTACK_STARTED, EVENT_ATTACKING, EVENT_DIE, EVENT_SPEED_UPDATE,
EVENT_ATTACK_ABORTED_BY_USER, EVENT_STOP_MOVEMENT, EVENT_CANCEL_STATE_CHANGE_TIMEOUT,
EVENT_ABLE_TO_JUMP, EVENT_UNABLE_TO_JUMP, EVENT_LEVEL_IS_LOW, EVENT_UPDATE_VISIBILITY, EVENT_DESTINATION_REACHED,
EVENT_DESTINATION_NEW, EVENT_SEEK_TARGET, EVENT_LEVEL_UP, EVENT_ADD_EVENTS, EVENT_READY, EVENT_DISTRIBUTE_REWARD,
EVENT_DAMAGE, EVENT_ITEM_USED, EVENT_CANNONS_USED, EVENT_HARPOONERS_USED, EVENT_QUEST_DONE, EVENT_EFFECT_ADD, EVENT_DESINATION_NEW, EVENT_ATTACK_BAR, EVENT_PATH_READY, EVENT_SPAWN_ADMIRAL,
EVENT_HEALTH_CHANGED, EVENT_HEALTH_CHANGED_AUTHORLESS, EVENT_GUILD_ISLAND_CAPTURE, EVENT_GUILD_ISLAND_TOWER_BUILT, EVENT_GUILD_ISLAND_TOWER_HEALTH_CHANGED
};
module.exports.BEHAVIOURS = {
BEHAVIOUR_AGGRESSIVE, BEHAVIOUR_STOP_IF_ATTACKED
};
module.exports.MAP_MODES = {
MAP_MODE_PVE, MAP_MODE_PVP
};
module.exports.LOGOUT_TIMES = {
LOGOUT_TIME_BASIC, LOGOUT_TIME_PREMIUM, LOGOUT_TIME_IDLE
};
module.exports.BASE = {
BASE_REPAIR_AMOUNT_MINIMUM, BASE_REPAIR_AMOUNT_MAXIMUM, BASE_SPEED_PLAYER_REPAIR, BASE_SPEED_PLAYER
};
module.exports.TASK_TYPES = {
TASK_TYPE_DEAL_DAMAGE, TASK_TYPE_DESTROY
};
module.exports.TIMING_EVENTS = {
TIMING_EVENT_CANNON_ATTACK, TIMING_EVENT_HARPOONER_ATTACK, TIMING_EVENT_REPAIR, TIMING_EVENT_DISCONNECT, TIMING_EVENT_DISCONNECT_IDLE, TIMING_EVENT_MAP_CHANGE, TIMING_EVENT_MOVE, TIMING_EVENT_RESPAWN,
TIMING_EVENT_OVERTIME_DECREASE_HITPOINT, TIMING_EVENT_OVERTIME_INCREASE_HITPOINT, TIMING_EVENT_OVERTIME_DECREASE_HITPOINT_2
};
module.exports.CATEGORIES = {
CATEGORY_ECONOMY, CATEGORY_ITEM, CATEGORY_AMMUNITION, CATEGORY_HARPOON, CATEGORY_DESIGN, CATEGORY_STATUS, CATEGORY_CANNON, CATEGORY_HARPOONER, CATEGORY_SAIL, CATEGORY_PIRATE, CATEGORY_RANKING_POINTS
};
module.exports.AFFECTS = {
AFFECT_CANNON_DAMAGE, AFFECT_HARPOONER_DAMAGE, AFFECT_PROTECTION, AFFECT_SAILING_SPEED, AFFECT_HITPOINT
};
module.exports.GUILD_PERMISSIONS = {
GUILD_PERMISSION_KICK, GUILD_PERMISSION_ACCEPT_JOIN_REQUEST, GUILD_PERMISSION_EDIT_IDENTITY, GUILD_PERMISSION_EDIT_TAX, GUILD_PERMISSION_EDIT_ISLAND
};
module.exports.GUILD_COOLDOWNS = {
GUILD_COOLDOWN_EDIT_TAX_RATES, GUILD_COOLDOWN_EDIT_TAG, GUILD_COOLDOWN_EDIT_NAME, GUILD_COOLDOWN_EDIT_DESCRIPTION
};
module.exports.COLLECTIBLE_CURRENCIES_BY_ID = COLLECTIBLE_CURRENCIES_BY_ID;
module.exports.COLLECTIBLE_CURRENCIES_BY_NAME = COLLECTIBLE_CURRENCIES_BY_NAME;
module.exports.ENTITY_TYPES_BY_ID = ENTITY_TYPES_BY_ID;
module.exports.TIMING_EVENTS_BY_ID = TIMING_EVENTS_BY_ID;
module.exports.EVENTS_BY_TIMING_EVENTS_ID = EVENTS_BY_TIMING_EVENTS_ID;
module.exports.EFFECTS_TERMINATE_MOVEMENT = EFFECTS_TERMINATE_MOVEMENT;
+62
View File
@@ -0,0 +1,62 @@
const DESIGNS = {
1: true,
2: true,
3: true,
4: true,
5: true,
6: true,
7: true,
8: true,
9: true,
10: true,
11: true,
12: true,
13: true,
14: true,
15: true,
16: true,
17: true,
18: true,
19: true,
20: true,
21: true,
22: true,
23: true,
24: true,
25: true,
26: true,
27: true,
28: true,
29: true,
30: true,
31: true,
32: true,
33: true,
34: true,
35: true,
36: true,
37: true,
38: true,
39: true,
40: true,
41: true,
42: true,
43: true,
44: true,
45: true,
46: true,
47: true,
48: true,
49: true,
50: true,
51: true,
52: true,
53: true,
54: true,
55: true,
56: true,
57: true,
58: true
};
module.exports = DESIGNS;
+18
View File
@@ -0,0 +1,18 @@
const effects = {
1: [1],
2: [2],
3: [3],
4: [4],
5: [5],
6: [6],
7: [7],
8: [8]
};
/*
Keys are the effectID's. Arrays bounded to them contain itemID's.
This is used to activate the items bounded to the effects.
It looks redundant: arrays are used so multiple items can be bounded to one effect.
*/
module.exports = effects;
+151
View File
@@ -0,0 +1,151 @@
const Reward = require("../Game/Reward");
const eliteRewards = [
0,
new Reward({
distributionType: 2,
baseReward: {
5: {
6: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
7: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
8: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
9: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
10: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
11: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
12: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
13: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
14: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
15: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
16: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
17: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
18: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
19: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
20: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
21: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
22: { amountMinimum: 1, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
5: {
23: { amountMinimum: 1, chance: 100 }
}
}
})
];
module.exports = eliteRewards;
+77
View File
@@ -0,0 +1,77 @@
const entityGroup = {
id: 1,
mapIDs: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
entitySettings: {
1: {
speed: 600,
respawnTime: 0,
size: 128
},
2: {
speed: 400,
respawnTime: 60,
size: 96
},
3: {
speed: 120,
respawnTime: 30,
size: 64
}
},
structure: [
{
typeID: 2,
entityTypeID: 113,
groupMemberTypeID: 1
},
{
typeID: 2,
entityTypeID: 113,
groupMemberTypeID: 1
},
{
typeID: 2,
entityTypeID: 114,
groupMemberTypeID: 2
},
{
typeID: 2,
entityTypeID: 114,
groupMemberTypeID: 2
},
{
typeID: 2,
entityTypeID: 114,
groupMemberTypeID: 2
},
{
typeID: 2,
entityTypeID: 115,
groupMemberTypeID: 3
},
{
typeID: 2,
entityTypeID: 115,
groupMemberTypeID: 3
},
{
typeID: 2,
entityTypeID: 115,
groupMemberTypeID: 3
},
{
typeID: 2,
entityTypeID: 115,
groupMemberTypeID: 3
},
{
typeID: 2,
entityTypeID: 115,
groupMemberTypeID: 3
}
]
};
const entityGroups = [entityGroup];
module.exports = entityGroups;
+22
View File
@@ -0,0 +1,22 @@
const harpooners = {
1: {
range: 150 / 4, damage: 1 / 4, reload: 6500 / 4
},
2: {
range: 200 / 4, damage: 3 / 4, reload: 5750 / 4
},
3: {
range: 250 / 4, damage: 5 / 4, reload: 5000 / 4
},
4: {
range: 300 / 4, damage: 8 / 4, reload: 4500 / 4
},
5: {
range: 350 / 4, damage: 11 / 4, reload: 4000 / 4
},
6: {
range: 400 / 4, damage: 10 / 4, reload: 4000 / 4
}
};
module.exports = harpooners;
+12
View File
@@ -0,0 +1,12 @@
const harpoons = {
1: { damage: 50 },
2: { damage: 250 },
3: { damage: 500 },
4: { damage: 750 },
5: { damage: 1250 },
6: { damage: 1500 },
7: { damage: 2000 },
8: { damage: 2500 }
};
module.exports = harpoons;
+33
View File
@@ -0,0 +1,33 @@
const constants = require("../Data/constants");
const { AFFECTS, MAP_MODES, TYPES } = constants;
const { AFFECT_CANNON_DAMAGE, AFFECT_HARPOONER_DAMAGE, AFFECT_PROTECTION, AFFECT_SAILING_SPEED, AFFECT_HITPOINT } = AFFECTS;
const { MAP_MODE_PVE, MAP_MODE_PVP } = MAP_MODES;
const { ENTITY_TYPE_PLAYER, ENTITY_TYPE_NPC, ENTITY_TYPE_TOWER } = TYPES;
const itemTable = {
1: { scale: 1.2, isSelf: true, isDurable: true, affects: [2], range: 0, cooldown: 0, statusID: 1, useOnImpact: false },
2: { scale: 1.2, isSelf: true, isDurable: true, affects: [2], range: 0, cooldown: 0, statusID: 2, useOnImpact: false },
3: { scale: 1.2, isSelf: true, isDurable: true, affects: [2], range: 0, cooldown: 0, statusID: 3, useOnImpact: false },
4: { scale: 1.2, isSelf: true, isDurable: true, affects: [2], range: 0, cooldown: 0, statusID: 4, useOnImpact: false },
5: { scale: 0.2, isSelf: true, isDurable: true, affects: [AFFECT_PROTECTION], range: 0, cooldown: 0, statusID: 5, useOnImpact: false },
6: { scale: 0.2, isSelf: true, isDurable: true, affects: [AFFECT_PROTECTION], range: 0, cooldown: 0, statusID: 6, useOnImpact: false },
7: { scale: 0.2, isSelf: true, isDurable: true, affects: [AFFECT_PROTECTION], range: 0, cooldown: 0, statusID: 7, useOnImpact: false },
8: { scale: 0.2, isSelf: true, isDurable: true, affects: [AFFECT_PROTECTION], range: 0, cooldown: 0, statusID: 8, useOnImpact: false },
9: { scale: -1000, isSelf: false, isDurable: false, affects: [AFFECT_HITPOINT], range: 700, cooldown: 2000, statusID: 0, useOnImpact: true, allowedTargetTypes: {
"PvE": [ENTITY_TYPE_NPC, ENTITY_TYPE_TOWER],
"PvP": [ENTITY_TYPE_PLAYER, ENTITY_TYPE_NPC, ENTITY_TYPE_TOWER]
}},
10: { scale: -25000, isSelf: false, isDurable: false, affects: [AFFECT_HITPOINT], range: 700, cooldown: 2000, statusID: 0, useOnImpact: true, allowedTargetTypes: {
"PvE": [ENTITY_TYPE_NPC, ENTITY_TYPE_TOWER],
"PvP": [ENTITY_TYPE_PLAYER, ENTITY_TYPE_NPC, ENTITY_TYPE_TOWER]
}},
11: { scale: 10000, isSelf: true, isDurable: false, affects: [AFFECT_HITPOINT], range: 0, cooldown: 10000, statusID: 0, useOnImpact: true },
12: { scale: 15000, isSelf: true, isDurable: false, affects: [AFFECT_HITPOINT], range: 0, cooldown: 10000, statusID: 0, useOnImpact: true },
13: { scale: 16000, isSelf: true, isDurable: false, affects: [AFFECT_HITPOINT], range: 0, cooldown: 10000, statusID: 0, useOnImpact: true },
14: { scale: 17000, isSelf: true, isDurable: false, affects: [AFFECT_HITPOINT], range: 0, cooldown: 10000, statusID: 0, useOnImpact: true },
15: { scale: 35000, isSelf: true, isDurable: false, affects: [AFFECT_HITPOINT], range: 0, cooldown: 10000, statusID: 0, useOnImpact: true },
16: { scale: -12, isSelf: true, isDurable: false, affects: [AFFECT_SAILING_SPEED], range: 0, cooldown: 15000, time: 5000, statusID: 16, iid: 299, useOnImpact: true },
17: { scale: -25, isSelf: true, isDurable: false, affects: [AFFECT_SAILING_SPEED], range: 0, cooldown: 30000, time: 10000, statusID: 17, iid: 300, useOnImpact: true }
};
module.exports = itemTable;
+20
View File
@@ -0,0 +1,20 @@
const DoubleLinkedList = require("../Utility/DoubleLinkedList");
const leaderboards = [];
for (let i = 0; i < 7; i++) {
const leaderboard = {
cache: {},
list: new DoubleLinkedList(),
size: 0,
entriesNEW: {},
updatePosition(id, amount, isAbsolute) {
if (isAbsolute) this.list.addItem(id, amount);
else this.list.accumulateItem(id, amount);
}
};
leaderboards.push(leaderboard);
};
module.exports = leaderboards;
+162
View File
@@ -0,0 +1,162 @@
const Reward = require("../Game/Reward");
const levelRewards = [
0,
0,
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
3: { amountMinimum: 42, chance: 100 }
},
8: {
3: { amountMinimum: 42, chance: 100 }
}
}
}),
new Reward({
distributionType: 2,
baseReward: {
3: {
5: { amountMinimum: 42, chance: 100 }
},
2: {
5: { amountMinimum: 42, chance: 100 }
},
7: {
1: { amountMinimum: 42, chance: 100 }
},
8: {
1: { amountMinimum: 42, chance: 100 }
}
}
})
];
module.exports = levelRewards;
+45
View File
@@ -0,0 +1,45 @@
const { MAXIMUM } = require("./constants");
const { MAX_LEVEL_ELITE } = MAXIMUM;
const a = 1;
const b = -1;
const levels = {
pirateLevel(points) {
const c = points * 2 / 250 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
},
eliteLevel(points) {
const c = points * 2 / 750 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return Math.min(currentLevel, MAX_LEVEL_ELITE);
},
fishingLevel(points) {
const c = points * 2 / 525 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
},
guildLevel(points) {
const c = points * 2 / 20 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
}
};
module.exports = levels;
+31
View File
@@ -0,0 +1,31 @@
const loginRewards = {
7: {
1: {
3: {
5: { amountMinimum: 1500, chance: 100 }
},
7: {
3: { amountMinimum: 2, chance: 100 }
},
8: {
3: { amountMinimum: 2, chance: 100 }
}
},
2: {
3: {
5: { amountMinimum: 1500, chance: 100 }
},
7: {
3: { amountMinimum: 2, chance: 100 }
},
8: {
3: { amountMinimum: 2, chance: 100 }
}
},
3: {
}
}
};
module.exports = loginRewards;
+9
View File
@@ -0,0 +1,9 @@
const maps = [
[1, 6, 11, 16],
[2, 7, 12, 17],
[3, 8, 13, 18],
[4, 9, 14, 19],
[5, 10, 15, 20]
];
module.exports = maps;
+436
View File
@@ -0,0 +1,436 @@
const constans = require("./constants");
const entityGroups = require("./entityGroups");
const { MAP_MODES } = constans;
const { MAP_MODE_PVE, MAP_MODE_PVP } = MAP_MODES;
const MAP_NEIGHBOUR_DIRECTION_LEFT = 1;
const MAP_NEIGHBOUR_DIRECTION_RIGHT = 2;
const MAP_NEIGHBOUR_DIRECTION_TOP = 3;
const MAP_NEIGHBOUR_DIRECTION_BOTTOM = 4;
const map_1 = {
name: "1/1",
level: 1,
id: 1,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(1)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 5, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 2, align: "y", threshold: 96 }
],
collision: {}
};
const map_2 = {
name: "1/2",
level: 1,
id: 2,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(2)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 1, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 6, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 3, align: "y", threshold: 96 }
]
}
const map_3 = {
name: "2/1",
level: 10,
id: 3,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(3)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 7, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 2, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 4, align: "y", threshold: 96 }
]
}
const map_4 = {
name: "2/2",
level: 10,
id: 4,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(4)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 8, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 3, align: "y", threshold: 96 }
]
}
const map_5 = {
name: "3/1",
level: 25,
id: 5,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(5)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 1, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 9, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 6, align: "y", threshold: 96 }
]
}
const map_6 = {
name: "3/2",
level: 25,
id: 6,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(6)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 2, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 10, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 5, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 7, align: "y", threshold: 96 }
]
}
const map_7 = {
name: "4/1",
level: 50,
id: 7,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(7)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 3, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 11, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 6, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 8, align: "y", threshold: 96 }
]
}
const map_8 = {
name: "4/2",
level: 50,
id: 8,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(8)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 4, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 12, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 7, align: "y", threshold: 96 },
]
}
const map_9 = {
name: "5/1",
level: 75,
id: 9,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(9)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 5, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 13, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 10, align: "y", threshold: 96 }
]
}
const map_10 = {
name: "5/2",
level: 75,
id: 10,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(10)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 6, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 14, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 9, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 11, align: "y", threshold: 96 }
]
}
const map_11 = {
name: "6/1",
level: 100,
id: 11,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(11)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 7, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 15, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 10, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 12, align: "y", threshold: 96 }
]
}
const map_12 = {
name: "6/2",
level: 1,
id: 12,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(12)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 8, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 16, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 11, align: "y", threshold: 96 }
]
}
const map_13 = {
name: "7/1",
level: 1,
id: 13,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(13)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 9, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 17, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 14, align: "y", threshold: 96 }
]
}
const map_14 = {
name: "7/2",
level: 1,
id: 14,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(14)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 10, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 18, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 13, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 15, align: "y", threshold: 96 }
]
}
const map_15 = {
name: "8/1",
level: 1,
id: 15,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(15)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 11, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 19, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 14, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 16, align: "y", threshold: 96 }
]
}
const map_16 = {
name: "8/2",
level: 1,
id: 16,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(16)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 12, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_RIGHT, id: 20, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 15, align: "y", threshold: 96 }
]
}
const map_17 = {
name: "9/1",
level: 1,
id: 17,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(17)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 13, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 18, align: "y", threshold: 96 }
]
}
const map_18 = {
name: "9/2",
level: 1,
id: 18,
type: MAP_MODE_PVE,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(18)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 14, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 17, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 19, align: "y", threshold: 96 }
]
}
const map_19 = {
name: "10/1",
level: 1,
id: 19,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(19)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 15, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 18, align: "y", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_BOTTOM, id: 20, align: "y", threshold: 96 }
]
}
const map_20 = {
name: "10/2",
level: 1,
id: 20,
type: MAP_MODE_PVP,
size: {
width: 6000,
height: 4500,
chunk: {
width: 1200,
height: 900
}
},
entityGroups: entityGroups.filter(e => e.mapIDs.includes(20)),
neighbours: [
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_LEFT, id: 16, align: "x", threshold: 96 },
{ directionIndex: MAP_NEIGHBOUR_DIRECTION_TOP, id: 19, align: "y", threshold: 96 }
]
}
module.exports = [map_1, map_2, map_3, map_4, map_5, map_6, map_7, map_8, map_9, map_10, map_11, map_12, map_13, map_14, map_15, map_16, map_17, map_18, map_19, map_20];
+7
View File
@@ -0,0 +1,7 @@
const OVERTIME_HEALTH_EFFECTS = {
1: { amount: 0.15, ticks: 10, time: 1000 },
2: { amount: 0.15, ticks: 5, time: 500 },
3: { amount: 0.15, ticks: 10, time: 100 }
};
module.exports = OVERTIME_HEALTH_EFFECTS;
+18
View File
@@ -0,0 +1,18 @@
const Utility = require("../Game/Utility");
const packetRelevancies = {
0: function (player, packet) {
return player.inDistance[packet.authorID] || player.id === packet.authorID;
},
1: function (player, packet) {
return Utility.IsInDistance(packet.position, player.position, player.sight + 60);
},
19: function (player) {
return true;
},
59: function (player, packet) {
return player.isAlive && (player.inDistance[packet.authorID] || player.id === packet.authorID);
}
};
module.exports = packetRelevancies;
+71
View File
@@ -0,0 +1,71 @@
const ReadyMessage = require("../Messages/ReadyMessage");
const QuestMessage = require("../Messages/QuestMessage");
const SpyMessage = require("../Messages/SpyMessage");
const CauldronMessage = require("../Messages/CauldronMessage");
const MovementMessage = require("../Messages/MovementMessage");
const CloseMessage = require("../Messages/CloseMessage");
const RepairMessage = require("../Messages/RepairMessage");
const AttackStartMessage = require("../Messages/AttackStartMessage");
const AttackAbortMessage = require("../Messages/AttackAbortMessage");
const RespawnMessage = require("../Messages/RespawnMessage");
const EquipmentChangeMessage = require("../Messages/EquipmentChangeMessage");
const MapChangeMessage = require("../Messages/MapChangeMessage");
const AmmunitionChangeMessage = require("../Messages/AmmunitionChangeMessage");
const DesignChangeMessage = require("../Messages/DesignChangeMessage");
const ItemUseMessage = require("../Messages/ItemUseMessage");
const ItemBuyMessage = require("../Messages/ItemBuyMessage");
const LeaderboardPageMessage = require("../Messages/LeaderboardPageMessage");
const GuildMemberLeaveMessage = require("../Messages/GuildMemberLeaveMessage");
const GuildMemberJoinMessage = require("../Messages/GuildMemberJoinMessage");
const GuildJoinRequestSubmitMessage = require("../Messages/GuildJoinRequestSubmitMessage");
const GuildDataMessage = require("../Messages/GuildDataMessage");
const GuildDonateMessage = require("../Messages/GuildDonateMessage");
const GuildDetailsTaxEditMessage = require("../Messages/GuildDetailsTaxEditMessage");
const GuildDetailsIdentityEditMessage = require("../Messages/GuildDetailsIdentityEditMessage");
const GuildIslandTowerRepairMessage = require("../Messages/GuildIslandTowerRepairMessage");
const GuildIslandTowerBuildMessage = require("../Messages/GuildIslandTowerBuildMessage");
const LeaderboardDataMessage = require("../Messages/LeaderboardDataMessage");
const GuildSearchMessage = require("../Messages/GuildSearchMessage");
const GuildJoinRequestRevokeMessage = require("../Messages/GuildJoinRequestRevokeMessage");
const GuildCreateMessage = require("../Messages/GuildCreateMessage");
const packetTable = {
1: { handler: ReadyMessage, expectedSize: 1, isAvailable: true },
2: { handler: QuestMessage, expectedSize: 3, isAvailable: true },
3: { handler: SpyMessage, expectedSize: 5, isAvailable: true },
4: { handler: CauldronMessage, expectedSize: 3, isAvailable: true },
5: { handler: MovementMessage, expectedSize: 5, isAvailable: true },
6: { handler: CloseMessage, expectedSize: 1, isAvailable: true },
7: { handler: RepairMessage, expectedSize: 1, isAvailable: true },
8: { handler: AttackStartMessage, expectedSize: 6, isAvailable: true },
9: { handler: AttackAbortMessage, expectedSize: 6, isAvailable: true },
10: { handler: RespawnMessage, expectedSize: 1, isAvailable: true },
11: { handler: EquipmentChangeMessage, expectedSize: 5, isAvailable: true },
12: { handler: MapChangeMessage, expectedSize: 1, isAvailable: true },
13: { handler: AmmunitionChangeMessage, expectedSize: 3, isAvailable: true },
14: { handler: DesignChangeMessage, expectedSize: 3, isAvailable: true },
15: { handler: ItemUseMessage, expectedSize: 7, isAvailable: true },
16: { handler: ItemBuyMessage, expectedSize: 7, isAvailable: true },
17: { handler: LeaderboardPageMessage, expectedSize: 4, isAvailable: true },
18: { handler: GuildMemberLeaveMessage, expectedSize: 5, isAvailable: true },
19: { handler: GuildMemberJoinMessage, expectedSize: 5, isAvailable: true },
20: { handler: GuildJoinRequestSubmitMessage, expectedSize: 0, isAvailable: true },
21: { handler: GuildDataMessage, expectedSize: 1, isAvailable: true },
22: { handler: GuildDonateMessage, expectedSize: 6, isAvailable: true },
23: { handler: GuildDetailsTaxEditMessage, expectedSize: 3, isAvailable: true },
24: { handler: GuildDetailsIdentityEditMessage, expectedSize: 0, isAvailable: true },
25: { handler: GuildIslandTowerRepairMessage, expectedSize: 6, isAvailable: true },
26: { handler: GuildIslandTowerBuildMessage, expectedSize: 7, isAvailable: true },
27: { handler: LeaderboardDataMessage, expectedSize: 1, isAvailable: true },
28: { handler: GuildSearchMessage, expectedSize: 0, isAvailable: true },
29: { handler: GuildJoinRequestRevokeMessage, expectedSize: 7, isAvailable: true },
30: { handler: GuildCreateMessage, expectedSize: 0, isAvailable: true }
};
module.exports = packetTable;
/*
handler: the function that runs when packet is received
expectedSize: size of the packet
isAvailable: whether the server accepts this packet
*/
+8
View File
@@ -0,0 +1,8 @@
const entries = {
1: { name: "Corsaire Coins (200)", unit_amount: 1000, amount: 200 },
2: { name: "Corsaire Coins (450)", unit_amount: 2000, amount: 450 },
3: { name: "Corsaire Coins (1000)", unit_amount: 3000, amount: 1000 },
4: { name: "Corsaire Coins (2000)", unit_amount: 4000, amount: 2000 }
};
module.exports = entries;
+30
View File
@@ -0,0 +1,30 @@
module.exports.QUERY_FETCH_RESOURCES = "SELECT categoryID, itemID AS id, amount FROM resources WHERE playerID = ?";
module.exports.QUERY_FETCH_PLAYER_DATA = "SELECT * FROM playerdata WHERE playerID = ?";
module.exports.QUERY_FETCH_PLAYER_INFORMATION = "SELECT extensions.cannonSlots FROM extensions WHERE playerID = ?";
module.exports.QUERY_FETCH_GUILD_INFORMATION = "SELECT guilds.id, guilds.tag FROM guilds JOIN guildmembers ON guilds.id = guildmembers.guildID WHERE guildmembers.playerID = ?";
module.exports.QUERY_INSERT_DEFAULT_PLAYER = "INSERT INTO playerdata (playerID, x, y, mapID) VALUES (?, ?, ?, ?)";
module.exports.QUERY_FETCH_EQUIPMENTS = "SELECT itemID AS id, categoryID, amountEquipped FROM equipments WHERE playerID = ?";
module.exports.QUERY_FETCH_NPC_SPAWN = "SELECT npc.id, npc.parentEntityTypeId, npc.name, npc.speed, npc.minHealth, npc.maxHealth, spawn.amount, spawn.respawnTime, reward.categoryId, reward.itemId, reward.min, reward.max, reward.chance, reward.isLastShot FROM spawn INNER JOIN npc ON spawn.entityTypeId = npc.id LEFT JOIN reward ON spawn.id = reward.rewardId WHERE mapId IN (?, 0) AND typeId = ?";
module.exports.QUERY_FETCH_MONSTER_SPAWN = "SELECT monster.id, monster.parentEntityTypeId, monster.name, monster.minHealth, monster.maxHealth, spawn.amount, spawn.respawnTime, reward.categoryId, reward.itemId, reward.min, reward.max, reward.chance, reward.isLastShot FROM spawn INNER JOIN monster ON spawn.entityTypeId = monster.id LEFT JOIN reward ON spawn.id = reward.rewardId WHERE mapId IN (?, 0) AND typeId = ?";
module.exports.QUERY_FETCH_COLLECTABLE_SPAWN = "SELECT collectable.id, collectable.name, spawn.amount, spawn.respawnTime, reward.categoryId, reward.itemId, reward.min, reward.max, reward.chance FROM spawn INNER JOIN collectable ON spawn.entityTypeId = collectable.id LEFT JOIN reward ON spawn.id = reward.rewardId WHERE mapId = ? AND typeId = ?";
module.exports.QUERY_FETCH_ACTIVE_QUESTS = "SELECT quests.questID, completedAmount, CAST(state AS UNSIGNED) AS state, questprogression.amount, questprogression.taskIndex, questprogression.taskType FROM quests LEFT JOIN questprogression ON quests.questID = questprogression.questID WHERE quests.playerID = ?";
module.exports.QUERY_FETCH_STATUS = "SELECT statusID FROM status WHERE playerID = ? AND isActive = ?";
module.exports.QUERY_FETCH_GUILD_REQUESTS = "SELECT guilds.id, guildrequests.playerID, guildrequests.message FROM guildrequests INNER JOIN guilds ON guildrequests.guildID = guilds.id";
module.exports.QUERY_FETCH_GUILD_MEMBERS = "SELECT guilds.id, BINARY(guilds.name) AS name, BINARY(guilds.tag) AS tag, BINARY(guilds.description) AS description, guilds.createdBy, guilds.taxRateGold / 100 AS taxRateGold, guilds.taxRateEmerald / 100 AS taxRateEmerald, guilds.taxRatesEditedAt, guilds.tagEditedAt, guilds.nameEditedAt, guilds.descriptionEditedAt, guilds.descriptionEditedAt, guildmembers.playerID, guildmembers.permission FROM guildmembers INNER JOIN guilds ON guildmembers.guildID = guilds.id";
module.exports.QUERY_FETCH_GUILD_ISLANDS = "SELECT * FROM guildislands";
module.exports.QUERY_FETCH_GUILD_ISLAND_DAMAGES = "SELECT * FROM guildislanddamages";
module.exports.QUERY_FETCH_GUILD_DIPLOMACIES = "SELECT guildID, targetGuildID, CONV(HEX(color), 16, 10) + 0 AS color FROM guilddiplomacy JOIN guilds ON guilddiplomacy.guildID = guilds.id";
module.exports.QUERY_FETCH_GUILD_RESOURCES = "SELECT guildID, categoryID, itemID AS id, amount FROM guildresources";
module.exports.QUERY_FETCH_GUILD_TOWERS = "SELECT gi.mapID, gt.id, gt.guildIslandID, gt.entityTypeID, gt.currentHitpoints, gt.positionX, gt.positionY FROM guildtowers gt INNER JOIN guildislands gi ON gt.guildIslandID = gi.id WHERE gi.mapID = ?";
module.exports.QUERY_UPDATE_GUILD_ISLAND_TOWER_DEAD = "UPDATE guildtowers SET currentHitpoints = ? WHERE id = ?";
module.exports.QUERY_UPDATE_GUILD_ISLAND_TOWER_UPGRADE = "UPDATE guildtowers SET entityTypeID = ?, currentHitpoints = ? WHERE id = ?";
module.exports.QUERY_UPDATE_GUILD_ISLAND_TOWER_DEFAULT = "UPDATE guildtowers SET currentHitpoints = ? WHERE guildIslandID = ?";
module.exports.QUERY_DELETE_GUILD_ISLAND_DAMAGES = "DELETE FROM guildislanddamages WHERE guildIslandID = ?";
module.exports.QUERY_UPDATE_GUILD_ISLAND_AUTHOR = "UPDATE guildislands SET guildID = ? WHERE id = ?";
module.exports.QUERY_UPDATE_GUILD_ISLAND_DAMAGES = "INSERT INTO guildislanddamages (damage, guildIslandID, guildID) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE damage = damage + ?";
module.exports.QUERY_UPDATE_GUILD_RESOURCE_SINGLE = "INSERT INTO guildresources (guildID, categoryID, itemID, amount) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE amount = ?";
module.exports.QUERY_UPDATE_PLAYER_RESOURCE_SINGLE = "INSERT INTO resources (playerID, categoryID, itemID, amount) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE amount = ?";
module.exports.QUERY_UPDATE_GUILD_TAX_RATES = "UPDATE guilds SET taxRateGold = ?, taxRateEmerald = ? WHERE id = ?";
module.exports.QUERY_DELETE_GUILD_MEMBER = "DELETE FROM guildmembers WHERE playerID = ? AND isLeader = ?";
module.exports.QUERY_FETCH_GUILD_OFFLINE_MEMBERS = "SELECT accounts.id, username, itemID, amount FROM resources INNER JOIN accounts on resources.playerID = accounts.id WHERE categoryID = 6 AND itemID = 1 AND playerID IN (?)";
module.exports.QUERY_FETCH_SHOP_ENTRIES = "SELECT * FROM shop";
+97
View File
@@ -0,0 +1,97 @@
const quest = {
id: 1,
maximumComplete: 1,
minimumLevel: 1,
maximumLevel: 99,
task: {
1: [
{ typeID: 2, entityTypeID: 1, requiredAmount: 200, amount: 0 },
{ typeID: 3, entityTypeID: 1, requiredAmount: 5000, amount: 0 },
],
2: [
{ typeID: 5, entityTypeID: 1, requiredAmount: 3, amount: 0 },
{ typeID: 3, entityTypeID: 3, requiredAmount: 3, amount: 0 }
]
},
reward: {
3: {
5: { amountMinimum: 69, chance: 100 }
},
5: {
18: { amountMinimum: 1, chance: 100 }
},
6: {
1: { amountMinimum: 100, chance: 100 }
},
7: {
1: { amountMinimum: 3, chance: 100 }
},
8: {
1: { amountMinimum: 3, chance: 100 }
}
}
};
const quest2 = {
id: 2,
maximumComplete: 3,
minimumLevel: 1,
maximumLevel: 2,
task: {
1: [
{ typeID: 2, entityTypeID: 3, requiredAmount: 2000, amount: 0 },
{ typeID: 2, entityTypeID: 5, requiredAmount: 1500, amount: 0 },
],
2: [
{ typeID: 5, entityTypeID: 1, requiredAmount: 10, amount: 0 },
{ typeID: 3, entityTypeID: 3, requiredAmount: 3, amount: 0 }
]
},
reward: {
5: {
6: { amountMinimum: 1, chance: 100 }
}
}
};
const quest3 = {
id: 3,
maximumComplete: 2,
minimumLevel: 1,
maximumLevel: 99,
task: {
2: [
{ typeID: 5, entityTypeID: 1, requiredAmount: 10, amount: 0 }
]
},
reward: {
3: {
1: { amountMinimum: 1000, chance: 100 },
2: { amountMinimum: 2000, chance: 100 },
5: { amountMinimum: 2700, chance: 100 },
},
5: {
35: { amountMinimum: 1, chance: 100 }
}
}
};
const quest4 = {
id: 4,
maximumComplete: 1,
minimumLevel: 4,
maximumLevel: 4,
task: {
2: [
{ typeID: 5, entityTypeID: 1, requiredAmount: 3, amount: 0 }
]
},
reward: {
5: {
34: { amountMinimum: 1, chance: 100 }
}
}
};
module.exports = [quest, quest2, quest3, quest4];
+49
View File
@@ -0,0 +1,49 @@
const schemeTower = {
1: {
maximumHitpoints: 5000,
},
2: {
maximumHitpoints: 15000,
},
3: {
maximumHitpoints: 25000,
},
4: {
maximumHitpoints: 35000,
},
5: {
maximumHitpoints: 45000,
},
6: {
maximumHitpoints: 55000,
},
7: {
maximumHitpoints: 65000,
},
8: {
maximumHitpoints: 75000,
},
9: {
maximumHitpoints: 85000,
},
10: {
maximumHitpoints: 95000,
},
11: {
maximumHitpoints: 105000,
},
12: {
maximumHitpoints: 115000,
},
13: {
maximumHitpoints: 125000,
},
14: {
maximumHitpoints: 135000,
},
15: {
maximumHitpoints: 145000,
}
};
module.exports = schemeTower;
+123
View File
@@ -0,0 +1,123 @@
const constants = require("./constants");
const { CATEGORIES } = constants;
const { CATEGORY_ITEM, CATEGORY_AMMUNITION, CATEGORY_HARPOON, CATEGORY_DESIGN, CATEGORY_CANNON, CATEGORY_HARPOONER } = CATEGORIES;
const SHOP = [];
const SHOP_ENTRIES_BUY = {
};
module.exports = {
SHOP,
SHOP_ENTRIES_BUY
};
/*
const SHOP = {
[CATEGORY_ITEM]: {
},
[CATEGORY_AMMUNITION]: {
1: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 1500,
maximumGlobalAmount: 2500,
shopCategoryID: 4,
isAvailable: () => true
},
2: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 3000,
maximumGlobalAmount: 1000,
shopCategoryID: 4,
isAvailable: () => true
},
},
[CATEGORY_HARPOON]: {
1: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 2000,
shopCategoryID: 6,
isAvailable: () => true
},
2: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 2000,
shopCategoryID: 6,
isAvailable: () => true
},
3: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 2000,
shopCategoryID: 6,
isAvailable: () => true
},
4: {
currency: 1,
unitPrice: 21,
maximumPlayerAmount: 2000,
shopCategoryID: 6,
isAvailable: () => true
}
},
[CATEGORY_DESIGN]: {
2: {
currency: 1,
unitPrice: 200_000,
maximumPlayerAmount: 1,
shopCategoryID: 2,
isAvailable: (player) => !player.inventory.hasDesign(2)
},
3: {
currency: 1,
unitPrice: 400_000,
maximumPlayerAmount: 1,
shopCategoryID: 2,
isAvailable: (player) => !player.inventory.hasDesign(3)
},
4: {
currency: 1,
unitPrice: 600_000,
maximumPlayerAmount: 1,
shopCategoryID: 2,
isAvailable: (player) => !player.inventory.hasDesign(4)
},
5: {
currency: 2,
unitPrice: 60_000,
maximumPlayerAmount: 1,
shopCategoryID: 2,
isAvailable: (player) => !player.inventory.hasDesign(5)
}
},
[CATEGORY_CANNON]: {
1: {
currency: 1,
unitPrice: 1_000_000,
maximumPlayerAmount: 10,
shopCategoryID: 3,
isAvailable: () => true
},
2: {
currency: 1,
unitPrice: 1_000_000,
maximumPlayerAmount: 10,
shopCategoryID: 3,
isAvailable: () => true
},
},
[CATEGORY_HARPOONER]: {
1: {
currency: 1,
unitPrice: 1_000_000,
maximumPlayerAmount: 10,
shopCategoryID: 5,
isAvailable: () => true
}
}
};*/
+12
View File
@@ -0,0 +1,12 @@
const startRewards = [
{ categoryID: 1, id: 1, amount: 100_000 },
{ categoryID: 1, id: 2, amount: 1_000 },
{ categoryID: 7, id: 1, amount: 20 },
{ categoryID: 8, id: 1, amount: 10 },
{ categoryID: 3, id: 1, amount: 2_000 },
{ categoryID: 4, id: 1, amount: 1_000 },
// { categoryID: 7, id: 10, amount: 50 },
// { categoryID: 3, id: 3, amount: 99999999 },
];
module.exports = startRewards;
+16
View File
@@ -0,0 +1,16 @@
const STRIPE_IP_COLLECTION = {
"3.18.12.63": true,
"3.130.192.231": true,
"13.235.14.237": true,
"13.235.122.149": true,
"18.211.135.69": true,
"35.154.171.200": true,
"52.15.183.38": true,
"54.88.130.119": true,
"54.88.130.237": true,
"54.187.174.169": true,
"54.187.205.235": true,
"54.187.216.72": true
};
module.exports = STRIPE_IP_COLLECTION;