Commit Graph

46 Commits

Author SHA1 Message Date
gsemaj
306a75f469 The great re-#include
Was getting frustrated by the inconsistency in our include statements,
which were causing me problems. As a result, I went through and manually
re-organized every include statement in non-core files.

I'm just gonna copy my rant from Discord:
FOR HEADER FILES (.hpp):
- everything you use IN THE HEADER must be EXPLICITLY INCLUDED with the exception of things that fall under Core.hpp
- you may NOT include ANYTHING ELSE

FOR SOURCE FILES (.cpp):
- you can #include whatever you want as long as the partner header is included first
- anything that gets included by another include is fair game
- redundant includes are ok because they'll be harmless AS LONG AS our header files stay lean.

the point of this is NOT to optimize the number of includes used all around or make things more efficient necessarily. it's to improve readability & coherence and make it easier to avoid cyclical issues
2023-08-19 20:46:41 +00:00
4494ba5932 [refactor] Get rid of NPC.hpp
This file was already obsoleted at the start of the refactor, but seems
to have escaped notice until now.
2023-08-19 20:46:41 +00:00
gsemaj
a0e758f5b7 [refac] Move WarpLocation to Transport.hpp 2021-05-06 12:17:34 -04:00
65462d01e3 Generalize NPC AI stepping logic
The MobAI::Mobs map still needs to be removed.
2021-03-31 22:28:27 +02:00
610a683804 [refactor] E g g s 2021-03-17 22:28:24 +01:00
a55a34e09a [refactor] Move files to core/ and servers/ subdirectories
CNProtocol, CNShared, CNStructs and Defines are now in core/.
CNLoginServer, CNShardServer and Monitor are now in servers/.

core/Core.hpp wraps all the core headers except for CNShared.hpp.

Defines.cpp has been renamed to Packets.cpp, and so has its
corresponding namespace, but not the header file. This is in preparation
for upcoming changes.
2021-03-17 20:16:48 +01:00
cee09f6344 [refactor] Mark all internal functions static
All packet handlers and helper functions that are only used in the
source file they're declared in have been taken out of the namespaces in
the corresponding header files, have been marked static, and have been
reordered to avoid the need for declarations at the top of each source
file.

Each source file now contains a "using namespace" directive so that the
static functions don't need to prefix the source file's symbols with
their namespace. All redundant namespace prefixes found have been
removed.

An unused nano power resetting function in NanoManager has been removed.
2021-03-16 22:54:41 +01:00
gsemaj
dd41d5b610 [refactor] Split vendor functions and crocpot out of NPCManager 2021-03-15 10:48:27 -04:00
4cd3a3dabd [refactor] src/contrib, src/mingw -> vendor 2021-03-13 02:58:57 +01:00
Jade
dc6de46a1f Added ON_COMBAT trigger 2021-03-07 15:55:51 +01:00
CakeLancelot
9e30e55669 eggBuffPlayer now takes duration, and buff duration is read from EggType 2021-01-06 05:56:54 -06:00
d25e7ca4fc Implement rudimentary NPC scripting framework and Lord Fuse boss fight 2020-12-15 23:19:29 +01:00
3359ca0c3e Moved common NPC summoning logic into a helper function 2020-12-15 23:19:29 +01:00
Gent S
e0858a42b2 Fix getNearestNPC w/ uses 2020-11-22 19:14:46 -05:00
Gent S
e50a4c2edd Experimental chunk refactor. 2020-11-19 17:37:02 -05:00
Kamil
0ecf76c5ec moved egg summoning to a custom ChatManager command 2020-11-11 23:19:07 -05:00
Kamil
674d5112f3 implemented basic eggs functionality 2020-11-11 23:19:07 -05:00
kamilprzyb
45ed99ae35 implemented player debuff 2020-11-11 23:19:07 -05:00
kamilprzyb
f2ff4c7f4d added basic player buffs implementation 2020-11-11 23:19:07 -05:00
Gent
d4aed0abf4 Add support for unique instances 2020-10-15 11:46:53 -04:00
Zenpock
bd34bb294c Instance Stuff
custom instance commands
warping takes you into instances
npcs show up only in the instance they are supposed to be inside.
2020-10-15 11:44:15 -04:00
Gent
1564cc7724 Make proximity NPC search a helper function 2020-10-10 23:18:01 -04:00
Gent
4873eba160 Add overload to updateNPCPosition with rotation arg 2020-10-06 17:57:46 -04:00
kamilprzyb
d4f1515f5d
Time to go, gumballs and nano potions (#113)
* set up "go to the time machine" button working

* warping to the past now sets PayZoneFlag and removes all active missions

* added gumballs functionality

* added nano potions functionality

* formatting fix
2020-09-25 00:35:27 -05:00
8f84c4c2f8 updateNPCPosition now tracks chunks 2020-09-24 20:58:20 -05:00
279cb78d5f Mob-related cleanup.
* NPCs now keep track of their chunk information like PlayerView does
for players
* NPCManager::sendToViewable() parallels PlayerManager::sendToViewable()
* Nano damage and debuffs now count as attacking a mob
* Mobs will de-aggro if something else killed their target
2020-09-25 02:00:26 +02:00
72d625fd8d Summoned mobs are now actually treated as mobs.
Unfortunetly, this necessitated keeping around yet more JSON objects for
the duration of the server's runtime.
It also involved unifying the way NPC IDs are handled, such that they
may be allocated and deallocated out of order.

If any NPCID-related bugs occour, this commit should be regarded as
the prime suspect.
2020-09-25 00:51:18 +02:00
Gent
f2596bfb6a Add NPC chunk management + Generalize lerp 2020-09-23 12:06:25 -04:00
CakeLancelot
77df7b7160
Merge pull request #92 from gsemaj/crocpot
Implement Croc Pot item combining
Fix vehicle type override
2020-09-20 13:40:36 -05:00
Gent
d1c5e272a8 Fix vehicle type override 2020-09-19 15:26:16 -04:00
ce9285bab5 support for /unsummon 2020-09-18 16:24:15 -05:00
Gent
b929d12902 Implement Croc Pot item combining 2020-09-17 23:55:57 -04:00
f4db0830ba huge refactoring, chunking added 2020-09-17 17:45:43 -05:00
e79f179628 Mobs respawn now.
Began work on mob logic. Also cleaned up TableData a little.
2020-09-17 01:43:48 +02:00
Gent
148d90f4f1 "Boosts and potions!"
Fixed crate opening such that the item has an iOpt of 1.
2020-09-14 18:36:50 +02:00
Gent
da8c833587 Implement buyback
Sellability tweak


Add additional item categories
2020-09-14 10:25:15 -04:00
Gent
4e7352da66 Add sell functionality to vendors 2020-09-11 22:04:23 -04:00
Ariii
3865249387 Vendors, set nano skill command + serverside command issues fixed (#74)
Added basic shopkeeper functions, a player can buy the preset 3 items (cannonbolt set), all shopkeepers have the same items atm (need to check the shopkeeper tabledata), setting itemprice is something I didn't figure out.
Added set nano skill command
Implemented a switch for certain commands like health/taros/fusionmatter etc to be handled on the serverside aswell

Co-authored-by: dongresource <dongresource@protonmail.com>
2020-09-11 23:19:03 +02:00
Eperty123
b239fb9331 Add NPC barking, seeing saved characters 2020-08-29 13:14:21 +02:00
b79bc56b31 Implement NPC spawning.
Protected by a simplified GM system. Either everyone is a GM (local
servers) or nobody is (public servers).
2020-08-25 04:28:42 +02:00
d964a83d6d Respawn points work now.
Note that some of them weren't present in clientnpc and will need to be
manually added later.
2020-08-25 03:34:53 +02:00
651ccba932 Replace ifdef guards with #pragma once
tl;dr this has potentially significant compilation speed benefits.
2020-08-23 19:14:54 +02:00
561a809f33 load warps into memory in NPCManager::init 2020-08-23 11:26:25 -05:00
Zenpock
1d792a21dd
Npc Warp implementation (#29)
* Update CNShardServer.hpp

* Update ChatManager.cpp

* Update ChatManager.hpp

* Update NPCManager.cpp

* Update NPCManager.hpp

* Add files via upload

* Update NPCManager.cpp

* Update NPCManager.cpp

* Update ChatManager.cpp

* Update ChatManager.cpp

* Update NPCManager.cpp

* Update NPCManager.cpp

Co-authored-by: CPunch <sethtstubbs@gmail.com>
2020-08-23 10:32:25 -05:00
6857f50c30 added basic NPCManager 2020-08-20 16:43:48 -05:00
4d9072a752 added radio's logo, started NPCManager 2020-08-19 17:21:35 -05:00