diff --git a/Changelog.txt b/Changelog.txt index a72642778..4a3090ee0 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -3985,3 +3985,14 @@ Added: 'H' shortcut for variables to get the value as hexadecimal. TALKMODE_SPELL = 10 // Used by spells TALKMODE_GUILD = 13 // Used by guild chat (client shortcut: \) TALKMODE_ALLIANCE = 14 // Used by alliance chat (client shortcut: shift+\) + +24-12-2024,canerksk +- Added: Add OpenDoorMacro and World Search Distance as Local Variables to @UserExtCmd Trigger + LOCAL.DoorAutoDist (R/W) + Default Distance = 2 + eg; + @UserExtCmd + Serv.Log + Local.DoorAutoDist=10 + Serv.Log + diff --git a/README.md b/README.md index d2f5e46fa..9aa3463a5 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ If you're new to the Sphere server and want to setup your first shard, [this is | :--- | :--- | | [![GitHub last commit on Master branch](https://img.shields.io/github/last-commit/Sphereserver/Source-X/master.svg)](https://github.com/Sphereserver/Source-X/)   Changelog | [![GitHub last commit on Dev branch](https://img.shields.io/github/last-commit/Sphereserver/Source-X/dev.svg)](https://github.com/Sphereserver/Source-X/tree/dev)   Changelog | | **Nightly builds:** | **Nightly builds:** | -| [![Build status: Windows x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml) [![Build status: Windows x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml) | [![Build status: Windows x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml) [![Build status: Windows x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml)| -| [![Build status: Linux x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml) [![Build status: Linux x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml) | [![Build status: Linux x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml) [![Build status: Linux x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml) | -| [![Build status: MacOS x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml) [![Build status: MacOS ARM](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml) | [![Build status: MacOS x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml) [![Build status: MacOS ARM](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml) | +| [![Build status: Windows x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml?query=branch%3Amaster) [![Build status: Windows x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml?query=branch%3Amaster) | [![Build status: Windows x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86_64.yml?query=branch%3Adev) [![Build status: Windows x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_win_x86.yml?query=branch%3Adev)| +| [![Build status: Linux x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml) [![Build status: Linux x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml?query=branch%3Amaster) | [![Build status: Linux x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86_64.yml?query=branch%3Adev) [![Build status: Linux x86](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_linux_x86.yml?query=branch%3Adev) | +| [![Build status: MacOS x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml?query=branch%3Amaster) [![Build status: MacOS ARM](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml/badge.svg?branch=master)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml?query=branch%3Amaster) | [![Build status: MacOS x86_64](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_x86_64.yml?query=branch%3Adev) [![Build status: MacOS ARM](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml/badge.svg?branch=dev)](https://github.com/Sphereserver/Source-X/actions/workflows/build_osx_arm.yml?query=branch%3Adev) | **Click the badges or follow the links:** diff --git a/src/game/CWorldTicker.cpp b/src/game/CWorldTicker.cpp index 659c4e4cc..3efc97708 100644 --- a/src/game/CWorldTicker.cpp +++ b/src/game/CWorldTicker.cpp @@ -226,8 +226,8 @@ void CWorldTicker::AddCharTicking(CChar* pChar, bool fNeedsLock) iTickOld = pChar->_iTimePeriodicTick; } - if (iTickNext == iTickOld) - { + //if (iTickNext == iTickOld) + //{ /* #ifdef _DEBUG auto it = std::find_if(_mCharTickList.begin(), _mCharTickList.end(), @@ -237,8 +237,8 @@ void CWorldTicker::AddCharTicking(CChar* pChar, bool fNeedsLock) DEBUG_ASSERT(it == _mCharTickList.end()); #endif */ - return; - } + // return; + //} //if (iTickNext < CWorldGameTime::GetCurrentTime().GetTimeRaw()) // We do that to get them tick as sooner as possible // return; diff --git a/src/game/clients/CClientEvent.cpp b/src/game/clients/CClientEvent.cpp index 491ec1962..e32474f7a 100644 --- a/src/game/clients/CClientEvent.cpp +++ b/src/game/clients/CClientEvent.cpp @@ -2975,14 +2975,19 @@ void CClient::Event_ExtCmd( EXTCMD_TYPE type, tchar *pszName ) g_Log.EventWarn("%0x:Event_ExtCmd received too long argument\n", GetSocketID()); return; } - + byte bDoorAutoDist = 2; if ( IsTrigUsed(TRIGGER_USEREXTCMD) ) { CScriptTriggerArgs Args(pszName); Args.m_iN1 = type; + if (type == EXTCMD_DOOR_AUTO) + Args.m_VarsLocal.SetNumNew("DoorAutoDist", bDoorAutoDist); + if ( m_pChar->OnTrigger(CTRIG_UserExtCmd, m_pChar, &Args) == TRIGRET_RET_TRUE ) return; Str_CopyLimitNull(pszName, Args.m_s1, MAX_TALK_BUFFER); + if (type == EXTCMD_DOOR_AUTO) + bDoorAutoDist = (byte)(Args.m_VarsLocal.GetKeyNum("DoorAutoDist")); } tchar *ppArgs[2]; @@ -3075,8 +3080,13 @@ void CClient::Event_ExtCmd( EXTCMD_TYPE type, tchar *pszName ) CPointMap pt = m_pChar->GetTopPoint(); char iCharZ = pt.m_z; + if (bDoorAutoDist > UO_MAP_VIEW_SIGHT) + bDoorAutoDist = UO_MAP_VIEW_SIGHT; + else if (bDoorAutoDist <= 0) + bDoorAutoDist = 1; + pt.Move(m_pChar->m_dirFace); - auto Area = CWorldSearchHolder::GetInstance(pt, 1); + auto Area = CWorldSearchHolder::GetInstance(pt, bDoorAutoDist); for (;;) { CItem *pItem = Area->GetItem(); diff --git a/src/sphere.ini b/src/sphere.ini index f35328575..077ca190d 100644 --- a/src/sphere.ini +++ b/src/sphere.ini @@ -1017,7 +1017,7 @@ WOPStaff=0 // TALKMODE_GUILD = 13 // Used by guild chat (client shortcut: \) // TALKMODE_ALLIANCE = 14 // Used by alliance chat (client shortcut: shift+\) // Words of power talk mode (Default: 10 = TALKMODE_SPELL) -WOPTalkMode=1 +WOPTalkMode=10 // Mana lost when casting spell action fails or abort ManaLossAbort=0 // Lose Mana when the spell is aborted during spell casting.