Skip to content
Permalink
Browse files
*Added Skill Damage Adjustment!
- Disabled by default on src/config/core.h. Uncomment '#define ADJUST_SKILL_DAMAGE' to enable this skill damage adjustment
- Added skill_damage_db.txt (thank Lilith for 'Manage Skill Damage')
- Added new mapflag: 'skill_damage'. Please read 'doc/mapflags.txt' for more details
*Fixed bugreport:8029 (thank exneval for testing and reporting) (Akinari)
*Follow-up 647f99f (Akinari)
*Follow-up 15074d8: optimized item_isNoEquip check parts
*and some mirror changes
  • Loading branch information
cydh committed Aug 29, 2013
1 parent da390ca commit cd9a776f236bb3f372f43b32d75a5d4d4957a7cd
Showing with 496 additions and 82 deletions.
  1. +2 −1 conf/msg_conf/map_msg.conf
  2. +46 −0 db/skill_damage_db.txt
  3. +34 −1 doc/mapflags.txt
  4. +3 −0 npc/mapflag/skill_damage.txt
  5. +6 −5 npc/scripts_mapflags.conf
  6. +10 −0 src/config/core.h
  7. +41 −0 src/map/atcommand.c
  8. +154 −8 src/map/battle.c
  9. +14 −8 src/map/map.c
  10. +26 −2 src/map/map.h
  11. +2 −2 src/map/mob.c
  12. +49 −6 src/map/npc.c
  13. +7 −7 src/map/pc.c
  14. +51 −17 src/map/script.c
  15. +31 −23 src/map/skill.c
  16. +18 −0 src/map/skill.h
  17. +2 −2 src/map/status.c
@@ -887,7 +887,8 @@
1049: Weather Flags:
1050: Other Flags:
1051: Other Flags2:
//1052-1064 free
1052: Skill Damage Adjustments:
//1053-1064 free
1065: No Exp Penalty: %s | No Zeny Penalty: %s
1066: On
1067: Off
@@ -0,0 +1,46 @@
// Manage skill damage database
// ----------------------------------------------
// rAthena dev team
// ----------------------------------------------
// Credits:
// [Lilith]
// [Cydh]
// ----------------------------------------------
// <SkillName>,<Caster>,<Map>,<Damage against Players>{,<Damage against Mobs>{,<Damage against Bosses>{,<Damage against Other>}}}
// ----------------------------------------------
// Caster: The adjustment only works if the caster is (bitmask)
// 1 = Player
// 2 = Monster
// 4 = Pet
// 8 = Homunculus
// 16 = Mercenary
// 32 = Elemental
// Map:
// 1 - Normal (the maps that aren't classified as these maps below)
// 2 - PVP
// 4 - GVG
// 8 - Battlegrounds
// 16 - 'skill_damage' mapflag
// Restricted zones - they're configured by 'restricted <numberCastermapflag
// 32 - Zone 1
// 64 - Zone 2
// 128 - Zone 3
// 256 - Zone 4
// 512 - Zone 5
// 1024 - Zone 6
// 2048 - Zone 7
// Damage adjustments:
// Using value between -100 and 100000
// minus value that mean normal damage will be decreased, and positive is
// otherwise. 0 = no additional rate
// ----------------------------------------------
// Examples:
// 1. Mammonite: Normal maps, +50% player vs players, nothing else
//MC_MAMMONITE,1,1,50
// 2. Adoramus: PvP & GvG maps, if the caster is player: +50% vs player, +0% vs
// mob, +10% vs boss mob, +15% vs other
//AB_ADORAMUS,1,6,50,0,10,15
// 3. Asura Strike: Only deals half damage (-50%) if player vs player at PvP &
// GvG maps
//MO_EXTREMITYFIST,1,6,-50
// ----------------------------------------------
@@ -283,6 +283,39 @@ Notes:

---------------------------------------

*skill_damage {<skill_name>,<caster>,<damage1>,<damage2>,<damage3>,<damage4>}

Enable skill damage adjustment on this map that used for 'Map' field on
skill_damage_db.txt.

For advanced settings, this mapflag can be used to adjust damage of 'skill' if the caster
is 'caster', the damage will be added or reduced 'damage'% from normal damage.

<skill> is name of skill, look at skill_db.txt, not the skill id. Example SM_BASH.
<caster> is to decide who can trigger this adjustment, the invoker not only for player.
Using bitmask, and the available casters are:
1 = Player
2 = Monster
4 = Pet
8 = Homunculus
16 = Mercenary
32 = Elemental
<damage1> addition rate to against player
<damage2> addition rate to against normal monster
<damage3> addition rate to against boss monster
<damage4> addition rate to against other (homunculus, mercenary, pet, and elemetal)

Notes:
- If you want to adjust X skill, you need at least define 'skill' (skill name), 'caster',
and 'damage1'
- This mapflag can be used to adjust all skill damages, put "all" (without quotes) at
'skill' column
- Please put the damages value between -100 and 100000. 0 means no addition.
- One map can contains up to 5 skills adjustment
(max. value is defined on map.h, MAX_MAP_SKILL_MODIFIER)

---------------------------------------

==================
| 3. Map Effects |
==================
@@ -327,7 +360,7 @@ Allows usage of item Neuralizer (ID 12213).
*jexp <rate>

Changes the base and job experience rates on a map.
<rate> is given as a percentage (i.e. 100 = 1x EXP). This takes into account the modifiers
<ratecasters given as a percentage (i.e. 100 = 1x EXP). This takes into account the modifiers

This comment has been minimized.

Copy link
@cydh

cydh Aug 29, 2013

Author Contributor

err my Notepad++ is drunk, when double click something to selecting, it selects random place. Please fix this on next commit

This comment has been minimized.

Copy link
@euphyy

euphyy Aug 30, 2013

Contributor

Fixed in 1c7c002.

This comment has been minimized.

Copy link
@cydh

cydh Aug 30, 2013

Author Contributor

thank you. :D

'base_exp_rate' and 'job_exp_rate' in '/conf/battle/exp.conf'.

---------------------------------------
@@ -0,0 +1,3 @@
//============================================================
//<mapname> mapflag skill_damage {<skill_name>,<caster>,<damage1>,<damage2>,<damage3>,<damage4>}
//------------------------------------------------------------

This comment has been minimized.

Copy link
@cydh

cydh Aug 29, 2013

Author Contributor

please add 'rAthena Script Header' or remove this later. :P
but if the file isn't here, maybe this will be forgotten mapflag like other mapflags. Like, 'itemnoconsumption' most of user don't realize. XD

This comment has been minimized.

Copy link
@euphyy

euphyy Aug 30, 2013

Contributor

Added in 1c7c002.

This comment has been minimized.

Copy link
@cydh

cydh Aug 30, 2013

Author Contributor

thank you again. :D

@@ -1,26 +1,27 @@
// --------------------------------------------------------------
// - Map Flags -
// --------------------------------------------------------------
npc: npc/mapflag/nopvp.txt
npc: npc/mapflag/battleground.txt
npc: npc/mapflag/gvg.txt
npc: npc/mapflag/jail.txt
npc: npc/mapflag/night.txt
npc: npc/mapflag/nightmare.txt
npc: npc/mapflag/nobranch.txt
npc: npc/mapflag/noicewall.txt
npc: npc/mapflag/nomemo.txt
npc: npc/mapflag/nopenalty.txt
npc: npc/mapflag/nopvp.txt
npc: npc/mapflag/noreturn.txt
npc: npc/mapflag/nosave.txt
npc: npc/mapflag/noteleport.txt
npc: npc/mapflag/noreturn.txt
npc: npc/mapflag/noskill.txt
npc: npc/mapflag/nowarp.txt
npc: npc/mapflag/nowarpto.txt
//npc: npc/mapflag/partylock.txt
npc: npc/mapflag/pvp.txt
npc: npc/mapflag/pvp_noparty.txt
npc: npc/mapflag/pvp_noguild.txt
npc: npc/mapflag/night.txt
npc: npc/mapflag/restricted.txt
npc: npc/mapflag/battleground.txt
npc: npc/mapflag/town.txt
npc: npc/mapflag/reset.txt
npc: npc/mapflag/skill_damage.txt
npc: npc/mapflag/town.txt
@@ -59,6 +59,16 @@
/// Uncomment to enable real-time server stats (in and out data and ram usage).
//#define SHOW_SERVER_STATS

/// Uncomment to enable skill's damage adjustments [Cydh]
/// By enabling this, db/skill_damage.txt and skill_damage mapflag will be active to add
/// damage rate of specified skill againts player, monster, boss-monster, or other.
/// skill_damage mapflag is used to adjust damage of specified skill at specified map
//#define ADJUST_SKILL_DAMAGE
/// This MAX_SKILL_DAMAGE_RATE is used to cap max the rate
#ifdef ADJUST_SKILL_DAMAGE
#define MAX_SKILL_DAMAGE_RATE 100000
#endif

/**
* No settings past this point
**/
@@ -3846,6 +3846,38 @@ ACMD_FUNC(mapinfo) {
sprintf(atcmd_output, msg_txt(sd,1045),map[m_id].flag.battleground); // Battlegrounds ON (type %d)
clif_displaymessage(fd, atcmd_output);
}

/* Skill damage adjustment info [Cydh] */
#ifdef ADJUST_SKILL_DAMAGE
if (map[m_id].flag.skill_damage) {
int j;
clif_displaymessage(fd,msg_txt(sd,1052)); // Skill Damage Adjustments:
sprintf(atcmd_output," > [Map] %d%%, %d%%, %d%%, %d%% | Caster:%d"
,map[m_id].adjust.damage.pc
,map[m_id].adjust.damage.mob
,map[m_id].adjust.damage.boss
,map[m_id].adjust.damage.other
,map[m_id].adjust.damage.caster);
clif_displaymessage(fd, atcmd_output);
if (map[m_id].skill_damage[0].skill_id) {
clif_displaymessage(fd," > [Map Skill] Name : Player, Monster, Boss Monster, Other | Caster");
for (j = 0; j < MAX_MAP_SKILL_MODIFIER; j++) {
if (map[m_id].skill_damage[j].skill_id) {
sprintf(atcmd_output," %d. %s : %d%%, %d%%, %d%%, %d%% | %d"
,j+1
,skill_db[skill_get_index(map[m_id].skill_damage[j].skill_id)].name
,map[m_id].skill_damage[j].pc
,map[m_id].skill_damage[j].mob
,map[m_id].skill_damage[j].boss
,map[m_id].skill_damage[j].other
,map[m_id].skill_damage[j].caster);
clif_displaymessage(fd,atcmd_output);
}
}
}
}
#endif

strcpy(atcmd_output,msg_txt(sd,1046)); // PvP Flags:
if (map[m_id].flag.pvp)
strcat(atcmd_output, " Pvp ON |");
@@ -7677,6 +7709,9 @@ ACMD_FUNC(mapflag) {
checkflag(partylock); checkflag(guildlock); checkflag(reset); checkflag(chmautojoin);
checkflag(nousecart); checkflag(noitemconsumption); checkflag(nosumstarmiracle); checkflag(nomineeffect);
checkflag(nolockon); checkflag(notomb);
#ifdef ADJUST_SKILL_DAMAGE
checkflag(skill_damage);
#endif
clif_displaymessage(sd->fd," ");
clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
clif_displaymessage(sd->fd,msg_txt(sd,1313)); // Type "@mapflag available" to list the available mapflags.
@@ -7698,6 +7733,9 @@ ACMD_FUNC(mapflag) {
setflag(partylock); setflag(guildlock); setflag(reset); setflag(chmautojoin);
setflag(nousecart); setflag(noitemconsumption); setflag(nosumstarmiracle); setflag(nomineeffect);
setflag(nolockon); setflag(notomb);
#ifdef ADJUST_SKILL_DAMAGE
setflag(skill_damage);
#endif

clif_displaymessage(sd->fd,msg_txt(sd,1314)); // Invalid flag name or flag.
clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
@@ -7710,6 +7748,9 @@ ACMD_FUNC(mapflag) {
clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot, nomvploot,");
clif_displaymessage(sd->fd,"nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock, guildlock,");
clif_displaymessage(sd->fd,"reset, chmautojoin, nousecart, noitemconsumption, nosumstarmiracle, nolockon, notomb");
#ifdef ADJUST_SKILL_DAMAGE
clif_displaymessage(sd->fd,"skill_damage");
#endif

#undef checkflag
#undef setflag

3 comments on commit cd9a776

@Lilith-
Copy link
Contributor

@Lilith- Lilith- commented on cd9a776 Sep 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to see ^^

@euphyy
Copy link
Contributor

@euphyy euphyy commented on cd9a776 Sep 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the code! :)

@cydh
Copy link
Contributor Author

@cydh cydh commented on cd9a776 Sep 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx Lilith :D

Please sign in to comment.