diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/itemdb.c | 17 | ||||
-rw-r--r-- | src/map/skill.c | 27 |
2 files changed, 31 insertions, 13 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 29b676aed..4b40a93e7 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -113,13 +113,28 @@ int itemdb_searchrandomid(int group) }
/*==========================================
- *
+ * Returns the group this item belongs to.
+ * Skips general random item givers (gift/blue/violet box)
*------------------------------------------
*/
int itemdb_group (int nameid)
{
int i, j;
for (i=0; i < MAX_ITEMGROUP; i++) {
+ switch (i) {
+ case IG_BLUEBOX:
+ case IG_VIOLETBOX:
+ case IG_CARDALBUM:
+ case IG_GIFTBOX:
+ case IG_COOKIEBAG:
+ case IG_GIFTBOX_1:
+ case IG_GIFTBOX_2:
+ case IG_GIFTBOX_3:
+ case IG_GIFTBOX_4:
+ case IG_GIFTBOXCHINA:
+ continue;
+ }
+
for (j=0; j < itemgroup_db[i].qty; j++) {
if (itemgroup_db[i].id[j] == nameid)
return i;
diff --git a/src/map/skill.c b/src/map/skill.c index e360680b6..364d87b1b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -9320,21 +9320,24 @@ int skill_landprotector (struct block_list *bl, va_list ap) return 1; } - if (skill_get_type(unit->group->skill_id) != BF_MAGIC) - return 0; //Only blocks out magical skills. - - if (skillid == SA_LANDPROTECTOR || skillid == HW_GANBANTEIN ) { + if((skillid == SA_LANDPROTECTOR || skillid == HW_GANBANTEIN) && + skill_get_type(unit->group->skill_id) == BF_MAGIC) + { //Delete Magical effects skill_delunit(unit); - } else - if (unit->group->skill_id == SA_LANDPROTECTOR) { + return 1; + } + if (unit->group->skill_id == SA_LANDPROTECTOR && + skill_get_type(skillid) == BF_MAGIC) + { //Magic tile won't be activated (*alive) = 0; - } else - if (skillid == HP_BASILICA && unit->group->skill_id == HP_BASILICA) { - //Basilica can't be placed on top of itself to avoid map-cell stacking problems. [Skotlex] + return 1; + } + if (skillid == HP_BASILICA && unit->group->skill_id == HP_BASILICA) + { //Basilica can't be placed on top of itself to avoid map-cell stacking problems. [Skotlex] (*alive) = 0; - } else - return 0; - return 1; + return 1; + } + return 0; } /*========================================== |