summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c31
-rw-r--r--src/map/atcommand.h1
-rw-r--r--src/map/pc.c15
-rw-r--r--src/map/skill.c5
4 files changed, 48 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 12c6e5ff3..19818a441 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -190,6 +190,7 @@ ACMD_FUNC(storeall); // by MouseJstr
ACMD_FUNC(charstoreall); // by MouseJstr
ACMD_FUNC(skillid); // by MouseJstr
ACMD_FUNC(useskill); // by MouseJstr
+ACMD_FUNC(displayskill); // by MouseJstr
ACMD_FUNC(summon);
ACMD_FUNC(rain);
ACMD_FUNC(snow);
@@ -508,6 +509,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_Charstoreall, "@charstoreall", 60, atcommand_charstoreall }, // MouseJstr
{ AtCommand_Skillid, "@skillid", 40, atcommand_skillid }, // MouseJstr
{ AtCommand_Useskill, "@useskill", 40, atcommand_useskill }, // MouseJstr
+ { AtCommand_DisplaySkill, "@displayskill", 99, atcommand_displayskill }, // MouseJstr
// { AtCommand_Rain, "@rain", 99, atcommand_rain }, //Client no longer supports rain!
{ AtCommand_Snow, "@snow", 99, atcommand_snow },
{ AtCommand_Sakura, "@sakura", 99, atcommand_sakura },
@@ -7217,6 +7219,35 @@ int atcommand_useskill(const int fd, struct map_session_data* sd, const char* co
}
/*==========================================
+ * @showskill by [Skotlex]
+ * Debug command to locate new skill IDs. It sends the
+ * three possible skill-effect packets to the area.
+ *------------------------------------------
+ */
+int atcommand_displayskill(const int fd, struct map_session_data* sd, const char* command, const char* message)
+{
+ struct status_data * status;
+ unsigned int tick;
+ int skillnum;
+ int skilllv = 1;
+ nullpo_retr(-1, sd);
+
+ if (!message || !*message ||
+ sscanf(message, "%d %d", &skillnum, &skilllv) < 1)
+ {
+ clif_displaymessage(fd, "Usage: @displayskill <skillnum> {<skillv>}>");
+ return -1;
+ }
+ status = status_get_status_data(&sd->bl);
+ tick = gettick();
+ clif_skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion,
+ 1, 1, skillnum, skilllv, 5);
+ clif_skill_nodamage(&sd->bl, &sd->bl, skillnum, skilllv, 1);
+ clif_skill_poseffect(&sd->bl, skillnum, skilllv, sd->bl.x, sd->bl.y, tick);
+ return 0;
+}
+
+/*==========================================
* @skilltree by [MouseJstr]
* prints the skill tree for a player required to get to a skill
*------------------------------------------
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 19b0e27f4..9d4880cb3 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -172,6 +172,7 @@ enum AtCommandType {
AtCommand_Charstoreall, // by MouseJstr
AtCommand_Skillid, // by MouseJstr
AtCommand_Useskill, // by MouseJstr
+ AtCommand_DisplaySkill,
AtCommand_Summon,
AtCommand_Rain,
AtCommand_Snow,
diff --git a/src/map/pc.c b/src/map/pc.c
index eca06237d..7ea090113 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1442,7 +1442,20 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
switch (sd->state.lr_flag)
{
case 2:
- sd->arrow_ele=val;
+ switch (sd->status.weapon) {
+ case W_BOW:
+ case W_REVOLVER:
+ case W_RIFLE:
+ case W_SHOTGUN:
+ case W_GATLING:
+ case W_GRENADE:
+ //Become weapon element.
+ status->rhw.ele=val;
+ break;
+ default: //Become arrow element.
+ sd->arrow_ele=val;
+ break;
+ }
break;
case 1:
status->lhw->ele=val;
diff --git a/src/map/skill.c b/src/map/skill.c
index ce6f81aaf..d7334a079 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6770,9 +6770,8 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
{
int element[5]={ELE_WIND,ELE_DARK,ELE_POISON,ELE_WATER,ELE_FIRE};
- if (sd)
- val1=sd->arrow_ele;
- else
+ val1 = status->rhw.ele;
+ if (!val1)
val1=element[rand()%5];
switch (val1)