avertuss 48 Posted February 9, 2018 Share Posted February 9, 2018 (edited) Hi. i wrote quest quest block_horse begin state start begin when login with pc.get_map_index() >= 1100000 and pc.get_map_index() <= 1110000 begin horse.unride() horse.unsummon() pc.unmount() end end end quest works but only with horse, with mount too(pc isn't on mount), but mount item is still in the slot How can i fix that? Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
JeeX 38 Posted February 9, 2018 Share Posted February 9, 2018 why with quest? do you use source? - its pritty simple to create in c++ Link to comment Share on other sites More sharing options...
avertuss 48 Posted February 9, 2018 Author Share Posted February 9, 2018 1 godzinę temu, JeeX napisał: why with quest? do you use source? - its pritty simple to create in c++ Yes. I'm using source but i have no idea how to do it in c++. Link to comment Share on other sites More sharing options...
JeeX 38 Posted February 10, 2018 Share Posted February 10, 2018 vor 20 Stunden schrieb avertuss: Yes. I'm using source but i have no idea how to do it in c++. I hope i didn't forgot anything <- //char.cpp //add after includes: bool IsMountable(int map_index, bool isHorse) { if (CArenaManager::instance().IsArenaMap(map_index)) return false; switch (map_index) { case YOUR_MAPINDEX: //edit this <- [e.g. 61 - look @ your map_index] return false; } return true; } //char_item.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell) //add: if (item->IsCostumeMount() && !IsMountable(GetMapIndex(), false)) return false; //input_login.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: void CInputLogin::Entergame(LPDESC d, const char * data) if (!IsMountable(ch->GetMapIndex(), false)) ch->UnEquipCostumeMoudeItem(false); //questlua_horse.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: ALUA(horse_summon) //add: if (!IsMountable(ch->GetMapIndex(), true)) return 0; //search: ALUA(horse_in_summonable_area) //add: lua_pushboolean(L, IsMountable(ch->GetMapIndex(), isMount)); //questlua_pc.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: ALUA(pc_mount) //add: if (!IsMountable(ch->GetMapIndex(), mount_vnum == ch->GetMyHorseVnum())) return 0; Link to comment Share on other sites More sharing options...
avertuss 48 Posted February 10, 2018 Author Share Posted February 10, 2018 44 minuty temu, JeeX napisał: I hope i didn't forgot anything <- //char.cpp //add after includes: bool IsMountable(int map_index, bool isHorse) { if (CArenaManager::instance().IsArenaMap(map_index)) return false; switch (map_index) { case YOUR_MAPINDEX: //edit this <- [e.g. 61 - look @ your map_index] return false; } return true; } //char_item.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell) //add: if (item->IsCostumeMount() && !IsMountable(GetMapIndex(), false)) return false; //input_login.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: void CInputLogin::Entergame(LPDESC d, const char * data) if (!IsMountable(ch->GetMapIndex(), false)) ch->UnEquipCostumeMoudeItem(false); //questlua_horse.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: ALUA(horse_summon) //add: if (!IsMountable(ch->GetMapIndex(), true)) return 0; //search: ALUA(horse_in_summonable_area) //add: lua_pushboolean(L, IsMountable(ch->GetMapIndex(), isMount)); //questlua_pc.cpp //add after includes: extern bool IsMountable(int map_index, bool isHorse); //search: ALUA(pc_mount) //add: if (!IsMountable(ch->GetMapIndex(), mount_vnum == ch->GetMyHorseVnum())) return 0; I don't have that IsCostumeMount in source. Link to comment Share on other sites More sharing options...
JeeX 38 Posted February 10, 2018 Share Posted February 10, 2018 // open item.h //search: bool IsDragonSoul(); //add under: bool IsCostumeMount() { return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT; } Link to comment Share on other sites More sharing options...
avertuss 48 Posted February 11, 2018 Author Share Posted February 11, 2018 21 godzin temu, JeeX napisał: // open item.h //search: bool IsDragonSoul(); //add under: bool IsCostumeMount() { return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT; } input_login.cpp:608: error: 'class CHARACTER' has no member named 'UnEquipCostumeMoudeItem' Link to comment Share on other sites More sharing options...
JeeX 38 Posted February 12, 2018 Share Posted February 12, 2018 vor 11 Stunden schrieb avertuss: input_login.cpp:608: error: 'class CHARACTER' has no member named 'UnEquipCostumeMoudeItem' //open char_item.cpp //search: bool CHARACTER::UnEquipSpecialRideUniqueItem() //add avbove: bool CHARACTER::UnEquipCostumeMoudeItem(bool isOnDeath) { LPITEM CostumeMount = GetWear(WEAR_COSTUME_MOUNT); if (NULL != CostumeMount) { if (CostumeMount->IsCostumeMount()) { return UnequipItem(CostumeMount); } } return true; } //open char.h //search: bool UnEquipSpecialRideUniqueItem (); //add: bool UnEquipCostumeMoudeItem(bool isOnDeath); Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now