summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-14 13:46:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-14 13:46:14 +0000
commit4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0 (patch)
tree6f8c93989fac5b609363d112e91213387607e478 /src/map/pet.c
parentdca95417da6587e2bc8916cbc749b28430e82b84 (diff)
downloadhercules-4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0.tar.gz
hercules-4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0.tar.bz2
hercules-4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0.tar.xz
hercules-4be12e4c23f2a73543fa60ff3e0e0f4235a49ff0.zip
- 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
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c21
1 files changed, 11 insertions, 10 deletions
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;
}