Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3914,3 +3914,10 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.

13-10-2024, Jhobean
- Added: @PetRelease trigger work like @petdesert and return 1 to prevent the pet from being released.

26-10-2024, canerksk
- Added: New client function CLOSECONTAINER and CLOSEVENDORMENU
CLOSEVENDORMENU <vendor uid> OR CLOSEVENDORMENU empty if empty, 14 squares will close the sales menu of all near shops.
If no value is entered, it closes the sales menu of all vendors in the surrounding area (14 squares). If a value is entered and this value is the vendor uid, it closes the sales menu of the vendor belonging to that serial number.
CLOSECONTAINER <container uid>
Actually, there is already a package for this, but since dealing with the package takes a long time, such a command was needed. When CLOSECONTAINER <container uid> is entered, that container is closed in the interface.
48 changes: 48 additions & 0 deletions src/game/clients/CClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "../CWorld.h"
#include "../CWorldGameTime.h"
#include "../CWorldMap.h"
#include "../CWorldSearch.h"
#include "../spheresvr.h"
#include "../triggers.h"
#include "CParty.h"
Expand Down Expand Up @@ -1289,6 +1290,53 @@ bool CClient::r_Verb( CScript & s, CTextConsole * pSrc ) // Execute command from
}
break;

case CV_CLOSECONTAINER:
{
const CItem *pItem = nullptr;
if (s.HasArgs())
{
const CUID uid(s.GetArgDWVal());
if (!uid.IsItem())
return (false);
pItem = uid.ItemFind();
}
if (pItem != nullptr && pItem->IsType(IT_CONTAINER))
closeUIWindow(pItem, PacketCloseUIWindow::Container);
}
break;

case CV_CLOSEVENDORMENU:
{
const CChar *pChar = m_pChar;
if (s.HasArgs())
{
const CUID uid(s.GetArgDWVal());
if (!uid.IsChar())
return (false);
pChar = uid.CharFind();
if (pChar)
addVendorClose(pChar);
}
else
{
auto AreaChars = CWorldSearchHolder::GetInstance(pChar->GetTopPoint(), UO_MAP_VIEW_SIGHT);
for (;;)
{
const CChar *pCharArea = AreaChars->GetChar();
if (pCharArea == nullptr)
break;
if (pCharArea->m_pPlayer)
continue;
if (pCharArea == GetChar())
continue;
if (!pCharArea->NPC_IsVendor())
continue;
addVendorClose(pCharArea);
}
}
}
break;

case CV_CODEXOFWISDOM:
{
int64 piArgs[2];
Expand Down
2 changes: 2 additions & 0 deletions src/tables/CClient_functions.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ ADD(CAST, "CAST")
ADD(CHANGEFACE, "CHANGEFACE")
ADD(CHARLIST, "CHARLIST")
ADD(CLEARCTAGS, "CLEARCTAGS")
ADD(CLOSECONTAINER, "CLOSECONTAINER")
ADD(CLOSEPAPERDOLL, "CLOSEPAPERDOLL")
ADD(CLOSEPROFILE, "CLOSEPROFILE")
ADD(CLOSESTATUS, "CLOSESTATUS")
ADD(CLOSEVENDORMENU,"CLOSEVENDORMENU")
ADD(CODEXOFWISDOM, "CODEXOFWISDOM")
ADD(CTAGLIST, "CTAGLIST")
ADD(DYE, "DYE")
Expand Down