From 5d467dd19d1756e42d3c95f553054177be6b5290 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 25 Jun 2013 11:26:53 -0300 Subject: Fixed item package announcer Made Possible Thanks to Yommy (<3!) Special Thanks to kyeme and Beret for bringing this issue to our attention. Signed-off-by: shennetsind --- src/map/clif.c | 12 +++++++----- src/map/packets_struct.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 3e01230b2..2bb272cd2 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/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)); -- cgit v1.2.3-60-g2f50 From 70ee2e2545d150f21392fb7d7f47b5479307f29f Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 25 Jun 2013 11:42:47 -0300 Subject: Fixed Bug #7429 Special Thanks to Poison, Haru. http://hercules.ws/board/tracker/issue-7429-partymembercount-gone-missing-when-reloadscript-is-executed/ Signed-off-by: shennetsind --- src/map/npc.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3-60-g2f50 From 5785dbae3f513da20611e3147dadef2b9c911443 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 25 Jun 2013 17:32:22 -0300 Subject: For Bug #7402 Temporary measure until malufett is capable of adjusting it himself. Special Thanks to Xgear for going thru all the testing for this with me, Also Special Thanks to VyLow for making it possible for me to reproduce the issue, and Zopokx, mofo and malufett. http://hercules.ws/board/tracker/issue-7402-damage-with-reduction-cards/ Signed-off-by: shennetsind --- src/map/battle.c | 63 +++++++++++++++++++++++++++++++++++--------------------- src/map/battle.h | 4 +++- 2 files changed, 42 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 9e65146e2..65c86cefd 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]; @@ -3373,9 +3378,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 +3445,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 +3591,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 +3663,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 +4356,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 @@ -4444,7 +4456,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 +4785,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 +4814,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 +4842,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); -- cgit v1.2.3-60-g2f50 From 1b035a978d52bfc6c17c63bb7afd9210abd4983c Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 25 Jun 2013 20:44:44 -0300 Subject: Follow up 5785dbae3f513da20611e3147dadef2b9c911443 Adjusted asura, special thanks to VyLow for bringing it up. Signed-off-by: shennetsind --- src/map/battle.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 65c86cefd..8e4fd305c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1868,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); @@ -4439,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 -- cgit v1.2.3-60-g2f50