summaryrefslogtreecommitdiff
path: root/src/map/npc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/npc.hpp')
-rw-r--r--src/map/npc.hpp58
1 files changed, 32 insertions, 26 deletions
diff --git a/src/map/npc.hpp b/src/map/npc.hpp
index eb9a5eb..33dd378 100644
--- a/src/map/npc.hpp
+++ b/src/map/npc.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_MAP_NPC_HPP
-#define TMWA_MAP_NPC_HPP
+#pragma once
// npc.hpp - Noncombatants.
//
// Copyright © ????-2004 Athena Dev Teams
@@ -21,47 +20,55 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "../sanity.hpp"
+#include "fwd.hpp"
-# include <cstddef>
-# include <cstdint>
+#include <cstdint>
-# include "../strings/fwd.hpp"
+#include "../strings/fwd.hpp"
-# include "../mmo/timer.t.hpp"
+#include "../generic/fwd.hpp"
-# include "map.hpp"
+#include "../net/timer.t.hpp"
-constexpr int START_NPC_NUM = 110000000;
+#include "../proto2/fwd.hpp"
-constexpr int WARP_CLASS = 45;
-constexpr int WARP_DEBUG_CLASS = 722;
-constexpr int INVISIBLE_CLASS = 32767;
+#include "map.hpp"
+
+
+namespace tmwa
+{
+constexpr BlockId START_NPC_NUM = wrap<BlockId>(110000000);
+
+// TODO make these species, see npc_class in npc_data
+constexpr Species WARP_CLASS = wrap<Species>(45);
+constexpr Species FAKE_NPC_CLASS = wrap<Species>(127);
+constexpr Species WARP_DEBUG_CLASS = wrap<Species>(722);
+constexpr Species INVISIBLE_CLASS = wrap<Species>(32767);
int npc_event_dequeue(dumb_ptr<map_session_data> sd);
int npc_event(dumb_ptr<map_session_data> sd, NpcEvent npcname, int);
void npc_timer_event(NpcEvent eventname); // Added by RoVeRT
int npc_command(dumb_ptr<map_session_data> sd, NpcName npcname, XString command);
int npc_touch_areanpc(dumb_ptr<map_session_data>, map_local *, int, int);
-int npc_click(dumb_ptr<map_session_data>, int);
-int npc_scriptcont(dumb_ptr<map_session_data>, int);
-int npc_buysellsel(dumb_ptr<map_session_data>, int, int);
-int npc_buylist(dumb_ptr<map_session_data>, int, const uint16_t *);
-int npc_selllist(dumb_ptr<map_session_data>, int, const uint16_t *);
+int npc_click(dumb_ptr<map_session_data>, BlockId);
+int npc_scriptcont(dumb_ptr<map_session_data>, BlockId);
+int npc_buysellsel(dumb_ptr<map_session_data>, BlockId, int);
+int npc_buylist(dumb_ptr<map_session_data>, const std::vector<Packet_Repeat<0x00c8>>&);
+int npc_selllist(dumb_ptr<map_session_data>, const std::vector<Packet_Repeat<0x00c9>>&);
int npc_parse_warp(XString w1, XString, NpcName w3, XString w4);
int npc_enable(NpcName name, bool flag);
dumb_ptr<npc_data> npc_name2id(NpcName name);
-int npc_get_new_npc_id(void);
+BlockId npc_get_new_npc_id(void);
/**
* Spawns and installs a talk-only NPC
*
- * \param message The message to speak. If message is NULL, the NPC will not do anything at all.
+ * \param message The message to speak. If message is nullptr, the NPC will not do anything at all.
*/
dumb_ptr<npc_data> npc_spawn_text(map_local *m, int x, int y,
- int class_, NpcName name, AString message);
+ Species class_, NpcName name, AString message);
/**
* Uninstalls and frees an NPC
@@ -73,17 +80,17 @@ void npc_delsrcfile(XString);
bool do_init_npc(void);
int npc_event_do_oninit(void);
-int npc_event_doall_l(ScriptLabel name, int rid, Slice<argrec_t> argv);
-int npc_event_do_l(NpcEvent name, int rid, Slice<argrec_t> argv);
+int npc_event_doall_l(ScriptLabel name, BlockId rid, Slice<argrec_t> argv);
+int npc_event_do_l(NpcEvent name, BlockId rid, Slice<argrec_t> argv);
inline
int npc_event_doall(ScriptLabel name)
{
- return npc_event_doall_l(name, 0, nullptr);
+ return npc_event_doall_l(name, BlockId(), nullptr);
}
inline
int npc_event_do(NpcEvent name)
{
- return npc_event_do_l(name, 0, nullptr);
+ return npc_event_do_l(name, BlockId(), nullptr);
}
void npc_timerevent_start(dumb_ptr<npc_data_script> nd);
@@ -91,5 +98,4 @@ void npc_timerevent_stop(dumb_ptr<npc_data_script> nd);
interval_t npc_gettimerevent_tick(dumb_ptr<npc_data_script> nd);
void npc_settimerevent_tick(dumb_ptr<npc_data_script> nd, interval_t newtimer);
int npc_delete(dumb_ptr<npc_data> nd);
-
-#endif // TMWA_MAP_NPC_HPP
+} // namespace tmwa