summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 14:39:38 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 14:39:38 +0000
commitcb1d2d92afbf8d9ebec4c9290a180835ad5dae78 (patch)
tree0a25e15fd6687a6f99764e794a49e97c04524cba /src
parent4d34cd6ca7f80bf298c9837b27d1b5cc7d294098 (diff)
downloadhercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.gz
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.bz2
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.xz
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.zip
- Cleaned up the last NJ update code.
- Added @ command `charspeed` - Fixed @jailfor using MAP_PRONTERA as jail instead of MAP_JAIL - Removed case for GS_SPREADATTACK on damage packets to see if the skill displays correctly now. - Corrected Deluge/Volcano/V. Gale overlaps so that the placing tiles are removed, NOT the ones who were already placed. - Made SC_SPEEDUP0 and SC_SPEEDUP1 use different icon IDs, to fix icon-confusion when both are enabled at a time. - Mob rude-attacked count is not reset now on picking a new char (gotta investigate this further) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8096 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c53
-rw-r--r--src/map/atcommand.h1
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/skill.c25
-rw-r--r--src/map/status.c7
-rw-r--r--src/map/status.h4
7 files changed, 72 insertions, 26 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 640fcba90..7fac911d9 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -63,6 +63,7 @@ ACMD_FUNC(happyhappyjoyjoy); // [Valaris]
ACMD_FUNC(save);
ACMD_FUNC(load);
ACMD_FUNC(speed);
+ACMD_FUNC(charspeed);
ACMD_FUNC(storage);
ACMD_FUNC(guildstorage);
ACMD_FUNC(option);
@@ -338,6 +339,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_Load, "@return", 40, atcommand_load },
{ AtCommand_Load, "@load", 40, atcommand_load },
{ AtCommand_Speed, "@speed", 40, atcommand_speed },
+ { AtCommand_CharSpeed, "@charspeed", 40, atcommand_charspeed },
{ AtCommand_Storage, "@storage", 1, atcommand_storage },
{ AtCommand_GuildStorage, "@gstorage", 50, atcommand_guildstorage },
{ AtCommand_Option, "@option", 40, atcommand_option },
@@ -2140,6 +2142,53 @@ int atcommand_speed(
*
*------------------------------------------
*/
+int atcommand_charspeed(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ struct map_session_data *pl_sd;
+ int speed;
+
+ nullpo_retr(-1, sd);
+
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+
+ if (!message || !*message || sscanf(message, "%d %23[^\n]", speed, atcmd_player_name) < 2) {
+ sprintf(atcmd_output, "Please, enter a speed and a player name (usage: @charspeed <speed <%d-%d>> <char name>).", MIN_WALK_SPEED, MAX_WALK_SPEED);
+ clif_displaymessage(fd, atcmd_output);
+ return -1;
+ }
+
+ if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
+ clif_displaymessage(fd, msg_table[3]); // Character not found.
+ return -1;
+ }
+
+ if (pc_isGM(sd) < pc_isGM(pl_sd))
+ { //GM level check
+ clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player.
+ return -1;
+ }
+
+ if (speed >= MIN_WALK_SPEED && speed <= MAX_WALK_SPEED) {
+ pl_sd->base_status.speed = speed;
+ status_calc_bl(&pl_sd->bl, SCB_SPEED);
+ clif_displaymessage(fd, msg_table[8]); // Speed changed.
+ if(pl_sd->fd)
+ clif_displaymessage(pl_sd->fd, msg_table[8]); // Speed changed.
+ } else {
+ sprintf(atcmd_output, "Please, enter a valid speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED);
+ clif_displaymessage(fd, atcmd_output);
+ return -1;
+ }
+ return 0;
+}
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
int atcommand_storage(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
@@ -6607,11 +6656,11 @@ int atcommand_jailfor(
switch(rand()%2)
{
case 1: //Jail #1
- m_index = mapindex_name2id(MAP_PRONTERA);
+ m_index = mapindex_name2id(MAP_JAIL);
x = 49; y = 75;
break;
default: //Default Jail
- m_index = mapindex_name2id(MAP_PRONTERA);
+ m_index = mapindex_name2id(MAP_JAIL);
x = 24; y = 75;
break;
}
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index d199f364f..f33e49ba5 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -26,6 +26,7 @@ enum AtCommandType {
AtCommand_Save,
AtCommand_Load,
AtCommand_Speed,
+ AtCommand_CharSpeed,
AtCommand_Storage,
AtCommand_GuildStorage,
AtCommand_Option,
diff --git a/src/map/battle.c b/src/map/battle.c
index 4a84744d1..225cc9670 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -325,13 +325,13 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if(sc->data[SC_UTSUSEMI].timer != -1 && !skill_num)
{
clif_skill_nodamage(bl,bl,NJ_UTSUSEMI,1,1);
- skill_blown (src, bl, sc->data[SC_UTSUSEMI].val3|(map_calc_dir(bl,src->x,src->y)<<20));
+ skill_blown (src, bl, sc->data[SC_UTSUSEMI].val3);
if (--sc->data[SC_UTSUSEMI].val2 <= 0)
status_change_end(bl, SC_UTSUSEMI, -1);
return 0;
}
- if(sc->data[SC_BUNSINJYUTSU].timer != -1 && (flag&BF_WEAPON || flag&BF_MISC) )
+ if(sc->data[SC_BUNSINJYUTSU].timer != -1 && (flag&(BF_WEAPON|BF_MISC)) )
{
clif_skill_nodamage(bl,bl,NJ_BUNSINJYUTSU,1,1);
if (--sc->data[SC_BUNSINJYUTSU].val2 <= 0)
@@ -340,7 +340,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
}
//Now damage increasing effects
- if(sc->data[SC_AETERNA].timer!=-1 && skill_num != PA_PRESSURE && skill_num != PF_SOULBURN && skill_num != NJ_ZENYNAGE){
+ if(sc->data[SC_AETERNA].timer!=-1 && skill_num != PA_PRESSURE && skill_num != PF_SOULBURN){
damage<<=1;
status_change_end( bl,SC_AETERNA,-1 );
}
diff --git a/src/map/mob.c b/src/map/mob.c
index b4bd0750c..a06cc3731 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1139,7 +1139,7 @@ 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;
+ //md->attacked_count = 0; //Should we reset rude attack count?
md->min_chase = dist+md->db->range3;
if(md->min_chase>MAX_MINCHASE)
md->min_chase=MAX_MINCHASE;
diff --git a/src/map/skill.c b/src/map/skill.c
index 47d151f6c..f9b229377 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -770,7 +770,7 @@ int skill_get_range2 (struct block_list *bl, int id, int lv)
case SN_SHARPSHOOTING:
case HT_POWER:
if (bl->type == BL_PC)
- range += pc_checkskill((struct map_session_data *)bl, AC_VULTURE);
+ range += pc_checkskill((TBL_PC*)bl, AC_VULTURE);
else
range += 10; //Assume level 10?
break;
@@ -782,13 +782,13 @@ int skill_get_range2 (struct block_list *bl, int id, int lv)
case GS_SPREADATTACK:
case GS_GROUNDDRIFT:
if (bl->type == BL_PC)
- range += pc_checkskill((struct map_session_data *)bl, GS_SNAKEEYE);
+ range += pc_checkskill((TBL_PC*)bl, GS_SNAKEEYE);
else
range += 10; //Assume level 10?
break;
case NJ_KIRIKAGE:
if (bl->type == BL_PC)
- range = skill_get_range(NJ_SHADOWJUMP,pc_checkskill((struct map_session_data *)bl,NJ_SHADOWJUMP));
+ range = skill_get_range(NJ_SHADOWJUMP,pc_checkskill((TBL_PC*)bl,NJ_SHADOWJUMP));
break;
}
@@ -1999,7 +1999,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case SM_MAGNUM:
case AS_SPLASHER:
case ASC_METEORASSAULT:
- case GS_SPREADATTACK:
+// case GS_SPREADATTACK: <- as it is, it shows no animation at all.
dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, skillid, -1, 5);
break;
case KN_BRANDISHSPEAR:
@@ -3207,9 +3207,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
status_change_end(src, SC_HIDING, -1);
skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
if (unit_movepos(src, bl->x, bl->y, 0, 0))
- {
+ { //FIXME: Why are you sending a packet to LIE about where the character is?
+ //If you want to place yourself adjacent to the target, do the proper coding..?
int dir = unit_getdir(src);
-
clif_slide(src,src->x - dirx[dir],src->y - diry[dir]);
}
break;
@@ -3783,15 +3783,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
break;
case NJ_BUNSINJYUTSU:
- {
- struct status_change *sc;
- sc = status_get_sc(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,
+ clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-
- if (sc && sc->data[SC_NEN].timer != -1)
- status_change_end(bl,SC_NEN,-1);
- }
+ if (tsc && tsc->data[SC_NEN].timer != -1)
+ status_change_end(bl,SC_NEN,-1);
break;
case CG_MOONLIT:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -9339,7 +9334,7 @@ int skill_landprotector (struct block_list *bl, va_list ap)
case SA_VOLCANO:
case SA_DELUGE:
case SA_VIOLENTGALE:
- skill_delunit(unit);
+ (*alive) = 0;
return 1;
}
break;
diff --git a/src/map/status.c b/src/map/status.c
index 3c75ee226..9752483d4 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -403,8 +403,8 @@ void initChangeTables(void) {
StatusIconChangeTable[SC_ASPDPOTION1] = SI_ASPDPOTION;
StatusIconChangeTable[SC_ASPDPOTION2] = SI_ASPDPOTION;
StatusIconChangeTable[SC_ASPDPOTION3] = SI_ASPDPOTION;
- StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION;
- StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION;
+ StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION1;
+ StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION2;
StatusIconChangeTable[SC_MIRACLE] = SI_SPIRIT;
//Other SC which are not necessarily associated to skills.
@@ -5406,10 +5406,11 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
case SC_UTSUSEMI:
val2=(val1+1)/2; // number of hits blocked
- val3=7; // move you back 7 cells
+ val3=skill_get_blewcount(NJ_UTSUSEMI, val1); //knockback value.
break;
case SC_BUNSINJYUTSU:
val2=(val1+1)/2; // number of hits blocked
+ break;
default:
if (calc_flag == SCB_NONE && StatusSkillChangeTable[type]==0)
{ //Status change with no calc, and no skill associated...? unknown?
diff --git a/src/map/status.h b/src/map/status.h
index 46b16c02b..104750f98 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -308,8 +308,8 @@ enum {
//38: Again Aspd Potion
//39: Again Aspd Potion
//40: Again Aspd Potion
- SI_SPEEDPOTION = 41,
- //42: Again Speed Up
+ SI_SPEEDPOTION1 = 41,
+ SI_SPEEDPOTION2 = 42,
SI_STRIPWEAPON = 50,
SI_STRIPSHIELD = 51,
SI_STRIPARMOR = 52,