summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-31 16:40:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-31 16:40:37 +0000
commitc23aea66ad78acff3914f7b865eeba3adb159b0d (patch)
treef3eafde9cd91e643336bf6d1bff7cbae27872858 /src/map
parent693613de2eda402fe459809cbe7ea22cbd052218 (diff)
downloadhercules-c23aea66ad78acff3914f7b865eeba3adb159b0d.tar.gz
hercules-c23aea66ad78acff3914f7b865eeba3adb159b0d.tar.bz2
hercules-c23aea66ad78acff3914f7b865eeba3adb159b0d.tar.xz
hercules-c23aea66ad78acff3914f7b865eeba3adb159b0d.zip
- Moved the intimacy penalty of HFLI_SBR44 and HVAN_EXPLOSION to skill_counter_additional_effect
- Simplified skillnotok_hom by using an invocation to skillnotok - Hopefully fixed BD_ADAPTATION - Homun won't lose any intimacy on death now. - Homun will be saved together with the master now (as long as the homun is active) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8564 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c7
-rw-r--r--src/map/chrif.c5
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mercenary.c13
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/skill.c44
6 files changed, 25 insertions, 51 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index fdac13afc..7e724b0d0 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1204,11 +1204,8 @@ static struct Damage battle_calc_weapon_attack(
break;
}
case HFLI_SBR44: //[orn]
- if(src->type == BL_HOM){
- TBL_HOM *hd = (TBL_HOM*)src;
- wd.damage = hd->master->homunculus.intimacy ;
- hd->master->homunculus.intimacy = 200;
- clif_send_homdata(hd->master,0x100,hd->master->homunculus.intimacy/100);
+ if(src->type == BL_HOM && ((TBL_HOM*)src)->master) {
+ wd.damage = ((TBL_HOM*)src)->master->homunculus.intimacy ;
break;
}
default:
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 6f3e35c0d..64194c1a2 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -209,7 +209,6 @@ int chrif_save(struct map_session_data *sd, int flag)
intif_saveregistry(sd, 2); //Save account regs
if (sd->state.reg_dirty&1)
intif_saveregistry(sd, 1); //Save account2 regs
-
#ifndef TXT_ONLY
if(charsave_method){ //New 'Local' save
charsave_savechar(sd->char_id, &sd->status);
@@ -228,6 +227,10 @@ int chrif_save(struct map_session_data *sd, int flag)
WFIFOB(char_fd,12) = (flag==1)?1:0; //Flag to tell char-server this character is quitting.
memcpy(WFIFOP(char_fd,13), &sd->status, sizeof(sd->status));
WFIFOSET(char_fd, WFIFOW(char_fd,2));
+
+ if (sd->hd && merc_is_hom_active(sd->hd))
+ merc_save(sd->hd);
+
if (flag)
sd->state.finalsave = 1; //Mark the last save as done.
return 0;
diff --git a/src/map/map.h b/src/map/map.h
index 1680efb7c..2cb6896e4 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -9,7 +9,7 @@
#include "../common/mapindex.h"
#include "../common/db.h"
-//Uncomment to enable the Cell Stack Limit mod. (EXPERIMENTAL)
+//Uncomment to enable the Cell Stack Limit mod.
//It's only config is the battle_config cell_stack_limit.
//Only chars affected are those defined in BL_CHAR (mobs and players currently)
//#define CELL_NOSTACK
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 2c3cbdf52..f868ddc2a 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -56,22 +56,13 @@ int merc_hom_dead(struct homun_data *hd, struct block_list *src)
clif_emotion(&hd->bl, 16) ; //wah
if (!sd) //unit remove map will invoke unit free
return 3;
+ //There's no intimacy penalties on death (from Tharis)
//Delete timers when dead.
merc_hom_hungry_timer_delete(hd);
sd->homunculus.hp = 0 ;
clif_hominfo(sd,hd,0); // Send dead flag
-
- if(!merc_hom_decrease_intimacy(hd, 100)) // Intimacy was <= 100
- clif_emotion(&sd->bl, 23) ; //omg
- else {
- clif_emotion(&sd->bl, 28) ; //sob
- // Not needed because the status window will be closed until resurect homun and then
- // Intimacy will be sent
- //clif_send_homdata(hd->master,SP_INTIMATE,hd->master->homunculus.intimacy / 100);
- }
-
- merc_save(hd);
+ clif_emotion(&sd->bl, 28) ; //sob
//Remove from map (if it has no intimacy, it is auto-removed from memory)
return 3;
}
diff --git a/src/map/pc.c b/src/map/pc.c
index af8aab4a2..25f79b3a9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -344,11 +344,6 @@ int pc_makesavestatus(struct map_session_data *sd)
else
memcpy(&sd->status.last_point,&sd->status.save_point,sizeof(sd->status.last_point));
}
-
- if (sd->hd) { //Update Homun HP info
- sd->homunculus.hp = sd->hd->battle_status.hp ;
- sd->homunculus.sp = sd->hd->battle_status.sp ;
- }
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 9d5f360f2..0fd01aac1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -928,10 +928,6 @@ int skillnotok_hom (int skillid, struct homun_data *hd)
{
int i = skillid;
nullpo_retr (1, hd);
- //if (sd == 0)
- //return 0;
- //return 1;
- // I think it was meant to be "no skills allowed when not a valid sd"
if (skillid >= GD_SKILLRANGEMIN && skillid <= GD_SKILLRANGEMAX)
return 1;
@@ -947,23 +943,8 @@ int skillnotok_hom (int skillid, struct homun_data *hd)
if (hd->blockskill[i] > 0)
return 1;
- // Check skill restrictions [Celest]
- if(!map_flag_vs(hd->bl.m) && skill_get_nocast (skillid) & 1)
- return 1;
- if(map[hd->bl.m].flag.pvp) {
- if(!battle_config.pk_mode && skill_get_nocast (skillid) & 2)
- return 1;
- if(battle_config.pk_mode && skill_get_nocast (skillid) & 16)
- return 1;
- }
- if(map_flag_gvg(hd->bl.m) && skill_get_nocast (skillid) & 4)
- return 1;
- if(agit_flag && skill_get_nocast (skillid) & 8)
- return 1;
- if(map[hd->bl.m].flag.restricted && map[hd->bl.m].zone && skill_get_nocast (skillid) & (8*map[hd->bl.m].zone))
- return 1;
-
- return (map[hd->bl.m].flag.noskill);
+ //Use master's criteria.
+ return skillnotok(skillid, hd->master);
}
struct skill_unit_layout skill_unit_layout[MAX_SKILL_UNIT_LAYOUT];
@@ -1526,6 +1507,16 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
case GS_FULLBUSTER:
status_change_start(src,SC_BLIND,200*skilllv,skilllv,0,0,0,skill_get_time2(skillid,skilllv),10);
break;
+ case HFLI_SBR44: //[orn]
+ case HVAN_EXPLOSION:
+ if(src->type == BL_HOM){
+ TBL_HOM *hd = (TBL_HOM*)src;
+ if (hd->master) {
+ hd->master->homunculus.intimacy = 200;
+ clif_send_homdata(hd->master,0x100,hd->master->homunculus.intimacy/100);
+ }
+ }
+ break;
}
if(sd && skillid && attack_type&BF_MAGIC && status_isdead(bl) &&
@@ -2421,10 +2412,10 @@ static int skill_check_condition_hom (struct homun_data *hd, int skill, int lv,
}
}
+ if (!type) //States are only checked on begin casting.
switch(state) {
case ST_MOVE_ENABLE:
- //Check only on begin casting. [Skotlex]
- if(!type && !unit_can_move(&hd->bl)) {
+ if(!unit_can_move(&hd->bl)) {
clif_skill_fail(sd,skill,0,0);
return 0;
}
@@ -4050,10 +4041,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case HVAN_EXPLOSION: //[orn]
- if(hd){
- hd->master->homunculus.intimacy = 200;
- clif_send_homdata(hd->master,0x100,hd->master->homunculus.intimacy/100);
- }
case NPC_SELFDESTRUCTION:
//Self Destruction hits everyone in range (allies+enemies)
//Except for Summoned Marine spheres on non-versus maps, where it's just enemy.
@@ -8120,7 +8107,8 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
}
group=(struct skill_unit_group*)sc->data[SC_DANCING].val2;
time = 1000*(sc->data[SC_DANCING].val3>>16);
- if (!group || (skill_get_time(sc->data[SC_DANCING].val1,group->skill_lv) - time <= skill_get_time2(skill,lv)))
+ if (!group ||
+ (skill_get_time(group->skill_id,group->skill_lv) - time <= skill_get_time2(skill,lv)))
{
clif_skill_fail(sd,skill,0,0);
return 0;