From a6e725229813ae54674f4ed116b3e515fc1d8dbb Mon Sep 17 00:00:00 2001 From: ediejohnny Date: Mon, 4 Feb 2013 21:57:52 +0000 Subject: One more fix at "bindatcmd" command. Related to bug:7240. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17121 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/npc.c b/src/map/npc.c index aa44d8840..124446d62 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2911,11 +2911,13 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c for( i = 0; i < ( strlen( message ) + 1 ) && k < 127; i ++ ) { if( message[i] == ' ' || message[i] == '\0' ) { if( message[ ( i - 1 ) ] == ' ' ) { - continue; // To prevent "@atcmd [space][space][space]..." + continue; // To prevent "@atcmd [space][space]" and .@atcmd_numparameters return 1 without any parameter. } temp[k] = '\0'; k = 0; - setd_sub( st, NULL, ".@atcmd_parameters$", j++, (void *)temp, NULL ); + if( temp[0] != '\0' ) { + setd_sub( st, NULL, ".@atcmd_parameters$", j++, (void *)temp, NULL ); + } } else { temp[k] = message[i]; k++; -- cgit v1.2.3-70-g09d2 From c6c82fdf4120a08a860068f99bcc3ea5b338dd58 Mon Sep 17 00:00:00 2001 From: ediejohnny Date: Fri, 8 Feb 2013 22:58:50 +0000 Subject: Fixed "sscanf" script command related at bug:7166. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17124 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index 3e51859d1..f55f9602a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14138,12 +14138,12 @@ BUILDIN_FUNC(sscanf){ if(sscanf(str, buf, ref_str)==0){ break; } - set_reg(st, sd, add_str(buf_p), buf_p, (void *)(ref_str), reference_getref(data)); - }else{ // Number + set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)(ref_str), reference_getref(data)); + } else { // Number if(sscanf(str, buf, &ref_int)==0){ break; } - set_reg(st, sd, add_str(buf_p), buf_p, (void *)__64BPRTSIZE(ref_int), reference_getref(data)); + set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)__64BPRTSIZE(ref_int), reference_getref(data)); } arg++; -- cgit v1.2.3-70-g09d2 From 39790db451bf767bea78e843a4663d9e2b05beaf Mon Sep 17 00:00:00 2001 From: ediejohnny Date: Fri, 8 Feb 2013 23:39:22 +0000 Subject: Fix at "callfunc" script command. bugreport:7246. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17125 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index f55f9602a..4f98fff09 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4783,7 +4783,7 @@ BUILDIN_FUNC(callfunc) st->state = END; return 1; } - + for( i = st->start+3, j = 0; i < st->end; i++, j++ ) { struct script_data* data = push_copy(st->stack,i); @@ -4791,10 +4791,8 @@ BUILDIN_FUNC(callfunc) { const char* name = reference_getname(data); if( name[0] == '.' ) { - if ( !ref ) { - ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1); - ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars); - } + ref = (struct DBMap**)aCalloc(sizeof(struct DBMap*), 1); + ref[0] = (name[1] == '@' ? st->stack->var_function : st->script->script_vars); data->ref = ref; } } -- cgit v1.2.3-70-g09d2 From d8f0ee4c476102066268e6376f6544b57dbf5b71 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 15:40:35 -0300 Subject: Follow up 1a4d3fcf403745de60eb5d7648342cdfa1388af8 Improved Fix. Signed-off-by: shennetsind --- src/map/itemdb.c | 2 -- src/map/itemdb.h | 2 ++ src/map/script.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 2b7d27c8a..22ac031ee 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -20,8 +20,6 @@ static struct item_data* itemdb_array[MAX_ITEMDB]; static DBMap* itemdb_other;// int nameid -> struct item_data* -static struct item_group itemgroup_db[MAX_ITEMGROUP]; - struct item_data dummy_item; //This is the default dummy item used for non-existant items. [Skotlex] /** diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 06c95da8a..4c8847705 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -155,6 +155,8 @@ struct item_combo { bool isRef;/* whether this struct is a reference or the master */ }; +struct item_group itemgroup_db[MAX_ITEMGROUP]; + struct item_data* itemdb_searchname(const char *name); int itemdb_searchname_array(struct item_data** data, int size, const char *str); struct item_data* itemdb_load(int nameid); diff --git a/src/map/script.c b/src/map/script.c index 4f98fff09..182b04f86 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -17263,10 +17263,17 @@ BUILDIN_FUNC(getrandgroupitem) { ShowError("getrandgroupitem: qty is <= 0!\n"); return 1; } - if( (nameid = itemdb_searchrandomid(group)) == UNKNOWN_ITEM_ID ) { - return 1;/* itemdb_searchrandomid will already scream a error */ + + if(group < 1 || group >= MAX_ITEMGROUP) { + ShowError("getrandgroupitem: Invalid group id %d\n", group); + return 1; + } + if (!itemgroup_db[group].qty) { + ShowError("getrandgroupitem: group id %d is empty!\n", group); + return 1; } + nameid = itemdb_searchrandomid(group); memset(&item_tmp,0,sizeof(item_tmp)); item_tmp.nameid = nameid; -- cgit v1.2.3-70-g09d2 From cafe335b38d41ec3986eedf5ecd156f354ea2c37 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 15:50:07 -0300 Subject: Merge of 995c3daa01ab74fb6f1f22aa218b0a0a139bdee2 (couldn't automatically merge) --Concerned skill are : RK_PHANTOMTHRUST, WL_WHITEIMPRISON, SEVERE_RAINSTORM, NETHERWORLD, FIRE_MANTLE Additionally fixed SO_STRIKING with same issue. Signed-off-by: shennetsind --- src/map/skill.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index e393e4293..848422f3c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4043,7 +4043,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint clif->skill_nodamage(src,bl,skill_id,skill_lv,1); skill->blown(src,bl,distance_bl(src,bl)-1,unit_getdir(src),0); - if( battle->check_target(src,bl,BCT_ENEMY) ) + if( battle->check_target(src,bl,BCT_ENEMY) > 0 ) skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); break; @@ -5223,7 +5223,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui int bonus = 25 + 10 * skill_lv; bonus += (pc_checkskill(sd, SA_FLAMELAUNCHER)+pc_checkskill(sd, SA_FROSTWEAPON)+pc_checkskill(sd, SA_LIGHTNINGLOADER)+pc_checkskill(sd, SA_SEISMICWEAPON))*5; clif->skill_nodamage( src, bl, skill_id, skill_lv, - battle->check_target(src,bl,BCT_PARTY) ? + battle->check_target(src,bl,BCT_PARTY) > 0 ? sc_start2(bl, type, 100, skill_lv, bonus, skill->get_time(skill_id,skill_lv)) : 0 ); @@ -7740,7 +7740,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui break; case WL_WHITEIMPRISON: - if( (src == bl || battle->check_target(src, bl, BCT_ENEMY)) && !is_boss(bl) )// Should not work with bosses. + if( (src == bl || battle->check_target(src, bl, BCT_ENEMY) > 0 ) && !is_boss(bl) )// Should not work with bosses. { int rate = ( sd? sd->status.job_level : 50 ) / 4; @@ -11670,11 +11670,11 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns break; case UNT_SEVERE_RAINSTORM: - if( battle->check_target(&src->bl, bl, BCT_ENEMY) ) + if( battle->check_target(&src->bl, bl, BCT_ENEMY) > 0 ) skill->attack(BF_WEAPON,ss,&src->bl,bl,WM_SEVERE_RAINSTORM_MELEE,sg->skill_lv,tick,0); break; case UNT_NETHERWORLD: - if( !(status_get_mode(bl)&MD_BOSS) && ss != bl && battle->check_target(&src->bl, bl, BCT_PARTY) ) { + if( !(status_get_mode(bl)&MD_BOSS) && ss != bl && battle->check_target(&src->bl, bl, BCT_PARTY) > 0 ) { if( !(tsc && tsc->data[type]) ){ sc_start(bl, type, 100, sg->skill_lv, skill->get_time2(sg->skill_id,sg->skill_lv)); sg->limit = DIFF_TICK(tick,sg->tick); @@ -11811,7 +11811,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns break; case UNT_FIRE_MANTLE: - if( battle->check_target(&src->bl, bl, BCT_ENEMY) ) + if( battle->check_target(&src->bl, bl, BCT_ENEMY) > 0 ) skill->attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0); break; -- cgit v1.2.3-70-g09d2 From 0e6dcf7291164716aa47940e5967489e13cebfb6 Mon Sep 17 00:00:00 2001 From: glighta Date: Thu, 21 Feb 2013 06:59:42 +0000 Subject: -Fix SC__SHADOWFORM not ending if target does not move after being warp. bugreport:7271 -- Thus allowing to inflict damage between map (only if both player don't move). -- Cleanup old map-check on move check. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17148 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 6 +++--- src/map/map.c | 4 ++-- src/map/unit.c | 13 +++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index d06e02f6c..c8af6badc 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1143,7 +1143,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag if( sc && sc->data[SC__SHADOWFORM] ) { struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2); - if( !s_bl ) { // If the shadow form target is not present remove the sc. + if( !s_bl || s_bl->m != bl->m ) { // If the shadow form target is not present remove the sc. status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); } else if( status_isdead(s_bl) || !battle->check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both. status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); @@ -1833,7 +1833,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list wd.div_ = skill->get_num(GS_CHAINACTION,skill_lv); wd.type = 0x08; } - else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW + else if(sc && sc->data[SC_FEARBREEZE] && sd->weapontype1==W_BOW && (i = sd->equip_index[EQI_AMMO]) >= 0 && sd->inventory_data[i] && sd->status.inventory[i].amount > 1){ int chance = rand()%100; wd.type = 0x08; @@ -6166,4 +6166,4 @@ void battle_defaults(void) { battle->config_adjust = battle_adjust_conf; battle->get_enemy_area = battle_getenemyarea; battle->damage_area = battle_damage_area; -} \ No newline at end of file +} diff --git a/src/map/map.c b/src/map/map.c index 779070f0e..dbff42fa3 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -413,7 +413,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) if( bl->type == BL_PC && ((TBL_PC*)bl)->shadowform_id ) {//Shadow Form Target Moving struct block_list *d_bl; - if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) ) { + if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || !check_distance_bl(bl,d_bl,10) ) { if( d_bl ) status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER); ((TBL_PC*)bl)->shadowform_id = 0; @@ -438,7 +438,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) if( sc->data[SC__SHADOWFORM] ) {//Shadow Form Caster Moving struct block_list *d_bl; - if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) ) + if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || !check_distance_bl(bl,d_bl,10) ) status_change_end(bl,SC__SHADOWFORM,INVALID_TIMER); } diff --git a/src/map/unit.c b/src/map/unit.c index 4732b89dd..798a6ef6f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -406,7 +406,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int ud = unit_bl2ud(bl); if( ud == NULL) return 0; - + if (!(status_get_mode(bl)&MD_CANMOVE)) return 0; @@ -416,13 +416,13 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int ud->target_to = 0; return 0; } - + ud->state.walk_easy = flag&1; ud->target_to = tbl->id; ud->chaserange = range; //Note that if flag&2, this SHOULD be attack-range ud->state.attack_continue = flag&2?1:0; //Chase to attack. unit_set_target(ud, 0); - + sc = status_get_sc(bl); if (sc && sc->data[SC_CONFUSION]) //Randomize the target position map_random_dir(bl, &ud->to_x, &ud->to_y); @@ -432,7 +432,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int set_mobstate(bl, flag&2); return 1; } - + if(DIFF_TICK(ud->canmove_tick, gettick()) > 0) { //Can't move, wait a bit before invoking the movement. add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target); @@ -2089,6 +2089,11 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, case BL_PC: { struct map_session_data *sd = (struct map_session_data*)bl; + if(sd->shadowform_id){ + struct block_list *d_bl = map_id2bl(sd->shadowform_id); + if( d_bl ) + status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER); + } //Leave/reject all invitations. if(sd->chatID) chat_leavechat(sd,0); -- cgit v1.2.3-70-g09d2 From 14a406ee0e5c6ba25539cc98f27ff9c2b8047e2e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:01:51 -0300 Subject: Fixed Chorus skill partner check Improved from the merge 2fec7b3c41bd3b1c5a94ba31789c433350ff98c8 Signed-off-by: shennetsind --- src/map/unit.c | 62 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/map/unit.c b/src/map/unit.c index 798a6ef6f..a6d8fcf53 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1148,41 +1148,41 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui // Record the status of the previous skill) if(sd) { - if( (skill->get_inf2(skill_id)&INF2_ENSEMBLE_SKILL) && skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if( (skill->get_inf2(skill_id)&(INF2_ENSEMBLE_SKILL|INF2_CHORUS_SKILL)) && skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) { + clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; - } - + } + switch(skill_id){ - case SA_CASTCANCEL: - if(ud->skill_id != skill_id){ - sd->skill_id_old = ud->skill_id; - sd->skill_lv_old = ud->skill_lv; - } - break; - case BD_ENCORE: - //Prevent using the dance skill if you no longer have the skill in your tree. - if(!sd->skill_id_dance || pc_checkskill(sd,sd->skill_id_dance)<=0){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); - return 0; + case SA_CASTCANCEL: + if(ud->skill_id != skill_id){ + sd->skill_id_old = ud->skill_id; + sd->skill_lv_old = ud->skill_lv; + } + break; + case BD_ENCORE: + //Prevent using the dance skill if you no longer have the skill in your tree. + if(!sd->skill_id_dance || pc_checkskill(sd,sd->skill_id_dance)<=0){ + clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + return 0; + } + sd->skill_id_old = skill_id; + break; + case WL_WHITEIMPRISON: + if( battle->check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) { + clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); + return 0; + } + break; + case MG_FIREBOLT: + case MG_LIGHTNINGBOLT: + case MG_COLDBOLT: + sd->skill_id_old = skill_id; + sd->skill_lv_old = skill_lv; + break; } - sd->skill_id_old = skill_id; - break; - case WL_WHITEIMPRISON: - if( battle->check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); + if (!skill->check_condition_castbegin(sd, skill_id, skill_lv)) return 0; - } - break; - case MG_FIREBOLT: - case MG_LIGHTNINGBOLT: - case MG_COLDBOLT: - sd->skill_id_old = skill_id; - sd->skill_lv_old = skill_lv; - break; - } - if (!skill->check_condition_castbegin(sd, skill_id, skill_lv)) - return 0; } if( src->type == BL_MOB ) -- cgit v1.2.3-70-g09d2 From c2797dc5080c0b65dee81d3ad7770208daf6f7d9 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:05:27 -0300 Subject: Fixed renewal_exp modifier was affecting party members as well as self instead of only self. Modified version from a43cf4c84488d343a74e75722fee9a46a9dddebc Signed-off-by: shennetsind --- src/map/party.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/party.c b/src/map/party.c index f69a843fc..0d1048699 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -910,6 +910,9 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b { struct map_session_data* sd[MAX_PARTY]; unsigned int i, c; +#ifdef RENEWAL_EXP + unsigned int job_exp_bonus, base_exp_bonus; +#endif nullpo_ret(p); @@ -926,8 +929,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b job_exp/=c; zeny/=c; - if (battle_config.party_even_share_bonus && c > 1) - { + if (battle_config.party_even_share_bonus && c > 1) { double bonus = 100 + battle_config.party_even_share_bonus*(c-1); if (base_exp) base_exp = (unsigned int) cap_value(base_exp * bonus/100, 0, UINT_MAX); @@ -937,12 +939,17 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX); } +#ifdef RENEWAL_EXP + base_exp_bonus = base_exp; + job_exp_bonus = job_exp; +#endif + for (i = 0; i < c; i++) { #ifdef RENEWAL_EXP if( !(src && src->type == BL_MOB && ((TBL_MOB*)src)->db->mexp) ){ int rate = pc_level_penalty_mod(sd[i], (TBL_MOB*)src, 1); - base_exp = (unsigned int)cap_value(base_exp * rate / 100, 1, UINT_MAX); - job_exp = (unsigned int)cap_value(job_exp * rate / 100, 1, UINT_MAX); + base_exp = (unsigned int)cap_value(base_exp_bonus * rate / 100, 1, UINT_MAX); + job_exp = (unsigned int)cap_value(job_exp_bonus * rate / 100, 1, UINT_MAX); } #endif pc_gainexp(sd[i], src, base_exp, job_exp, false); -- cgit v1.2.3-70-g09d2 From 9a0b84c93b8098b76911b09b103602797fede9dc Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:16:01 -0300 Subject: Merge ca0642a75528cac73dd3683af7ca05bb42aa7dc0 (couldn't do it automatically) Signed-off-by: shennetsind --- src/map/skill.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index 848422f3c..2c255ffb7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6635,18 +6635,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui case NPC_EMOTION_ON: case NPC_EMOTION: - //va[0] is the emotion to use. + //val[0] is the emotion to use. //NPC_EMOTION & NPC_EMOTION_ON can change a mob's mode 'permanently' [Skotlex] //val[1] 'sets' the mode //val[2] adds to the current mode //val[3] removes from the current mode //val[4] if set, asks to delete the previous mode change. - if(md && md->skill_idx >= 0 && tsc) - { + if(md && md->skill_idx >= 0 && tsc) { clif->emotion(bl, md->db->skill[md->skill_idx].val[0]); if(md->db->skill[md->skill_idx].val[4] && tsce) status_change_end(bl, type, INVALID_TIMER); + //If mode gets set by NPC_EMOTION then the target should be reset [Playtester] + if(skill_id == NPC_EMOTION && md->db->skill[md->skill_idx].val[1]) + mob_unlocktarget(md,tick); + if(md->db->skill[md->skill_idx].val[1] || md->db->skill[md->skill_idx].val[2]) sc_start4(src, type, 100, skill_lv, md->db->skill[md->skill_idx].val[1], -- cgit v1.2.3-70-g09d2 From 278e9949a662dd320c5fc408f585da4600526154 Mon Sep 17 00:00:00 2001 From: playtester Date: Fri, 15 Mar 2013 20:37:30 +0000 Subject: - Then % ASPD bonus from Spear Quicken now depends on RENEWAL_ASPD rather than RENEWAL, this should fix the problem that there is no ASPD bonus at all if RENEWAL is activated but RENEWAL_ASPD is not (bugreport:7357) - Added missing critical bonus on Valorous Assaulter's Katzbalger, it was only missing in the renewal db (bugreport:7355) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17199 54d463be-8e91-2dee-dedb-b68131a5f0ec --- db/re/item_db.txt | 2 +- src/map/status.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/db/re/item_db.txt b/db/re/item_db.txt index e551a3e2f..f07291dbe 100644 --- a/db/re/item_db.txt +++ b/db/re/item_db.txt @@ -540,7 +540,7 @@ 1181,Tae_Goo_Lyeon,Tae Goo Lyeon,4,20,,2000,250,,1,2,0x00004082,2,2,34,4,90,1,3,{ bonus bFlee2,10; if(JobLevel>=70) autobonus "{ bonus bBaseAtk,50; }",10,10000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; if(getrefine()>8) { bonus bVariableCastrate,-20; bonus bDelayRate,-20; } },{},{} 1182,Bloody_Eater,Bloody Eater,4,20,,1200,200,,1,2,0x00004082,7,2,34,4,50,1,3,{ bonus bAtkEle,Ele_Ghost; autobonus "{ bonus bCritical,100; bonus bBaseAtk,50; }",1,5000,0,"{ specialeffect2 EF_FIRESPLASHHIT; }"; bonus bHPGainValue,100; },{},{} 1183,BF_Two_Handed_Sword1,Brave Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bStr,2; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{} -1184,BF_Two_Handed_Sword2,Valorous Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus2 bAddRace,RC_DemiHuman,55; bonus bCritAtkRate,20; bonus bUnbreakableWeapon,0; },{},{} +1184,BF_Two_Handed_Sword2,Valorous Assaulter's Katzbalger,4,20,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bCritical,20; bonus2 bAddRace,RC_DemiHuman,55; bonus bCritAtkRate,20; bonus bUnbreakableWeapon,0; },{},{} 1185,Violet_Fear,Violet Fear,4,20,,2200,275,,1,2,0x00004082,2,2,34,4,80,1,3,{ bonus3 bAutoSpell,"WZ_METEOR",3,30; bonus3 bAutoSpell,"WZ_FROSTNOVA",5,50; autobonus "{ bonus bIgnoreDefRace,RC_NonBoss; }",50,5000; },{},{} 1186,Death_Guidance,Death Guidance,4,20,,2000,200,,1,2,0x00004082,2,2,34,4,70,1,3,{ bonus bStr,5; bonus bAgi,2; bonus bFlee2,20; bonus3 bAutoSpell,"NPC_HELLPOWER",1,10; bonus4 bAutoSpell,"NPC_HELLPOWER",1,10,0; if( getrefine()>8 ) bonus3 bAutoSpell,"NPC_VAMPIRE_GIFT",2,20; else bonus3 bAutoSpell,"NPC_VAMPIRE_GIFT",1,20; },{},{} 1187,Krieger_Twohand_Sword1,Glorious Claymore,4,20,,0,220,,1,0,0x00004082,7,2,34,4,80,1,3,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; if(getrefine()>5) { bonus2 bAddRace,RC_DemiHuman,pow(((getrefine()>14)?14:getrefine())-3,1); bonus2 bIgnoreDefRate,RC_DemiHuman,5; } if(getrefine()>8) { bonus3 bAutoSpell,"LK_CONCENTRATION",getskilllv("LK_CONCENTRATION")>1?getskilllv("LK_CONCENTRATION"):1,30; bonus3 bAutoSpell,"LK_AURABLADE",getskilllv("LK_AURABLADE")>1?getskilllv("LK_AURABLADE"):1,30; } },{},{} diff --git a/src/map/status.c b/src/map/status.c index 5d41acbe0..1ed8d91b5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7258,7 +7258,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_MERC_QUICKEN: val2 = 300; break; -#ifndef RENEWAL +#ifndef RENEWAL_ASPD case SC_SPEARQUICKEN: val2 = 200+10*val1; break; -- cgit v1.2.3-70-g09d2 From 931058402a47abd14f022c12bdf29c68e261204d Mon Sep 17 00:00:00 2001 From: playtester Date: Sat, 16 Mar 2013 20:53:23 +0000 Subject: - Strongly improved the structure of status_get_sc_def so it's a lot easier to apply official formulas and make sure the checks are applied in the correct order - In the process, fixed the effect of luk on status changes and removed the static 3% resistance that has been proven to not exist (97 vit, 1 luk can get stunned on officials) - As there is no general luk resistance as it depends on each status change, removed the luk_status_def configurations - Updated the success chance of Decrease Agi to the formula that was extracted from Aegis (blevel/5 + int/5 + skill_lv*3 + 50) Note: I tested all the status changes thoroughly, but as this is a quite large update, it would be nice if someone could cross-check it. Note2: Renewal status resistances (for pre-renewal status changes) are currently not implemented in rAthena at all. They need to be added in another update. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17201 54d463be-8e91-2dee-dedb-b68131a5f0ec --- conf/battle/status.conf | 8 -- src/map/battle.c | 2 - src/map/battle.h | 2 - src/map/status.c | 211 ++++++++++++++++++++++++++++-------------------- 4 files changed, 122 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/conf/battle/status.conf b/conf/battle/status.conf index 6efe973b7..5341b606b 100644 --- a/conf/battle/status.conf +++ b/conf/battle/status.conf @@ -27,14 +27,6 @@ debuff_on_logout: 3 pc_status_def_rate: 100 mob_status_def_rate: 100 -// Required luk to gain inmunity to status changes. -// Luk increases resistance by closing the gap between natural resist and max -// linearly. This setting indicates required luk to gain complete immunity. -// Eg: 40 vit -> 40% resist. 150 luk -> +50% of the missing gap. -// So 40% + (50% of 60%) = 70% -pc_luk_status_def: 300 -mob_luk_status_def: 300 - // Maximum resistance to status changes. (100 = 100%) // NOTE: Cards and equipment can go over this limit, so it only applies to natural resist. pc_max_status_def: 100 diff --git a/src/map/battle.c b/src/map/battle.c index c8af6badc..81c616928 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5782,8 +5782,6 @@ static const struct _battle_data { { "status_cast_cancel", &battle_config.sc_castcancel, BL_NUL, BL_NUL, BL_ALL, }, { "pc_status_def_rate", &battle_config.pc_sc_def_rate, 100, 0, INT_MAX, }, { "mob_status_def_rate", &battle_config.mob_sc_def_rate, 100, 0, INT_MAX, }, - { "pc_luk_status_def", &battle_config.pc_luk_sc_def, 300, 1, INT_MAX, }, - { "mob_luk_status_def", &battle_config.mob_luk_sc_def, 300, 1, INT_MAX, }, { "pc_max_status_def", &battle_config.pc_max_sc_def, 100, 0, INT_MAX, }, { "mob_max_status_def", &battle_config.mob_max_sc_def, 100, 0, INT_MAX, }, { "sg_miracle_skill_ratio", &battle_config.sg_miracle_skill_ratio, 1, 0, 10000, }, diff --git a/src/map/battle.h b/src/map/battle.h index 54f941de8..8b1f757f5 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -381,8 +381,6 @@ struct Battle_Config { int sc_castcancel; // [Skotlex] int pc_sc_def_rate; // [Skotlex] int mob_sc_def_rate; - int pc_luk_sc_def; - int mob_luk_sc_def; int pc_max_sc_def; int mob_max_sc_def; diff --git a/src/map/status.c b/src/map/status.c index 1ed8d91b5..72643e3c8 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6078,7 +6078,12 @@ void status_change_init(struct block_list *bl) //the flag values are the same as in status_change_start. int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int tick, int flag) { - int sc_def = 0, tick_def = 0; + //Percentual resistance: 10000 = 100% Resist + //Example: 50% -> sc_def=5000 -> 25%; 5000ms -> tick_def=5000 -> 2500ms + int sc_def = 0, tick_def = -1; //-1 = use sc_def + //Linear resistance substracted from rate and tick after percentual resistance was applied + //Example: 25% -> sc_def2=2000 -> 5%; 2500ms -> tick_def2=2000 -> 500ms + int sc_def2 = 0, tick_def2 = -1; //-1 = use sc_def2 struct status_data* status; struct status_change* sc; struct map_session_data *sd; @@ -6127,67 +6132,72 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti if( sc && !sc->count ) sc = NULL; switch (type) { - case SC_STUN: - case SC_POISON: - if( sc && sc->data[SC__UNLUCKY] ) - return tick; - case SC_DPOISON: - case SC_SILENCE: - case SC_BLEEDING: - sc_def = 3 +status->vit; - break; - case SC_SLEEP: - sc_def = 3 +status->int_; - break; - case SC_DEEPSLEEP: - tick_def = status->int_ / 10 + status_get_lv(bl) * 65 / 1000; // Seems to be -1 sec every 10 int and -5% chance every 10 int. - sc_def = 5 * status->int_ /10; - break; - case SC_DECREASEAGI: - case SC_ADORAMUS://Arch Bishop - if (sd) tick>>=1; //Half duration for players. - case SC_STONE: - case SC_FREEZE: - sc_def = 3 +status->mdef; - break; - case SC_CURSE: - //Special property: inmunity when luk is greater than level or zero - if (status->luk > status_get_lv(bl) || status->luk == 0) - return 0; - else - sc_def = 3 +status->luk; - tick_def = status->vit; - break; - case SC_BLIND: - if( sc && sc->data[SC__UNLUCKY] ) - return tick; - sc_def = 3 +(status->vit + status->int_)/2; - break; - case SC_CONFUSION: - sc_def = 3 +(status->str + status->int_)/2; - break; - case SC_ANKLE: - if(status->mode&MD_BOSS) // Lasts 5 times less on bosses - tick /= 5; - sc_def = status->agi / 2; - break; - case SC_MAGICMIRROR: - case SC_ARMORCHANGE: - if (sd) //Duration greatly reduced for players. - tick /= 15; - //No defense against it (buff). - rate -= (status_get_lv(bl) / 5 + status->vit / 4 + status->agi / 10)*100; // Lineal Reduction of Rate - break; + case SC_STUN: + case SC_POISON: + if( sc && sc->data[SC__UNLUCKY] ) + return tick; + case SC_DPOISON: + case SC_SILENCE: + case SC_BLEEDING: + sc_def = status->vit*100; + sc_def2 = status->luk*10; + break; + case SC_SLEEP: + sc_def = status->int_*100; + sc_def2 = status->luk*10; + break; + case SC_DEEPSLEEP: + sc_def = status->int_*50; + tick_def = status->int_*10 + status_get_lv(bl) * 65 / 10; //Seems to be -1 sec every 10 int and -5% chance every 10 int. + break; + case SC_DECREASEAGI: + case SC_ADORAMUS: //Arch Bishop + if (sd) tick>>=1; //Half duration for players. + case SC_STONE: + //Impossible to reduce duration with stats + tick_def = 0; + tick_def2 = 0; + case SC_FREEZE: + sc_def = status->mdef*100; + sc_def2 = status->luk*10; + break; + case SC_CURSE: + //Special property: inmunity when luk is greater than level or zero + if (status->luk > status_get_lv(bl) || status->luk == 0) + return 0; + sc_def = status->luk*100; + sc_def2 = status->luk*10; + tick_def = status->vit*100; + break; + case SC_BLIND: + if( sc && sc->data[SC__UNLUCKY] ) + return tick; + sc_def = (status->vit + status->int_)*50; + sc_def2 = status->luk*10; + break; + case SC_CONFUSION: + sc_def = (status->str + status->int_)*50; + sc_def2 = status->luk*10; + break; + case SC_ANKLE: + if(status->mode&MD_BOSS) // Lasts 5 times less on bosses + tick /= 5; + sc_def = status->agi*50; + break; + case SC_MAGICMIRROR: + case SC_ARMORCHANGE: + if (sd) //Duration greatly reduced for players. + tick /= 15; + sc_def2 = status_get_lv(bl)*20 + status->vit*25 + status->agi*10; // Lineal Reduction of Rate + tick_def2 = 0; //No duration reduction + break; case SC_MARSHOFABYSS: //5 second (Fixed) + 25 second - {( INT + LUK ) / 20 second } - tick -= (status->int_ + status->luk) / 20 * 1000; + tick_def2 = (status->int_ + status->luk)*50; break; case SC_STASIS: //5 second (fixed) + { Stasis Skill level * 5 - (Target's VIT + DEX) / 20 } - tick -= (status->vit + status->dex) / 20 * 1000; - break; - case SC_WHITEIMPRISON: - if( tick == 5000 ) // 100% on caster + tick_def2 = (status->vit + status->dex)*50; break; if( bl->type == BL_PC ) tick -= (status_get_lv(bl) / 5 + status->vit / 4 + status->agi / 10)*100; @@ -6236,51 +6246,58 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti if (sd) { - if (battle_config.pc_sc_def_rate != 100) + if (battle_config.pc_sc_def_rate != 100) { sc_def = sc_def*battle_config.pc_sc_def_rate/100; + sc_def2 = sc_def2*battle_config.pc_sc_def_rate/100; + } - if (sc_def < battle_config.pc_max_sc_def) - sc_def += (battle_config.pc_max_sc_def - sc_def)* - status->luk/battle_config.pc_luk_sc_def; - else - sc_def = battle_config.pc_max_sc_def; + sc_def = min(sc_def, battle_config.pc_max_sc_def*100); + sc_def2 = min(sc_def2, battle_config.pc_max_sc_def*100); - if (tick_def) { - if (battle_config.pc_sc_def_rate != 100) - tick_def = tick_def*battle_config.pc_sc_def_rate/100; + if (tick_def > 0 && battle_config.pc_sc_def_rate != 100) { + tick_def = tick_def*battle_config.pc_sc_def_rate/100; + tick_def2 = tick_def2*battle_config.pc_sc_def_rate/100; } - } else { - if (battle_config.mob_sc_def_rate != 100) + if (battle_config.mob_sc_def_rate != 100) { sc_def = sc_def*battle_config.mob_sc_def_rate/100; + sc_def2 = sc_def2*battle_config.mob_sc_def_rate/100; + } - if (sc_def < battle_config.mob_max_sc_def) - sc_def += (battle_config.mob_max_sc_def - sc_def)* - status->luk/battle_config.mob_luk_sc_def; - else - sc_def = battle_config.mob_max_sc_def; + sc_def = min(sc_def, battle_config.mob_max_sc_def*100); + sc_def2 = min(sc_def2, battle_config.mob_max_sc_def*100); - if (tick_def) { - if (battle_config.mob_sc_def_rate != 100) - tick_def = tick_def*battle_config.mob_sc_def_rate/100; + if (tick_def > 0 && battle_config.mob_sc_def_rate != 100) { + tick_def = tick_def*battle_config.mob_sc_def_rate/100; + tick_def2 = tick_def2*battle_config.mob_sc_def_rate/100; } } if (sc) { if (sc->data[SC_SCRESIST]) - sc_def += sc->data[SC_SCRESIST]->val1; //Status resist + sc_def += sc->data[SC_SCRESIST]->val1*100; //Status resist else if (sc->data[SC_SIEGFRIED]) - sc_def += sc->data[SC_SIEGFRIED]->val3; //Status resistance. + sc_def += sc->data[SC_SIEGFRIED]->val3*100; //Status resistance. } //When no tick def, reduction is the same for both. - if( !tick_def && type != SC_STONE ) //Recent tests show duration of petrify isn't reduced by MDEF. [Inkfish] + if(tick_def < 0) tick_def = sc_def; + if(tick_def2 < 0) + tick_def2 = sc_def2; //Natural resistance if (!(flag&8)) { - rate -= rate*sc_def/100; + rate -= rate*sc_def/10000; + rate -= sc_def2; + + //Minimum chances + switch (type) { + case SC_BITE: + rate = max(rate, 5000); //Minimum of 50% + break; + } //Item resistance (only applies to rate%) if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX) @@ -6291,22 +6308,38 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1/100; } } + if (!(rnd()%10000 < rate)) return 0; - //Why would a status start with no duration? Presume it has - //duration defined elsewhere. - if (!tick) return 1; + //Even if a status change doesn't have a duration, it should still trigger + if (tick < 1) return 1; //Rate reduction - if (flag&2) + if (flag&2) return tick; - tick -= tick*tick_def/100; - // Changed to 5 seconds according to recent tests [Playtester] - if (type == SC_ANKLE && tick < 5000) - tick = 5000; - return tick<=0?0:tick; + tick -= tick*tick_def/10000; + tick -= tick_def2; + + //Minimum durations + switch (type) { + case SC_ANKLE: + case SC_MARSHOFABYSS: + case SC_STASIS: + tick = max(tick, 5000); //Minimum duration 5s + break; + case SC_BURNING: + case SC_FREEZING: + tick = max(tick, 10000); //Minimum duration 10s + break; + default: + //Skills need to trigger even if the duration is reduced below 1ms + tick = max(tick, 1); + break; + } + + return tick; } /*========================================== -- cgit v1.2.3-70-g09d2 From c079423d172fa772e6b56262f80c09cd0e5a7f47 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:26:34 -0300 Subject: Follow up 80ca4067115774d6c1c447072b470d5f69ab5883 Improved, previous fix would screw up when non-player unit attacked a player. Signed-off-by: shennetsind --- src/map/battle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 81c616928..b6180328a 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3394,10 +3394,10 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR ) ATK_ADD(10*sd->status.inventory[index].refine); } - } //if (sd) + } //Card Fix, tsd side - if(tsd) + if(!sd && 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, flag.lh, wd.flag); if( flag.infdef ) -- cgit v1.2.3-70-g09d2 From 4519b9f207fec921433843278198a8ff886c9a72 Mon Sep 17 00:00:00 2001 From: playtester Date: Thu, 28 Mar 2013 14:43:29 +0000 Subject: - Fixed more chances on item status changes - Fixed class requirements of Heart Breaker Hammerfall in renewal (bugreport:7418) - Increased minimum respawn delay for monsters to 5000ms, this is needed to prevent the client from thinking the newly spawned monster is the same than the killed one; one problem it can cause is described in bugreport:7390, also at least in pre-renewal the minimum respawn time is 5 seconds officially and handling this via the code is much better than updating all spawn files - Implemented the official formula for Potion Pitcher when used by monsters git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17219 54d463be-8e91-2dee-dedb-b68131a5f0ec --- db/pre-re/item_db.txt | 8 ++++---- db/re/item_db.txt | 12 ++++++------ src/map/mob.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/db/pre-re/item_db.txt b/db/pre-re/item_db.txt index 59d61be1c..f996dcf1d 100644 --- a/db/pre-re/item_db.txt +++ b/db/pre-re/item_db.txt @@ -616,7 +616,7 @@ 1271,Blood_Tears,Blood Tears,4,20,,1700,120,,1,2,0x00001000,2,2,34,4,55,1,16,{ if(getrefine()>=9){ bonus3 bAutoSpell,"NPC_WIDEBLEEDING",2,30; } else bonus3 bAutoSpell,"NPC_WIDEBLEEDING",1,30; },{},{} 1272,Scratcher,Scratcher,4,20,,0,120,,1,0,0x00001000,7,2,34,1,0,0,16,{ bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{} 1273,Bloody_Roar_C,Refined Bloody Roar,4,1,,0,148,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bIgnoreDefRace,RC_DemiHuman; bonus bFlee,-160; bonus bFlee2,-160; },{},{} -1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,500; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{} +1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,5000; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{} 1275,Katar_Of_Cold_Icicle_,Katar of Frozen Icicle,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Water; bonus2 bAddEff,Eff_Freeze,500; },{},{} 1276,Katar_Of_Thornbush_,Katar of Quaking,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500; },{},{} 1277,Katar_Of_Raging_Blaze_,Katar of Raging Blaze,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Silence,500; },{},{} @@ -673,7 +673,7 @@ 1375,Berdysz,Berdysz,4,20,,2500,200,,1,2,0x000444A2,2,2,34,3,70,1,7,{ bonus2 bSubSize,Size_Medium,13; bonus2 bSubSize,Size_Large,15; },{},{} 1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{} 1377,Hurricane_Fury,Hurricane's Fury,4,20,,3500,332,,1,1,0x000444A2,2,2,34,4,80,1,7,{ bonus2 bSubSize,Size_Medium,10+getrefine(); bonus bAspdRate,getrefine(); bonus3 bAutoSpell,"NPC_PULSESTRIKE",5,20; },{},{} -1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,1500; },{},{} +1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,2000; },{},{} 1379,BF_Two_Handed_Axe1,Valorous Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{} 1380,BF_Two_Handed_Axe2,Brave Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; autobonus "{ bonus bBreakArmorRate,10000; }",20,3000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; bonus bUnbreakableWeapon,0; },{},{} 1381,N_Battle_Axe,Novice Battle Axe,4,0,,0,100,,1,3,0x000444A2,7,2,34,1,3,0,7,{},{},{} @@ -1551,7 +1551,7 @@ 2730,Morroc_Seal,Seal of Continental Guard,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxHP,50; bonus bAspdRate,3; },{},{} 2731,Morroc_Charm_Stone,Rune Spellstone,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxSP,50; bonus bCastRate,-1; },{},{} 2732,Morroc_Ring,Death Loop,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bCritical,5; },{},{} -2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,1000,ATF_LONG; },{},{} +2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,100,ATF_LONG; },{},{} 2734,Directive_A,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{} 2735,Directive_B,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{} 2736,Navel_Ring,Navel Ring,5,20,,100,,0,,0,0xFFFFFFFE,7,2,136,,75,0,0,{ bonus bDex,3; bonus bLuk,3; bonus bMdef,2; },{},{} @@ -2543,7 +2543,7 @@ 5373,Darkness_Helm,Dark Randgris Helm,5,20,,300,,2,,1,0xFFFFFFFF,7,2,768,,0,1,379,{ bonus bDex,3; bonus bMdef,1; },{},{} 5374,L_Magestic_Goat,Gigantic Majestic Goat,5,20,,800,,5,,0,0xFFFFFFFF,7,2,256,,0,1,380,{ bonus2 bAddRace,RC_DemiHuman,12; bonus bBaseAtk,(JobLevel*2)/7; },{},{} 5375,L_Orc_Hero_Helm,Orc Hero Headdress,5,20,,900,,5,,1,0xFFFFFFFF,7,2,768,,0,1,381,{ bonus bStr,2; bonus3 bAutoSpellWhenHit,"BS_WEAPONPERFECT",3,10; },{},{} -5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus3 bAddEffWhenHit,Eff_Curse,100,ATF_SELF; },{},{} +5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus2 bAddEff2,Eff_Curse,300; },{},{} 5377,Antique_Pipe,Gentleman's Pipe,5,20,,100,,0,,0,0xFFFFFFFF,7,2,1,,0,0,383,{ bonus2 bSubRace,RC_DemiHuman,2; },{},{} 5378,Rabbit_Ear_Hat,Bunny Top Hat,5,20,,300,,0,,0,0xFFFFFFFF,7,2,256,,0,1,384,{ bonus bAgi,3; bonus3 bAutoSpellWhenHit,"AL_INCAGI",5,10; },{},{} 5379,Balloon_Hat,Tam,5,0,,800,,3,,1,0xFFFFFFFF,7,2,256,,50,1,385,{ bonus bMdef,2; bonus bMatkRate,2+(getrefine()/2); },{},{} diff --git a/db/re/item_db.txt b/db/re/item_db.txt index f07291dbe..de07386a4 100644 --- a/db/re/item_db.txt +++ b/db/re/item_db.txt @@ -631,7 +631,7 @@ 1271,Blood_Tears,Blood Tears,4,20,,1700,120,,1,2,0x00001000,2,2,34,4,55,1,16,{ if(getrefine()>=9){ bonus3 bAutoSpell,"NPC_WIDEBLEEDING",2,30; } else bonus3 bAutoSpell,"NPC_WIDEBLEEDING",1,30; },{},{} 1272,Scratcher,Scratcher,4,20,,0,120,,1,0,0x00001000,7,2,34,1,0,0,16,{ bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{} 1273,Bloody_Roar_C,Refined Bloody Roar,4,1,,0,148,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bIgnoreDefRace,RC_DemiHuman; bonus bFlee,-160; bonus bFlee2,-160; },{},{} -1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,500; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{} +1274,Unholy_Touch_C,Refined Unholy Touch,4,1,,0,179,,1,0,0x00001000,7,2,34,4,0,0,16,{ bonus bAtkEle,Ele_Dark; bonus2 bAddEff,Eff_Curse,5000; bonus bCritical,-1; bonus bUnbreakableWeapon,0; },{},{} 1275,Katar_Of_Cold_Icicle_,Katar of Frozen Icicle,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Water; bonus2 bAddEff,Eff_Freeze,500; },{},{} 1276,Katar_Of_Thornbush_,Katar of Quaking,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Earth; bonus2 bAddEff,Eff_Blind,500; },{},{} 1277,Katar_Of_Raging_Blaze_,Katar of Raging Blaze,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Fire; bonus2 bAddEff,Eff_Silence,500; },{},{} @@ -698,9 +698,9 @@ 1373,Brood_Axe_C,Refined Bloody Axe,4,2,,0,205,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,20; bonus bSpeedRate,25; bonus bAspdRate,5; },{},{} 1374,Tomahawk_C,Tomahawk,4,2,,0,200,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bAtkEle,Ele_Wind; skill "ITM_TOMAHAWK",1; },{},{} 1375,Berdysz,Berdysz,4,20,,2500,200,,1,2,0x000444A2,2,2,34,3,70,1,7,{ bonus2 bSubSize,Size_Medium,13; bonus2 bSubSize,Size_Large,15; },{},{} -1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{} +1376,Heart_Breaker,Heart Breaker,4,20,,2000,175,,1,1,0x000444A2,2,2,34,4,70,1,7,{ bonus bCritical,20+getrefine(); bonus bAspdRate,5; if((Class==Job_Whitesmith)||(Class==Job_Creator)||(Class==Job_Mechanic)||(Class==Job_Mechanic_T)||(Class==Job_Genetic)||(Class==Job_Genetic_T)) bonus3 bAutoSpell,"BS_HAMMERFALL",3,30; },{},{} 1377,Hurricane_Fury,Hurricane's Fury,4,20,,3500,332,,1,1,0x000444A2,2,2,34,4,80,1,7,{ bonus2 bSubSize,Size_Medium,10+getrefine(); bonus bAspdRate,getrefine(); bonus3 bAutoSpell,"NPC_PULSESTRIKE",5,20; },{},{} -1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,1500; },{},{} +1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,0,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,2000; },{},{} 1379,BF_Two_Handed_Axe1,Valorous Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{} 1380,BF_Two_Handed_Axe2,Brave Insane Battle Axe,4,20,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; autobonus "{ bonus bBreakArmorRate,10000; }",20,3000,BF_WEAPON,"{ specialeffect2 EF_POTION_BERSERK; }"; bonus bUnbreakableWeapon,0; },{},{} 1381,N_Battle_Axe,Novice Battle Axe,4,0,,0,100,,1,3,0x000444A2,7,2,34,1,3,0,7,{},{},{} @@ -1764,7 +1764,7 @@ 2730,Morroc_Seal,Seal of Continental Guard,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxHP,50; bonus bAspdRate,3; },{},{} 2731,Morroc_Charm_Stone,Rune Spellstone,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bMaxSP,50; bonus bVariableCastrate,-1; },{},{} 2732,Morroc_Ring,Death Loop,5,20,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus bCritical,5; },{},{} -2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,1000,ATF_LONG; },{},{} +2733,Medal_Gunner,Sheriff Badge,5,20,,0,,1,,0,0x01000000,7,2,136,,70,0,0,{ bonus2 bAddRace,RC_NonBoss,5; bonus2 bAddRace,RC_Boss,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,100,ATF_LONG; },{},{} 2734,Directive_A,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{} 2735,Directive_B,Directive,5,0,,0,,1,,0,0x00000001,7,2,136,,0,0,0,{},{},{} 2736,Navel_Ring,Navel Ring,5,20,,100,,0,,0,0xFFFFFFFE,7,2,136,,75,0,0,{ bonus bDex,3; bonus bLuk,3; bonus bMdef,2; },{},{} @@ -3067,7 +3067,7 @@ 5373,Darkness_Helm,Dark Randgris Helm,5,20,,300,,2,,1,0xFFFFFFFF,7,2,768,,0,1,379,{ bonus bDex,3; bonus bMdef,1; },{},{} 5374,L_Magestic_Goat,Gigantic Majestic Goat,5,20,,800,,5,,0,0xFFFFFFFF,7,2,256,,0,1,380,{ bonus2 bAddRace,RC_DemiHuman,12; bonus bBaseAtk,(JobLevel*2)/7; },{},{} 5375,L_Orc_Hero_Helm,Orc Hero Headdress,5,20,,900,,5,,1,0xFFFFFFFF,7,2,768,,0,1,381,{ bonus bStr,2; bonus3 bAutoSpellWhenHit,"BS_WEAPONPERFECT",3,10; },{},{} -5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus3 bAddEffWhenHit,Eff_Curse,100,ATF_SELF; },{},{} +5376,Satanic_Chain_P,Flying Evil Wing,5,20,,100,,3,,1,0xFFFFFFFF,7,2,256,,0,1,382,{ bonus bMaxSP,120; bonus2 bAddEff2,Eff_Curse,300; },{},{} 5377,Antique_Pipe,Gentleman's Pipe,5,20,,100,,0,,0,0xFFFFFFFF,7,2,1,,0,0,383,{ bonus2 bSubRace,RC_DemiHuman,2; },{},{} 5378,Rabbit_Ear_Hat,Bunny Top Hat,5,20,,300,,0,,0,0xFFFFFFFF,7,2,256,,0,1,384,{ bonus bAgi,3; bonus3 bAutoSpellWhenHit,"AL_INCAGI",5,10; },{},{} 5379,Balloon_Hat,Tam,5,0,,800,,3,,1,0xFFFFFFFF,7,2,256,,50,1,385,{ bonus bMdef,2; bonus bMatkRate,2+(getrefine()/2); },{},{} @@ -6153,7 +6153,7 @@ 13059,E_Asura_C,Asura,4,1,,0,120,,1,0,0x02000000,7,2,2,1,1,0,1,{},{},{} 13060,E_Counter_Dagger_C,Counter Dagger,4,1,,0,209,,1,0,0x00810204,7,2,2,4,1,0,1,{},{},{} 13061,Black_Wing,Black Wing,4,20,,600,142,,1,1,0x00020000,7,2,2,3,102,1,1,{ bonus2 bSkillAtk,"SC_FATALMENACE",30+(getrefine()*2); bonus bMatkRate,(getrefine()*3); },{},{} -13062,Ancient_Dagger,Ancient Dagger,4,20,,600,107,,0,0,0x028F5EEE,2,2,2,4,120,1,1,{ bonus bMatk,120; bonus bMaxSP,100; bonus bSPrecovRate,5; bonus2 bAddEff2,Eff_Curse,50; },{},{} +13062,Ancient_Dagger,Ancient Dagger,4,20,,600,107,,0,0,0x028F5EEE,2,2,2,4,120,1,1,{ bonus bMatk,120; bonus bMaxSP,100; bonus bSPrecovRate,5; bonus2 bAddEff2,Eff_Curse,20; bonus3 bAddEff,Eff_Curse,20,ATF_SELF|ATF_SKILL; },{},{} //13063, //13064, //13065, diff --git a/src/map/mob.c b/src/map/mob.c index 6a507a099..df7e2c365 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -875,8 +875,8 @@ int mob_setdelayspawn(struct mob_data *md) spawntime = spawntime/100*battle_config.mob_spawn_delay; } - if (spawntime < 500) //Min respawn time (is it needed?) - spawntime = 500; + if (spawntime < 5000) //Monsters should never respawn faster than within 5 seconds + spawntime = 5000; if( md->spawn_timer != INVALID_TIMER ) delete_timer(md->spawn_timer, mob_delayspawn); -- cgit v1.2.3-70-g09d2 From 3185ca423f28c25ca10210631a3474dc599c84a0 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:33:22 -0300 Subject: Follow up e7cb725387ceaa535562555c0461ead078dbdfd3 Improved Signed-off-by: shennetsind --- src/map/mob.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/mob.c b/src/map/mob.c index df7e2c365..f53e48316 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2634,8 +2634,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if (battle_config.mvp_tomb_enabled && md->spawn->state.boss) mvptomb_create(md, mvp_sd ? mvp_sd->status.name : NULL, time(NULL)); - if( !rebirth ) + if( !rebirth ) { + status_change_clear(&md->bl,1); mob_setdelayspawn(md); //Set respawning. + } return 3; //Remove from map. } -- cgit v1.2.3-70-g09d2 From 727e790733ea6a753765a271b51a91a31e1fb110 Mon Sep 17 00:00:00 2001 From: lemongrass3110 Date: Sun, 31 Mar 2013 13:00:28 +0000 Subject: Fixed warpportal script. bugreport:7451 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17226 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index 182b04f86..c65ce5c24 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -15662,6 +15662,7 @@ BUILDIN_FUNC(warpportal) group = skill->unitsetting(bl, AL_WARP, 4, spx, spy, 0); if( group == NULL ) return 0;// failed + group->val1 = (group->val1<<16)|(short)0; group->val2 = (tpx<<16) | tpy; group->val3 = mapindex; -- cgit v1.2.3-70-g09d2 From 13d907bb2548c75d19a6a3c85bcd2014e184f936 Mon Sep 17 00:00:00 2001 From: aleos Date: Mon, 8 Apr 2013 22:30:12 +0000 Subject: * Adjusted @speed so it is no longer reset when a player's status is recalculated. Log out or use @speed -1 to reset to default. (bugreport:7306) > Follow up to r17220: * Added an extra check if a player does not have a homunculus for 'hommutate' and 'morphembryo' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17236 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 8 +++++++- src/map/map.c | 2 ++ src/map/pc.h | 1 + src/map/script.c | 2 +- src/map/status.c | 6 +++++- 5 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d9c01b0fb..777d777a2 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -850,7 +850,13 @@ ACMD_FUNC(speed) return -1; } - sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); + if (speed < 0) { + sd->base_status.speed = DEFAULT_WALK_SPEED; + sd->state.permanent_speed = 0; // Remove lock when set back to default speed. + } else { + sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); + sd->state.permanent_speed = 1; // Set lock when set to non-default speed. + } status_calc_bl(&sd->bl, SCB_SPEED); clif->message(fd, msg_txt(8)); // Speed changed. return 0; diff --git a/src/map/map.c b/src/map/map.c index dbff42fa3..03ed08f8b 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1692,6 +1692,8 @@ int map_quit(struct map_session_data *sd) { if( sd->state.storage_flag == 1 ) sd->state.storage_flag = 0; // No need to Double Save Storage on Quit. + if (sd->state.permanent_speed == 1) sd->state.permanent_speed = 0; // Remove lock so speed is set back to normal at login. + if( sd->ed ) { elemental_clean_effect(sd->ed); unit_remove_map(&sd->ed->bl,CLR_TELEPORT); diff --git a/src/map/pc.h b/src/map/pc.h index 809822e78..2ebd5ad22 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -165,6 +165,7 @@ struct map_session_data { struct guild *gmaster_flag; unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not. unsigned int warping : 1;//states whether you're in the middle of a warp processing + unsigned int permanent_speed : 1; // When 1, speed cannot be changed through status_calc_pc(). } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; diff --git a/src/map/script.c b/src/map/script.c index c65ce5c24..ce312e894 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10152,7 +10152,7 @@ BUILDIN_FUNC(homunculus_mutate) TBL_PC *sd; sd = script_rid2sd(st); - if( sd == NULL ) + if( sd == NULL || sd->hd == NULL ) return 0; if(script_hasdata(st,2)) diff --git a/src/map/status.c b/src/map/status.c index 72643e3c8..482a9890d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2335,7 +2335,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first) memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp))); //FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex] - status->speed = DEFAULT_WALK_SPEED; + if (!pc->state.permanent_speed) + status->speed = DEFAULT_WALK_SPEED; //Give them all modes except these (useful for clones) status->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK); @@ -4988,6 +4989,9 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha if( sc == NULL ) return cap_value(speed,10,USHRT_MAX); + if (sd && sd->state.permanent_speed) + return (short)cap_value(speed,10,USHRT_MAX); + if( sd && sd->ud.skilltimer != INVALID_TIMER && (pc_checkskill(sd,SA_FREECAST) > 0 || sd->ud.skill_id == LG_EXEEDBREAK) ) { if( sd->ud.skill_id == LG_EXEEDBREAK ) -- cgit v1.2.3-70-g09d2 From 43ce3dbf3da829635869d6a7a9c6688bc0b133e3 Mon Sep 17 00:00:00 2001 From: lemongrass3110 Date: Mon, 8 Apr 2013 02:05:27 +0000 Subject: Speeded up jobchange command. Partially fixes bugreport:7453 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17235 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 777d777a2..bc76859e9 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1001,14 +1001,24 @@ ACMD_FUNC(jobchange) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d %d", &job, &upper) < 1) { - int i, found = 0; - - for (i = JOB_NOVICE; i < JOB_MAX; ++i) { - if (strncmpi(message, job_name(i), 16) == 0) { - job = i; - upper = 0; - found = 1; - break; + int i; + bool found = false; + + upper = 0; + + // Normal Jobs + for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ){ + if (strncmpi(message, job_name(i), 16) == 0) { + job = i; + found = true; + } + } + + // High Jobs, Babys and Third + for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ + if (strncmpi(message, job_name(i), 16) == 0) { + job = i; + found = true; } } -- cgit v1.2.3-70-g09d2 From 12963a5aa4e6e6cbf167d44ef6e509855f725282 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:42:07 -0300 Subject: Partial 09a7d4d217fb847c6853b7dd4c2cebe3868d4aff merge Signed-off-by: shennetsind --- src/map/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 482a9890d..29da8cfad 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2335,7 +2335,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first) memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp))); //FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex] - if (!pc->state.permanent_speed) + if (!sd->state.permanent_speed) status->speed = DEFAULT_WALK_SPEED; //Give them all modes except these (useful for clones) status->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK); -- cgit v1.2.3-70-g09d2 From e1f41ae8fdac977851bfd090a6e266a0dda8ed29 Mon Sep 17 00:00:00 2001 From: lemongrass3110 Date: Wed, 10 Apr 2013 15:02:11 +0000 Subject: New NPC range now working. Sorry guys, back in my days it was as easy as this, but I did not test it. So now tested and working. :) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17246 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 12 ++++++++++-- src/map/npc.h | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/npc.c b/src/map/npc.c index 124446d62..5cca94a87 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -96,6 +96,7 @@ static DBMap *npc_path_db; //For holding the view data of npc classes. [Skotlex] static struct view_data npc_viewdb[MAX_NPC_CLASS]; +static struct view_data npc_viewdb2[MAX_NPC_CLASS2_END-MAX_NPC_CLASS2_START]; static struct script_event_s { //Holds pointers to the commonly executed scripts for speedup. [Skotlex] @@ -108,8 +109,13 @@ struct view_data* npc_get_viewdata(int class_) { //Returns the viewdata for normal npc classes. if( class_ == INVISIBLE_CLASS ) return &npc_viewdb[0]; - if (npcdb_checkid(class_) || class_ == WARP_CLASS) - return &npc_viewdb[class_]; + if (npcdb_checkid(class_) || class_ == WARP_CLASS){ + if( class_ > MAX_NPC_CLASS2_START ){ + return &npc_viewdb2[class_-MAX_NPC_CLASS2_START]; + }else{ + return &npc_viewdb[class_]; + } + } return NULL; } @@ -3994,6 +4000,8 @@ int do_init_npc(void) npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here. for( i = 1; i < MAX_NPC_CLASS; i++ ) npc_viewdb[i].class_ = i; + for( i = MAX_NPC_CLASS2_START; i < MAX_NPC_CLASS2_END; i++ ) + npc_viewdb2[i - MAX_NPC_CLASS2_START].class_ = i; ev_db = strdb_alloc((DBOptions)(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA),2*NAME_LENGTH+2+1); npcname_db = strdb_alloc(DB_OPT_BASE,NAME_LENGTH); diff --git a/src/map/npc.h b/src/map/npc.h index c2351a836..229363191 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -88,7 +88,12 @@ enum actor_classes INVISIBLE_CLASS = 32767, }; +// Old NPC range #define MAX_NPC_CLASS 1000 +// New NPC range +#define MAX_NPC_CLASS2_START 10000 +#define MAX_NPC_CLASS2_END 10049 + //Checks if a given id is a valid npc id. [Skotlex] //Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001) #define npcdb_checkid(id) ( ( (id) >= 46 && (id) <= 125) || (id) == HIDDEN_WARP_CLASS || ( (id) > 400 && (id) < MAX_NPC_CLASS ) || (id) == INVISIBLE_CLASS || ( (id) > 10000 && (id) < 10049 ) ) -- cgit v1.2.3-70-g09d2 From dbb062c2f3657746a36feebc190c736ddcaa3881 Mon Sep 17 00:00:00 2001 From: euphyy Date: Mon, 4 Mar 2013 04:32:43 +0000 Subject: * Initial implementation of Malangdo Card Separation script. * Added and documented 'delequip' command, used in new official scripts. * Fixed issue in Guillotine Cross job quest where mobs did not properly reset (bugreport:7323). * Minor cleaning of script_commands.txt. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17168 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/re/cities/malangdo.txt | 8 +- npc/re/merchants/card_separation.txt | 279 +++++++++++++++++++++++++++++++++++ npc/re/merchants/enchan_mal.txt | 29 ++-- src/map/script.c | 23 +++ 4 files changed, 317 insertions(+), 22 deletions(-) create mode 100644 npc/re/merchants/card_separation.txt (limited to 'src') diff --git a/npc/re/cities/malangdo.txt b/npc/re/cities/malangdo.txt index 99d7e327d..e6732b754 100644 --- a/npc/re/cities/malangdo.txt +++ b/npc/re/cities/malangdo.txt @@ -180,9 +180,9 @@ izlude,182,218,4 script Odgnalam#iz 554,{ mes "You are a hero of cat's fleet. Your activity is the legend between us."; next; mes "[Odgnalam]"; - mes "As you are hero of fleet so let me send you to the heaven of the cat, ^A2314BMeow Meow Island^000000 for free."; + mes "As you are a hero of the cat fleet let me send you to ^A2314BMeow Meow Island^000000 for free."; next; - if(select("Let's go Meow Meow Island!!:Do not go") == 1) { + if(select("Send me to Meow Meow Island!:Do not go.") == 1) { mes "[Odgnalam]"; mes "Have a comfortable trip... Alright let's go~"; warp "malangdo",217,85; @@ -192,7 +192,7 @@ izlude,182,218,4 script Odgnalam#iz 554,{ mes "[Odgnalam]"; mes .@s1$; next; - if(select("Let's go Meow Meow Island!!:Do not go") == 2) close; + if(select("Send me to Meow Meow Island!:Do not go.") == 2) close; if (Zeny < .@price) { mes "[Odgnalam]"; mes "Money? Where is the money? You can't go anywhere without the money. Shame on you."; @@ -204,7 +204,7 @@ izlude,182,218,4 script Odgnalam#iz 554,{ warp "malangdo",217,85; close; } -alberta,200,151,4 duplicate(Odgnalam#iz) Odgnalam#albe 554 +alberta,200,151,4 duplicate(Odgnalam#Izlude) Odgnalam#Alberta 554 malangdo,219,86,4 script Kong#malang 545,{ mes "[Kong]"; diff --git a/npc/re/merchants/card_separation.txt b/npc/re/merchants/card_separation.txt new file mode 100644 index 000000000..a81aeb746 --- /dev/null +++ b/npc/re/merchants/card_separation.txt @@ -0,0 +1,279 @@ +//===== rAthena Script ======================================= +//= Card Separation System +//===== By: ================================================== +//= Muad_Dib +//===== Current Version: ===================================== +//= 1.0 +//===== Compatible With: ===================================== +//= rAthena SVN +//===== Description: ========================================= +//= [Official Conversion] +//= Separates cards from equipment. +//===== Additional Comments: ================================= +//= 1.0 First Version. [Euphy] +//============================================================ + +malangdo,215,166,4 script Jeremy#mal 553,{ + disable_items; + if (checkweight(1201,1) == 0) { + mes "You have too many kinds of objects. Let's try to continue after reducing those objects."; + close; + } + if (MaxWeight - Weight < 10000) { + mes "Can't continue because you have too many heavy objects. Let's try to continue after reducing the weight."; + close; + } + mes "[Jeremy]"; + mes "Long time no see~"; + mes "I have learned a new skill that separates cards from Armor, Shoes, Garment and Headgear. Do you want to try it?"; + next; + mes "[Jeremy]"; + mes "Generally the fee is 1,000,000 Zeny. During the card separation, you can use ^990000special items that reduce the rate of destroying equipment or cards^000000. We don't charge additional zeny for this."; + next; + mes "[Jeremy]"; + mes "There is a possibility of destroying them even using a special item. Also, ^ff0000the refine level might be lost^000000. Do you have any equipment to separate?"; + next; + + setarray .@equip_name$[0], "Armor", "Shoes", "Garment", "Upper Hat"; + setarray .@equip_slot[0], EQI_ARMOR,EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP; + for(set .@i,0; .@i= 4700) // Armor Enchant System + set .@equip_card[.@i],0; + } + if (!getarraysize(.@equip_card)) { + mes "[Jeremy]"; + mes "The card is not equipped. Do you want to check again?"; + close; + } + + // Detect MVP cards. + set .@mvp_list$, + "|4408|4128|4456|4168|4142"+ //Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card + "|4134|4137|4386|4407|4357"+ //Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card + "|4146|4132|4147|4372|4145"+ //Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card + "|4374|4352|4367|4236|4425"+ //Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card + "|4359|4123|4144|4135|4143"+ //B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card + "|4263|4131|4430|4276|4419"+ //Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card + "|4403|4399|4376|4441|4302"+ //Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card + "|4305|4148|4318|4121|4365"+ //Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card + "|4363|4324|4361|4330|4342|"; //B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card + if ((.@equip_card[0] && compare(.@mvp_list$,"|"+.@equip_card[0]+"|")) || + (.@equip_card[1] && compare(.@mvp_list$,"|"+.@equip_card[1]+"|")) || + (.@equip_card[2] && compare(.@mvp_list$,"|"+.@equip_card[2]+"|")) || + (.@equip_card[3] && compare(.@mvp_list$,"|"+.@equip_card[3]+"|"))) + set .@boss_chk,1; + + if (.@boss_chk == 0) { + mes "[Jeremy]"; + mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:"; + next; + set .@menu$, + "Next time...:"+ + ((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+ + ((countitem(6441))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+ + ((countitem(6440))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000"); + switch(select(.@menu$)) { + case 1: + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + case 2: + if (Zeny < 1000000) { + mes "[Jeremy]"; + mes "You don't have enough zeny. Please come back with enough fees."; + close; + } + mes "[Jeremy]"; + mes "This is pretty old equipment. There is a high rate of destroying the cards or equipment during the work. Are you sure you want to continue?"; + next; + if(select("Next time...:Continue") == 1) { + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + } + set .@sf_c_num,150; + set .@sf_r_num,150; + set .@sf_w_num,150; + set Zeny, Zeny - 1000000; + break; + case 3: + if (countitem(6441) == 0) { + mes "[Jeremy]"; + mes "You don't have Premium Lubricant."; + close; + } + mes "[Jeremy]"; + mes "If you use the Premium Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?"; + next; + if(select("Next time...:Continue") == 1) { + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + } + set .@sf_c_num,75; + set .@sf_r_num,75; + set .@sf_w_num,75; + delitem 6441,1; //High_RankLubricant + break; + case 4: + if (countitem(6440) == 0) { + mes "[Jeremy]"; + mes "You don't have Ordinary Lubricant."; + close; + } + mes "[Jeremy]"; + mes "If you use the Ordinary Lubricant, the rate of destruction will be decreased highly, but I can't give you a 100% guarantee. Are you sure you want to continue?"; + next; + if(select("Next time...:Continue") == 1) { + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + } + set .@sf_c_num,75; + set .@sf_r_num,150; + set .@sf_w_num,150; + delitem 6440,1; //General_Lubricant + break; + } + } else if (.@boss_chk == 1) { + mes "[Jeremy]"; + mes "This equipment contains a precious MVP card. This card can't be separated with lubricant. If you bring the super surfactant ^0000ffSillit Pong^000000, I will be able to work."; + next; + switch(select("Next time...:I have a Sillit Pong.")) { + case 1: + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + case 2: + if (countitem(6443) == 0) { + mes "[Jeremy]"; + mes "You don't have Sillit Pong."; + close; + } + break; + } + mes "[Jeremy]"; + mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:"; + next; + switch(select("Next time...:Alright, let's do it!")) { + case 1: + mes "[Jeremy]"; + mes "Whenever you need the work, visit me here."; + close; + case 2: + set .@sf_c_num,60; + set .@sf_r_num,60; + set .@sf_w_num,60; + delitem 6443,1; //Sillit_Pong_Bottle + break; + } + } + + set .@equip_id, getequipid(.@equip_num); + set .@equip_refine, getequiprefinerycnt(.@equip_num); + delequip .@equip_num; + + // Chance of retaining refine level. + if (rand(1,.@sf_r_num) >= 61) + set .@equip_refine,0; + + // Chance of retaining equipment. + if (rand(1,.@sf_w_num) < 61) { + set .@equip_safe,1; + getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0; + } + + // Chance of retaining cards. + for(set .@i,0; .@i<4; set .@i,.@i+1) { + if (.@equip_card[.@i]) { + if (rand(1,.@sf_c_num) < 61) + getitem .@equip_card[.@i],1; + else + set .@card_break,1; + } + } + + // Display corresponding effect. + if (!.@equip_safe && .@card_break) + specialeffect2 EF_LORD; + else if (.@equip_safe && .@card_break) + specialeffect2 EF_SUI_EXPLOSION; + else if (!.@equip_safe && !.@card_break) + specialeffect2 EF_FIREPILLAR; + else + specialeffect2 EF_MAXPOWER; + + // Output results. + mes "-- Result of Card Separation --"; + if (.@equip_safe) { + mes "Crack has not occured during the card separation process."; + mes "^0000FFEquipment separation is normal.^000000"; + } else { + mes "Crack has occured during the card separation process."; + mes "Equipment has been damaged. ^ff0000Unrecoverable.^000000"; + } + mes "-------------------"; + if (!.@card_break) { + mes "Erosion of surface has not occured during the card separation process."; + mes "^0000ffCard separation has succeeded.^000000"; + } else { + mes "Erosion of surface has occured during the card separation process."; + mes "Card has been damaged. ^ff0000Unrecoverable.^000000"; + } + next; + mes "[Jeremy]"; + mes "That is all for the results of the card separation. Please come again."; + close; +} diff --git a/npc/re/merchants/enchan_mal.txt b/npc/re/merchants/enchan_mal.txt index 36e8487b5..5caa70217 100644 --- a/npc/re/merchants/enchan_mal.txt +++ b/npc/re/merchants/enchan_mal.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Muad_Dib //===== Current Version: ===================================== -//= 1.0 +//= 1.0a //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= @@ -12,6 +12,7 @@ //= for Malangdo coins. //===== Additional Comments: ================================= //= 1.0 First Version. [Euphy] +//= 1.0a Added 'delequip' command. [Euphy] //============================================================ malangdo,213,167,4 script Mayomayo#mal 555,{ @@ -567,10 +568,10 @@ L_Socket: mes "There is something wrong. Please try again."; close; } - if (.@equip_card[3] == 0 && getarg(1) < 4) set .@target,3; - else if (.@equip_card[2] == 0 && getarg(1) < 3) set .@target,2; - else if (.@equip_card[1] == 0 && getarg(1) < 2) set .@target,1; - else if (.@equip_card[0] == 0 && getarg(1) < 1) set .@target,0; + if (.@equip_card[3] == 0 && getarg(1) < 4) set .@equip_card[3],.@enchant; + else if (.@equip_card[2] == 0 && getarg(1) < 3) set .@equip_card[2],.@enchant; + else if (.@equip_card[1] == 0 && getarg(1) < 2) set .@equip_card[1],.@enchant; + else if (.@equip_card[0] == 0 && getarg(1) < 1) set .@equip_card[0],.@enchant; else { mes "[Mayomayo]"; mes "This equipment is at the end of enchant. I provide enchant for two times maximum."; @@ -585,24 +586,18 @@ L_Socket: mes "Oh my god!"; mes "This equipment is destroyed because it could not endure powerful ability. I'm so sorry."; delitem .@coin[.@coin_select],.@total[.@coin_select]; - -// dropequipitem EQI_HAND_R - unequip EQI_HAND_R; - delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; + delequip EQI_HAND_R; close; } specialeffect2 EF_REPAIRWEAPON; mes "[Mayomayo]"; mes "I have enchanted ^990000slot "+.@socket+"^000000 of this equipment."; delitem .@coin[.@coin_select],.@total[.@coin_select]; - -// dropequipitem EQI_HAND_R - unequip EQI_HAND_R; - delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; + delequip EQI_HAND_R; // GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3] - set .@equip_card[.@target],.@enchant; getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; + close; } else if (.@select == 2) { mes "[Mayomayo]"; @@ -632,10 +627,7 @@ L_Socket: mes "[Mayomayo]"; mes "Initialize the enchant effect from the equipment."; delitem 6417,1; //Silvervine - -// dropequipitem EQI_HAND_R - unequip EQI_HAND_R; - delitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; + delequip EQI_HAND_R; // GetNonSlotItemSock2 .@equip_refine .@equip_id .@equip_card[0] .@equip_card[1] .@equip_card[2] .@equip_card[3] for(set .@i,0; .@i<4; set .@i,.@i+1) { @@ -643,6 +635,7 @@ L_Socket: set .@equip_card[.@i],0; } getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; + close; } } diff --git a/src/map/script.c b/src/map/script.c index ce312e894..0a33c1eef 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7782,6 +7782,29 @@ BUILDIN_FUNC(downrefitem) return 0; } +/*========================================== + * Delete the item equipped at pos. + *------------------------------------------*/ +BUILDIN_FUNC(delequip) +{ + int i=-1,num; + TBL_PC *sd; + + num = script_getnum(st,2); + sd = script_rid2sd(st); + if( sd == NULL ) + return 0; + + if (num > 0 && num <= ARRAYLENGTH(equip)) + i=pc_checkequip(sd,equip[num-1]); + if(i >= 0) { + pc_unequipitem(sd,i,3); //recalculate bonus + pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT); + } + + return 0; +} + /*========================================== * *------------------------------------------*/ -- cgit v1.2.3-70-g09d2 From 31420c03a8443b729cc850acdad4f32845379f85 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 16:53:30 -0300 Subject: Missing stuff from the merges done earlier Signed-off-by: shennetsind --- npc/re/cities/malangdo.txt | 2 +- src/common/mmo.h | 2 +- src/map/script.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/npc/re/cities/malangdo.txt b/npc/re/cities/malangdo.txt index e6732b754..f6fd3f14d 100644 --- a/npc/re/cities/malangdo.txt +++ b/npc/re/cities/malangdo.txt @@ -204,7 +204,7 @@ izlude,182,218,4 script Odgnalam#iz 554,{ warp "malangdo",217,85; close; } -alberta,200,151,4 duplicate(Odgnalam#Izlude) Odgnalam#Alberta 554 +alberta,200,151,4 duplicate(Odgnalam#iz) Odgnalam#Alberta 554 malangdo,219,86,4 script Kong#malang 545,{ mes "[Kong]"; diff --git a/src/common/mmo.h b/src/common/mmo.h index 7d1928201..bd6b29f76 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -98,7 +98,7 @@ #define MAX_GUILDSKILL 15 // increased max guild skills because of new skills [Sara-chan] #define MAX_GUILDLEVEL 50 #define MAX_GUARDIANS 8 //Local max per castle. [Skotlex] -#define MAX_QUEST_DB 2350 //Max quests that the server will load +#define MAX_QUEST_DB 2400 //Max quests that the server will load #define MAX_QUEST_OBJECTIVES 3 //Max quest objectives for a quest // for produce diff --git a/src/map/script.c b/src/map/script.c index 0a33c1eef..4ba5cc669 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -17855,6 +17855,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF2(cleanmap,"cleanarea","siiii"), BUILDIN_DEF(npcskill,"viii"), BUILDIN_DEF(itemeffect,"v"), + BUILDIN_DEF(delequip,"i"), /** * @commands (script based) **/ -- cgit v1.2.3-70-g09d2 From 1152ef720d3ef010a40ddf3cb5fc63fbc2f3e030 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 19:24:59 -0300 Subject: Fixed Bug #7158 http://hercules.ws/board/tracker/issue-7158-memory-leak/ Signed-off-by: shennetsind --- src/map/atcommand.c | 7 +----- src/map/clif.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/map/clif.h | 2 ++ src/map/guild.c | 8 ++---- src/map/map.c | 24 +----------------- 5 files changed, 76 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index bc76859e9..1c0542066 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5708,12 +5708,7 @@ ACMD_FUNC(autotrade) { } } - if( sd->channel_count ) { - for( i = 0; i < sd->channel_count; i++ ) { - if( sd->channels[i] != NULL ) - clif->chsys_left(sd->channels[i],sd); - } - } + clif->chsys_quit(sd); clif->authfail_fd(sd->fd, 15); diff --git a/src/map/clif.c b/src/map/clif.c index 56fdb4193..109ce7b9e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9901,6 +9901,74 @@ void clif_hercules_chsys_left(struct hChSysCh *channel, struct map_session_data } +void clif_hercules_chsys_quitg(struct map_session_data *sd) { + unsigned char i; + struct hChSysCh *channel = NULL; + + for( i = 0; i < sd->channel_count; i++ ) { + if( (channel = sd->channels[i] ) != NULL && channel->type == hChSys_ALLY ) { + idb_remove(channel->users,sd->status.char_id); + + if( channel == sd->gcbind ) + sd->gcbind = NULL; + + if( !db_size(channel->users) && channel->type == hChSys_PRIVATE ) { + clif->chsys_delete(channel); + } else if( !hChSys.closing && (channel->opt & hChSys_OPT_ANNOUNCE_JOIN) ) { + char message[60]; + sprintf(message, "#%s '%s' left",channel->name,sd->status.name); + clif->chsys_msg(channel,sd,message); + } + sd->channels[i] = NULL; + } + } + + if( i < sd->channel_count ) { + unsigned char cursor = 0; + for( i = 0; i < sd->channel_count; i++ ) { + if( sd->channels[i] == NULL ) + continue; + if( cursor != i ) { + sd->channels[cursor] = sd->channels[i]; + } + cursor++; + } + if ( !(sd->channel_count = cursor) ) { + aFree(sd->channels); + sd->channels = NULL; + } + } + +} + + +void clif_hercules_chsys_quit(struct map_session_data *sd) { + unsigned char i; + struct hChSysCh *channel = NULL; + + for( i = 0; i < sd->channel_count; i++ ) { + if( (channel = sd->channels[i] ) != NULL ) { + idb_remove(channel->users,sd->status.char_id); + + if( channel == sd->gcbind ) + sd->gcbind = NULL; + + if( !db_size(channel->users) && channel->type == hChSys_PRIVATE ) { + clif->chsys_delete(channel); + } else if( !hChSys.closing && (channel->opt & hChSys_OPT_ANNOUNCE_JOIN) ) { + char message[60]; + sprintf(message, "#%s '%s' left",channel->name,sd->status.name); + clif->chsys_msg(channel,sd,message); + } + + } + } + + sd->channel_count = 0; + aFree(sd->channels); + sd->channels = NULL; +} + /// Request for an action. /// 0089 .L .B (CZ_REQUEST_ACT) /// 0437 .L .B (CZ_REQUEST_ACT2) @@ -17160,6 +17228,8 @@ void clif_defaults(void) { clif->chsys_left = clif_hercules_chsys_left; clif->chsys_delete = clif_hercules_chsys_delete; clif->chsys_mjoin = clif_hercules_chsys_mjoin; + clif->chsys_quit = clif_hercules_chsys_quit; + clif->chsys_quitg = clif_hercules_chsys_quitg; clif->cashshop_load = clif_cashshop_db; /*------------------------ *- Parse Incoming Packet diff --git a/src/map/clif.h b/src/map/clif.h index 90915e1c9..ecdf17429 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -858,6 +858,8 @@ struct clif_interface { void (*chsys_left) (struct hChSysCh *channel, struct map_session_data *sd); void (*chsys_delete) (struct hChSysCh *channel); void (*chsys_mjoin) (struct map_session_data *sd); + void (*chsys_quit) (struct map_session_data *sd); + void (*chsys_quitg) (struct map_session_data *sd); /*------------------------ *- Parse Incoming Packet *------------------------*/ diff --git a/src/map/guild.c b/src/map/guild.c index 9b128c4e1..321560420 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -902,17 +902,13 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c clif->guild_memberlist(online_member_sd); // update char, if online - if(sd != NULL && sd->status.guild_id == guild_id) - { + if(sd != NULL && sd->status.guild_id == guild_id) { // do stuff that needs the guild_id first, BEFORE we wipe it if (sd->state.storage_flag == 2) //Close the guild storage. storage_guild_storageclose(sd); guild_send_dot_remove(sd); if( hChSys.ally ) { - for (i = 0; i < sd->channel_count; i++) { - if( sd->channels[i] && sd->channels[i]->type == hChSys_ALLY ) - clif->chsys_left(sd->channels[i],sd); - } + clif->chsys_quitg(sd); } sd->status.guild_id = 0; sd->guild = NULL; diff --git a/src/map/map.c b/src/map/map.c index 03ed08f8b..cdbe591f5 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1699,33 +1699,11 @@ int map_quit(struct map_session_data *sd) { unit_remove_map(&sd->ed->bl,CLR_TELEPORT); } - if( hChSys.ally && sd->status.guild_id ) { - struct guild *g = sd->guild, *sg; - if( g ) { - if( idb_exists(((struct hChSysCh *)g->channel)->users, sd->status.char_id) ) - clif->chsys_left((struct hChSysCh *)g->channel,sd); - for (i = 0; i < MAX_GUILDALLIANCE; i++) { - if( g->alliance[i].guild_id && (sg = guild_search(g->alliance[i].guild_id) ) ) { - if( idb_exists(((struct hChSysCh *)sg->channel)->users, sd->status.char_id) ) - clif->chsys_left((struct hChSysCh *)sg->channel,sd); - break; - } - } - } - } - if( hChSys.local && map[sd->bl.m].channel && idb_exists(map[sd->bl.m].channel->users, sd->status.char_id) ) { clif->chsys_left(map[sd->bl.m].channel,sd); } - if( sd->channel_count ) { - for( i = 0; i < sd->channel_count; i++ ) { - if( sd->channels[i] != NULL ) - clif->chsys_left(sd->channels[i],sd); - } - if( hChSys.closing ) - aFree(sd->channels); - } + clif->chsys_quit(sd); unit_remove_map_pc(sd,CLR_TELEPORT); -- cgit v1.2.3-70-g09d2 From 789c8d77c7de5673a3cefd8ca302d97bc358ce8e Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 11 Apr 2013 21:18:12 -0300 Subject: Hercules Channel System Update http://hercules.ws/board/topic/316-introducing-hercules-channel-system/?p=2716 Signed-off-by: shennetsind --- conf/messages.conf | 34 ++++++ src/map/atcommand.c | 323 +++++++++++++++++++++++++++++++++++++++++++++++++--- src/map/clif.c | 47 +++++--- src/map/clif.h | 16 ++- src/map/guild.c | 9 +- src/map/pc.c | 3 +- src/map/pc.h | 3 +- src/map/skill.c | 4 +- 8 files changed, 397 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/conf/messages.conf b/conf/messages.conf index e21c41176..e1a122fc6 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1452,6 +1452,40 @@ 1431: Your global chat is now binded to the '%s' channel 1432: Your global chat is not binded to any channel 1433: Your global chat is now unbinded from the '#%s' channel +1434: Player '%s' was not found +1437: Player '%s' has now been banned from '%s' channel +1438: You cannot join the '%s' channel because you've been banned from it +1439: Channel '%s' has no banned players +1440: Player '%s' is not banned from this channel +1441: Player '%s' has now been unbanned from the '%s' channel +1442: Removed all bans from '%s' channel +1443: -- '%s' ban list +1444: - %s +1445: - %s (%d) +1446: You need to input a option +1447: '%s' is not a known channel option +1448: -- Available options +1449: option '%s' is already enabled, if you'd like to disable it type '@channel opt %s 0' +1450: option '%s' is now enabled for channel '%s' +1451: value '%d' for option '%s' is out of range (limit is 0-10) +1452: option '%s' is now enabled for channel '%s' with %d seconds +1453: option '%s' is now disabled for channel '%s' +1454: option '%s' is not enabled on channel '%s' +1455: You're talking too fast! +1456: -- %s ban +1457: - bans from channel +1458: -- %s banlist +1459: - lists all banned characters from channel +1460: -- %s unban +1461: - unbans from channel +1462: -- %s setopt