Skip to content

Commit

Permalink
Homonculus S Update
Browse files Browse the repository at this point in the history
-Updated and fixed Eira skills to official behavior.
Fixed Bug#8168
-http://hercules.ws/board/tracker/issue-8168-crush-strike/?gopid=22703#entry22703

Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
  • Loading branch information
malufett committed May 8, 2014
1 parent db42e06 commit f4f4b33
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 137 deletions.
16 changes: 8 additions & 8 deletions db/pre-re/skill_cast_db.txt
Expand Up @@ -1759,16 +1759,16 @@
8020,500:700:900:1100:1300,0,0,12000:14000:16000:18000:20000,4000:6000:8000:10000:12000,0
//-- MH_PAIN_KILLER
8021,1000:1200:1400:1600:1800,0,0,20000:30000:40000:50000:60000,0,0
//-- MH_LIGHT_OF_REGENE
//-- MH_LIGHT_OF_REGENE
8022,1600:1400:1200:1000:800,0,0,360000:420000:480000:540000:600000,0,0
//-- MH_OVERED_BOOST
//-- MH_OVERED_BOOST
8023,800:700:600:500:400,0,0,30000:45000:60000:75000:90000,0,0
//-- MH_ERASER_CUTTER
8024,1000:1500:2000:2500:3000,0,0,0,0,0
//-- MH_XENO_SLASHER
8025,1500:2500:3500:4500:5500,0,0,500,0,0
//-- MH_SILENT_BREEZE
8026,2000,0,0,9000:12000:15000:18000:21000,0,0
//-- MH_ERASER_CUTTER
8024,1000:1500:2000:2500:3000,2000,0,0,0,0
//-- MH_XENO_SLASHER
8025,1500:2500:3500:4500:5500,5000,0,500,0,0
//-- MH_SILENT_BREEZE
8026,1000:1200:1400:1600:1800,0,0,9000:12000:15000:18000:21000,0,0
//-- MH_STYLE_CHANGE
//8027,0,0,0,0,0,0,0
//-- MH_SONIC_CRAW
Expand Down
6 changes: 3 additions & 3 deletions db/pre-re/skill_db.txt
Expand Up @@ -1136,9 +1136,9 @@
8021,1,6,1,0,0x1,0,5,1,no,0,0,0,none,0, MH_PAIN_KILLER,Pain Killer
8022,0,6,4,0,0,0x1,5,1,no,0,0,0,none,0, MH_LIGHT_OF_REGENE,Light of Regene
8023,0,6,4,0,0,0x1,5,1,no,0,0,0,none,0, MH_OVERED_BOOST,Overed Boost
8024,7,6,1,4:0:4:0:4,0,0,5,1,no,0,0,0,magic,0, MH_ERASER_CUTTER,Eraser Cutter
8025,7,6,2,4:0:4:0:4,0,0,5,1,no,0,0,0,magic,0, MH_XENO_SLASHER,Xeno Slasher
8026,5:5:7:7:9,6,16,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze
8024,7,8,1,4:0:4:0:4,0,0,5,-6,yes,0,0,0,magic,0, MH_ERASER_CUTTER,Eraser Cutter
8025,7,8,2,4:0:4:0:4,0x2,2:2:3:3:4,5,-6,no,0,0,0,magic,0, MH_XENO_SLASHER,Xeno Slasher
8026,5:5:7:7:9,6,1,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze
8027,0,6,4,0,0x1,0,1,1,no,0,0,0,none,0, MH_STYLE_CHANGE,Style Change
8028,1,8,1,0,0,0,5,1,no,0,0,0,weapon,0, MH_SONIC_CRAW,Sonic Claw
8029,1,6,4,0,0,0,5,1,no,0,0x200,0,weapon,0, MH_SILVERVEIN_RUSH,Silver Bain Rush
Expand Down
8 changes: 4 additions & 4 deletions db/re/skill_cast_db.txt
Expand Up @@ -1761,15 +1761,15 @@
//-- MH_PAIN_KILLER
8021,1000:1200:1400:1600:1800,0,0,20000:30000:40000:50000:60000,0,0,1000:800:600:400:200
//-- MH_LIGHT_OF_REGENE
8022,1600:1400:1200:1000:800,0,0,360000:420000:480000:540000:600000,0,0,1600:1400:1200:1000:800
8022,0,0,0,360000:420000:480000:540000:600000,0,0,1600:1400:1200:1000:800
//-- MH_OVERED_BOOST
8023,800:700:600:500:400,0,0,30000:45000:60000:75000:90000,0,0,200:300:400:500:600
//-- MH_ERASER_CUTTER
8024,1000:1500:2000:2500:3000,0,0,0,0,0,-1
8024,1000:1500:2000:2500:3000,2000,0,0,0,0,-1
//-- MH_XENO_SLASHER
8025,1500:2500:3500:4500:5500,0,0,500,0,0,500
8025,1500:2500:3500:4500:5500,5000,0,500,0,0,500
//-- MH_SILENT_BREEZE
8026,2000,0,0,9000:12000:15000:18000:21000,0,0,1000:800:600:400:200
8026,1000:1200:1400:1600:1800,0,0,9000:12000:15000:18000:21000,0,0,1000:800:600:400:200
//-- MH_STYLE_CHANGE
//8027,0,0,0,0,0,0,0
//-- MH_SONIC_CRAW
Expand Down
6 changes: 3 additions & 3 deletions db/re/skill_db.txt
Expand Up @@ -1149,9 +1149,9 @@
8021,1,6,1,0,0x1,0,5,1,no,0,0,0,none,0, MH_PAIN_KILLER,Pain Killer
8022,0,6,4,0,0,0x1,5,1,no,0,0,0,none,0, MH_LIGHT_OF_REGENE,Light of Regene
8023,0,6,4,0,0,0x1,5,1,no,0,0,0,none,0, MH_OVERED_BOOST,Overed Boost
8024,7,6,1,4:0:4:0:4,0,0,5,1,no,0,0,0,magic,0, MH_ERASER_CUTTER,Eraser Cutter
8025,7,6,2,4:0:4:0:4,0,0,5,1,no,0,0,0,magic,0, MH_XENO_SLASHER,Xeno Slasher
8026,5:5:7:7:9,6,16,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze
8024,7,8,1,4:0:4:0:4,0,0,5,-6,yes,0,0,0,magic,0, MH_ERASER_CUTTER,Eraser Cutter
8025,7,8,2,4:0:4:0:4,0x2,2:2:3:3:4,5,-6,no,0,0,0,magic,0, MH_XENO_SLASHER,Xeno Slasher
8026,5:5:7:7:9,6,1,0,0x1,0,5,1,no,0,0,0,magic,0, MH_SILENT_BREEZE,Silent Breeze
8027,0,6,4,0,0x1,0,1,1,no,0,0,0,none,0, MH_STYLE_CHANGE,Style Change
8028,1,8,1,0,0,0,5,1,no,0,0,0,weapon,0, MH_SONIC_CRAW,Sonic Claw
8029,1,6,4,0,0,0,5,1,no,0,0x200,0,weapon,0, MH_SILVERVEIN_RUSH,Silver Bain Rush
Expand Down
41 changes: 20 additions & 21 deletions src/map/battle.c
Expand Up @@ -1721,9 +1721,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += 1100;
break;
case MH_ERASER_CUTTER:
if(skill_lv%2) skillratio += 400; //600:800:1000
else skillratio += 700; //1000:1200
skillratio += 100 * skill_lv;
skillratio += 400 + 100 * skill_lv + (skill_lv%2 > 0 ? 0 : 300);
break;
case MH_XENO_SLASHER:
if(skill_lv%2) skillratio += 350 + 50 * skill_lv; //500:600:700
Expand Down Expand Up @@ -2108,15 +2106,6 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
if( st->rhw.ele == ELE_FIRE )
skillratio += 100 * skill_lv;
break;
case RK_CRUSHSTRIKE:
if( sd )
{//ATK [{Weapon Level * (Weapon Upgrade Level + 6) * 100} + (Weapon ATK) + (Weapon Weight)]%
short index = sd->equip_index[EQI_HAND_R];
if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON )
skillratio += -100 + sd->inventory_data[index]->weight/10 + st->rhw.atk +
100 * sd->inventory_data[index]->wlv * (sd->status.inventory[index].refine + 6);
}
break;
case RK_STORMBLAST:
skillratio = ((sd ? pc->checkskill(sd,RK_RUNEMASTERY) : 1) + status_get_int(src) / 8) * 100;
break;
Expand Down Expand Up @@ -2546,7 +2535,18 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += sc->data[SC_LKCONCENTRATION]->val2;
if( sd && sd->status.weapon == W_KATAR && (i=pc->checkskill(sd,ASC_KATAR)) > 0 )
skillratio += skillratio * (10 + 2 * i) / 100;
#endif
#endif
if( sc && sc->data[SC_CRUSHSTRIKE] ){
if( sd )
{//ATK [{Weapon Level * (Weapon Upgrade Level + 6) * 100} + (Weapon ATK) + (Weapon Weight)]%
short index = sd->equip_index[EQI_HAND_R];
if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON )
skillratio += -100 + sd->inventory_data[index]->weight/10 + st->rhw.atk +
100 * sd->inventory_data[index]->wlv * (sd->status.inventory[index].refine + 6);
}
status_change_end(src, SC_CRUSHSTRIKE, INVALID_TIMER);
skill->break_equip(src,EQP_WEAPON,2000,BCT_SELF); // 20% chance to destroy the weapon.
}
}
}
if( skillratio < 1 )
Expand Down Expand Up @@ -4304,6 +4304,10 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
cri <<= 1;
}
switch (skill_id) {
case 0:
if(!(sc && sc->data[SC_AUTOCOUNTER]))
break;
status_change_end(src, SC_AUTOCOUNTER, INVALID_TIMER);
case KN_AUTOCOUNTER:
if(battle_config.auto_counter_type &&
(battle_config.auto_counter_type&src->type))
Expand Down Expand Up @@ -4653,6 +4657,8 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
ATK_ADDRATE(sc->data[SC_EXEEDBREAK]->val1);
status_change_end(src, SC_EXEEDBREAK, INVALID_TIMER);
}


#ifdef RENEWAL
if( sd && skill_id == NJ_KUNAI ){
flag.tdef = 1;
Expand Down Expand Up @@ -5647,7 +5653,6 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
return ATK_BLOCK;
}
}

if( tsc && tsc->data[SC_BLADESTOP_WAIT] && !is_boss(src) && (src->type == BL_PC || tsd == NULL || distance_bl(src, target) <= (tsd->status.weapon == W_FIST ? 1 : 2)) )
{
uint16 skill_lv = tsc->data[SC_BLADESTOP_WAIT]->val1;
Expand Down Expand Up @@ -5711,13 +5716,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
skill->get_time(MO_CALLSPIRITS, tsc->data[SC_GENTLETOUCH_ENERGYGAIN]->val1),
tsc->data[SC_GENTLETOUCH_ENERGYGAIN]->val1);
}
if( sc && sc->data[SC_CRUSHSTRIKE] ){
uint16 skill_lv = sc->data[SC_CRUSHSTRIKE]->val1;
status_change_end(src, SC_CRUSHSTRIKE, INVALID_TIMER);
if( skill->attack(BF_WEAPON,src,src,target,RK_CRUSHSTRIKE,skill_lv,tick,0) )
return ATK_DEF;
return ATK_MISS;
}

if( tsc && tsc->data[SC_MTF_MLEATKED] && rnd()%100 < 20 )
clif->skill_nodamage(target, target, SM_ENDURE, 5,
sc_start(target,target, SC_ENDURE, 100, 5, skill->get_time(SM_ENDURE, 5)));
Expand Down
19 changes: 14 additions & 5 deletions src/map/clif.c
Expand Up @@ -10109,7 +10109,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,

if (sd->sc.count &&
(sd->sc.data[SC_TRICKDEAD] ||
sd->sc.data[SC_AUTOCOUNTER] ||
(sd->sc.data[SC_AUTOCOUNTER] && action_type != 0x07) ||
sd->sc.data[SC_BLADESTOP] ||
sd->sc.data[SC_DEEP_SLEEP] ||
sd->sc.data[SC__MANHOLE] ||
Expand Down Expand Up @@ -14609,18 +14609,27 @@ void clif_parse_HomMenu(int fd, struct map_session_data *sd) { //[orn]
/// 0292
void clif_parse_AutoRevive(int fd, struct map_session_data *sd) {
int item_position = pc->search_inventory(sd, ITEMID_TOKEN_OF_SIEGFRIED);
int hpsp = 100;

if (item_position < 0)
return;
if (item_position < 0){
if (sd->sc.data[SC_LIGHT_OF_REGENE])
hpsp = 20 * sd->sc.data[SC_LIGHT_OF_REGENE]->val1;
else
return;
}

if (sd->sc.data[SC_HELLPOWER]) //Cannot res while under the effect of SC_HELLPOWER.
return;

if (!status->revive(&sd->bl, 100, 100))
if (!status->revive(&sd->bl, hpsp, hpsp))
return;

if ( item_position > 0)
pc->delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);
else
status_change_end(&sd->bl,SC_LIGHT_OF_REGENE,INVALID_TIMER);

clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
pc->delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME);
}


Expand Down
19 changes: 19 additions & 0 deletions src/map/homunculus.c
Expand Up @@ -1182,6 +1182,24 @@ bool homunculus_read_skill_db_sub(char* split[], int columns, int current) {
return true;
}

int8 homunculus_get_intimacy_grade(struct homun_data *hd) {
unsigned int val = hd->homunculus.intimacy / 100;
if( val > 100 ) {
if( val > 250 ) {
if( val > 750 ) {
if ( val > 900 )
return 4;
else
return 3;
} else
return 2;
} else
return 1;
}

return 0;
}

void homunculus_skill_db_read(void) {
memset(homun->skill_tree,0,sizeof(homun->skill_tree));
sv->readdb(map->db_path, "homun_skill_tree.txt", ',', 13, 15, -1, homun->read_skill_db_sub);
Expand Down Expand Up @@ -1303,4 +1321,5 @@ void homunculus_defaults(void) {
homun->exp_db_read = homunculus_exp_db_read;
homun->addspiritball = homunculus_addspiritball;
homun->delspiritball = homunculus_delspiritball;
homun->get_intimacy_grade = homunculus_get_intimacy_grade;
}
1 change: 1 addition & 0 deletions src/map/homunculus.h
Expand Up @@ -140,6 +140,7 @@ struct homunculus_interface {
void (*exp_db_read) (void);
void (*addspiritball) (struct homun_data *hd, int max);
void (*delspiritball) (struct homun_data *hd, int count, int type);
int8 (*get_intimacy_grade) (struct homun_data *hd);
};

struct homunculus_interface *homun;
Expand Down
2 changes: 1 addition & 1 deletion src/map/pc.c
Expand Up @@ -6855,7 +6855,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
}

if (sd->status.hom_id > 0){
if(battle_config.homunculus_auto_vapor && sd->hd && !sd->hd->sc.data[SC_LIGHT_OF_REGENE])
if(battle_config.homunculus_auto_vapor && sd->hd)
homun->vaporize(sd, HOM_ST_REST);
}

Expand Down

0 comments on commit f4f4b33

Please sign in to comment.