summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/battle/homunc.conf2
-rw-r--r--src/map/homunculus.c4
-rw-r--r--src/map/homunculus.h2
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/unit.c35
6 files changed, 33 insertions, 20 deletions
diff --git a/conf/battle/homunc.conf b/conf/battle/homunc.conf
index 5e1b1c9d2..92c4b5fe8 100644
--- a/conf/battle/homunc.conf
+++ b/conf/battle/homunc.conf
@@ -18,7 +18,7 @@
// stat window (by default they don't crit)
// 0x020: Their Min-Matk is always the same as their max
// 0x040: Skill re-use delay is reset when they are vaporized.
-hom_setting: 0xFFFF
+hom_setting: 0x3D
// The rate a homunculus will get friendly by feeding it. (Note 2)
homunculus_friendly_rate: 100
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 0a162958a..7ab471b9d 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -755,9 +755,11 @@ bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
unit->calc_pos(&hd->bl, sd->bl.x, sd->bl.y, sd->ud.dir);
hd->bl.x = hd->ud.to_x;
hd->bl.y = hd->ud.to_y;
-
+ hd->masterteleport_timer = 0;
+
map->addiddb(&hd->bl);
status_calc_homunculus(hd,SCO_FIRST);
+ status_percent_heal(&hd->bl, 100, 100);
hd->hungry_timer = INVALID_TIMER;
return true;
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index bf1de6171..b7906d4c8 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -64,6 +64,8 @@ struct homun_data {
int hungry_timer; //[orn]
unsigned int exp_next;
char blockskill[MAX_SKILL]; // [orn]
+
+ int64 masterteleport_timer;
};
struct homun_skill_tree_entry {
diff --git a/src/map/pc.c b/src/map/pc.c
index 07fba6e57..a11d5a8d9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6580,7 +6580,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
pc->setoption(sd, i);
if( homun_alive(sd->hd) && pc->checkskill(sd, AM_CALLHOMUN) )
- homun->vaporize(sd, HOM_ST_ACTIVE);
+ homun->vaporize(sd, HOM_ST_REST);
}
for( i = 1; i < MAX_SKILL; i++ ) {
diff --git a/src/map/skill.c b/src/map/skill.c
index c16ab832c..f468b5364 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7541,8 +7541,12 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
case AM_CALLHOMUN: //[orn]
- if (sd && homun->call(sd))
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if( sd ) {
+ if (homun->call(sd))
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ else
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ }
break;
case AM_REST:
diff --git a/src/map/unit.c b/src/map/unit.c
index b1240def2..0d5b0d8d3 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -204,23 +204,28 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
} else
sd->areanpc_id=0;
- if( sd->md && !check_distance_bl(&sd->bl, &sd->md->bl, MAX_MER_DISTANCE) )
- {
- // mercenary should be warped after being 3 seconds too far from the master [greenbox]
- if (sd->md->masterteleport_timer == 0)
- {
- sd->md->masterteleport_timer = timer->gettick();
- }
- else if (DIFF_TICK(timer->gettick(), sd->md->masterteleport_timer) > 3000)
- {
+ if( sd->md ) { // mercenary should be warped after being 3 seconds too far from the master [greenbox]
+ if( !check_distance_bl(&sd->bl, &sd->md->bl, MAX_MER_DISTANCE) ) {
+ if (sd->md->masterteleport_timer == 0)
+ sd->md->masterteleport_timer = timer->gettick();
+ else if (DIFF_TICK(timer->gettick(), sd->md->masterteleport_timer) > 3000) {
+ sd->md->masterteleport_timer = 0;
+ unit->warp( &sd->md->bl, sd->bl.m, sd->bl.x, sd->bl.y, CLR_TELEPORT );
+ }
+ } else // reset the tick, he is not far anymore
sd->md->masterteleport_timer = 0;
- unit->warp( &sd->md->bl, sd->bl.m, sd->bl.x, sd->bl.y, CLR_TELEPORT );
- }
+
}
- else if( sd->md )
- {
- // reset the tick, he is not far anymore
- sd->md->masterteleport_timer = 0;
+ if( sd->hd ) {
+ if( homun_alive(sd->hd) && !check_distance_bl(&sd->bl, &sd->hd->bl, MAX_MER_DISTANCE) ) {
+ if (sd->hd->masterteleport_timer == 0)
+ sd->hd->masterteleport_timer = timer->gettick();
+ else if (DIFF_TICK(timer->gettick(), sd->hd->masterteleport_timer) > 3000) {
+ sd->hd->masterteleport_timer = 0;
+ unit->warp( &sd->hd->bl, sd->bl.m, sd->bl.x, sd->bl.y, CLR_TELEPORT );
+ }
+ } else
+ sd->hd->masterteleport_timer = 0;
}
} else if (md) {
if( map->getcell(bl->m,x,y,CELL_CHKNPC) ) {