From 83c8183a2ed2e46ffd7005ee9cb998c0f20dfda0 Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Mon, 6 Aug 2018 08:06:30 +0700 Subject: [PATCH] Added IG_PRIVATE_AIRSHIP (#3378) * Item group for Private Airship tickets --- db/re/item_misc.txt | 3 +++ src/map/clif.cpp | 14 ++------------ src/map/itemdb.hpp | 3 +-- src/map/script_constants.hpp | 1 + 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/db/re/item_misc.txt b/db/re/item_misc.txt index 823f521c7c..76cf358c25 100644 --- a/db/re/item_misc.txt +++ b/db/re/item_misc.txt @@ -1400,3 +1400,6 @@ IG_PrizeOfHero,15098,1 // Hero_Taget_Suits IG_PrizeOfHero,22035,2 // Vet_Nepen_Heel IG_PrizeOfHero,22036,2 // Vet_SliverFox_Boots IG_PrizeOfHero,22037,2 // Vet_Ungo_Boots +// Private Airship items +IG_PRIVATE_AIRSHIP,6909,1 // Actinidia_Cat_Fruit +IG_PRIVATE_AIRSHIP,25464,1 // World_Moving_Rights diff --git a/src/map/clif.cpp b/src/map/clif.cpp index f3c3bca6f5..ad6b3155ca 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20466,24 +20466,14 @@ void clif_parse_private_airship_request( int fd, struct map_session_data* sd ){ return; } - // The UI only offers these two buttons(items) for now - uint16 item_ids[] = { - ITEMID_ACTINIDIA_CAT_FRUIT, - ITEMID_WORLD_MOVING_RIGHTS - }; - uint16 item_id = RFIFOW( fd, 2 + MAP_NAME_LENGTH_EXT ); - int i; - - ARR_FIND( 0, ARRAYLENGTH( item_ids ), i, item_ids[i] == item_id ); - // Check if the item sent by the client is known to us - if( i == ARRAYLENGTH( item_ids ) ){ + if( !itemdb_group_item_exists(IG_PRIVATE_AIRSHIP, item_id) ){ clif_private_airship_response( sd, PRIVATEAIRSHIP_ITEM_UNAVAILABLE ); return; } - + int idx = pc_search_inventory( sd, item_id ); // Check if the player has the item at all diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 6942551f98..a45114468d 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -80,7 +80,6 @@ enum item_itemid ITEMID_PAINT_BRUSH = 6122, ITEMID_MAGIC_GEAR_FUEL = 6146, ITEMID_STRANGE_EMBRYO = 6415, - ITEMID_ACTINIDIA_CAT_FRUIT = 6909, ITEMID_STONE = 7049, ITEMID_FIRE_BOTTLE = 7135, ITEMID_ACID_BOTTLE = 7136, @@ -121,7 +120,6 @@ enum item_itemid ITEMID_WOB_RACHEL = 14584, ITEMID_WOB_LOCAL = 14585, ITEMID_SIEGE_TELEPORT_SCROLL = 14591, - ITEMID_WORLD_MOVING_RIGHTS = 25464, }; ///Rune Knight @@ -734,6 +732,7 @@ enum e_random_item_group { IG_SPECIAL_CHRISTMAS_BOX, IG_SANTA_GIFT, IG_PRIZEOFHERO, + IG_PRIVATE_AIRSHIP, }; /// Enum for bound/sell restricted selling diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 9ba73c6b01..f81a824c48 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -4977,6 +4977,7 @@ export_constant(IG_SPECIAL_CHRISTMAS_BOX); export_constant(IG_SANTA_GIFT); export_constant(IG_PRIZEOFHERO); + export_constant(IG_PRIVATE_AIRSHIP); /* unit stop walking */ export_constant(USW_NONE);