Skip to content

Commit

Permalink
odr / itemslua / string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
MillhioreBT committed Nov 11, 2023
1 parent 5d9ce13 commit 1d4d1bd
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 206 deletions.
33 changes: 17 additions & 16 deletions data/items/items.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---@type RegisterTableItems?
local items = {
{id = 1, name = "water"},
{id = 2, name = "lifefluid"},
Expand Down Expand Up @@ -236,7 +237,7 @@ local items = {
name = "magic forcefield",
article = "a",
description = "You can see the other side through it.",
type = "teleport",
type = ITEM_TYPE_TELEPORT,
effect = CONST_ME_TELEPORT
},
{id = 1388, name = "ramp", article = "a", floorChange = TILESTATE_FLOORCHANGE_EAST},
Expand All @@ -253,7 +254,7 @@ local items = {
name = "mystic flame",
article = "a",
description = "You feel drawn to the mesmerizing light.",
type = "teleport",
type = ITEM_TYPE_TELEPORT,
effect = CONST_ME_TELEPORT
},
{id = 1398, name = "ramp", article = "a", floorChange = TILESTATE_FLOORCHANGE_EAST},
Expand Down Expand Up @@ -1580,7 +1581,7 @@ local items = {
id = 2265,
name = "intense healing rune",
article = "an",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adura gran",
weight = 210,
charges = 1
Expand All @@ -1599,7 +1600,7 @@ local items = {
id = 2268,
name = "sudden death rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adori gran mort",
weight = 70,
charges = 3
Expand All @@ -1608,7 +1609,7 @@ local items = {
id = 2269,
name = "wild growth rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adevo grav vita",
weight = 105,
charges = 2
Expand All @@ -1620,7 +1621,7 @@ local items = {
id = 2273,
name = "ultimate healing rune",
article = "an",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adura vita",
weight = 210,
charges = 1
Expand All @@ -1639,7 +1640,7 @@ local items = {
id = 2277,
name = "energy field rune",
article = "an",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adevo grav vis",
weight = 70,
charges = 3
Expand All @@ -1649,7 +1650,7 @@ local items = {
id = 2279,
name = "energy wall rune",
article = "an",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adevo mas grav vis",
weight = 52,
charges = 4
Expand Down Expand Up @@ -1677,7 +1678,7 @@ local items = {
id = 2287,
name = "light magic missile rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adori min vis",
weight = 21,
charges = 10
Expand All @@ -1695,7 +1696,7 @@ local items = {
id = 2289,
name = "poison wall rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adevo mas grav pox",
weight = 52,
charges = 4
Expand All @@ -1704,7 +1705,7 @@ local items = {
id = 2290,
name = "convince creature rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adeta sio",
weight = 210,
charges = 1
Expand Down Expand Up @@ -1761,7 +1762,7 @@ local items = {
id = 2303,
name = "fire wall rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adevo mas grav flam",
weight = 52,
charges = 4
Expand All @@ -1770,7 +1771,7 @@ local items = {
id = 2304,
name = "great fireball rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adori mas flam",
weight = 52,
charges = 4
Expand Down Expand Up @@ -1808,7 +1809,7 @@ local items = {
id = 2311,
name = "heavy magic missile rune",
article = "a",
type = "rune",
type = ITEM_TYPE_RUNE,
runeSpellName = "adori vis",
weight = 21,
charges = 10
Expand Down Expand Up @@ -5823,7 +5824,7 @@ local items = {
toId = 5024,
name = "magic forcefield",
article = "a",
type = "teleport",
type = ITEM_TYPE_TELEPORT,
description = "You can see the other side trough it.",
effect = CONST_ME_TELEPORT
},
Expand Down Expand Up @@ -11810,7 +11811,7 @@ local items = {
name = "mystic flame",
article = "a",
description = "You feel drawn to the mesmerizing light.",
type = "teleport",
type = ITEM_TYPE_TELEPORT,
effect = CONST_ME_TELEPORT
},
{id = 8059, name = "sanctified grave", article = "a"},
Expand Down
4 changes: 2 additions & 2 deletions src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <unordered_set>

static constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
static constexpr int32_t CONNECTION_READ_TIMEOUT = 30;
inline constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
inline constexpr int32_t CONNECTION_READ_TIMEOUT = 30;

class Protocol;
using Protocol_ptr = std::shared_ptr<Protocol>;
Expand Down
8 changes: 4 additions & 4 deletions src/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef FS_CONST_H
#define FS_CONST_H

static constexpr int32_t NETWORKMESSAGE_MAXSIZE = 24590;
inline constexpr int32_t NETWORKMESSAGE_MAXSIZE = 24590;

enum MagicEffectClasses : uint8_t
{
Expand Down Expand Up @@ -483,8 +483,8 @@ enum ReloadTypes_t : uint8_t
RELOAD_TYPE_WEAPONS,
};

static constexpr int32_t CHANNEL_GUILD = 0x00;
static constexpr int32_t CHANNEL_PARTY = 0x01;
static constexpr int32_t CHANNEL_PRIVATE = 0xFFFF;
inline constexpr int32_t CHANNEL_GUILD = 0x00;
inline constexpr int32_t CHANNEL_PARTY = 0x01;
inline constexpr int32_t CHANNEL_PRIVATE = 0xFFFF;

#endif
6 changes: 3 additions & 3 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class Npc;
class Item;
class Tile;

static constexpr int32_t EVENT_CREATURECOUNT = 10;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 250;
static constexpr int32_t EVENT_CHECK_CREATURE_INTERVAL = (EVENT_CREATURE_THINK_INTERVAL / EVENT_CREATURECOUNT);
inline constexpr int32_t EVENT_CREATURECOUNT = 10;
inline constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 250;
inline constexpr int32_t EVENT_CHECK_CREATURE_INTERVAL = (EVENT_CREATURE_THINK_INTERVAL / EVENT_CREATURECOUNT);

class FrozenPathingConditionCall
{
Expand Down
2 changes: 1 addition & 1 deletion src/cylinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Item;
class Creature;

static constexpr int32_t INDEX_WHEREEVER = -1;
inline constexpr int32_t INDEX_WHEREEVER = -1;

enum cylinderflags_t
{
Expand Down
18 changes: 9 additions & 9 deletions src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#ifndef FS_DEFINITIONS_H
#define FS_DEFINITIONS_H

static constexpr auto STATUS_SERVER_NAME = "TFS Nekiro Downgrade";
static constexpr auto STATUS_SERVER_VERSION = "1.5+";
static constexpr auto STATUS_SERVER_DEVELOPERS = "Mark Samman";
static constexpr auto STATUS_SERVER_REPOSITORY = "https://github.com/MillhioreBT/forgottenserver-downgrade";
inline constexpr auto STATUS_SERVER_NAME = "TFS Nekiro Downgrade";
inline constexpr auto STATUS_SERVER_VERSION = "1.5+";
inline constexpr auto STATUS_SERVER_DEVELOPERS = "Mark Samman";
inline constexpr auto STATUS_SERVER_REPOSITORY = "https://github.com/MillhioreBT/forgottenserver-downgrade";

static constexpr auto CLIENT_VERSION_MIN = 860;
static constexpr auto CLIENT_VERSION_MAX = 860;
static constexpr auto CLIENT_VERSION_STR = "8.60";
inline constexpr auto CLIENT_VERSION_MIN = 860;
inline constexpr auto CLIENT_VERSION_MAX = 860;
inline constexpr auto CLIENT_VERSION_STR = "8.60";

static constexpr auto AUTHENTICATOR_DIGITS = 6U;
static constexpr auto AUTHENTICATOR_PERIOD = 30U;
inline constexpr unsigned int AUTHENTICATOR_DIGITS = 6;
inline constexpr unsigned int AUTHENTICATOR_PERIOD = 30;

#ifndef __FUNCTION__
#define __FUNCTION__ __func__
Expand Down
34 changes: 17 additions & 17 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ enum GameState_t
GAME_STATE_MAINTAIN,
};

static constexpr int32_t PLAYER_NAME_LENGTH = 25;

static constexpr int32_t EVENT_LIGHTINTERVAL = 10000;
static constexpr int32_t EVENT_WORLDTIMEINTERVAL = 2500;
static constexpr int32_t EVENT_DECAYINTERVAL = 250;
static constexpr int32_t EVENT_DECAY_BUCKETS = 4;

static constexpr int32_t MOVE_CREATURE_INTERVAL = 1000;
static constexpr int32_t RANGE_MOVE_CREATURE_INTERVAL = 1500;
static constexpr int32_t RANGE_MOVE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_USE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_USE_ITEM_EX_INTERVAL = 400;
static constexpr int32_t RANGE_USE_WITH_CREATURE_INTERVAL = 400;
static constexpr int32_t RANGE_ROTATE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_BROWSE_FIELD_INTERVAL = 400;
static constexpr int32_t RANGE_WRAP_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_REQUEST_TRADE_INTERVAL = 400;
inline constexpr int32_t PLAYER_NAME_LENGTH = 25;

inline constexpr int32_t EVENT_LIGHTINTERVAL = 10000;
inline constexpr int32_t EVENT_WORLDTIMEINTERVAL = 2500;
inline constexpr int32_t EVENT_DECAYINTERVAL = 250;
inline constexpr int32_t EVENT_DECAY_BUCKETS = 4;

inline constexpr int32_t MOVE_CREATURE_INTERVAL = 1000;
inline constexpr int32_t RANGE_MOVE_CREATURE_INTERVAL = 1500;
inline constexpr int32_t RANGE_MOVE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_ITEM_EX_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_WITH_CREATURE_INTERVAL = 400;
inline constexpr int32_t RANGE_ROTATE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_BROWSE_FIELD_INTERVAL = 400;
inline constexpr int32_t RANGE_WRAP_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_REQUEST_TRADE_INTERVAL = 400;

/**
* Main Game class.
Expand Down
Loading

0 comments on commit 1d4d1bd

Please sign in to comment.