summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 02:31:08 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 02:31:08 +0000
commit59208abde035ebeea609b043055614616afb72f1 (patch)
tree1f55277a529095e4480547af91528284e7e53635
parentf27a5dd6038f94d5f8ef015c700b4c6bc7fc1cc1 (diff)
downloadhercules-59208abde035ebeea609b043055614616afb72f1.tar.gz
hercules-59208abde035ebeea609b043055614616afb72f1.tar.bz2
hercules-59208abde035ebeea609b043055614616afb72f1.tar.xz
hercules-59208abde035ebeea609b043055614616afb72f1.zip
- Fixed pets ignoring can-act delays for skill usage.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6870 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--doc/client_packet.txt2
-rw-r--r--src/map/pet.c12
3 files changed, 13 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 1bcc6f943..8a2cc4540 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/30
+ * Fixed pets ignoring can-act delays for skill usage. [Skotlex]
* [Added]:
- Mercenary.c in VS.NET 2005 project files
[Improved]:
diff --git a/doc/client_packet.txt b/doc/client_packet.txt
index 0b39da3c7..e763ab5f6 100644
--- a/doc/client_packet.txt
+++ b/doc/client_packet.txt
@@ -108,7 +108,7 @@ S 0072 <account ID>.l <charactor ID>.l <login ID1>.l <login ID2>.l <sex>.b
ゲーム鯖接続要求
R 0073 <server tick>.l <coordidate>.3B ?.2B
ゲーム鯖接続成功&サーバ側1ms時計&出現位置
-R 0078 <ID>.l <speed>.w <opt1>.w <opt2>.w <option>.w <class>.w <hair>.w <weapon>.w <head option bottom>.w <sheild>.w <head option top>.w <head option mid>.w <hair color>.w ?.w <head dir>.w <guild>.l <emblem>.l <manner>.w <karma>.B <sex>.B <X_Y_dir>.3B ?.B ?.B <sit>.B <Lv>.B
+R 0078 <ID>.l <speed>.w <opt1>.w <opt2>.w <option>.w <class>.w <hair>.w <weapon>.w <head option bottom>.w <sheild>.w <head option top>.w <head option mid>.w <hair color>.w <cloth color>.w <head dir>.w <guild>.l <emblem>.l <manner>.w <karma>.B <sex>.B <X_Y_dir>.3B ?.B ?.B <sit>.B <Lv>.B
マップロード時&移動時用、向き付き用キャラ情報?
R 0079 <ID>.l <speed>.w <opt1>.w <opt2>.w <option>.w <class>.w <hair>.w <weapon>.w <head option bottom>.w <sheild>.w <head option top>.w <head option mid>.w <hair color>.w ?.w <head dir>.w <guild>.l <emblem>.l <manner>.w <karma>.B <sex>.B <X_Y_dir>.3B ?.B ?.B <Lv>.B
テレポ等の表示範囲内沸きキャラ用、向き付き無しキャラ情報?
diff --git a/src/map/pet.c b/src/map/pet.c
index 2b349daff..8fe9c9c72 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -130,12 +130,16 @@ int pet_attackskill(struct pet_data *pd, int target_id)
(battle_config.pet_equip_required && !pd->equip))
return 0;
+ if (DIFF_TICK(pd->ud.canact_tick, gettick()) > 0)
+ return 0;
+
if (rand()%100 < (pd->a_skill->rate +pd->msd->pet.intimate*pd->a_skill->bonusrate/1000))
{ //Skotlex: Use pet's skill
bl=map_id2bl(target_id);
if(bl == NULL || pd->bl.m != bl->m || bl->prev == NULL || status_isdead(bl) ||
!check_distance_bl(&pd->bl, bl, pd->db->range3))
return 0;
+
if (skill_get_inf(pd->a_skill->id) & INF_GROUND_SKILL)
unit_skilluse_pos(&pd->bl, bl->x, bl->y, pd->a_skill->id, pd->a_skill->lv);
else
@@ -1217,13 +1221,19 @@ int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
}
status = status_get_status_data(&sd->bl);
+
+ if (DIFF_TICK(pd->ud.canact_tick, tick) > 0)
+ { //Wait until the pet can act again.
+ pd->s_skill->timer=add_timer(pd->ud.canact_tick,pet_skill_support_timer,sd->bl.id,0);
+ return 0;
+ }
if(pc_isdead(sd) ||
(rate = status->sp*100/status->max_sp) > pd->s_skill->sp ||
(rate = status->hp*100/status->max_hp) > pd->s_skill->hp ||
(rate = (pd->ud.skilltimer != -1)) //Another skill is in effect
) { //Wait (how long? 1 sec for every 10% of remaining)
- pd->s_skill->timer=add_timer(gettick()+(rate>10?rate:10)*100,pet_skill_support_timer,sd->bl.id,0);
+ pd->s_skill->timer=add_timer(tick+(rate>10?rate:10)*100,pet_skill_support_timer,sd->bl.id,0);
return 0;
}