summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-27 10:47:02 -0200
committershennetsind <ind@henn.et>2013-11-27 10:47:02 -0200
commit8ecffa8892e00fc1116e4e34fa448e46774194e5 (patch)
tree1d07fc89342b740735ae5bb83fdf6ab0e37fbcd4 /src
parent85d99a3207a34eb5abdc3bafd44d9e7d10082bc6 (diff)
downloadhercules-8ecffa8892e00fc1116e4e34fa448e46774194e5.tar.gz
hercules-8ecffa8892e00fc1116e4e34fa448e46774194e5.tar.bz2
hercules-8ecffa8892e00fc1116e4e34fa448e46774194e5.tar.xz
hercules-8ecffa8892e00fc1116e4e34fa448e46774194e5.zip
Dropped emperium spawn restrictions
Thanks to kyeme for bringing it to our attention. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c9
-rw-r--r--src/map/mob.c12
-rw-r--r--src/map/script.c5
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c2
5 files changed, 12 insertions, 18 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 5c31155b1..b45807cf8 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1927,12 +1927,7 @@ ACMD(monster)
clif->message(fd, msg_txt(40)); // Invalid monster ID or name.
return false;
}
-
- if (mob_id == MOBID_EMPERIUM) {
- clif->message(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
- return false;
- }
-
+
if (number <= 0)
number = 1;
@@ -1957,7 +1952,7 @@ ACMD(monster)
range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
for (i = 0; i < number; i++) {
map->search_freecell(&sd->bl, 0, &mx, &my, range, range, 0);
- k = mob->once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE);
+ k = mob->once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE|(mob_id == MOBID_EMPERIUM?0x200:0x0));
count += (k != 0) ? 1 : 0;
}
diff --git a/src/map/mob.c b/src/map/mob.c
index 35c9ed1aa..2cd82e4d1 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -459,6 +459,12 @@ struct mob_data *mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int
int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const char* mobname, int class_, int amount, const char* event, unsigned int size, unsigned int ai) {
struct mob_data* md = NULL;
int count, lv;
+ bool no_guardian_data = false;
+
+ if( ai && ai&0x200 ) {
+ no_guardian_data = true;
+ ai &=~ 0x200;
+ }
if (m < 0 || amount <= 0)
return 0; // invalid input
@@ -472,7 +478,7 @@ int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const
if (!md)
continue;
- if (class_ == MOBID_EMPERIUM) {
+ if (class_ == MOBID_EMPERIUM && !no_guardian_data) {
struct guild_castle* gc = guild->mapindex2gc(map_id2index(m));
struct guild* g = (gc) ? guild->search(gc->guild_id) : NULL;
if (gc) {
@@ -581,7 +587,7 @@ int mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) {
if (g == NULL)
{ //Liberate castle, if the guild is not found this is an error! [Skotlex]
ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n", (int)data);
- if (md->class_ == MOBID_EMPERIUM)
+ if (md->class_ == MOBID_EMPERIUM && md->guardian_data)
{ //Not sure this is the best way, but otherwise we'd be invoking this for ALL guardians spawned later on.
md->guardian_data->guild_id = 0;
if (md->guardian_data->castle->guild_id) //Free castle up.
@@ -2512,7 +2518,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
logs->mvpdrop(mvp_sd, md->class_, log_mvp);
}
- if (type&2 && !sd && md->class_ == MOBID_EMPERIUM)
+ if (type&2 && !sd && md->class_ == MOBID_EMPERIUM && md->guardian_data)
//Emperium destroyed by script. Discard mvp character. [Skotlex]
mvp_sd = NULL;
diff --git a/src/map/script.c b/src/map/script.c
index 777179507..39f29ec4f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -17330,11 +17330,6 @@ BUILDIN(montransform) {
return false;
}
- if(mob_id == MOBID_EMPERIUM) {
- ShowWarning("buildin_montransform: Monster 'Emperium' cannot be used.\n");
- return false;
- }
-
if( !(type > SC_NONE && type < SC_MAX) ){
ShowWarning("buildin_montransform: Unsupported status change id %d\n", type);
return false;
diff --git a/src/map/skill.c b/src/map/skill.c
index 698252d18..84c45e8a6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -12930,7 +12930,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB,
MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) {
char output[128];
- sprintf(output, "You're too close to a stone or emperium to do this skill");
+ sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */
clif->colormes(sd->fd, COLOR_RED, output);
return 0;
}
diff --git a/src/map/status.c b/src/map/status.c
index d4e1d1b31..132724bef 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2022,8 +2022,6 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
if (md->guardian_data && md->guardian_data->guardup_lv)
flag|=4;
- if (md->class_ == MOBID_EMPERIUM)
- flag|=4;
if (battle_config.slaves_inherit_speed && md->master_id)
flag|=8;