diff options
author | Susu <bruant.bastien@gmail.com> | 2013-06-26 12:07:31 +0200 |
---|---|---|
committer | Susu <bruant.bastien@gmail.com> | 2013-06-26 12:07:31 +0200 |
commit | 56e37cb8d74da7c12814df50a1d28f59a9b8dc36 (patch) | |
tree | c280a8aa3be9bdd329b5de235d24b66667c71393 /src/map | |
parent | 71627e92fbe36c23993456486a308acd0428fd3d (diff) | |
parent | 1b035a978d52bfc6c17c63bb7afd9210abd4983c (diff) | |
download | hercules-56e37cb8d74da7c12814df50a1d28f59a9b8dc36.tar.gz hercules-56e37cb8d74da7c12814df50a1d28f59a9b8dc36.tar.bz2 hercules-56e37cb8d74da7c12814df50a1d28f59a9b8dc36.tar.xz hercules-56e37cb8d74da7c12814df50a1d28f59a9b8dc36.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 71 | ||||
-rw-r--r-- | src/map/battle.h | 4 | ||||
-rw-r--r-- | src/map/clif.c | 12 | ||||
-rw-r--r-- | src/map/npc.c | 3 | ||||
-rw-r--r-- | src/map/packets_struct.h | 3 |
5 files changed, 57 insertions, 36 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index b818e7ef4..cf0a4f3cd 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -488,8 +488,9 @@ int battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, uin * &8: Skip target size adjustment (Extremity Fist?) *&16: Arrow attack but BOW, REVOLVER, RIFLE, SHOTGUN, GATLING or GRENADE type weapon not equipped (i.e. shuriken, kunai and venom knives not affected by DEX) */ - -#ifdef RENEWAL +/* modifying until malufett is able to adjust the formula */ +//#ifdef RENEWAL +#if 0 int battle_calc_base_damage(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2) { int damage, batk; @@ -818,8 +819,10 @@ int battle_calc_elefix(struct block_list *src, struct block_list *target, uint16 } if( sc && sc->data[SC_WATK_ELEMENT] ) { // Descriptions indicate this means adding a percent of a normal attack in another element. [Skotlex] - damage = -#ifndef RENEWAL + damage = +/* modifying until malufett can adjust the formula */ +//#ifndef RENEWAL +#if 1 battle->calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, BL_CAST(BL_PC, src), (flag?2:0)) #else battle->calc_base_damage(src, target, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, EQI_HAND_R, (flag?2:0)|(sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0), 0) @@ -829,7 +832,9 @@ int battle_calc_elefix(struct block_list *src, struct block_list *target, uint16 damage += battle->attr_fix(src, target, damage, sc->data[SC_WATK_ELEMENT]->val1, tstatus->def_ele, tstatus->ele_lv); if( left ){ damage = -#ifndef RENEWAL +/* modifying until malufett can adjust the formula */ +//#ifndef RENEWAL +#if 1 battle->calc_base_damage(sstatus, &sstatus->lhw, sc, tstatus->size, BL_CAST(BL_PC, src), (flag?2:0)) #else battle->calc_base_damage(src, target, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, EQI_HAND_L, (flag?2:0)|(sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0), 0) @@ -863,7 +868,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li sstatus = status_get_status_data(src); tstatus = status_get_status_data(target); s_race2 = status_get_race2(src); - + switch(attack_type){ case BF_MAGIC: if ( sd && !(nk&NK_NO_CARDFIX_ATK) ) { @@ -1056,7 +1061,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li else if( cardfix != 1000 ) damage = damage * cardfix / 1000; - }else if( tsd && !(nk&NK_NO_CARDFIX_DEF) ){ + } else if( tsd && !(nk&NK_NO_CARDFIX_DEF) && !(left&2) ){ if( !(nk&NK_NO_ELEFIX) ) { int ele_fix = tsd->subele[s_ele]; @@ -1863,7 +1868,9 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block case MO_INVESTIGATE: skillratio += 75 * skill_lv; break; - #ifndef RENEWAL + /* modifying until malufett can adjust the formula */ + //#ifndef RENEWAL + #if 1 case MO_EXTREMITYFIST: { //Overflow check. [Skotlex] unsigned int ratio = skillratio + 100*(8 + status->sp/10); @@ -3373,9 +3380,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list } } #endif -#ifdef RENEWAL - ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag); -#endif +/* temporarily disabling until malufett can adjust */ +//#ifdef RENEWAL +// ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag); +//#endif if(sd) { //Damage bonuses if ((i = pc->skillatk_bonus(sd, skill_id))) @@ -3439,10 +3447,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list ad.damage = 0; } } - -#ifndef RENEWAL +/* temporarily making global until malufett can adjust */ +//#ifndef RENEWAL ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag); -#endif +//#endif } damage_div_fix(ad.damage, ad.div_); @@ -3585,8 +3593,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * case PA_GOSPEL: md.damage = 1+rnd()%9999; break; - case CR_ACIDDEMONSTRATION: -#ifdef RENEWAL + case CR_ACIDDEMONSTRATION: +/* modifying until malufett can adjust the formula */ +//#ifdef RENEWAL +#if 0 {// [malufett] int matk=0, atk; short tdef = status_get_total_def(target); @@ -3655,7 +3665,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * break ; case ASC_BREAKER: { -#ifndef RENEWAL +/* modifying until malufett can adjust the formula */ +//#ifndef RENEWAL +#if 1 md.damage = 500+rnd()%500 + 5*skill_lv * sstatus->int_; nk|=NK_IGNORE_FLEE|NK_NO_ELEFIX; //These two are not properties of the weapon based part. #else @@ -4346,7 +4358,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list wd.damage2 = 0; break; case NJ_ISSEN: // [malufett] -#ifndef RENEWAL +/* modifying until malufett can adjust the formula */ +//#ifndef RENEWAL +#if 1 wd.damage = 40*sstatus->str +skill_lv*(sstatus->hp/10 + 35); wd.damage2 = 0; #else @@ -4427,7 +4441,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list #endif ?1:0)| (flag.arrow?2:0)| -#ifndef RENEWAL +/* modifying until malufett can adjust the formula */ +//#ifndef RENEWAL +#if 1 (skill_id == HW_MAGICCRASHER?4:0)| (skill_id == MO_EXTREMITYFIST?8:0)| #endif @@ -4444,7 +4460,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list default: i |= 16; // for ex. shuriken must not be influenced by DEX } -#ifdef RENEWAL +/* modifying until malufett can adjust the formula */ +//#ifdef RENEWAL +#if 0 wd.damage = battle->calc_base_damage(src, target, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, EQI_HAND_R, i, wd.flag); wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon); if (flag.lh){ @@ -4771,8 +4789,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list #endif if(skill_id==TF_POISON) ATK_ADD(15*skill_lv); - -#ifndef RENEWAL +/* temp-fix until malufett adjusts */ +//#ifndef RENEWAL +#if 1 wd.damage = battle->calc_elefix(src, target, skill_id, skill_lv, wd.damage, nk, n_ele, s_ele, s_ele_, false, flag.arrow); if( flag.lh ) wd.damage2 = battle->calc_elefix(src, target, skill_id, skill_lv, wd.damage2, nk, n_ele, s_ele, s_ele_, true, flag.arrow); @@ -4799,7 +4818,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list } } #endif -#ifndef RENEWAL +/* modiftying until malufett adjusts */ +//#ifndef RENEWAL +#if 1 if (sd) { if (skill_id != CR_SHIELDBOOMERANG) //Only Shield boomerang doesn't takes the Star Crumbs bonus. ATK_ADD2(wd.div_*sd->right_weapon.star, wd.div_*sd->left_weapon.star); @@ -4825,9 +4846,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list } //Card Fix, tsd side if(tsd){ //if player on player then it was already measured above - wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 2, wd.flag); - if( flag.lh ) - wd.damage2 = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, 3, wd.flag); + wd.damage = battle->calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 0, wd.flag); } #endif if( flag.infdef ) { //Plants receive 1 damage when hit diff --git a/src/map/battle.h b/src/map/battle.h index 37968f53a..2b502beaf 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -535,7 +535,9 @@ struct battle_interface { /* skill range criteria */ int (*range_type) (struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv); int (*calc_base_damage) -#ifdef RENEWAL +/* temporary until malufett is able to adjust the formula */ +//#ifdef RENEWAL +#if 0 (struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2); #else (struct status_data *status, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag); diff --git a/src/map/clif.c b/src/map/clif.c index f98df7ec3..06363c8a2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -17445,18 +17445,20 @@ void clif_scriptclear(struct map_session_data *sd, int npcid) { clif->send(&p,sizeof(p), &sd->bl, SELF); } - +/* Made Possible Thanks to Yommy! */ void clif_package_item_announce(struct map_session_data *sd, unsigned short nameid, unsigned short containerid) { struct packet_package_item_announce p; p.PacketType = package_item_announceType; - p.PacketLength = 10+NAME_LENGTH; + p.PacketLength = 11+NAME_LENGTH; p.type = 0x0; - p.ItemID = containerid; + p.ItemID = nameid; p.len = NAME_LENGTH; safestrncpy(p.Name, sd->status.name, sizeof(p.Name)); - p.BoxItemID = nameid; - clif->send(&p,p.PacketLength, &sd->bl, ALL_CLIENT); + p.unknown = 0x2; // some strange byte, IDA shows.. BYTE3(BoxItemIDLength) = 2; + p.BoxItemID = containerid; + + clif->send(&p,sizeof(p), &sd->bl, ALL_CLIENT); } /* */ unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) { diff --git a/src/map/npc.c b/src/map/npc.c index 8381ac409..2dd02e88f 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3847,9 +3847,6 @@ int npc_reload(void) { npc->motd = npc_name2id("HerculesMOTD"); /* [Ind/Hercules] */ - /* re-insert */ - itemdb->name_constants(); - //Re-read the NPC Script Events cache. npc_read_event_script(); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 1a52040a8..d77784dc5 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -459,7 +459,7 @@ struct packet_script_clear { short PacketType; unsigned int NpcID; } __attribute__((packed)); - +/* made possible thanks to Yommy!! */ struct packet_package_item_announce { short PacketType; short PacketLength; @@ -467,6 +467,7 @@ struct packet_package_item_announce { unsigned short ItemID; char len; char Name[NAME_LENGTH]; + char unknown; unsigned short BoxItemID; } __attribute__((packed)); |