Skip to content

Commit 3ee39f3

Browse files
committed
== Crash-fixes and more ==
=General: *Merged missing changes from 3ceam rev. 503 - 504 *Fixed Wizard Jobquest -Fixed getting stuck when failing 2nd Wave of Earth Room. *Fixed an issue where the Itembound system would crash the char-server. *Fixed an typo that was causing map server crashes. *Fixed wrong item deletion in guild creation code if emperium item not in inventory. -Thanks to @HerculesWS / @4144. *Fixed GC_CLOAKINGEXCEED that wasn't properly hiding from demons/insects. =Databases: *Added Eclage Card drops. -Also added some missing cards. *Added some more monsters to Dead Branches.
1 parent cbbe671 commit 3ee39f3

File tree

9 files changed

+96
-63
lines changed

9 files changed

+96
-63
lines changed

Changelog-15-3athena.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
// * Modifications.
55
// - Details.
66
//========================================
7+
08/09/2016
8+
r133 [15peaces]
9+
*Merged missing changes from 3ceam rev. 503 - 504
10+
*Added Eclage Card drops.
11+
-Also added some missing cards.
12+
*Added some more monsters to Dead Branches.
13+
*Fixed Wizard Jobquest
14+
-Fixed getting stuck when failing 2nd Wave of Earth Room.
15+
*Fixed an issue where the Itembound system would crash the char-server.
16+
*Fixed an typo that was causing map server crashes.
17+
*Fixed wrong item deletion in guild creation code if emperium item not in inventory.
18+
-Thanks to @HerculesWS / @4144.
19+
*Fixed GC_CLOAKINGEXCEED that wasn't properly hiding from demons/insects.
20+
721
07/31/2016
822
r132 [15peaces]
923
*Merged missing changes from 3ceam rev. 501 - 502

db/item_db2.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@
163163
19862,C_Succubus_Horn,Costume Succubus Horn,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,150,{},{},{}
164164
19863,C_Incubus_Horn,Costume Incubus Horn,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,156,{},{},{}
165165
19864,C_Dokebis_Wig,Costume Dokebi's Wig,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,302,{},{},{}
166-
167166
19865,C_Joker_Jester,Costume Joker Jester,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,89,{},{},{}
168167
19866,C_Blue_Pajamas,Costume Blue Pajamas,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,501,{},{},{}
169168
19867,C_Red_Pajamas,Costume Red Pajamas,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,501,{},{},{}
170169
19868,C_Showy_High_Cap,Costume Showy High Cap,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,830,{},{},{}
171170
19869,C_Boss_Beret,Costume Boss Beret,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,1134,{},{},{}
172171
19873,C_Carnival_Hat,Costume Carnival Hat,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,505,{},{},{}
172+
173173
19874,C_Carnival_Circlet,Costume Carnival Circlet,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,506,{},{},{}
174174
19875,C_Love_Rabbit_Hood,Costume Love Rabbit Hood,5,0,,0,,,,0,0xFFFFFFFF,63,2,7168,,,,549,{},{},{}
175175
19876,C_Rabbit_Ear_Hat,Costume Rabbit Ear Hat,5,0,,0,,,,0,0xFFFFFFFF,63,2,1024,,,,384,{},{},{}
@@ -2186,6 +2186,17 @@
21862186
22700,Jumping_Support_Box,Jumping Support Box,18,10,,0,,,,0,0xFFFFFFFF,63,2,,,,,,{ /*TODO: getitem 12529,1; getitem 12323,200; getitem 12324,50; and 5 boxes that containing quivers + oridecons*/ },{},{}
21872187

21882188
// New kRO Cards [renewal]
2189+
4593,Menblatt_Card,Menblatt Card,6,20,,10,,,,,,,,4,,,,,{ bonus bLongAtkRate,readparam(bDex)/10; },{},{}
2190+
4594,Petal_Card,Petal Card,6,20,,10,,,,,,,,4,,,,,{ bonus bCritAtkRate,2*(readparam(bLuk)/10); },{},{}
2191+
4595,Cenere_Card,Cenere Card,6,20,,10,,,,,,,,4,,,,,{ bonus bAspdRate,2*(readparam(bAgi)/10); },{},{}
2192+
4596,Antique_Book_Card,Antique Book Card,6,20,,10,,,,,,,,4,,,,,{ bonus bMatk,5*(readparam(bInt)/10); },{},{}
2193+
4597,Lichtern_Blue_Card,Lichtern Blue Card,6,20,,10,,,,,,,,769,,,,,{ bonus bMatk,10; bonus2 bMagicAtkEle,Ele_Water,(getrefine()>=9)?10:5; },{},{}
2194+
4598,Lichtern_Green_Card,Lichtern Green Card,6,20,,10,,,,,,,,769,,,,,{ bonus bMatk,10; bonus2 bMagicAtkEle,Ele_Ghost,(getrefine()>=9)?10:5; },{},{}
2195+
4599,Lichtern_Red_Card,Lichtern Red Card,6,20,,10,,,,,,,,769,,,,,{ bonus bMatk,10; bonus2 bMagicAtkEle,Ele_Fire,(getrefine()>=9)?10:5; },{},{}
2196+
4600,Lichtern_Yellow_Card,Lichtern Yellow Card,6,20,,10,,,,,,,,769,,,,,{ bonus bMatk,10; bonus2 bMagicAtkEle,Ele_Earth,(getrefine()>=9)?10:5; },{},{}
2197+
4601,Amdarais_Card,Amdarais Card,6,20,,10,,,,,,,,16,,,,,{ bonus bAtkRate,15; bonus bMatkRate,15; bonus2 bHPLossRate,666,4000; bonus2 bSPLossRate,66,4000; },{},{ heal -6666,-666; }
2198+
4602,Realized_Amdarais_Card,Realized Amdarais Card,6,20,,10,,,,,,,,16,,,,,{ bonus bAtkRate,20; bonus bMatkRate,20; bonus2 bHPLossRate,666,6000; bonus2 bSPLossRate,66,6000; },{},{ heal -6666,-666; }
2199+
4607,Faithful_Manager_Card,Faithful Manager Card,6,20,,10,,,,,,,,2,,,,,{ bonus bBaseAtk,5; bonus bMatk,5; if(getiteminfo(getequipid(EQI_HAND_R),11) == W_BOOK) { set .@r, getrefine(); if(.@r>=10) { bonus bBaseAtk,20; bonus bMatk,20; } if(.@r>=14) { bonus bBaseAtk,20; bonus bMatk,20; } } },{},{}
21892200
4642,Min_Toad_Card,Infinite Toad Card,6,20,,10,,,,,,,,64,,,,,{ set .@r,getrefine(); if(.@r>6){ set .@b,.@b+2; if(.@r>8) set .@b,.@b+3; } bonus bFlee2,2+.@b; },{},{}
21902201
4643,Min_Vagabond_Wolf_Card,Infinite Vagabond Wolf Card,6,20,,10,,,,,,,,64,,,,,{ set .@r,getrefine(); if(.@r>6){ set .@b,.@b+10; if(.@r>8)set .@b,.@b+15; } bonus bAtk,10+.@b; },{},{}
21912202
4644,Min_Vocal_Card,Infinite Vocal Card,6,20,,10,,,,,,,,64,,,,,{ set .@r,getrefine(); if(.@r>6){ set .@b,.@b+10; if(.@r>8) set .@b,.@b+15; } bonus bMdef,5+.@b; },{},{}

db/mob_branch.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,15 @@
417417
1796,Aunoe,142857
418418
1797,Fanat,142857
419419
1830,Bow Guardian,71428
420+
1837,Imp,71428
420421
1839,Byrogue,71428
421422
1866,Hellhound,71428
422423
1867,Banshee,71428
423424
1869,Flame Skull,71428
424425
1872,Hell Fly,71428
425426
1882,Baba-Yaga,71428
427+
1920,Incarnation of Morroc,71428
428+
1921,Incarnation of Morroc,71428
426429
1974,Banshee Master,71428
427430
1975,Beholder Master,71428
428431
1976,Cobalt Mineral,71428

db/mob_db.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,15 +1273,15 @@
12731273

12741274
2343,HIDDEN_MOB_W,Hidden Mob,Hidden Mob,151,10000,200,0,0,7,0,1000,200,10,200,200,200,200,200,200,12,12,0,4,88,0x1C4,2000,0,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12751275
// Eclage (14.2)
1276-
2363,MENBLATT,Menblatt,Menblatt,143,147960,1,41500,34210,3,816,1017,9,6,70,68,40,55,108,30,10,12,1,4,44,0x3795,145,472,1056,480,0,0,0,0,0,0,0,0,6557,4000,7168,2000,7163,4608,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1277-
2364,PETAL,Petal,Petal,141,145855,1,40580,33610,1,671,844,8,4,70,82,55,45,108,25,10,12,1,2,24,0x3795,200,1500,768,480,0,0,0,0,0,0,0,0,6558,4000,12346,2000,1026,2000,6089,500,0,0,0,0,0,0,0,0,0,0,0,0
1278-
2365,CENERE,Cenere,Cenere,146,234235,1,71170,57120,1,1802,2833,10,10,67,39,30,35,95,45,10,12,0,3,24,0x3795,300,1500,720,360,0,0,0,0,0,0,0,0,6561,4000,7322,1000,7001,3000,7320,2000,0,0,0,0,0,0,0,0,0,0,0,0
1279-
2366,ANTIQUE_BOOK,Antique Book,Antique Book,148,242307,1,72250,58700,1,1861,3074,8,5,67,53,32,44,125,5,10,12,0,0,60,0x3795,150,864,960,480,0,0,0,0,0,0,0,0,6560,4000,7015,2000,1097,2000,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1280-
2367,LICHTERN_B,Blue Lichtern,Lichtern,149,236179,1,71870,57010,1,1513,2923,8,5,124,74,60,55,92,50,10,12,0,0,81,0x3795,150,480,1728,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,995,40,12812,10,0,0,0,0,0,0,0,0,0,0,0,0
1281-
2368,LICHTERN_Y,Yellow Lichtern,Lichtern,147,236723,1,70710,58100,1,1416,2977,9,6,141,94,75,91,144,50,10,12,0,0,88,0x3795,150,0,3456,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,997,40,12815,10,0,0,0,0,0,0,0,0,0,0,0,0
1282-
2369,LICHTERN_R,Red Lichtern,Lichtern,149,244292,1,72010,60130,1,1647,3096,12,7,147,77,66,65,133,50,10,12,0,0,83,0x3795,150,0,4032,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,994,40,12813,10,0,0,0,0,0,0,0,0,0,0,0,0
1283-
2370,LICHTERN_G,Green Lichtern,Lichtern,151,240211,1,72140,57100,1,1547,3141,13,57,121,60,58,62,102,50,10,12,0,0,82,0x3795,100,0,2304,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,996,40,12814,10,0,0,0,0,0,0,0,0,0,0,0,0
1284-
2371,FAITHFUL_MANAGER,Faithful Manager,Faithful Manager,155,272786,1,86760,65010,3,2091,3698,23,18,80,28,40,25,88,45,10,12,2,0,80,0x3795,200,480,1536,480,0,0,0,0,0,0,0,0,6559,4000,12353,2000,970,50,971,50,0,0,0,0,0,0,0,0,0,0,0,0
1276+
2363,MENBLATT,Menblatt,Menblatt,143,147960,1,41500,34210,3,816,1017,9,6,70,68,40,55,108,30,10,12,1,4,44,0x3795,145,472,1056,480,0,0,0,0,0,0,0,0,6557,4000,7168,2000,7163,4608,0,0,0,0,0,0,0,0,0,0,0,0,4593,1
1277+
2364,PETAL,Petal,Petal,141,145855,1,40580,33610,1,671,844,8,4,70,82,55,45,108,25,10,12,1,2,24,0x3795,200,1500,768,480,0,0,0,0,0,0,0,0,6558,4000,12346,2000,1026,2000,6089,500,0,0,0,0,0,0,0,0,0,0,4594,1
1278+
2365,CENERE,Cenere,Cenere,146,234235,1,71170,57120,1,1802,2833,10,10,67,39,30,35,95,45,10,12,0,3,24,0x3795,300,1500,720,360,0,0,0,0,0,0,0,0,6561,4000,7322,1000,7001,3000,7320,2000,0,0,0,0,0,0,0,0,0,0,4595,1
1279+
2366,ANTIQUE_BOOK,Antique Book,Antique Book,148,242307,1,72250,58700,1,1861,3074,8,5,67,53,32,44,125,5,10,12,0,0,60,0x3795,150,864,960,480,0,0,0,0,0,0,0,0,6560,4000,7015,2000,1097,2000,0,0,0,0,0,0,0,0,0,0,0,0,4596,1
1280+
2367,LICHTERN_B,Blue Lichtern,Lichtern,149,236179,1,71870,57010,1,1513,2923,8,5,124,74,60,55,92,50,10,12,0,0,81,0x3795,150,480,1728,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,995,40,12812,10,0,0,0,0,0,0,0,0,0,0,4597,1
1281+
2368,LICHTERN_Y,Yellow Lichtern,Lichtern,147,236723,1,70710,58100,1,1416,2977,9,6,141,94,75,91,144,50,10,12,0,0,88,0x3795,150,0,3456,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,997,40,12815,10,0,0,0,0,0,0,0,0,0,0,4600,1
1282+
2369,LICHTERN_R,Red Lichtern,Lichtern,149,244292,1,72010,60130,1,1647,3096,12,7,147,77,66,65,133,50,10,12,0,0,83,0x3795,150,0,4032,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,994,40,12813,10,0,0,0,0,0,0,0,0,0,0,4599,1
1283+
2370,LICHTERN_G,Green Lichtern,Lichtern,151,240211,1,72140,57100,1,1547,3141,13,57,121,60,58,62,102,50,10,12,0,0,82,0x3795,100,0,2304,480,0,0,0,0,0,0,0,0,1000,2000,1001,2000,996,40,12814,10,0,0,0,0,0,0,0,0,0,0,4598,1
1284+
2371,FAITHFUL_MANAGER,Faithful Manager,Faithful Manager,155,272786,1,86760,65010,3,2091,3698,23,18,80,28,40,25,88,45,10,12,2,0,80,0x3795,200,480,1536,480,0,0,0,0,0,0,0,0,6559,4000,12353,2000,970,50,971,50,0,0,0,0,0,0,0,0,0,0,4607,1
12851285
2372,SOIL,Soil,Soil,1,15,0,0,0,1,1,2,100,99,0,0,0,0,0,0,7,12,0,3,22,0x40,2000,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12861286
2373,ROCK,Rock,Rock,1,15,0,0,0,1,1,2,100,99,0,0,0,0,0,0,7,12,0,3,22,0x40,2000,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
12871287
2374,THICKET,Thicket,Thicket,1,15,0,0,0,1,1,2,100,99,0,0,0,0,0,0,7,12,0,3,22,0x40,2000,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

npc/jobs/2-1/wizard.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ OnTimer60000:
14031403
end;
14041404

14051405
OnTimer61000:
1406-
donpcevent "Room of Earth#Failed::OnEnable";
1406+
enablenpc "Room of Earth#Failed";
14071407
end;
14081408

14091409
OnTimer62000:

src/char_sql/char.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ int memitemdata_to_sql(const struct item items[], int max, int id, int tableswit
765765
SqlStmt_BindColumn(stmt, 5, SQLDT_CHAR, &item.refine, 0, NULL, NULL);
766766
SqlStmt_BindColumn(stmt, 6, SQLDT_CHAR, &item.attribute, 0, NULL, NULL);
767767
SqlStmt_BindColumn(stmt, 7, SQLDT_UINT, &item.expire_time, 0, NULL, NULL);
768-
SqlStmt_BindColumn(stmt, 8, SQLDT_UINT, &item.bound, 0, NULL, NULL);
768+
SqlStmt_BindColumn(stmt, 8, SQLDT_CHAR, &item.bound, 0, NULL, NULL);
769769
for( j = 0; j < MAX_SLOTS; ++j )
770770
SqlStmt_BindColumn(stmt, 9+j, SQLDT_USHORT, &item.card[j], 0, NULL, NULL);
771771

@@ -993,7 +993,7 @@ int inventory_to_sql(const struct item items[], int max, int id) {
993993
else {
994994
// update all fields.
995995
StringBuf_Clear(&buf);
996-
StringBuf_Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `favorite`='%d', `bound`='%u'",
996+
StringBuf_Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `favorite`='%d', `bound`='%d'",
997997
inventory_db, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].bound);
998998
for( j = 0; j < MAX_SLOTS; ++j )
999999
StringBuf_Printf(&buf, ", `card%d`=%d", j, items[i].card[j]);
@@ -1036,7 +1036,7 @@ int inventory_to_sql(const struct item items[], int max, int id) {
10361036
else
10371037
found = true;
10381038

1039-
StringBuf_Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%d', '%u'",
1039+
StringBuf_Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%d', '%d'",
10401040
id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].bound);
10411041
for( j = 0; j < MAX_SLOTS; ++j )
10421042
StringBuf_Printf(&buf, ", '%d'", items[i].card[j]);

src/map/clif.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5993,13 +5993,13 @@ int clif_display_banding(struct block_list *dst, struct block_list *bl, int val1
59935993
return 0;
59945994
}
59955995

5996-
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
5997-
/// 008e <packet len>.W <message>.?B
5998-
void clif_displaymessage(const int fd, const char* mes)
5999-
{
6000-
nullpo_retv(mes);
6001-
6002-
//Scrapped, as these are shared by disconnected players =X [Skotlex]
5996+
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
5997+
/// 008e <packet len>.W <message>.?B
5998+
void clif_displaymessage(const int fd, const char* mes)
5999+
{
6000+
nullpo_retv(mes);
6001+
6002+
//Scrapped, as these are shared by disconnected players =X [Skotlex]
60036003
if ( fd > 0 ) {
60046004
#if PACKETVER == 20141022
60056005
/** for some reason game client crashes depending on message pattern (only for this packet) **/

src/map/guild.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,12 @@ void guild_created(int account_id,int guild_id)
307307
//struct guild *g;
308308
sd->status.guild_id=guild_id;
309309
clif_guild_created(sd,0);
310-
if(battle_config.guild_emperium_check)
311-
pc_delitem(sd,pc_search_inventory(sd,714),1,0,0); //emperium consumption
310+
if(battle_config.guild_emperium_check){
311+
int index = pc_search_inventory(sd,ITEMID_EMPERIUM);
312+
313+
if( index > 0 )
314+
pc_delitem(sd,index,1,0,0); //emperium consumption
315+
}
312316
return;
313317
}
314318

src/map/status.c

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,45 +1571,46 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
15711571
if( skill_get_ele(skill_num, (skill_lv) ? skill_lv : 1) == ELE_EARTH )
15721572
hide_flag &= ~OPTION_HIDE;
15731573

1574-
switch( target->type )
1575-
{
1576-
case BL_PC:
1577-
{
1578-
struct map_session_data *sd = (TBL_PC*) target;
1579-
if (pc_isinvisible(sd))
1580-
return 0;
1581-
if( tsc->option&hide_flag && !(status->mode&MD_BOSS) && (sd->special_state.perfect_hiding || !(status->mode&MD_DETECTOR)))
1582-
return 0;
1583-
if( tsc->data[SC_CAMOUFLAGE] && !(status->mode&(MD_BOSS|MD_DETECTOR)) && !skill_num )
1584-
return 0;
1585-
if( tsc->data[SC_STEALTHFIELD] )
1586-
return 0;
1587-
if( sc && sc->data[SC_CURSEDCIRCLE_TARGET] )
1588-
return 0;
1589-
}
1590-
break;
1591-
case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them).
1592-
//TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex]
1593-
if (status->mode&MD_LOOTER)
1594-
return 1;
1595-
return 0;
1596-
case BL_HOM:
1597-
case BL_MER:
1598-
case BL_ELEM:
1599-
if( target->type == BL_HOM && skill_num && battle_config.hom_setting&0x1 && skill_get_inf(skill_num)&INF_SUPPORT_SKILL && battle_get_master(target) != src )
1600-
return 0; // Can't use support skills on Homunculus (only Master/Self)
1601-
if( target->type == BL_MER && (skill_num == PR_ASPERSIO || (skill_num >= SA_FLAMELAUNCHER && skill_num <= SA_SEISMICWEAPON)) && battle_get_master(target) != src )
1602-
return 0; // Can't use Weapon endow skills on Mercenary (only Master)
1603-
if( (target->type == BL_MER || target->type == BL_ELEM) && skill_num == AM_POTIONPITCHER )
1604-
return 0; // Can't use Potion Pitcher on Mercenaries
1605-
default:
1606-
//Check for chase-walk/hiding/cloaking opponents.
1607-
if( tsc ){
1608-
if( tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)) )
1609-
return 0;
1610-
if( tsc->data[SC_STEALTHFIELD] )
1611-
return 0;
1612-
}
1574+
switch( target->type ) {
1575+
case BL_PC:
1576+
{
1577+
struct map_session_data *sd = (TBL_PC*) target;
1578+
if (pc_isinvisible(sd))
1579+
return 0;
1580+
if( tsc->data[SC_CLOAKINGEXCEED] && !(status->mode&MD_BOSS) )
1581+
return 0;
1582+
if( tsc->option&hide_flag && !(status->mode&MD_BOSS) && (sd->special_state.perfect_hiding || !(status->mode&MD_DETECTOR)))
1583+
return 0;
1584+
if( tsc->data[SC_CAMOUFLAGE] && !(status->mode&(MD_BOSS|MD_DETECTOR)) && !skill_num )
1585+
return 0;
1586+
if( tsc->data[SC_STEALTHFIELD] )
1587+
return 0;
1588+
if( sc && sc->data[SC_CURSEDCIRCLE_TARGET] )
1589+
return 0;
1590+
}
1591+
break;
1592+
case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them).
1593+
//TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex]
1594+
if (status->mode&MD_LOOTER)
1595+
return 1;
1596+
return 0;
1597+
case BL_HOM:
1598+
case BL_MER:
1599+
case BL_ELEM:
1600+
if( target->type == BL_HOM && skill_num && battle_config.hom_setting&0x1 && skill_get_inf(skill_num)&INF_SUPPORT_SKILL && battle_get_master(target) != src )
1601+
return 0; // Can't use support skills on Homunculus (only Master/Self)
1602+
if( target->type == BL_MER && (skill_num == PR_ASPERSIO || (skill_num >= SA_FLAMELAUNCHER && skill_num <= SA_SEISMICWEAPON)) && battle_get_master(target) != src )
1603+
return 0; // Can't use Weapon endow skills on Mercenary (only Master)
1604+
if( (target->type == BL_MER || target->type == BL_ELEM) && skill_num == AM_POTIONPITCHER )
1605+
return 0; // Can't use Potion Pitcher on Mercenaries
1606+
default:
1607+
//Check for chase-walk/hiding/cloaking opponents.
1608+
if( tsc ){
1609+
if( tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)) )
1610+
return 0;
1611+
if( tsc->data[SC_STEALTHFIELD] )
1612+
return 0;
1613+
}
16131614
}
16141615
return 1;
16151616
}
@@ -4206,7 +4207,7 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
42064207
if( sc->data[SC_PYROTECHNIC_OPTION] )
42074208
watk += sc->data[SC_PYROTECHNIC_OPTION]->val2;
42084209
if( sc && sc->data[SC_TIDAL_WEAPON] )
4209-
watk += watk * sc->data[SC_TIDAL_WEAPON_OPTION]->val2 / 100;
4210+
watk += watk * sc->data[SC_TIDAL_WEAPON]->val2 / 100;
42104211

42114212
return (unsigned short)cap_value(watk,0,USHRT_MAX);
42124213
}

0 commit comments

Comments
 (0)