Jimmermania 27 Posted September 27, 2022 Share Posted September 27, 2022 Hello community. I'm searching a way to make an item to be able to use it only on PvP Map. For example, I want talisman (79800 vnum) to be able to wear it ONLY at PvP map. Any ideas how to do it? Thanks in advance. Link to comment Share on other sites More sharing options...
BadGrecee 4 Posted September 28, 2022 Share Posted September 28, 2022 char_item.cpp open and search: if (CArenaManager::instance().IsLimitedItem(GetMapIndex(), item->GetVnum()) == true) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·Ã Áß¿¡´Â ÀÌ¿ëÇÒ ¼ö ¾ø´Â ¹°Ç°ÀÔ´Ï´Ù.")); return false; } before add: if (item->GetVnum() == 71018 && GetMapIndex() != 41) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Only Arena Map")); return false; } 71018 item code 41 map codes edit it yourself. Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted September 29, 2022 Author Share Posted September 29, 2022 8 hours ago, BadGrecee said: char_item.cpp open and search: if (CArenaManager::instance().IsLimitedItem(GetMapIndex(), item->GetVnum()) == true) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·Ã Áß¿¡´Â ÀÌ¿ëÇÒ ¼ö ¾ø´Â ¹°Ç°ÀÔ´Ï´Ù.")); return false; } before add: if (item->GetVnum() == 71018 && GetMapIndex() != 41) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Only Arena Map")); return false; } 71018 item code 41 map codes edit it yourself. Thanks for your answer. But when the player goes to 41 map and wear the item, if he goes after to the other maps he keeps wearing the item. How i can unquip it ? (here there must be a check to check if the inventory is full too. If its full it should not unequip the item) Link to comment Share on other sites More sharing options...
BadGrecee 4 Posted September 29, 2022 Share Posted September 29, 2022 (edited) 9 hours ago, Jimmermania said: Thanks for your answer. But when the player goes to 41 map and wear the item, if he goes after to the other maps he keeps wearing the item. How i can unquip it ? (here there must be a check to check if the inventory is full too. If its full it should not unequip the item) input_login.cpp open and search (Inside the Entergame function) Search: // Adding a character to the map ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z); SECTREE_MANAGER::instance().SendNPCPosition(ch); ch->ReviveInvisible(REVIVEINVISIBLE_TIME); d->SetPhase(PHASE_GAME); Add after: if (ch->GetMapIndex() != 41) ch->UnequipItem(71018); Edited September 29, 2022 by BadGrecee Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted September 29, 2022 Author Share Posted September 29, 2022 3 hours ago, BadGrecee said: input_login.cpp open and search (Inside the Entergame function) Search: // Adding a character to the map ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z); SECTREE_MANAGER::instance().SendNPCPosition(ch); ch->ReviveInvisible(REVIVEINVISIBLE_TIME); d->SetPhase(PHASE_GAME); Add after: if (ch->GetMapIndex() != 41) ch->UnequipItem(71018); And how to check if inventory is full not to unequip ? 3 hours ago, BadGrecee said: input_login.cpp open and search (Inside the Entergame function) Search: // Adding a character to the map ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z); SECTREE_MANAGER::instance().SendNPCPosition(ch); ch->ReviveInvisible(REVIVEINVISIBLE_TIME); d->SetPhase(PHASE_GAME); Add after: if (ch->GetMapIndex() != 41) ch->UnequipItem(71018); Also, i have this error : error: invalid conversion from 'int' to 'LPITEM' {aka 'CItem*'} [-fpermissive] Link to comment Share on other sites More sharing options...
BadGrecee 4 Posted September 30, 2022 Share Posted September 30, 2022 (edited) 10 hours ago, Jimmermania said: And how to check if inventory is full not to unequip ? Also, i have this error : error: invalid conversion from 'int' to 'LPITEM' {aka 'CItem*'} [-fpermissive] Ah soryy LPITEM if (ch->GetMapIndex() != 41) { LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; ////ITEM_CODE you item code if (onlyMapItem) ch->UnequipItem(onlyMapItem); } Add them to the line I call input_login.cpp. Delete my old codes. NOTE : LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; //ITEM_CODE you item code Edited September 30, 2022 by BadGrecee 1 Link to comment Share on other sites More sharing options...
Jimmermania 27 Posted September 30, 2022 Author Share Posted September 30, 2022 28 minutes ago, BadGrecee said: Ah soryy LPITEM if (ch->GetMapIndex() != 41) { LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; ////ITEM_CODE you item code if (onlyMapItem) ch->UnequipItem(onlyMapItem); } Add them to the line I call input_login.cpp. Delete my old codes. NOTE : LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; //ITEM_CODE you item code Thanks for your answer dude, but if the inventory is full , it should not unequip it because the player will be bugged. Link to comment Share on other sites More sharing options...
BadGrecee 4 Posted September 30, 2022 Share Posted September 30, 2022 8 hours ago, Jimmermania said: Thanks for your answer dude, but if the inventory is full , it should not unequip it because the player will be bugged. If the inventory is full, it will not remove the item anyway. I know like this. Does your game take out the item if the inventory is full? I'm sorry for my bad english. 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