summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 15:54:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 15:54:46 +0000
commitab7c57743e1807cca8c994a38137065f5b174a0c (patch)
treeb0ce5fb7df134de5b0de0f1d7caca61940022396 /src
parent29a426dac900b815634989355199bd6d7bce4fae (diff)
downloadhercules-ab7c57743e1807cca8c994a38137065f5b174a0c.tar.gz
hercules-ab7c57743e1807cca8c994a38137065f5b174a0c.tar.bz2
hercules-ab7c57743e1807cca8c994a38137065f5b174a0c.tar.xz
hercules-ab7c57743e1807cca8c994a38137065f5b174a0c.zip
- Added RUDE_ATTACKED_COUNT so you can easily adjust how many rude-attacks should happen before a mob uses the rude-attacked skill. Value has been set to 2 for now.
- Now when a mob changes target (to someone they can hit) their rude-attacked count won't be reset, but instead will be reduced by one. - SC_SPEEDUP0 can now stack with the other speed raising buffs. - Changed the inf2 value of SA_DISPEL so it can be casted on party/guild mates, but not yourself. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8104 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c12
-rw-r--r--src/map/status.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index a06cc3731..f9e85dc57 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -43,6 +43,9 @@
#define MOB_LAZYWARPPERC 20 // Warp probability in the negligent mode MOB (rate of 1000 minute)
#define MAX_MINCHASE 30 //Max minimum chase value to use for mobs.
+
+#define RUDE_ATTACKED_COUNT 2 //After how many rude-attacks should the skill be used?
+
//Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
struct mob_db *mob_db_data[MAX_MOB_DB+1];
struct mob_db *mob_dummy = NULL; //Dummy mob to be returned when a non-existant one is requested.
@@ -1105,7 +1108,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
!battle_check_range(&md->bl, tbl, md->status.rhw.range))
{ //Rude-attacked (avoid triggering due to can-walk delay).
if (DIFF_TICK(tick, md->ud.canmove_tick) > 0 &&
- md->attacked_count++ > 3)
+ md->attacked_count++ >= RUDE_ATTACKED_COUNT)
mobskill_use(md, tick, MSC_RUDEATTACKED);
}
} else
@@ -1120,7 +1123,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
((TBL_PC*)abl)->state.gangsterparadise
)
) { //Can't attack back
- if (md->attacked_count++ > 3) {
+ if (md->attacked_count++ >= RUDE_ATTACKED_COUNT) {
if (mobskill_use(md, tick, MSC_RUDEATTACKED) == 0 && can_move)
{
int dist = rand() % 10 + 1;//Œã‘Þ‚·‚é‹——£
@@ -1139,7 +1142,8 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
//or if the previous target is not attacking the mob. [Skotlex]
md->target_id = md->attacked_id; // set target
md->state.aggressive = 0; //Retaliating.
- //md->attacked_count = 0; //Should we reset rude attack count?
+ if (md->attacked_count)
+ md->attacked_count--; //Should we reset rude attack count?
md->min_chase = dist+md->db->range3;
if(md->min_chase>MAX_MINCHASE)
md->min_chase=MAX_MINCHASE;
@@ -2676,7 +2680,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
case MSC_SKILLUSED: // specificated skill used
flag = ((event & 0xffff) == MSC_SKILLUSED && ((event >> 16) == c2 || c2 == 0)); break;
case MSC_RUDEATTACKED:
- flag = (md->attacked_count >= 3);
+ flag = (md->attacked_count >= RUDE_ATTACKED_COUNT);
if (flag) md->attacked_count = 0; //Rude attacked count should be reset after the skill condition is met. Thanks to Komurka [Skotlex]
break;
case MSC_MASTERHPLTMAXRATE:
diff --git a/src/map/status.c b/src/map/status.c
index 9752483d4..81b8641dd 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3422,10 +3422,10 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
if(sc->data[SC_WEDDING].timer!=-1)
speed += 300;
- //% increases (they don't stack)
+ //% increases (they don't stack, with the exception of Speedup1? @.@)
if(sc->data[SC_SPEEDUP1].timer!=-1)
speed -= speed * 50/100;
- else if(sc->data[SC_SPEEDUP0].timer!=-1)
+ if(sc->data[SC_SPEEDUP0].timer!=-1)
speed -= speed * 25/100;
else if(sc->data[SC_INCREASEAGI].timer!=-1)
speed -= speed * 25/100;