summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf47
-rw-r--r--db/mob_db2.conf1
-rw-r--r--db/pre-re/mob_db.conf1
-rw-r--r--db/re/item_db.conf17
-rw-r--r--db/re/mob_db.conf1
-rw-r--r--doc/constants.md2
-rw-r--r--doc/script_commands.txt263
-rw-r--r--sql-files/item_db_re.sql20
-rw-r--r--src/map/battle.c12
-rw-r--r--src/map/mob.c7
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/script.c13
-rw-r--r--src/map/script.h1
-rw-r--r--src/map/skill.c12
14 files changed, 226 insertions, 173 deletions
diff --git a/db/constants.conf b/db/constants.conf
index f1283b26e..1d6d295c0 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -1508,29 +1508,30 @@ constants_db: {
}
comment__: "getmonsterinfo"
- MOB_NAME: 0
- MOB_LV: 1
- MOB_MAXHP: 2
- MOB_BASEEXP: 3
- MOB_JOBEXP: 4
- MOB_ATK1: 5
- MOB_ATK2: 6
- MOB_DEF: 7
- MOB_MDEF: 8
- MOB_STR: 9
- MOB_AGI: 10
- MOB_VIT: 11
- MOB_INT: 12
- MOB_DEX: 13
- MOB_LUK: 14
- MOB_RANGE: 15
- MOB_RANGE2: 16
- MOB_RANGE3: 17
- MOB_SIZE: 18
- MOB_RACE: 19
- MOB_ELEMENT: 20
- MOB_MODE: 21
- MOB_MVPEXP: 22
+ MOB_NAME: 0
+ MOB_LV: 1
+ MOB_MAXHP: 2
+ MOB_BASEEXP: 3
+ MOB_JOBEXP: 4
+ MOB_ATK1: 5
+ MOB_ATK2: 6
+ MOB_DEF: 7
+ MOB_MDEF: 8
+ MOB_STR: 9
+ MOB_AGI: 10
+ MOB_VIT: 11
+ MOB_INT: 12
+ MOB_DEX: 13
+ MOB_LUK: 14
+ MOB_RANGE: 15
+ MOB_RANGE2: 16
+ MOB_RANGE3: 17
+ MOB_SIZE: 18
+ MOB_RACE: 19
+ MOB_ELEMENT: 20
+ MOB_MODE: 21
+ MOB_MVPEXP: 22
+ MOB_DMG_TAKEN_RATE: 23
comment__: "mercenary guilds"
ARCH_MERC_GUILD: 0
diff --git a/db/mob_db2.conf b/db/mob_db2.conf
index e2894a719..bd8379030 100644
--- a/db/mob_db2.conf
+++ b/db/mob_db2.conf
@@ -93,6 +93,7 @@ mob_db: (
AegisName: (chance, "Option Drop Group")
// ...
}
+ DamageTakenRate: damage taken rate (int, defaults to 100)
},
**************************************************************************/
diff --git a/db/pre-re/mob_db.conf b/db/pre-re/mob_db.conf
index 553593cea..565167e95 100644
--- a/db/pre-re/mob_db.conf
+++ b/db/pre-re/mob_db.conf
@@ -93,6 +93,7 @@ mob_db: (
AegisName: (chance, "Option Drop Group")
// ...
}
+ DamageTakenRate: damage taken rate (int, defaults to 100)
},
**************************************************************************/
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 6c0bea7f0..794746784 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -94644,7 +94644,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_REFRESH, 1; ">
},
{
@@ -94671,7 +94671,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_CRUSHSTRIKE, 1; ">
},
{
@@ -94698,7 +94698,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_MILLENNIUMSHIELD, 1; ">
},
{
@@ -94724,7 +94724,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_VITALITYACTIVATION, 1; ">
},
{
@@ -94750,7 +94750,6 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
Script: <" itemskill RK_FIGHTINGSPIRIT, 1; ">
},
{
@@ -94776,7 +94775,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_ABUNDANCE, 1; ">
},
{
@@ -94802,7 +94801,6 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
Script: <" itemskill RK_GIANTGROWTH, 1; ">
},
{
@@ -94829,7 +94827,6 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
Script: <" itemskill RK_STORMBLAST, 1; ">
},
{
@@ -94855,7 +94852,7 @@ item_db: (
Nouse: {
sitting: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_STONEHARDSKIN, 1; ">
},
@@ -147917,7 +147914,7 @@ item_db: (
nomail: true
noauction: true
}
- Stack: [20, 1]
+ Stack: [60, 1]
Script: <" itemskill RK_LUXANIMA, 1; ">
},
{
diff --git a/db/re/mob_db.conf b/db/re/mob_db.conf
index f787d5478..7ac31655c 100644
--- a/db/re/mob_db.conf
+++ b/db/re/mob_db.conf
@@ -93,6 +93,7 @@ mob_db: (
AegisName: (chance, "Option Drop Group")
// ...
}
+ DamageTakenRate: damage taken rate (int, defaults to 100)
},
**************************************************************************/
diff --git a/doc/constants.md b/doc/constants.md
index 48564573d..4c2be542e 100644
--- a/doc/constants.md
+++ b/doc/constants.md
@@ -1442,6 +1442,7 @@
- `MOB_ELEMENT`: 20
- `MOB_MODE`: 21
- `MOB_MVPEXP`: 22
+- `MOB_DMG_TAKEN_RATE`: 23
### mercenary guilds
@@ -4460,6 +4461,7 @@
- `UDT_ROBE`: 55
- `UDT_BODY2`: 56
- `UDT_GROUP`: 57
+- `UDT_DAMAGE_TAKEN_RATE`: 58
### getguildonline types
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 567d0ad56..bab4287c1 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -3969,29 +3969,30 @@ It will return -1 if there is no such monster (or the type value is
invalid), or "null" if you requested the monster's name.
Valid types are listed in doc/constants.md:
- MOB_NAME 0
- MOB_LV 1
- MOB_MAXHP 2
- MOB_BASEEXP 3
- MOB_JOBEXP 4
- MOB_ATK1 5
- MOB_ATK2 6
- MOB_DEF 7
- MOB_MDEF 8
- MOB_STR 9
- MOB_AGI 10
- MOB_VIT 11
- MOB_INT 12
- MOB_DEX 13
- MOB_LUK 14
- MOB_RANGE 15
- MOB_RANGE2 16
- MOB_RANGE3 17
- MOB_SIZE 18
- MOB_RACE 19
- MOB_ELEMENT 20
- MOB_MODE 21
- MOB_MVPEXP 22
+ MOB_NAME 0
+ MOB_LV 1
+ MOB_MAXHP 2
+ MOB_BASEEXP 3
+ MOB_JOBEXP 4
+ MOB_ATK1 5
+ MOB_ATK2 6
+ MOB_DEF 7
+ MOB_MDEF 8
+ MOB_STR 9
+ MOB_AGI 10
+ MOB_VIT 11
+ MOB_INT 12
+ MOB_DEX 13
+ MOB_LUK 14
+ MOB_RANGE 15
+ MOB_RANGE2 16
+ MOB_RANGE3 17
+ MOB_SIZE 18
+ MOB_RACE 19
+ MOB_ELEMENT 20
+ MOB_MODE 21
+ MOB_MVPEXP 22
+ MOB_DMG_TAKEN_RATE 23
Check sample in doc/sample/getmonsterinfo.txt
@@ -10240,60 +10241,61 @@ Sets or alters the data in real-time for game objects of the following types -
NPCs, Pets, Monsters, Homunuculus', Mercenaries, Elementals.
Applicable Data Types (available as constants) -
- Data Types Description (parameter type)
- UDT_SIZE: Unit Size
- UDT_LEVEL: Level
- UDT_HP: Current HP
- UDT_MAXHP: Max HP
- UDT_SP: SP
- UDT_MAXSP: MAX SP
- UDT_MASTERAID: Master Account ID (for Summons)
- UDT_MASTERCID: Master Char ID (for Summons)
- UDT_SPEED: Unit Speed.
- UDT_MODE: Mode (Mobs only)
- UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
- UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
- UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
- UDT_CLASS: Class of the unit. (Monster ID)
- UDT_HAIRSTYLE: Hair Style ID.
- UDT_HAIRCOLOR: Hair Color ID.
- UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
- UDT_HEADMIDDLE: Headgear Middle Sprite ID.
- UDT_HEADTOP: Headgear Top Sprite ID.
- UDT_CLOTHCOLOR: Cloth Color ID.
- UDT_SHIELD: Shield Sprite ID.
- UDT_WEAPON: Weapon Sprite ID.
- UDT_LOOKDIR: Face direction.
- UDT_CANMOVETICK: Stop a unit from move for n seconds.
- UDT_STR: Unit STR.
- UDT_AGI: Unit AGI.
- UDT_VIT: Unit VIT.
- UDT_INT: Unit INT.
- UDT_DEX: Unit DEX.
- UDT_LUK: Unit LUK.
- UDT_ATKRANGE: Attack range of a unit.
- UDT_ATKMIN: Min Atk of a unit.
- UDT_ATKMAX: Max Atk of a unit.
- UDT_MATKMIN: Min MATK of a unit.
- UDT_MATKMAX: Max MATK of a unit.
- UDT_DEF: DEF.
- UDT_MDEF: MDEF.
- UDT_HIT: HIT.
- UDT_FLEE: FLEE.
- UDT_PDODGE: Perfect Dodge.
- UDT_CRIT: Critical Rate.
- UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
- UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
- UDT_ELELEVEL: Element Level.
- UDT_AMOTION: AMotion Rate.
- UDT_ADELAY: ADelay Rate.
- UDT_DMOTION: DMotion Rate.
- UDT_HUNGER: Hunger Rate - for summons.
- UDT_INTIMACY: Intimacy Rate - for summons.
- UDT_LIFETIME: LifeTime - for summons.
- UDT_MERC_KILLCOUNT: Kill count for mercenaries
- UDT_STATADD: Status Points - for NPCs.
- UDT_GROUP: group id
+ Data Types Description (parameter type)
+ UDT_SIZE: Unit Size
+ UDT_LEVEL: Level
+ UDT_HP: Current HP
+ UDT_MAXHP: Max HP
+ UDT_SP: SP
+ UDT_MAXSP: MAX SP
+ UDT_MASTERAID: Master Account ID (for Summons)
+ UDT_MASTERCID: Master Char ID (for Summons)
+ UDT_SPEED: Unit Speed.
+ UDT_MODE: Mode (Mobs only)
+ UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
+ UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
+ UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
+ UDT_CLASS: Class of the unit. (Monster ID)
+ UDT_HAIRSTYLE: Hair Style ID.
+ UDT_HAIRCOLOR: Hair Color ID.
+ UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
+ UDT_HEADMIDDLE: Headgear Middle Sprite ID.
+ UDT_HEADTOP: Headgear Top Sprite ID.
+ UDT_CLOTHCOLOR: Cloth Color ID.
+ UDT_SHIELD: Shield Sprite ID.
+ UDT_WEAPON: Weapon Sprite ID.
+ UDT_LOOKDIR: Face direction.
+ UDT_CANMOVETICK: Stop a unit from move for n seconds.
+ UDT_STR: Unit STR.
+ UDT_AGI: Unit AGI.
+ UDT_VIT: Unit VIT.
+ UDT_INT: Unit INT.
+ UDT_DEX: Unit DEX.
+ UDT_LUK: Unit LUK.
+ UDT_ATKRANGE: Attack range of a unit.
+ UDT_ATKMIN: Min Atk of a unit.
+ UDT_ATKMAX: Max Atk of a unit.
+ UDT_MATKMIN: Min MATK of a unit.
+ UDT_MATKMAX: Max MATK of a unit.
+ UDT_DEF: DEF.
+ UDT_MDEF: MDEF.
+ UDT_HIT: HIT.
+ UDT_FLEE: FLEE.
+ UDT_PDODGE: Perfect Dodge.
+ UDT_CRIT: Critical Rate.
+ UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
+ UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
+ UDT_ELELEVEL: Element Level.
+ UDT_AMOTION: AMotion Rate.
+ UDT_ADELAY: ADelay Rate.
+ UDT_DMOTION: DMotion Rate.
+ UDT_HUNGER: Hunger Rate - for summons.
+ UDT_INTIMACY: Intimacy Rate - for summons.
+ UDT_LIFETIME: LifeTime - for summons.
+ UDT_MERC_KILLCOUNT: Kill count for mercenaries
+ UDT_STATADD: Status Points - for NPCs.
+ UDT_GROUP: group id
+ UDT_DAMAGE_TAKEN_RATE: damage taken rate of a unit.
returns 0 if value could not be set, 1 if successful.
@@ -10304,59 +10306,60 @@ returns 0 if value could not be set, 1 if successful.
Retrieves real-time data of a game object.
Applicable Data types (available as constants) -
- Data Types Description (return type)
- UDT_SIZE: Unit Size
- UDT_LEVEL: Level
- UDT_HP: Current HP
- UDT_MAXHP: Max HP
- UDT_SP: SP
- UDT_MAXSP: MAX SP
- UDT_MASTERAID: Master Account ID (for Summons)
- UDT_MASTERCID: Master Char ID (for Summons)
- UDT_SPEED: Unit Speed.
- UDT_MODE: Mode (Mobs only)
- UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
- UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
- UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
- UDT_CLASS: Class of the unit. (Monster ID)
- UDT_HAIRSTYLE: Hair Style ID.
- UDT_HAIRCOLOR: Hair Color ID.
- UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
- UDT_HEADMIDDLE: Headgear Middle Sprite ID.
- UDT_HEADTOP: Headgear Top Sprite ID.
- UDT_CLOTHCOLOR: Cloth Color ID.
- UDT_SHIELD: Shield Sprite ID.
- UDT_WEAPON: Weapon Sprite ID.
- UDT_LOOKDIR: Face direction.
- UDT_CANMOVETICK: Stop a unit from move for n seconds.
- UDT_STR: Unit STR.
- UDT_AGI: Unit AGI.
- UDT_VIT: Unit VIT.
- UDT_INT: Unit INT.
- UDT_DEX: Unit DEX.
- UDT_LUK: Unit LUK.
- UDT_ATKRANGE: Attack range of a unit.
- UDT_ATKMIN: Min Atk of a unit.
- UDT_ATKMAX: Max Atk of a unit.
- UDT_MATKMIN: Min MATK of a unit.
- UDT_MATKMAX: Max MATK of a unit.
- UDT_DEF: DEF.
- UDT_MDEF: MDEF.
- UDT_HIT: HIT.
- UDT_FLEE: FLEE.
- UDT_PDODGE: Perfect Dodge.
- UDT_CRIT: Critical Rate.
- UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
- UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
- UDT_ELELEVEL: Element Level.
- UDT_AMOTION: AMotion Rate.
- UDT_ADELAY: ADelay Rate.
- UDT_DMOTION: DMotion Rate.
- UDT_HUNGER: Hunger Rate - for summons.
- UDT_INTIMACY: Intimacy Rate - for summons.
- UDT_LIFETIME: LifeTime - for summons.
- UDT_MERC_KILLCOUNT: Kill count for mercenaries.
- UDT_GROUP: group id
+ Data Types Description (return type)
+ UDT_SIZE: Unit Size
+ UDT_LEVEL: Level
+ UDT_HP: Current HP
+ UDT_MAXHP: Max HP
+ UDT_SP: SP
+ UDT_MAXSP: MAX SP
+ UDT_MASTERAID: Master Account ID (for Summons)
+ UDT_MASTERCID: Master Char ID (for Summons)
+ UDT_SPEED: Unit Speed.
+ UDT_MODE: Mode (Mobs only)
+ UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types)
+ UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types)
+ UDT_SEX: Gender of the unit. (see doc/constants.md for Genders)
+ UDT_CLASS: Class of the unit. (Monster ID)
+ UDT_HAIRSTYLE: Hair Style ID.
+ UDT_HAIRCOLOR: Hair Color ID.
+ UDT_HEADBOTTOM: Headgear Bottom Sprite ID.
+ UDT_HEADMIDDLE: Headgear Middle Sprite ID.
+ UDT_HEADTOP: Headgear Top Sprite ID.
+ UDT_CLOTHCOLOR: Cloth Color ID.
+ UDT_SHIELD: Shield Sprite ID.
+ UDT_WEAPON: Weapon Sprite ID.
+ UDT_LOOKDIR: Face direction.
+ UDT_CANMOVETICK: Stop a unit from move for n seconds.
+ UDT_STR: Unit STR.
+ UDT_AGI: Unit AGI.
+ UDT_VIT: Unit VIT.
+ UDT_INT: Unit INT.
+ UDT_DEX: Unit DEX.
+ UDT_LUK: Unit LUK.
+ UDT_ATKRANGE: Attack range of a unit.
+ UDT_ATKMIN: Min Atk of a unit.
+ UDT_ATKMAX: Max Atk of a unit.
+ UDT_MATKMIN: Min MATK of a unit.
+ UDT_MATKMAX: Max MATK of a unit.
+ UDT_DEF: DEF.
+ UDT_MDEF: MDEF.
+ UDT_HIT: HIT.
+ UDT_FLEE: FLEE.
+ UDT_PDODGE: Perfect Dodge.
+ UDT_CRIT: Critical Rate.
+ UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7).
+ UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0).
+ UDT_ELELEVEL: Element Level.
+ UDT_AMOTION: AMotion Rate.
+ UDT_ADELAY: ADelay Rate.
+ UDT_DMOTION: DMotion Rate.
+ UDT_HUNGER: Hunger Rate - for summons.
+ UDT_INTIMACY: Intimacy Rate - for summons.
+ UDT_LIFETIME: LifeTime - for summons.
+ UDT_MERC_KILLCOUNT: Kill count for mercenaries.
+ UDT_GROUP: group id
+ UDT_DAMAGE_TAKEN_RATE: damage taken rate of a unit.
returns -1 if value could not be retrieved.
diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql
index 933ef3815..bba22d6df 100644
--- a/sql-files/item_db_re.sql
+++ b/sql-files/item_db_re.sql
@@ -6545,15 +6545,15 @@ REPLACE INTO `item_db` VALUES ('12721','Poison_Numb','Toxin','0','0','2','1','20
REPLACE INTO `item_db` VALUES ('12722','Poison_Fever','Pyrexia','0','0','2','1','20','0','0','0','0','0','4096','56','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','specialeffect(EF_ENCHANTPOISON, AREA, playerattached()); sc_start SC_PYREXIA, 300000, 0, 10, SCFLAG_FIXEDTICK;','','');
REPLACE INTO `item_db` VALUES ('12723','Poison_Laughing','Magic Mushroom','0','0','2','1','20','0','0','0','0','0','4096','56','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','specialeffect(EF_ENCHANTPOISON, AREA, playerattached()); sc_start SC_MAGICMUSHROOM, 300000, 0, 10, SCFLAG_FIXEDTICK;','','');
REPLACE INTO `item_db` VALUES ('12724','Poison_Fatigue','Venom Bleed','0','0','2','1','20','0','0','0','0','0','4096','56','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','specialeffect(EF_ENCHANTPOISON, AREA, playerattached()); sc_start SC_VENOMBLEED, 15000, 0, 10, SCFLAG_FIXEDTICK;','','');
-REPLACE INTO `item_db` VALUES ('12725','Runstone_Nosiege','Nosiege Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','120000','475',NULL,'1',NULL,'20','1','0','itemskill RK_REFRESH, 1;','','');
-REPLACE INTO `item_db` VALUES ('12726','Runstone_Rhydo','Rhydo Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','30000','475',NULL,'1',NULL,'20','1','0','itemskill RK_CRUSHSTRIKE, 1;','','');
-REPLACE INTO `item_db` VALUES ('12727','Runstone_Verkana','Verkana Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','60000','475',NULL,'1',NULL,'20','1','0','itemskill RK_MILLENNIUMSHIELD, 1;','','');
-REPLACE INTO `item_db` VALUES ('12728','Runstone_Isia','Isia Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'20','1','0','itemskill RK_VITALITYACTIVATION, 1;','','');
-REPLACE INTO `item_db` VALUES ('12729','Runstone_Asir','Asir Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'20','1','0','itemskill RK_FIGHTINGSPIRIT, 1;','','');
-REPLACE INTO `item_db` VALUES ('12730','Runstone_Urj','Urj Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'20','1','0','itemskill RK_ABUNDANCE, 1;','','');
-REPLACE INTO `item_db` VALUES ('12731','Runstone_Turisus','Turisus Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'20','1','0','itemskill RK_GIANTGROWTH, 1;','','');
-REPLACE INTO `item_db` VALUES ('12732','Runstone_Pertz','Pertz Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','1000','475',NULL,'1',NULL,'20','1','0','itemskill RK_STORMBLAST, 1;','','');
-REPLACE INTO `item_db` VALUES ('12733','Runstone_Hagalas','Hagalas Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'20','1','0','itemskill RK_STONEHARDSKIN, 1;','','');
+REPLACE INTO `item_db` VALUES ('12725','Runstone_Nosiege','Nosiege Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','120000','475',NULL,'1',NULL,'60','1','0','itemskill RK_REFRESH, 1;','','');
+REPLACE INTO `item_db` VALUES ('12726','Runstone_Rhydo','Rhydo Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','30000','475',NULL,'1',NULL,'60','1','0','itemskill RK_CRUSHSTRIKE, 1;','','');
+REPLACE INTO `item_db` VALUES ('12727','Runstone_Verkana','Verkana Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','60000','475',NULL,'1',NULL,'60','1','0','itemskill RK_MILLENNIUMSHIELD, 1;','','');
+REPLACE INTO `item_db` VALUES ('12728','Runstone_Isia','Isia Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'60','1','0','itemskill RK_VITALITYACTIVATION, 1;','','');
+REPLACE INTO `item_db` VALUES ('12729','Runstone_Asir','Asir Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','itemskill RK_FIGHTINGSPIRIT, 1;','','');
+REPLACE INTO `item_db` VALUES ('12730','Runstone_Urj','Urj Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'60','1','0','itemskill RK_ABUNDANCE, 1;','','');
+REPLACE INTO `item_db` VALUES ('12731','Runstone_Turisus','Turisus Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'0',NULL,'0','itemskill RK_GIANTGROWTH, 1;','','');
+REPLACE INTO `item_db` VALUES ('12732','Runstone_Pertz','Pertz Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','1000','475',NULL,'1',NULL,'0',NULL,'0','itemskill RK_STORMBLAST, 1;','','');
+REPLACE INTO `item_db` VALUES ('12733','Runstone_Hagalas','Hagalas Runestone','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','0','475',NULL,'1',NULL,'60','1','0','itemskill RK_STONEHARDSKIN, 1;','','');
REPLACE INTO `item_db` VALUES ('12734','Runstone_Quality','Quality Rough Runestone','0','0','2','1','100','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','makerune 5;','','');
REPLACE INTO `item_db` VALUES ('12735','Runstone_Ancient','Ancient Rough Runestone','0','0','2','1','100','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','makerune 11;','','');
REPLACE INTO `item_db` VALUES ('12736','Runstone_Mystic','Mystic Rough Runestone','0','0','2','1','100','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','1','0','0',NULL,'0',NULL,'0',NULL,'0','makerune 14;','','');
@@ -9948,7 +9948,7 @@ REPLACE INTO `item_db` VALUES ('22514','Candy_Holder','Candy Holder','11','0','2
REPLACE INTO `item_db` VALUES ('22515','Key_Of_Twisted_Time','Twisted Key of Time','3','0','10','5','300','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('22534','Closedmind_Box','Closed Mind Box','18','0','10','5','1000','0','0','0','0','0','18446744073709551615','63','2','0','0','1',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
REPLACE INTO `item_db` VALUES ('22537','PrizeOfHero','Prize Of Hero','2','0','0','0','100','0','0','0','0','0','18446744073709551615','63','2','0','0','1',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','','','');
-REPLACE INTO `item_db` VALUES ('22540','Runstone_Lux','Lux Anima Rune','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','60000','475',NULL,'0',NULL,'20','1','0','itemskill RK_LUXANIMA, 1;','','');
+REPLACE INTO `item_db` VALUES ('22540','Runstone_Lux','Lux Anima Rune','11','0','2','1','100','0','0','0','0','0','128','56','2','0','0','0',NULL,'0','1','0','0','0','0','60000','475',NULL,'0',NULL,'60','1','0','itemskill RK_LUXANIMA, 1;','','');
REPLACE INTO `item_db` VALUES ('22669','HALLOWEEN_G_BOX','Halloween Box','2','0','0','0','20','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','getrandgroupitem 22669,1;','','');
REPLACE INTO `item_db` VALUES ('22670','DARK_INVITATION','Invitation of Darkness','2','0','10','5','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','.@temp = rand(1,3); if (.@temp == 1) { specialeffect(EF_DEVIL, AREA, playerattached()); warp \"niflheim\",193,186; } else if (.@temp == 2) { specialeffect(EF_DEVIL, AREA, playerattached()); warp \"niflheim\",106,254; } else { specialeffect(EF_DEVIL, AREA, playerattached()); warp \"niflheim\",347,255; }','','');
REPLACE INTO `item_db` VALUES ('22675','Mysterious_Scroll','Mysterious Scroll','2','0','20','10','10','0','0','0','0','0','18446744073709551615','63','2','0','0','0',NULL,'0','1','0','0','0','0','0','0',NULL,'0',NULL,'0',NULL,'0','sc_start SC_FOOD_INT,3600000,30;','','');
diff --git a/src/map/battle.c b/src/map/battle.c
index abbaa549a..37fc03bca 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6321,6 +6321,18 @@ static enum damage_lv battle_weapon_attack(struct block_list *src, struct block_
if (sd && sd->state.arrow_atk) //Consume arrow.
battle->consume_ammo(sd, 0, 0);
+ if (target->type == BL_MOB) {
+ struct mob_data *md = BL_CAST(BL_MOB, target);
+ if (md != NULL) {
+ if (md->db->dmg_taken_rate != 100) {
+ if (wd.damage > 0)
+ wd.damage = apply_percentrate64(wd.damage, md->db->dmg_taken_rate, 100);
+ if (wd.damage2 > 0)
+ wd.damage2 = apply_percentrate64(wd.damage2, md->db->dmg_taken_rate, 100);
+ }
+ }
+ }
+
damage = wd.damage + wd.damage2;
if( damage > 0 && src != target ) {
if( sc && sc->data[SC_DUPLELIGHT] && (wd.flag&BF_SHORT) && rnd()%100 <= 10+2*sc->data[SC_DUPLELIGHT]->val1 ){
diff --git a/src/map/mob.c b/src/map/mob.c
index 939d062af..283bec25a 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4604,6 +4604,7 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou
* AttackMotion: attack motion
* DamageMotion: damage motion
* MvpExp: mvp experience
+ * DamageTakenRate: damage taken rate
* MvpDrops: {
* AegisName: chance
* ...
@@ -4837,6 +4838,12 @@ static int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *sou
}
}
+ if (mob->lookup_const(mobt, "DamageTakenRate", &i32) && i32 >= 0) {
+ md.dmg_taken_rate = cap_value(i32, 1, INT_MAX);
+ } else if (!inherit) {
+ md.dmg_taken_rate = 100;
+ }
+
mob->read_db_additional_fields(&md, mobt, n, source);
return mob->db_validate_entry(&md, n, source);
diff --git a/src/map/mob.h b/src/map/mob.h
index 0a7489c47..a48c4cc74 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -206,6 +206,7 @@ struct mob_db {
unsigned int option;
int summonper[MAX_RANDOMMONSTER];
int maxskill;
+ int dmg_taken_rate;
struct mob_skill skill[MAX_MOBSKILL];
struct spawn_info spawn[10];
struct hplugin_data_store *hdata; ///< HPM Plugin Data Store
@@ -244,6 +245,7 @@ struct mob_data {
unsigned int dmg;
unsigned int flag : 2; //0: Normal. 1: Homunc exp. 2: Pet exp
} dmglog[DAMAGELOG_SIZE];
+ int dmg_taken_rate;
struct spawn_data *spawn; //Spawn data.
int spawn_timer; //Required for Convex Mirror
struct item *lootitem;
diff --git a/src/map/script.c b/src/map/script.c
index c1e210d27..f515d4403 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -16589,6 +16589,8 @@ static BUILDIN(isequippedcnt)
if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue;
if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue;
if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue;
+ if(j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == index) continue;
+ if(j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == index || sd->equip_index[EQI_COSTUME_LOW] == index)) continue;
if(!sd->inventory_data[index])
continue;
@@ -16642,6 +16644,8 @@ static BUILDIN(isequipped)
if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue;
if(j == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index) continue;
if(j == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index)) continue;
+ if(j == EQI_COSTUME_MID && sd->equip_index[EQI_COSTUME_LOW] == index) continue;
+ if(j == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == index || sd->equip_index[EQI_COSTUME_LOW] == index)) continue;
if(!sd->inventory_data[index])
continue;
@@ -18580,6 +18584,7 @@ static BUILDIN(getmonsterinfo)
case 20: script_pushint(st,monster->status.def_ele); break;
case 21: script_pushint(st,monster->status.mode); break;
case 22: script_pushint(st,monster->mexp); break;
+ case 23: script_pushint(st, monster->dmg_taken_rate); break;
default: script_pushint(st,-1); //wrong Index
}
return true;
@@ -19137,6 +19142,9 @@ static BUILDIN(setunitdata)
script_pushint(st, 1);
return true;
}
+ case UDT_DAMAGE_TAKEN_RATE:
+ setunitdata_check_bounds(4, 1, INT_MAX);
+ break;
default:
break;
}
@@ -19311,6 +19319,9 @@ static BUILDIN(setunitdata)
case UDT_DMOTION:
md->status.dmotion = (unsigned short) val;
break;
+ case UDT_DAMAGE_TAKEN_RATE:
+ md->dmg_taken_rate = (int) val;
+ break;
default:
ShowWarning("buildin_setunitdata: Invalid data type '%s' for mob unit.\n", udtype);
script_pushint(st, 0);
@@ -20158,6 +20169,7 @@ static BUILDIN(getunitdata)
case UDT_AMOTION: script_pushint(st, md->status.amotion); break;
case UDT_ADELAY: script_pushint(st, md->status.adelay); break;
case UDT_DMOTION: script_pushint(st, md->status.dmotion); break;
+ case UDT_DAMAGE_TAKEN_RATE: script_pushint(st, md->dmg_taken_rate); break;
default:
ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mob unit.\n", udtype);
script_pushint(st, -1);
@@ -26890,6 +26902,7 @@ static void script_hardcoded_constants(void)
script->set_constant("UDT_ROBE", UDT_ROBE, false, false);
script->set_constant("UDT_BODY2", UDT_BODY2, false, false);
script->set_constant("UDT_GROUP", UDT_GROUP, false, false);
+ script->set_constant("UDT_DAMAGE_TAKEN_RATE", UDT_DAMAGE_TAKEN_RATE, false, false);
script->constdb_comment("getguildonline types");
script->set_constant("GUILD_ONLINE_ALL", GUILD_ONLINE_ALL, false, false);
diff --git a/src/map/script.h b/src/map/script.h
index 62950ba8d..84a8e3b6e 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -434,6 +434,7 @@ enum script_unit_data_types {
UDT_ROBE,
UDT_BODY2,
UDT_GROUP,
+ UDT_DAMAGE_TAKEN_RATE,
UDT_MAX
};
diff --git a/src/map/skill.c b/src/map/skill.c
index a259829ef..af61c887c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2906,6 +2906,18 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li
}
}
+ if (bl->type == BL_MOB) {
+ struct mob_data *md = BL_CAST(BL_MOB, bl);
+ if (md != NULL) {
+ if (md->db->dmg_taken_rate != 100) {
+ if (dmg.damage > 0)
+ dmg.damage = apply_percentrate64(dmg.damage, md->db->dmg_taken_rate, 100);
+ if (dmg.damage2 > 0)
+ dmg.damage2 = apply_percentrate64(dmg.damage2, md->db->dmg_taken_rate, 100);
+ }
+ }
+ }
+
damage = dmg.damage + dmg.damage2;
if( (skill_id == AL_INCAGI || skill_id == AL_BLESSING ||