|
@@ -7,6 +7,8 @@
|
|
#include <map>
|
|
#include <map>
|
|
#include <math.h>
|
|
#include <math.h>
|
|
|
|
|
|
|
|
+#include "../common/utilities.hpp"
|
|
|
|
+
|
|
#include "../common/cbasetypes.h"
|
|
#include "../common/cbasetypes.h"
|
|
#include "../common/timer.h"
|
|
#include "../common/timer.h"
|
|
#include "../common/db.h"
|
|
#include "../common/db.h"
|
|
@@ -40,6 +42,8 @@
|
|
#include <unordered_map>
|
|
#include <unordered_map>
|
|
#include <algorithm>
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
+using namespace rathena;
|
|
|
|
+
|
|
#define ACTIVE_AI_RANGE 2 //Distance added on top of 'AREA_SIZE' at which mobs enter active AI mode.
|
|
#define ACTIVE_AI_RANGE 2 //Distance added on top of 'AREA_SIZE' at which mobs enter active AI mode.
|
|
|
|
|
|
#define IDLE_SKILL_INTERVAL 10 //Active idle skills should be triggered every 1 second (1000/MIN_MOBTHINKTIME)
|
|
#define IDLE_SKILL_INTERVAL 10 //Active idle skills should be triggered every 1 second (1000/MIN_MOBTHINKTIME)
|
|
@@ -76,11 +80,7 @@
|
|
//Dynamic mob database
|
|
//Dynamic mob database
|
|
std::map<uint16, struct mob_db> mob_db_data;
|
|
std::map<uint16, struct mob_db> mob_db_data;
|
|
struct mob_db *mob_db( int mob_id ){
|
|
struct mob_db *mob_db( int mob_id ){
|
|
- if( mob_db_data.find( mob_id ) != mob_db_data.end() ){
|
|
|
|
- return &mob_db_data.at(mob_id);
|
|
|
|
- }else{
|
|
|
|
- return nullptr;
|
|
|
|
- }
|
|
|
|
|
|
+ return util::map_find( mob_db_data, (uint16)mob_id );
|
|
}
|
|
}
|
|
|
|
|
|
// holds Monster Spawn informations
|
|
// holds Monster Spawn informations
|
|
@@ -89,11 +89,7 @@ std::unordered_map<uint16, std::vector<spawn_info>> mob_spawn_data;
|
|
//Dynamic mob chat database
|
|
//Dynamic mob chat database
|
|
std::map<short,struct mob_chat> mob_chat_db;
|
|
std::map<short,struct mob_chat> mob_chat_db;
|
|
struct mob_chat *mob_chat(short id) {
|
|
struct mob_chat *mob_chat(short id) {
|
|
- if( mob_chat_db.find(id) != mob_chat_db.end() ){
|
|
|
|
- return &mob_chat_db.at(id);
|
|
|
|
- }else{
|
|
|
|
- return nullptr;
|
|
|
|
- }
|
|
|
|
|
|
+ return util::map_find( mob_chat_db, id );
|
|
}
|
|
}
|
|
|
|
|
|
//Dynamic item drop ratio database for per-item drop ratio modifiers overriding global drop ratios.
|
|
//Dynamic item drop ratio database for per-item drop ratio modifiers overriding global drop ratios.
|