summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-08 16:58:57 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-08 16:58:57 +0000
commitb6f1b6b9a11bdb8a5001dbc042d54fce0a963705 (patch)
treecd37827a952867c4dc561f2961d3687561582e31
parentffa877bd248a6f6a014dd29e4c158b7399cb0a98 (diff)
downloadhercules-b6f1b6b9a11bdb8a5001dbc042d54fce0a963705.tar.gz
hercules-b6f1b6b9a11bdb8a5001dbc042d54fce0a963705.tar.bz2
hercules-b6f1b6b9a11bdb8a5001dbc042d54fce0a963705.tar.xz
hercules-b6f1b6b9a11bdb8a5001dbc042d54fce0a963705.zip
- Added some new items and headgears.
- Changed the way DEF Potion and MDEF potion works to official. - Cleanups to Barricade Engine. It now can be used in WoE 2.0, i will release optional scripts soon. - Fixes to @noks. Now if the mob is targeting someone else the protection get lost. - Added new status effects icons to cash items. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12693 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--db/const.txt4
-rw-r--r--db/item_db.txt32
-rw-r--r--src/map/atcommand.c14
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/clif.c9
-rw-r--r--src/map/map.h7
-rw-r--r--src/map/mob.c126
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/script.c37
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c25
-rw-r--r--src/map/status.h12
12 files changed, 197 insertions, 82 deletions
diff --git a/db/const.txt b/db/const.txt
index 1774c19c2..12b823d31 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -778,7 +778,7 @@ SC_INCCRI 261
SC_INCDEF 262
SC_INCBASEATK 263
SC_FASTCAST 264
-SC_INCMDEFRATE 265
+SC_MDEF_RATE 265
SC_HPREGEN 266
SC_INCHEALRATE 267
SC_PNEUMA 268
@@ -787,6 +787,8 @@ SC_KSPROTECTED 270
SC_ARMOR_RESIST 271
SC_SPCOST_RATE 272
SC_COMMONSC_RESIST 273
+SC_SEVENWIND 274
+SC_DEF_RATE 275
e_gasp 0
e_what 1
diff --git a/db/item_db.txt b/db/item_db.txt
index 8b99d1e83..250feae31 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1248,6 +1248,8 @@
2437,Combat_Boots,Combat Boots,5,,,0,,3,,1,0x01000000,7,2,64,,80,1,0,{ bonus bMaxHP,100; bonus bMdef,1; bonus2 bSubRace,RC_DemiHuman,1; },{},{}
2438,Cat's_Paw,Cat's Paw,5,,,300,,0,,0,0xFFFFFFFF,7,2,64,,80,1,0,{ bonus bFlee,5; bonus bAgi,1; },{},{}
2439,Refresh_Shoes,Refresh Shoes,5,,,0,,9,,0,0xFFFFFFFF,7,2,64,,0,0,0,{ bonus bMaxHPRate,17; bonus bMaxSPRate,8; bonus2 bHPRegenRate,20,10000; bonus2 bSPRegenRate,3,10000; },{},{}
+// **
+2441,Beach_Sandals,Beach Sandals,5,,,200,,0,,0,0xFFFFFFFF,7,2,64,,0,1,0,{ bonus bStr,1; bonus bInt,1; bonus bAgi,1; bonus2 bSubEle,Ele_Fire,10; if (isequipped(2546)) bonus bFlee,5; },{},{}
// Garments
//===================================================================
2501,Hood,Hood,5,1000,,200,,1,,0,0xFFFFFFFF,7,2,4,,0,1,0,{},{},{}
@@ -1293,6 +1295,8 @@
2541,Aesprika,Aesprika,5,,,400,,5,,0,0xFFFFFFFF,7,2,4,,94,0,0,{ bonus bMdef,5; bonus2 bSubEle,Ele_Neutral,30; bonus2 bSubEle,Ele_Water,30; bonus2 bSubEle,Ele_Earth,30; bonus2 bSubEle,Ele_Fire,30; bonus2 bSubEle,Ele_Wind,30; bonus2 bSubEle,Ele_Poison,30; bonus2 bSubEle,Ele_Holy,30; bonus2 bSubEle,Ele_Dark,30; bonus2 bSubEle,Ele_Ghost,30; bonus2 bSubEle,Ele_Undead,30; bonus bFlee,30; skill 26,1; bonus bUnbreakableArmor,0; },{},{}
2542,Naght_Seiger_Manteau,Naght Seiger Flame Manteau,5,,,0,,4,,1,0xFFFFFFFE,7,2,4,,55,0,0,{ bonus bMaxHPRate,5; bonus bMdef,2; bonus bMatkRate,1; bonus2 bAddEle,Ele_Fire,2; },{},{}
2543,Sylph_Manteau,Sylph Manteau,5,,,0,,9,,0,0xFFFFFFFF,7,2,4,,0,0,0,{ bonus bFlee,13; bonus2 bSubEle,Ele_Neutral,13; bonus bFlee2,1; },{},{}
+// **
+2546,Beach_Manteau,Beach Manteau,5,,,600,,0,,1,0xFFFFFFFF,7,2,4,,0,1,0,{ bonus bStr,1; bonus bInt,1; bonus2 bSubEle,Ele_Fire,10; },{},{}
// Accessories
//===================================================================
2601,Ring,Ring,5,30000,,100,,0,,0,0xFFFFFFFE,7,2,136,,20,0,0,{ bonus bStr,2; },{},{}
@@ -1434,6 +1438,8 @@
2739,Commemorative_Coin_,General's Commemorative Coin,5,,,0,,1,,0,0xFFFFFFFF,7,2,136,,80,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; },{},{}
2740,Commemorative_Coin__,Rusty Commemorative Coin,5,,,0,,1,,0,0xFFFFFFFF,7,2,136,,80,0,0,{ bonus bAtkRate,3; bonus bMatkRate,3; },{},{}
2741,All_In_One_Ring,All In One Ring,5,,,0,,0,,0,0xFFFFFFFF,7,2,136,,0,0,0,{ skill 28,1; skill 26,1; bonus bNoCastCancel,0; bonus bAllStats,1; bonus bCastrate,10; },{},{}
+// **
+2751,Academy_of_Badge,Academy of Badge,5,,,100,,0,,0,0xFFFFFFFF,7,2,136,,0,0,0,{ if(BaseLevel < 80) { bonus bMaxHP,400; bonus bMaxSP,200; } },{},{}
// Cards
//===================================================================
4001,Poring_Card,Poring Card,6,,10,10,,,,,,,,16,,,,,{ bonus bLuk,2; bonus bFlee2,1; },{},{}
@@ -2270,6 +2276,11 @@
//5395,Tiraya_Bonnet,Tiraya Bonnet,5,,,500,,2,,0,0xFFFFFFFF,7,2,256,,0,1,398,{},{},{}
//5396,Jasper_Crest,Jasper Crest,5,,,700,,2,,0,0xFFFFFFFF,7,2,256,,0,1,399,{ bonus bDex,3; bonus bVit,1; },{},{}
//5397,Scuba_Gear,Scuba Gear,5,0,,100,,0,,0,0xFFFFFFFF,7,2,512,,0,0,400,{ bonus2 bSubEle,Ele_Water,10; },{},{}
+// **
+//5400,Fox_Hat,Fox Mask,5,,10,200,,1,,0,0xFFFFFFFF,7,0,769,,0,1,403,{ bonus bLuk,1; },{},{}
+// **
+//5406,Academy_Freshman_Hat,Academy Freshman Hat,5,,10,200,,1,,0,0xFFFFFFFF,7,0,256,,0,,409,{ bonus bMaxHP,80; bonus bMaxSP,10; },{},{}
+//5407,Academy_Completion_Hat,Academy 1st Stage Completion Hat,5,,10,200,,1,,1,0xFFFFFFFF,7,0,256,,0,,410,{ bonus bMaxSP,30; },{},{}
5800,Blush_Of_Groom,Blush of Groom,5,,,50,,0,,0,0xFFFFFFFF,7,2,512,,0,0,125,{ bonus2 bSubRace,RC_DemiHuman,3; },{},{}
5801,Ribbon_Of_Bride,Red Tailed Ribbon,5,,,100,,5,,0,0xFFFFFFFF,7,2,256,,0,1,167,{ bonus bAllStats,2; bonus2 bSubRace,RC_DemiHuman,10; if (getskilllv(29) == 10) { bonus3 bAutoSpellWhenHit,28,10,20; } else { bonus3 bAutoSpellWhenHit,28,5,20; } },{},{}
5802,Upgrade_Elephant_Hat,Upgraded Elephant Hat,5,,,500,,3,,1,0xFFFFFFFF,7,2,256,,0,1,215,{},{},{}
@@ -3467,7 +3478,7 @@
12273,Military_Rations_C,Military Rations C,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCFLEE,600000,33; },{},{}
12274,Daehwandan,Daehwandan,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHPRATE,36000000,5; percentheal 10,0; },{},{}
12275,Taecheongdan,Taecheongdan,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,36000000,5; percentheal 0,10; },{},{}
-12279,Undead_Element_Scroll,Shadow Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,300000,20,20,20,20; },{},{}
+12279,Undead_Element_Scroll,Shadow Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_RESIST,300000,20,20,20,20; },{},{}
12280,Holy_Element_Scroll,Holy Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 91; sc_start SC_BENEDICTIO,300000,1; },{},{}
//Net Cafe Premium
12298,SP_Reduction_Potion,SP Reduction Potion,0,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_SPCOST_RATE,36000000,15; },{},{}
@@ -4099,6 +4110,14 @@
13902,Fish_Head_Box,Fish Head Box,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 5380,1; },{},{}
13903,Santa_Poring_Box,Santa Poring Box,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 5381,1; },{},{}
13904,Bell_Ribbon_Box,Bell Ribbon Box,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 5382,1; },{},{}
+// **
+14221,Amplification_10_Scroll_Box,Mystical Amplification Scroll 10ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14593,10; },{},{}
+14222,Amplification_30_Scroll_Box,Mystical Amplification Scroll 30ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14593,30; },{},{}
+14223,Amplification_50_Scroll_Box,Mystical Amplification Scroll 50ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14593,50; },{},{}
+14224,Quagmire_10_Scroll_Box,Quagmire Scroll 10ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14594,10; },{},{}
+14225,Quagmire_30_Scroll_Box,Quagmire Scroll 30ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14594,30; },{},{}
+14226,Quagmire_50_Scroll_Box,Quagmire Scroll 50ea Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14594,50; },{},{}
+// **
14508,Zeny_Pet_Egg_Scroll,Zeny Pet Egg Scroll,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
14509,Light_Center_Pot,Light Concentration Potion,2,,,20,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_ASPDPOTION0,1800000,0; },{},{}
14510,Light_Awakening_Pot,Light Awakening Potion,2,,,20,,,,,0xFFF7FEEF,7,2,,,40,,,{ sc_start SC_ASPDPOTION1,1800000,0; },{},{}
@@ -4132,10 +4151,10 @@
14538,Glass_of_Illusion,Glass of Illusion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
14539,Shadow_Armor_S,Shadow Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ELEMENTALCHANGE,1800000,1,Ele_Dark,1,0; },{},{}
14540,Holy_Armor_S,Holy Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 91; sc_start4 SC_ELEMENTALCHANGE,1800000,1,Ele_Holy,1,0; },{},{}
-14541,S_Def_Potion,Small Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCDEFRATE,60000,3; },{},{}
-14542,B_Def_Potion,Big Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCDEFRATE,180000,3; },{},{}
-14543,S_Mdef_Potion,Small Magic Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMDEFRATE,60000,3; },{},{}
-14544,B_Mdef_Potion,Big Magic Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMDEFRATE,180000,3; },{},{}
+14541,S_Def_Potion,Small Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_DEF_RATE,60000,3; },{},{}
+14542,B_Def_Potion,Big Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_DEF_RATE,180000,3; },{},{}
+14543,S_Mdef_Potion,Small Magic Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_MDEF_RATE,60000,3; },{},{}
+14544,B_Mdef_Potion,Big Magic Defense Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_MDEF_RATE,180000,3; },{},{}
14545,Battle_Manual_x3,Field Manual 300%,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,300; },{},{}
14546,Firecracker_Love,Love You Firecracker,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ misceffect(682); },{},{}
14547,Firecracker_Wday,White Day Firecracker,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ misceffect(683); },{},{}
@@ -4177,3 +4196,6 @@
14583,Green_Butterfly_Wing,Green Butterfly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashCity",2; },{},{}
14584,Red_Butterfly_Wing,Red Butterfly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashCity",3; },{},{}
14585,Blue_Butterfly_Wing,Blue Butterfly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashCity",4; },{},{}
+// **
+14593,Mystical_Amplification_Scroll,Mystical_Amplification_Scroll,11,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 366,10; },{},{}
+14594,Quagmire_scroll,Quagmire scroll,11,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 92,5; },{},{}
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 1f69df496..239f1aa32 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7801,28 +7801,28 @@ int atcommand_showdelay(const int fd, struct map_session_data* sd, const char* c
*------------------------------------------*/
int atcommand_barricade(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- int x = 0, y = 0, size = 1, killable = 0, dir = 0;
+ int x = 0, y = 0, size = 1, killable = 0, shootable = 0, dir = 0;
char event[50];
short result;
- if( !message || !*message || (sscanf(message, "%d %d %d %d %d %50s", &x, &y, &size, &dir, &killable, event) < 6) )
+ if( !message || !*message || (sscanf(message, "%d %d %d %d %d %d %50s", &x, &y, &size, &dir, &killable, &shootable, event) < 7) )
{
- clif_displaymessage(fd, "usage @barricade <x> <y> <size> <dir> <killable> <event>");
+ clif_displaymessage(fd, "usage @barricade <x> <y> <size> <dir> <killable> <shootable> <event>");
return -1;
}
if( x == -1 ) x = sd->bl.x;
if( y == -1 ) y = sd->bl.y;
- result = mob_barricade_build(sd->bl.m, x, y, size, dir, (bool)killable, event);
+ result = mob_barricade_build(sd->bl.m, x, y, "--ja--", size, dir, (bool)killable, false, (bool)shootable, false, event);
switch( result )
{
case 0: clif_displaymessage(fd, "Barricade build."); return 0; break;
case 1: clif_displaymessage(fd, "Barricade fail. Invalid Size"); break;
- case 2: clif_displaymessage(fd, "Barricade fail. Wall problem."); break;
- case 3: clif_displaymessage(fd, "Barricade fail. Invalid Event"); break;
- case 4: clif_displaymessage(fd, "Barricade fail. Event already exists"); break;
+ case 2: clif_displaymessage(fd, "Barricade fail. Invalid Event"); break;
+ case 3: clif_displaymessage(fd, "Barricade fail. Event already exists"); break;
+ case 4: clif_displaymessage(fd, "Barricade fail. Wall problem."); break;
}
return -1;
diff --git a/src/map/battle.c b/src/map/battle.c
index cdf7cca46..cb6d95b2a 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1943,6 +1943,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
else // BF_LONG (there's no other choice)
cardfix=cardfix*(100-tsd->long_attack_def_rate)/100;
+ if( tsd->sc.data[SC_DEF_RATE] )
+ cardfix=cardfix*(100-tsd->sc.data[SC_DEF_RATE]->val1)/100;
+
if (cardfix != 1000)
ATK_RATE(cardfix/10);
}
@@ -2416,6 +2419,9 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
cardfix=cardfix*(100-tsd->magic_def_rate)/100;
+ if( tsd->sc.data[SC_MDEF_RATE] )
+ cardfix=cardfix*(100-tsd->sc.data[SC_MDEF_RATE]->val1)/100;
+
if (cardfix != 1000)
MATK_RATE(cardfix/10);
}
@@ -3133,9 +3139,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if (!(agit_flag && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id)
return 0; //Disable guardians/emperiums owned by Guilds on non-woe times.
- if( md->class_ == MOBID_BARRICADEA && md->barricade )
+ if( md->barricade && !md->barricade->killable )
return 0;
-
break;
}
}
diff --git a/src/map/clif.c b/src/map/clif.c
index bc3872ad6..cfd87b748 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7920,7 +7920,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( sd->state.changemap )
{// restore information that gets lost on map-change
- if (night_flag && map[sd->bl.m].flag.nightenabled)
+ if( night_flag && map[sd->bl.m].flag.nightenabled )
{ //Display night.
if( !sd->state.night )
{
@@ -7934,6 +7934,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_status_load(&sd->bl, SI_NIGHT, 0);
}
+ if( map[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) )
+ {
+ char output[128];
+ sprintf(output, "[ Kill Steal Protection Disable. KS is allowed in this map ]");
+ clif_announce(&sd->bl, output, strlen(output) + 1, 0x00CC66, 3);
+ }
+
mob_barricade_get(sd);
sd->state.changemap = false;
}
diff --git a/src/map/map.h b/src/map/map.h
index 46cd966e0..c32951b45 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -44,8 +44,6 @@ struct item_data;
#define MAX_IGNORE_LIST 20 // official is 14
#define MAX_VENDING 12
#define MOBID_EMPERIUM 1288
-#define MOBID_BARRICADEB 1905
-#define MOBID_BARRICADEA 1906 // Undestruble
//The following system marks a different job ID system used by the map server,
//which makes a lot more sense than the normal one. [Skotlex]
@@ -163,6 +161,8 @@ enum {
#define map_flag_gvg(m) (map[m].flag.gvg || (agit_flag && map[m].flag.gvg_castle))
//Specifies if the map is tagged as GvG/WoE (regardless of agit_flag status)
#define map_flag_gvg2(m) (map[m].flag.gvg || map[m].flag.gvg_castle)
+// No Kill Steal Protection
+#define map_flag_ks(m) (map[m].flag.town || map[m].flag.pvp || map[m].flag.gvg)
//This stackable implementation does not means a BL can be more than one type at a time, but it's
//meant to make it easier to check for multiple types at a time on invocations such as map_foreach* calls [Skotlex]
@@ -389,7 +389,8 @@ struct mapcell
struct barricade_data {
char npc_event[50];
short m, x, y, count, amount, dir;
- bool killable;
+
+ bool killable, shootable, walkable;
};
struct map_data {
diff --git a/src/map/mob.c b/src/map/mob.c
index ac81e23e1..64aaf748f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -283,8 +283,11 @@ int mob_get_random_id(int type, int flag, int lv)
*------------------------------------------*/
bool mob_ksprotected (struct block_list *src, struct block_list *target)
{
- struct block_list *s_bl;
- struct map_session_data *sd, *pl_sd;
+ struct block_list *s_bl, *t_bl;
+ struct map_session_data
+ *sd, // Source
+ *pl_sd, // Owner
+ *t_sd; // Mob Target
struct status_change_entry *sce;
struct mob_data *md;
unsigned int tick = gettick();
@@ -302,8 +305,14 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
if( !(sd = BL_CAST(BL_PC,s_bl)) )
return false; // Master is not PC
+ t_bl = map_id2bl(md->target_id);
+ if( !t_bl || (s_bl = battle_get_master(t_bl)) == NULL )
+ s_bl = t_bl;
+
+ t_sd = BL_CAST(BL_PC,s_bl);
+
do {
- if( map[md->bl.m].flag.allowks || map[md->bl.m].flag.gvg || map[md->bl.m].flag.pvp )
+ if( map[md->bl.m].flag.allowks || map_flag_ks(md->bl.m) )
return false; // Ignores GVG, PVP and AllowKS map flags
if( md->db->mexp || md->master_id )
@@ -312,24 +321,23 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
if( (sce = md->sc.data[SC_KSPROTECTED]) == NULL )
break; // No KS Protected
- if( sd->bl.id == sce->val1 )
- break; // Same Player
+ if( sd->bl.id == sce->val1 || // Same Owner
+ (sce->val2 == 2 && sd->status.party_id && sd->status.party_id == sce->val3) || // Party KS allowed
+ (sce->val2 == 3 && sd->status.guild_id && sd->status.guild_id == sce->val4) ) // Guild KS allowed
+ break;
- if( !(pl_sd = map_id2sd(sce->val1)) )
- break; // Owner offline
+ if( t_sd && (
+ (sce->val2 == 1 && sce->val1 != t_sd->bl.id) ||
+ (sce->val2 == 2 && sce->val3 && sce->val3 != t_sd->status.party_id) ||
+ (sce->val2 == 3 && sce->val4 && sce->val4 != t_sd->status.guild_id)) )
+ break;
- if( pl_sd->bl.m != md->bl.m )
- break; // Protection expires on different map
+ if( (pl_sd = map_id2sd(sce->val1)) == NULL || pl_sd->bl.m != md->bl.m )
+ break;
if( !pl_sd->state.noks )
return false; // No KS Protected, but normal players should be protected too
- if( pl_sd->state.noks == 2 && pl_sd->status.party_id && pl_sd->status.party_id == sd->status.party_id )
- break; // Party KS allowed
-
- if( pl_sd->state.noks == 3 && pl_sd->status.guild_id && pl_sd->status.guild_id == sd->status.guild_id )
- break; // Guild KS allowed
-
// Message to KS
if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 )
{
@@ -351,7 +359,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
return true;
} while(0);
- status_change_start(target, SC_KSPROTECTED, 10000, sd->bl.id, 0, 0, 0, battle_config.ksprotection, 0);
+ status_change_start(target, SC_KSPROTECTED, 10000, sd->bl.id, sd->state.noks, sd->status.party_id, sd->status.guild_id, battle_config.ksprotection, 0);
return false;
}
@@ -516,27 +524,20 @@ void mob_barricade_nextxy(short x, short y, short dir, int pos, short *x1, short
*y1 = y + pos;
}
-short mob_barricade_build(short m, short x, short y, short count, short dir, bool killable, const char* event)
+short mob_barricade_build(short m, short x, short y, const char* mobname, short count, short dir, bool killable, bool walkable, bool shootable, bool odd, const char* event)
{
int i, j;
- short x1;
- short y1;
+ short x1, y1;
struct mob_data *md;
struct barricade_data *barricade;
- if( count <= 0 )
- return 1;
-
- if( !event )
- return 2;
-
- if( (barricade = (struct barricade_data *)strdb_get(barricade_db,event)) != NULL )
- return 3; // Already a barricade with event name
-
- if( map_getcell(m, x, y, CELL_CHKNOREACH) )
- return 4; // Starting cell problem
+ if( count <= 0 ) return 1;
+ if( !event ) return 2;
+ if( (barricade = (struct barricade_data *)strdb_get(barricade_db,event)) != NULL ) return 3; // Already a barricade with event name
+ if( map_getcell(m, x, y, CELL_CHKNOREACH) ) return 4; // Starting cell problem
CREATE(barricade, struct barricade_data, 1);
+
barricade->dir = dir;
barricade->x = x;
barricade->y = y;
@@ -544,26 +545,32 @@ short mob_barricade_build(short m, short x, short y, short count, short dir, boo
safestrncpy(barricade->npc_event, event, sizeof(barricade->npc_event));
barricade->amount = 0;
barricade->killable = killable;
-
- ShowInfo("New Barricade: %s.\n", barricade->npc_event);
-
+ barricade->shootable = shootable;
+ barricade->walkable = walkable;
+
for( i = 0; i < count; i++ )
{
mob_barricade_nextxy(x, y, dir, i, &x1, &y1);
- if( map_getcell(m, x1, y1, CELL_CHKNOREACH) )
- break; // Collision
+ if( map_getcell(m, x1, y1, CELL_CHKNOREACH) ) break; // Collision
- if( i % 2 == 0 )
+ if( (odd && i % 2 != 0) || (!odd && i % 2 == 0) )
{
barricade->amount++;
- j = mob_once_spawn(NULL, m, x1, y1, "--ja--", killable ? MOBID_BARRICADEB : MOBID_BARRICADEA, 1, "");
- md = (struct mob_data *)map_id2bl(j);
- md->barricade = barricade;
+
+ if( map[m].flag.gvg_castle )
+ j = mob_spawn_guardian(map[m].name, x1, y1, mobname, 1905, "", 0, false);
+ else
+ j = mob_once_spawn(NULL, m, x1, y1, mobname, 1905, 1, "");
+
+ if( (md = (struct mob_data *)map_id2bl(j)) != NULL )
+ md->barricade = barricade;
}
- map_setgatcell(m, x1, y1, (killable ? 5 : 1));
- clif_changemapcell(0, m, x1, y1, (killable ? 5 : 1), ALL_SAMEMAP);
+ if( !barricade->walkable ) map_setcell(m, x1, y1, CELL_WALKABLE, false);
+ map_setcell(m, x1, y1, CELL_SHOOTABLE, barricade->shootable);
+
+ clif_changemapcell(0, m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
barricade->count = i;
@@ -594,15 +601,16 @@ void mob_barricade_get(struct map_session_data *sd)
for( i = 0; i < barricade->count; i++ )
{
mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
- clif_changemapcell(sd->fd, barricade->m, x1, y1, (barricade->killable ? 5 : 1), SELF);
+ clif_changemapcell(sd->fd, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), SELF);
}
}
iter->destroy(iter);
}
-static void mob_barricade_break(struct barricade_data *barricade)
+static void mob_barricade_break(struct barricade_data *barricade, struct block_list *src)
{
int i;
+ struct map_session_data *sd = NULL;
short x1, y1;
if( barricade == NULL )
@@ -614,13 +622,29 @@ static void mob_barricade_break(struct barricade_data *barricade)
for( i = 0; i < barricade->count; i++ )
{
mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
- map_setgatcell(barricade->m, x1, y1, 0);
- clif_changemapcell(0, barricade->m, x1, y1, 0, ALL_SAMEMAP);
+
+ if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+ map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
+ clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
- npc_event_do(barricade->npc_event);
- map[barricade->m].barricade_num--;
+ if( src )
+ switch( src->type )
+ {
+ case BL_PC:
+ sd = BL_CAST(BL_PC,src);
+ break;
+ case BL_PET:
+ sd = ((TBL_PET*)src)->msd;
+ break;
+ case BL_HOM:
+ sd = ((TBL_HOM*)src)->master;
+ break;
+ }
+
+ if( sd ) npc_event(sd, barricade->npc_event, 0);
+ map[barricade->m].barricade_num--;
strdb_remove(barricade_db, barricade->npc_event);
}
@@ -660,8 +684,10 @@ void mod_barricade_clearall(void)
for( i = 0; i < barricade->count; i++ )
{
mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
- map_setgatcell(barricade->m, x1, y1, 0);
- clif_changemapcell(0, barricade->m, x1, y1, 0, ALL_SAMEMAP);
+
+ if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+ map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
+ clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
}
iter->destroy(iter);
@@ -2532,7 +2558,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
if( md->barricade != NULL )
- mob_barricade_break(md->barricade);
+ mob_barricade_break(md->barricade, src);
if(md->deletetimer!=-1) {
delete_timer(md->deletetimer,mob_timer_delete);
diff --git a/src/map/mob.h b/src/map/mob.h
index f01b4fff1..161a35126 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -222,7 +222,7 @@ int mob_once_spawn(struct map_session_data* sd,int m,short x,short y,const char*
int mob_once_spawn_area(struct map_session_data* sd,int m,int x0,int y0,int x1,int y1,const char* mobname,int class_,int amount,const char* event);
bool mob_ksprotected (struct block_list *src, struct block_list *target);
-short mob_barricade_build(short m, short x, short y, short count, short dir, bool killable, const char* event);
+short mob_barricade_build(short m, short x, short y, const char* mobname, short count, short dir, bool killable, bool walkable, bool shootable, bool odd, const char* event);
void mob_barricade_destroy(short m, const char *event);
void mob_barricade_get(struct map_session_data *sd);
void mod_barricade_clearall(void);
diff --git a/src/map/script.c b/src/map/script.c
index e0c853ba2..d9671516e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9857,6 +9857,41 @@ BUILDIN_FUNC(guardian)
return 0;
}
+/*==========================================
+ * Build Barricade [Zephyrus]
+ * buildbarricade("<map name>",<x>,<y>,"<name to show>",<size>,<dir>,<killable>,<walkable>,<shootable>,<odd>,"<event label>")
+ *------------------------------------------*/
+BUILDIN_FUNC(buildbarricade)
+{
+ int m = map_mapname2mapid(script_getstr(st,2));
+ int x = script_getnum(st,3);
+ int y = script_getnum(st,4);
+ const char *str = script_getstr(st,5);
+ int size = script_getnum(st,6);
+ short dir = script_getnum(st,7);
+ bool killable = (bool)script_getnum(st,8);
+ bool walkable = (bool)script_getnum(st,9);
+ bool shootable = (bool)script_getnum(st,10);
+ bool odd = (bool)script_getnum(st,11);
+ const char *evt = script_getstr(st,12);
+
+ if( m < 0 ) return -1;
+
+ check_event(st, evt);
+ mob_barricade_build(m, x, y , str, size, dir, killable, walkable, shootable, odd, evt);
+
+ return 0;
+}
+
+BUILDIN_FUNC(killbarricade)
+{
+ int m = map_mapname2mapid(script_getstr(st,2));
+ const char *evt = script_getstr(st,3);
+
+ mob_barricade_destroy(m, evt);
+
+ return 0;
+}
/// Retrieves various information about the specified guardian.
///
@@ -13527,6 +13562,8 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(openauction,""),
BUILDIN_DEF(checkcell,"siii"),
BUILDIN_DEF(setcell,"siiiiii"),
+ BUILDIN_DEF(buildbarricade,"siisiiiiiis"),
+ BUILDIN_DEF(killbarricade,"ss"),
BUILDIN_DEF(getquest, "ii*"),
BUILDIN_DEF(deletequest, "i"),
BUILDIN_DEF(setquestobjective, "iisi"),
diff --git a/src/map/skill.c b/src/map/skill.c
index 0770f28ab..c5a73188d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1244,7 +1244,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
case BL_MOB:
{
struct mob_data* md = BL_CAST(BL_MOB, target);
- if( md->class_ == MOBID_EMPERIUM || md->class_ == MOBID_BARRICADEA || md->class_ == MOBID_BARRICADEB )
+ if( md->class_ == MOBID_EMPERIUM || md->barricade )
return 0;
if(src != target && is_boss(target)) //Bosses can't be knocked-back
return 0;
diff --git a/src/map/status.c b/src/map/status.c
index 575b6b4ff..9fc4e8f93 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -449,6 +449,14 @@ void initChangeTables(void)
StatusIconChangeTable[SC_ITEMBOOST] = SI_ITEMBOOST;
StatusIconChangeTable[SC_LIFEINSURANCE] = SI_LIFEINSURANCE;
StatusIconChangeTable[SC_BOSSMAPINFO] = SI_BOSSMAPINFO;
+ StatusIconChangeTable[SC_DEF_RATE] = SI_DEF_RATE;
+ StatusIconChangeTable[SC_MDEF_RATE] = SI_MDEF_RATE;
+ StatusIconChangeTable[SC_INCCRI] = SI_INCCRI;
+ StatusIconChangeTable[SC_INCHEALRATE] = SI_INCHEALRATE;
+ StatusIconChangeTable[SC_HPREGEN] = SI_HPREGEN;
+ StatusIconChangeTable[SC_SPCOST_RATE] = SI_SPCOST_RATE;
+ StatusIconChangeTable[SC_COMMONSC_RESIST] = SI_COMMONSC_RESIST;
+ StatusIconChangeTable[SC_ARMOR_RESIST] = SI_ARMOR_RESIST;
//Other SC which are not necessarily associated to skills.
StatusChangeFlagTable[SC_ASPDPOTION0] = SCB_ASPD;
@@ -479,7 +487,6 @@ void initChangeTables(void)
StatusChangeFlagTable[SC_INCATKRATE] |= SCB_BATK|SCB_WATK;
StatusChangeFlagTable[SC_INCMATKRATE] |= SCB_MATK;
StatusChangeFlagTable[SC_INCDEFRATE] |= SCB_DEF;
- StatusChangeFlagTable[SC_INCMDEFRATE] |= SCB_MDEF;
StatusChangeFlagTable[SC_INCBASEATK] |= SCB_BATK;
StatusChangeFlagTable[SC_STRFOOD] |= SCB_STR;
StatusChangeFlagTable[SC_AGIFOOD] |= SCB_AGI;
@@ -744,12 +751,12 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
}
if (!(flag&8) && sc && sc->data[SC_KAIZEL]) { //flag&8 = disable Kaizel
- int time = skill_get_time2(SL_KAIZEL,sc->data[SC_KAIZEL]->val1);
+ int time = skill_get_time2(SL_KAIZEL,sc->data[SC_KAIZEL]->val1);
status_revive(target, sc->data[SC_KAIZEL]->val2, 0);
- status_change_clear(target,0);
- clif_skill_nodamage(target,target,ALL_RESURRECTION,1,1);
- sc_start(target,status_skill2sc(PR_KYRIE),100,10,time);
- return hp+sp;
+ status_change_clear(target,0);
+ clif_skill_nodamage(target,target,ALL_RESURRECTION,1,1);
+ sc_start(target,status_skill2sc(PR_KYRIE),100,10,time);
+ return hp+sp;
}
status_change_clear(target,0);
@@ -3680,8 +3687,6 @@ static signed char status_calc_mdef(struct block_list *bl, struct status_change
mdef += sc->data[SC_ENDURE]->val1;
if(sc->data[SC_CONCENTRATION])
mdef += 1; //Skill info says it adds a fixed 1 Mdef point.
- if(sc->data[SC_INCMDEFRATE])
- mdef += mdef * sc->data[SC_INCMDEFRATE]->val1/100;
return (signed char)cap_value(mdef,CHAR_MIN,CHAR_MAX);
}
@@ -4576,7 +4581,7 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX)
{
if( sd->reseff[type-SC_COMMON_MIN] > 0 )
- rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
+ rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
if( sd->sc.data[SC_COMMONSC_RESIST] )
rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1;
}
@@ -4639,7 +4644,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if( bl->type == BL_MOB )
{
struct mob_data *md = BL_CAST(BL_MOB,bl);
- if( (md->class_ == MOBID_EMPERIUM && type != SC_SAFETYWALL && type != SC_PNEUMA) || md->class_ == MOBID_BARRICADEA )
+ if( (md->class_ == MOBID_EMPERIUM && type != SC_SAFETYWALL && type != SC_PNEUMA) || md->barricade )
return 0; //Emperium can't be afflicted by status changes
}
diff --git a/src/map/status.h b/src/map/status.h
index 0cc5435a5..276cd1b1c 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -282,7 +282,7 @@ typedef enum sc_type {
SC_INCDEF,
SC_INCBASEATK,
SC_FASTCAST,
- SC_INCMDEFRATE,
+ SC_MDEF_RATE,
SC_HPREGEN,
SC_INCHEALRATE,
SC_PNEUMA,
@@ -292,6 +292,7 @@ typedef enum sc_type {
SC_SPCOST_RATE,
SC_COMMONSC_RESIST,
SC_SEVENWIND,
+ SC_DEF_RATE,
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;
@@ -456,6 +457,15 @@ enum si_type {
//SI_FOODLUK = 276, //Same as 246
SI_SLOWCAST = 282,
SI_CRITICALWOUND = 286,
+ SI_DEF_RATE = 290,
+ SI_MDEF_RATE = 291,
+ SI_INCCRI = 292,
+ SI_INCHEALRATE = 293,
+ SI_HPREGEN = 294,
+ // 295 Sword ?
+ SI_SPCOST_RATE = 300,
+ SI_COMMONSC_RESIST = 301,
+ SI_ARMOR_RESIST = 302,
};
// JOINTBEAT stackable ailments