Verified Commit 640dbc3a authored by Marwolf's avatar Marwolf 💬

Adds configuration for the default aggro tile range of NPCs

Fixes #2177
parent f6aac4c9
......@@ -49,6 +49,7 @@
<entry key = "restart_hour_2">11</entry> <!-- begins count down 5 minutes till so server shuts down at noon for linux cronjob to start after -->
<entry key = "restart_minute_2">55</entry> <!-- begins count down 5 minutes till so server shuts down at noon for linux cronjob to start after -->
<entry key = "restart_delay_2">300</entry> <!-- this is in seconds and 300 is 5 minutes -->
<entry key = "aggro_range">1</entry> <!-- default tile range aggressive NPCs will attack victims -->
<!-- Client Config -->
<entry key = "view_distance">2</entry>
......
......@@ -49,6 +49,7 @@
<entry key = "restart_hour_2">11</entry>
<entry key = "restart_minute_2">55</entry>
<entry key = "restart_delay_2">300</entry>
<entry key = "aggro_range">1</entry>
<!-- Client Config -->
<entry key = "view_distance">2</entry>
......
......@@ -49,6 +49,7 @@
<entry key = "restart_hour_2">11</entry>
<entry key = "restart_minute_2">55</entry>
<entry key = "restart_delay_2">300</entry>
<entry key = "aggro_range">1</entry>
<!-- Client Config -->
<entry key = "view_distance">2</entry>
......
......@@ -41,14 +41,15 @@
<entry key = "connection_limit">10</entry>
<entry key = "connection_timeout">15</entry>
<entry key = "want_fatigue">false</entry> <!-- MODIFIED -->
<entry key = "auto_server_restart">false</entry>
<entry key = "auto_server_restart">true</entry> <!-- MODIFIED -->
<entry key = "restart_hour">23</entry>
<entry key = "restart_minute">55</entry>
<entry key = "restart_delay">300</entry>
<entry key = "auto_server_restart_2">false</entry>
<entry key = "auto_server_restart_2">true</entry> <!-- MODIFIED -->
<entry key = "restart_hour_2">11</entry>
<entry key = "restart_minute_2">55</entry>
<entry key = "restart_delay_2">300</entry>
<entry key = "aggro_range">3</entry> <!-- MODIFIED -->
<!-- Client Config -->
<entry key = "view_distance">2</entry>
......
......@@ -49,6 +49,7 @@
<entry key = "restart_hour_2">11</entry>
<entry key = "restart_minute_2">55</entry>
<entry key = "restart_delay_2">300</entry>
<entry key = "aggro_range">1</entry>
<!-- Client Config -->
<entry key = "view_distance">2</entry>
......
......@@ -119,6 +119,10 @@ public final class Constants {
*/
public static int RESTART_DELAY;
public static int RESTART_DELAY_2;
/**
* Default tile range an aggressive NPC will attack a victim
*/
public static int AGGRO_RANGE;
/**
* the mysql database host
*/
......@@ -397,6 +401,7 @@ public final class Constants {
RESTART_HOUR_2 = Integer.parseInt(props.getProperty("restart_hour_2"));
RESTART_MINUTE_2 = Integer.parseInt(props.getProperty("restart_minute_2"));
RESTART_DELAY_2 = Integer.parseInt(props.getProperty("restart_delay_2"));
AGGRO_RANGE = Integer.parseInt(props.getProperty("aggro_range"));
STRICT_CHECK_ALL = Boolean.parseBoolean(props.getProperty("strict_check_all"));
STRICT_PDART_CHECK = Boolean.parseBoolean(props.getProperty("strict_pdart_check"));
......
......@@ -348,7 +348,7 @@ public class NpcBehavior {
// We loop through all players in view.
for (Player p : npc.getViewArea().getPlayersInView()) {
int range = 1;
int range = Constants.GameServer.AGGRO_RANGE; // Default tile range an aggressive NPC will attack a victim
switch (NpcId.getById(npc.getID())) {
case BANDIT_AGGRESSIVE:
range = 5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment