summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-30 17:53:18 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-30 17:53:18 +0000
commit5d2225fbbf84324c1cf370bb11776b1c0a671b4a (patch)
tree448f2af719809cbc0a733729be8017de4b5c57a7
parentb47c0ac38a3b04b6e5b0001608e726de3e93448f (diff)
downloadhercules-5d2225fbbf84324c1cf370bb11776b1c0a671b4a.tar.gz
hercules-5d2225fbbf84324c1cf370bb11776b1c0a671b4a.tar.bz2
hercules-5d2225fbbf84324c1cf370bb11776b1c0a671b4a.tar.xz
hercules-5d2225fbbf84324c1cf370bb11776b1c0a671b4a.zip
- Set the inf2 to encore skills of Wand of Hermode
- Modified battle_calc_return_damage to take the skill id as well, now magic damage return will not work on skills tagged as ground or self targetted. - Fixed Gank not working at all with the default max steal tries setting. - Soul Drain won't work with skills tagged as self-targetted. - Improved the Suiton code so that the walk/agi penalty only applies to enemies of whoever casted the skill. - Moved the initial status_calc_pc call to when you finish loading the map, should fix equipment scripts which are based on character variables not working. - Some cleanup of the clif_parse_LoadEndAck function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9099 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt11
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/skill_db.txt2
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/clif.c74
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/skill.c14
-rw-r--r--src/map/status.c11
9 files changed, 73 insertions, 55 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index adc8459b5..e2d98da83 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,17 @@ 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/10/30
+ * Modified battle_calc_return_damage to take the skill id as well, now
+ magic damage return will not work on skills tagged as ground or self
+ targetted. [Skotlex]
+ * Fixed Gank not working at all with the default max steal tries setting.
+ [Skotlex]
+ * Soul Drain won't work with skills tagged as self-targetted. [Skotlex]
+ * Improved the Suiton code so that the walk/agi penalty only applies to
+ enemies of whoever casted the skill. [Skotlex]
+ * Moved the initial status_calc_pc call to when you finish loading the map,
+ should fix equipment scripts which are based on character variables not
+ working. [Skotlex]
* Fixed getcharid according to samples and docs. [Lupus]
Thanks to joshuaali for pointing it out. eAPP has no such bug
2006/10/27
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 31338e6ea..c91bd6dee 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -19,6 +19,8 @@
-----
========================
+10/30
+ * Set the inf2 to encore skills of Wand of Hermode [Skotlex]
10/29
* Official NJ/GS exp chart for level 1-48 [Playtester]
* Added Shinobi Sash to Shinobi drops [Playtester]
diff --git a/db/skill_db.txt b/db/skill_db.txt
index 602e1d670..751d9c5a4 100644
--- a/db/skill_db.txt
+++ b/db/skill_db.txt
@@ -511,7 +511,7 @@
485,-2,6,1,-1,0,0,10,1,no,0,0,0,weapon,0 //WS_CARTTERMINATION#Cart Termination#
486,0,6,4,0,1,0,5,1,no,0,0,0,weapon,0 //WS_OVERTHRUSTMAX#Maximum Power Thrust#
487,0,6,4,0,1,0,5,1,no,0,0,0,none,0 //CG_LONGINGFREEDOM#Longing for Freedom#
-488,0,6,4,0,1,3,5,1,no,0,0,0,misc,0 //CG_HERMODE#Wand of Hermod#
+488,0,6,4,0,1,3,5,1,no,0,64,0,misc,0 //CG_HERMODE#Wand of Hermod#
489,9,6,1,0,1,0,5,1,no,0,0,0,misc,0 //CG_TAROTCARD#Tarot Card of Fate#
490,9,8,1,0,0,0,10,1:2:3:4:5:6:7:8:9:10,yes,0,0,0,misc,0 //CR_ACIDDEMONSTRATION#Acid Demonstration#
491,1,6,2,0,1,0,2,1,no,0,0,0,none,0 //CR_CULTIVATION#Cultivation#
diff --git a/src/map/battle.c b/src/map/battle.c
index 6a4dbf98f..6d6c928d7 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2761,7 +2761,7 @@ struct Damage battle_calc_attack( int attack_type,
return d;
}
-int battle_calc_return_damage(struct block_list *bl, int *damage, int flag) {
+int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag) {
struct map_session_data *sd=NULL;
struct status_change *sc;
int rdamage = 0;
@@ -2793,7 +2793,9 @@ int battle_calc_return_damage(struct block_list *bl, int *damage, int flag) {
// magic_damage_return by [AppleGirl] and [Valaris]
if(flag&BF_MAGIC)
{
- if(sd && sd->magic_damage_return && rand()%100 < sd->magic_damage_return)
+ if(sd && sd->magic_damage_return &&
+ !(skill_get_inf(skill)&(INF_GROUND_SKILL|INF_SELF_SKILL)) &&
+ rand()%100 < sd->magic_damage_return)
{ //Bounces back full damage, you take none.
rdamage = *damage;
*damage = 0;
@@ -2980,7 +2982,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
damage = wd.damage + wd.damage2;
if (damage > 0 && src != target) {
- rdamage = battle_calc_return_damage(target, &damage, wd.flag);
+ rdamage = battle_calc_return_damage(target, 0, &damage, wd.flag);
if (rdamage > 0) {
rdelay = clif_damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0);
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]
diff --git a/src/map/battle.h b/src/map/battle.h
index b27a27878..423591481 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -25,7 +25,7 @@ struct block_list;
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag);
-int battle_calc_return_damage(struct block_list *bl, int *damage, int flag);
+int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag);
void battle_drain(struct map_session_data *sd, struct block_list *tbl, int rdamage, int ldamage, int race, int boss);
diff --git a/src/map/clif.c b/src/map/clif.c
index 6bfe4ef50..ef1499cd9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8218,11 +8218,30 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->npc_id) npc_event_dequeue(sd);
if(sd->state.connect_new) {
+ status_calc_pc(sd,1);
+
+ if (sd->sc.option&OPTION_FALCON)
+ clif_status_load(&sd->bl, SI_FALCON, 1);
+ if (sd->sc.option&OPTION_RIDING)
+ clif_status_load(&sd->bl, SI_RIDING, 1);
+
+ //Auron reported that This skill only triggers when you logon on the map o.O [Skotlex]
+ if ((i = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) {
+ if(sd->bl.m == sd->feel_map[0].m
+ || sd->bl.m == sd->feel_map[1].m
+ || sd->bl.m == sd->feel_map[2].m)
+ sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i));
+ }
+
clif_skillinfoblock(sd);
clif_updatestatus(sd,SP_NEXTBASEEXP);
clif_updatestatus(sd,SP_NEXTJOBEXP);
clif_updatestatus(sd,SP_SKILLPOINT);
clif_initialstatus(sd);
+ //Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex]
+ //[LuzZza]
+ //clif_guild_send_onlineinfo(sd);
+
} else {
//For some reason the client "loses" these on map-change.
clif_updatestatus(sd,SP_STR);
@@ -8298,6 +8317,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_send_petdata(sd,0,0);
clif_send_petdata(sd,5,battle_config.pet_hair_style);
clif_send_petstatus(sd);
+
+ if(sd->state.connect_new && sd->pd->pet.intimate > 900)
+ clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd));
}
//homunculus [blackhole89]
@@ -8311,9 +8333,23 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_homskillinfoblock(sd);
}
+ // view equipment item
+#if PACKETVER < 4
+ clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
+#else
+ clif_changelook(&sd->bl,LOOK_WEAPON,0);
+#endif
+
+ if(sd->vd.cloth_color)
+ clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
+
+ if(sd->status.manner < 0)
+ sc_start(&sd->bl,SC_NOCHAT,100,0,0);
+
if(sd->state.connect_new) {
- sd->state.connect_new = 0;
//Delayed night effect on log-on fix for the glow-issue. Thanks to Larry.
+ sd->state.connect_new = 0;
if (night_flag) {
char tmpstr[1024];
strcpy(tmpstr, msg_txt(500)); // Actually, it's the night...
@@ -8322,28 +8358,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if (map[sd->bl.m].flag.nightenabled)
add_timer(gettick()+1000,clif_nighttimer,sd->bl.id,0);
}
-
-// if(sd->status.class_ != sd->vd.class_)
-// clif_refreshlook(&sd->bl,sd->bl.id,LOOK_BASE,sd->vd.class_,SELF);
-
- if (sd->sc.option&OPTION_FALCON)
- clif_status_load(&sd->bl, SI_FALCON, 1);
- if (sd->sc.option&OPTION_RIDING)
- clif_status_load(&sd->bl, SI_RIDING, 1);
-
- //Auron reported that This skill only triggers when you logon on the map o.O [Skotlex]
- if ((i = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) {
- if(sd->bl.m == sd->feel_map[0].m
- || sd->bl.m == sd->feel_map[1].m
- || sd->bl.m == sd->feel_map[2].m)
- sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i));
- }
-
- if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 900)
- clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd));
- //Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex]
- //[LuzZza]
- //clif_guild_send_onlineinfo(sd);
//On Login Script.
npc_script_event(sd, NPCE_LOGIN);
} else
@@ -8360,20 +8374,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_status_load(&sd->bl, SI_NIGHT, 0);
}
- // view equipment item
-#if PACKETVER < 4
- clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
- clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
-#else
- clif_changelook(&sd->bl,LOOK_WEAPON,0);
-#endif
-
- if(sd->vd.cloth_color)
- clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
-
- if(sd->status.manner < 0)
- sc_start(&sd->bl,SC_NOCHAT,100,0,0);
-
// Lance
if(sd->state.event_loadmap && map[sd->bl.m].flag.loadevent){
pc_setregstr(sd, add_str("@maploaded$"), map[sd->bl.m].name);
diff --git a/src/map/pc.c b/src/map/pc.c
index 3f9e5eb3d..210181527 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -705,8 +705,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
sd->state.event_kill_pc = 1;
sd->state.event_disconnect = 1;
sd->state.event_kill_mob = 1;
-
- status_calc_pc(sd,1);
sd->state.auth = 1; //Do not auth him until the initial stats have been placed.
{ //Add IP field
@@ -749,8 +747,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
}
- if(sd->status.manner < 0) //Needed or manner will always be negative.
- sc_start(&sd->bl,SC_NOCHAT,100,0,0);
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 8559581cb..3c8a956e8 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1023,7 +1023,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
skill_castend_damage_id(src,bl,HT_BLITZBEAT,(skill<lv)?skill:lv,tick,SD_LEVEL);
}
// Gank
- if(dstmd && dstmd->state.steal_flag<battle_config.skill_steal_max_tries && sd->status.weapon != W_BOW &&
+ if(dstmd && sd->status.weapon != W_BOW &&
(skill=pc_checkskill(sd,RG_SNATCHER)) > 0 &&
(skill*15 + 55) + pc_checkskill(sd,TF_STEAL)*10 > rand()%1000) {
if(pc_steal_item(sd,bl,pc_checkskill(sd,TF_STEAL)))
@@ -1520,7 +1520,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
}
if(sd && skillid && attack_type&BF_MAGIC && status_isdead(bl) &&
- skill_get_inf(skillid)!=INF_GROUND_SKILL &&
+ !(skill_get_inf(skillid)&(INF_GROUND_SKILL|INF_SELF_SKILL)) &&
(rate=pc_checkskill(sd,HW_SOULDRAIN))>0
){ //Soul Drain should only work on targetted spells [Skotlex]
if (pc_issit(sd)) pc_setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex]
@@ -1888,7 +1888,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
damage = dmg.damage + dmg.damage2;
if (damage > 0 && src != bl && src == dsrc)
- rdamage = battle_calc_return_damage(bl, &damage, dmg.flag);
+ rdamage = battle_calc_return_damage(bl, skillid, &damage, dmg.flag);
//Skill hit type
type=(skillid==0)?5:skill_get_hit(skillid);
@@ -6877,11 +6877,17 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
case UNT_VOLCANO:
case UNT_DELUGE:
case UNT_VIOLENTGALE:
- case UNT_SUITON:
if(sc && sc->data[type].timer==-1)
sc_start(bl,type,100,sg->skill_lv,sg->limit);
break;
+ case UNT_SUITON:
+ if(sc && sc->data[type].timer==-1)
+ sc_start4(bl,type,100,sg->skill_lv,
+ battle_check_target(&src->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi.
+ 0,0,sg->limit);
+ break;
+
case UNT_RICHMANKIM:
case UNT_ETERNALCHAOS:
case UNT_DRUMBATTLEFIELD:
diff --git a/src/map/status.c b/src/map/status.c
index 126ee5ae1..8ee4d5780 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3150,7 +3150,7 @@ static unsigned short status_calc_agi(struct block_list *bl, struct status_chang
agi -= sc->data[SC_DECREASEAGI].val2;
if(sc->data[SC_QUAGMIRE].timer!=-1)
agi -= sc->data[SC_QUAGMIRE].val2;
- if(sc->data[SC_SUITON].timer!=-1 && sc->data[SC_SUITON].val3) // does not affect players when not in PVP nor WoE. Does not affect Ninjas.
+ if(sc->data[SC_SUITON].timer!=-1 && sc->data[SC_SUITON].val3)
agi -= sc->data[SC_SUITON].val2;
if(sc->data[SC_MARIONETTE].timer!=-1)
agi -= (sc->data[SC_MARIONETTE].val3>>8)&0xFF;
@@ -4919,11 +4919,12 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
val2 = 0;
break;
case SC_SUITON:
- val2 = 0; //Agi penalty
- val3 = 0; //Walk speed penalty
- if (status_get_class(bl) == JOB_NINJA ||
- (sd && !map_flag_vs(bl->m)))
+ if (!val2 || (sd && (sd->class_&MAPID_UPPERMASK) == MAPID_NINJA)) {
+ //No penalties.
+ val2 = 0; //Agi penalty
+ val3 = 0; //Walk speed penalty
break;
+ }
val3 = 50;
val2 = 3*((val1+1)/3);
if (val1 > 4) val2--;