From 4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 14 Sep 2006 13:46:14 +0000 Subject: - Corrected Smokie's pet script to use petskillbonus instead of "bonus" - Added constant map_flag_gvg2 which tags gvg maps independently of whether woe is on or off. - battle_calc_gvg_damage will be invoked in gvg maps regardless of woe time. - NPC_MENTALBREAKER now zaps matk*lv SP based on observations by Tharis. - md->class_ will be changed on mob-class-change to fix all class-change related bugs. On respawn, the spawn data will be used to revert to the original class. - Improved the pet skillbonus timer for "eternal bonuses" cases where the bonus delay is 0. - Adjusted gvg long damage rate to 80%, magic damage rate to 60% git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8748 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pet.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/map/pet.c') diff --git a/src/map/pet.c b/src/map/pet.c index 9b5f6a3a3..d4069513f 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -577,12 +577,12 @@ int pet_catch_process2(struct map_session_data *sd,int target_id) pc_delitem(sd,i,1,0); } - i = search_petDB_index(md->vd->class_,PET_CLASS); + i = search_petDB_index(md->class_,PET_CLASS); //catch_target_class == 0 is used for universal lures. [Skotlex] //for now universal lures do not include bosses. if (sd->catch_target_class == 0 && !(md->status.mode&MD_BOSS)) - sd->catch_target_class = md->vd->class_; - if(i < 0 || sd->catch_target_class != md->vd->class_) { + sd->catch_target_class = md->class_; + if(i < 0 || sd->catch_target_class != md->class_) { clif_emotion(&md->bl, 7); //mob will do /ag if wrong lure is used on them. clif_pet_rulet(sd,0); sd->catch_target_class = -1; @@ -1100,6 +1100,7 @@ int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data) { struct map_session_data *sd=map_id2sd(id); struct pet_data *pd; + int bonus; int timer = 0; if(sd == NULL || sd->pd==NULL || sd->pd->bonus == NULL) @@ -1117,23 +1118,23 @@ int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data) } // determine the time for the next timer - if (pd->state.skillbonus) { - pd->state.skillbonus = 0; + if (pd->state.skillbonus && pd->bonus->delay > 0) { + bonus = 0; timer = pd->bonus->delay*1000; // the duration until pet bonuses will be reactivated again - if (timer <= 0) //Always active bonus - timer = MIN_PETTHINKTIME; } else if (pd->pet.intimate) { - pd->state.skillbonus = 1; + bonus = 1; timer = pd->bonus->duration*1000; // the duration for pet bonuses to be in effect } else { //Lost pet... pd->bonus->timer = -1; return 0; } - status_calc_pc(sd, 0); + if (pd->state.skillbonus != bonus) { + pd->state.skillbonus = bonus; + status_calc_pc(sd, 0); + } // wait for the next timer pd->bonus->timer=add_timer(tick+timer,pet_skill_bonus_timer,sd->bl.id,0); - return 0; } -- cgit v1.2.3-60-g2f50