diff --git a/Include/Core/Classes/IntegerNode.hpp b/Include/Core/Classes/IntegerNode.hpp new file mode 100644 index 0000000..d9a7061 --- /dev/null +++ b/Include/Core/Classes/IntegerNode.hpp @@ -0,0 +1,27 @@ +#ifndef INTEGERNODE_HPP_INCLUDED +#define INTEGERNODE_HPP_INCLUDED + +#include "Node.hpp" +#include "../JavaClass/Class.hpp" +#include + +namespace Internal +{ + class IntegerNode : public Node + { + public: + IntegerNode(const void* Obj); + + IntegerNode() = default; + IntegerNode(IntegerNode&& Obj) = default; + IntegerNode(const IntegerNode& Obj) = default; + IntegerNode& operator=(IntegerNode&& Obj) = default; + IntegerNode& operator=(const IntegerNode& Obj) = default; + + static Class GetClass(); + + std::int32_t GetInteger() const; + }; +} + +#endif // INTEGERNODE_HPP_INCLUDED diff --git a/Include/Core/Classes/ItemInfo.hpp b/Include/Core/Classes/ItemInfo.hpp index b9795e6..fd9c860 100644 --- a/Include/Core/Classes/ItemInfo.hpp +++ b/Include/Core/Classes/ItemInfo.hpp @@ -6,6 +6,7 @@ #include #include #include +#include "IterableHashTable.hpp" namespace Internal { @@ -28,6 +29,7 @@ namespace Internal bool GetMembers() const; std::string GetName() const; std::int32_t GetNoteID() const; + IterableHashTable GetParameters() const; std::int32_t GetPrice() const; std::int32_t GetShiftClickIndex() const; std::int32_t GetSpriteID() const; diff --git a/Include/Core/Classes/IterableHashTable.hpp b/Include/Core/Classes/IterableHashTable.hpp new file mode 100644 index 0000000..b0c00f7 --- /dev/null +++ b/Include/Core/Classes/IterableHashTable.hpp @@ -0,0 +1,33 @@ +#ifndef ITERABLEHASHTABLE_HPP_INCLUDED +#define ITERABLEHASHTABLE_HPP_INCLUDED + +#include "../JavaClass/Object.hpp" +#include "../JavaClass/Class.hpp" +#include +#include "Node.hpp" +#include + +namespace Internal +{ + class IterableHashTable : public Object + { + public: + IterableHashTable(const void* Obj); + + IterableHashTable() = default; + IterableHashTable(IterableHashTable&& Obj) = default; + IterableHashTable(const IterableHashTable& Obj) = default; + IterableHashTable& operator=(IterableHashTable&& Obj) = default; + IterableHashTable& operator=(const IterableHashTable& Obj) = default; + + static Class GetClass(); + + std::vector GetBuckets() const; + Node GetBuckets(std::int32_t I) const; + std::int32_t GetIndex() const; + std::int32_t GetSize() const; + + }; +} + +#endif // ITERABLEHASHTABLE_HPP_INCLUDED diff --git a/Include/Core/Classes/ObjectNode.hpp b/Include/Core/Classes/ObjectNode.hpp new file mode 100644 index 0000000..da3c972 --- /dev/null +++ b/Include/Core/Classes/ObjectNode.hpp @@ -0,0 +1,27 @@ +#ifndef OBJECTNODE_HPP_INCLUDED +#define OBJECTNODE_HPP_INCLUDED + +#include "Node.hpp" +#include "../JavaClass/Class.hpp" +#include "../JavaClass/Object.hpp" + +namespace Internal +{ + class ObjectNode : public Node + { + public: + ObjectNode(const void* Obj); + + ObjectNode() = default; + ObjectNode(ObjectNode&& Obj) = default; + ObjectNode(const ObjectNode& Obj) = default; + ObjectNode& operator=(ObjectNode&& Obj) = default; + ObjectNode& operator=(const ObjectNode& Obj) = default; + + static Class GetClass(); + + Object GetObject() const; + }; +} + +#endif // OBJECTNODE_HPP_INCLUDED diff --git a/Include/Core/Classes/ParameterInfo.hpp b/Include/Core/Classes/ParameterInfo.hpp new file mode 100644 index 0000000..112825c --- /dev/null +++ b/Include/Core/Classes/ParameterInfo.hpp @@ -0,0 +1,29 @@ +#ifndef PARAMETERINFO_HPP_INCLUDED +#define PARAMETERINFO_HPP_INCLUDED + +#include "CacheableNode.hpp" +#include "../JavaClass/Class.hpp" +#include + +namespace Internal +{ + class ParameterInfo : public CacheableNode + { + public: + ParameterInfo(const void* Obj); + + ParameterInfo() = default; + ParameterInfo(ParameterInfo&& Obj) = default; + ParameterInfo(const ParameterInfo& Obj) = default; + ParameterInfo& operator=(ParameterInfo&& Obj) = default; + ParameterInfo& operator=(const ParameterInfo& Obj) = default; + + static Class GetClass(); + + std::int32_t GetInteger() const; + std::string GetString() const; + + }; +} + +#endif // PARAMETERINFO_HPP_INCLUDED diff --git a/Include/Core/Globals.hpp b/Include/Core/Globals.hpp index 1e691bb..a658f8f 100644 --- a/Include/Core/Globals.hpp +++ b/Include/Core/Globals.hpp @@ -81,21 +81,28 @@ namespace Globals // grandchild 0 = proper widget bounds, grandchild 1 = text //************ Chat.cpp ************// - typedef struct ChatWidgetDef + typedef struct ChatDialogWidgetDef { std::int32_t Parent = -1; std::int32_t TitleChild = -1; std::int32_t ContinueChild = -1; std::int32_t ContentChild = -1; - } ChatWidgetDef; + } ChatDialogWidgetDef; - const ChatWidgetDef CHAT_NPC_CHAT_WIDGETS = { 231, 2, 3, 4 }; // Appears when a NPC is talking (NPC head is visible in dialogue) - const ChatWidgetDef CHAT_PLAYER_CHAT_WIDGETS = { 217, 2, 3, 4 }; // Appears when a Player is talking (Player head is visible in dialogue) - const ChatWidgetDef CHAT_GAME_CHAT_WIDGETS = { 193, 2, 3, 4 }; // Unknown - const ChatWidgetDef CHAT_LEVEL_UP_CHAT_WIDGETS = { 233, 1, 3, 2 }; // Appears when leveling up - const ChatWidgetDef CHAT_BANK_PIN_ERROR_WIDGETS = { 229, 1, 2 }; // Appears when entering the bank pin wrong - const WidgetDef CHAT_QUEST_DIALOGUE_CONTINUE = { 193, 0, 2 }; // Quest dialogues - const WidgetDef CHAT_QUEST_DIALOGUE_CONTENT = { 193, 2 }; // Quest dialogues + typedef struct SpriteChatDialogWidgetDef + { + std::int32_t Parent = -1; + std::int32_t SpriteChild = -1; + std::int32_t ContentChild = -1; + std::int32_t OptionsContainerChild = -1; // Options are found via grandchildren of this widget + std::int32_t OptionsContainerChildStart = -1; // Child to add an Index to (193, 0, 2 + Index) + } SpriteChatDialogWidgetDef; + + const ChatDialogWidgetDef CHAT_NPC_CHAT_WIDGETS = { 231, 2, 3, 4 }; // Appears when a NPC is talking (NPC head is visible in dialogue) + const ChatDialogWidgetDef CHAT_PLAYER_CHAT_WIDGETS = { 217, 2, 3, 4 }; // Appears when a Player is talking (Player head is visible in dialogue) + const SpriteChatDialogWidgetDef CHAT_SPRITE_WIDGETS = { 193, 1, 2, 0, 2 }; // Appears when a sprite is shown, mainly quest dialogues + const ChatDialogWidgetDef CHAT_LEVEL_UP_CHAT_WIDGETS = { 233, 1, 3, 2 }; // Appears when leveling up + const ChatDialogWidgetDef CHAT_BANK_PIN_ERROR_WIDGETS = { 229, 1, 2 }; // Appears when entering the bank pin wrong const WidgetDef CHAT_SELECT_OPTION_CONTAINER = { 219, 1 }; // Container for all Select Option options const WidgetDef CHAT_SELECT_OPTION_TITLE = { CHAT_SELECT_OPTION_CONTAINER.Parent, CHAT_SELECT_OPTION_CONTAINER.Child, 0 }; diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index 97fc263..0ae06aa 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -69,8 +69,10 @@ #include "Classes/Ignore.hpp" #include "Classes/IgnoreList.hpp" #include "Classes/IndexableData.hpp" +#include "Classes/IntegerNode.hpp" #include "Classes/ItemContainer.hpp" #include "Classes/ItemInfo.hpp" +#include "Classes/IterableHashTable.hpp" #include "Classes/LinkedList.hpp" #include "Classes/MessageNode.hpp" #include "Classes/Model.hpp" @@ -81,6 +83,8 @@ #include "Classes/NPC.hpp" #include "Classes/NPCInfo.hpp" #include "Classes/ObjectInfo.hpp" +#include "Classes/ObjectNode.hpp" +#include "Classes/ParameterInfo.hpp" #include "Classes/Player.hpp" #include "Classes/PlayerInfo.hpp" #include "Classes/PlayerManager.hpp" @@ -188,6 +192,7 @@ namespace Internal std::vector GetNPCs(); IndexableData GetObjectIndexableData(); Cache GetObjectInfoCache(); + Cache GetParameterInfoCache(); std::string GetPassword(); AttackOption GetPlayerAttackOption(); Cache GetPlayerModelCache(); diff --git a/Include/Core/JavaClass/Object.hpp b/Include/Core/JavaClass/Object.hpp index da671e6..0b592bb 100644 --- a/Include/Core/JavaClass/Object.hpp +++ b/Include/Core/JavaClass/Object.hpp @@ -1,6 +1,8 @@ #ifndef OBJECT_HPP_INCLUDED #define OBJECT_HPP_INCLUDED +#include + namespace Internal { class Class; @@ -22,6 +24,7 @@ namespace Internal bool Equals(Object O) const; bool InstanceOf(Class C) const; + virtual ~Object(); }; } diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index 4fef868..cb7e671 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -26,6 +26,7 @@ namespace Interactable bool IsHidden() const; bool IsVisible() const; + std::vector GetInteractableChildren() const; std::vector GetNormalizedItemIDs() const; Box GetBox() const; @@ -37,7 +38,6 @@ namespace Interactable bool Interact(const std::string& Option) const; bool Interact(const std::vector& Options) const; bool Interact(const std::function& InteractMethod) const; - }; } diff --git a/Include/Game/Interfaces/Chat.hpp b/Include/Game/Interfaces/Chat.hpp index f02e468..0b82d88 100644 --- a/Include/Game/Interfaces/Chat.hpp +++ b/Include/Game/Interfaces/Chat.hpp @@ -15,7 +15,8 @@ namespace Chat SELECT_OPTION, PLEASE_WAIT, ENTER_AMOUNT, - LEVEL_UP + LEVEL_UP, + SPRITE_SELECT_OPTION } DIALOGUE_STATE; typedef enum CHAT_TYPE diff --git a/Include/Game/Interfaces/GameTabs/Magic.hpp b/Include/Game/Interfaces/GameTabs/Magic.hpp index d74ef6b..90579b6 100644 --- a/Include/Game/Interfaces/GameTabs/Magic.hpp +++ b/Include/Game/Interfaces/GameTabs/Magic.hpp @@ -205,6 +205,7 @@ namespace Magic const SPELL GetSelectedSpell(); bool CastSpell(const SPELL& Spell); + bool CastSpell(const SPELL& Spell, const std::string& Option); bool SelectSpell(const SPELL& Spell); } diff --git a/Include/Game/Tools/Camera.hpp b/Include/Game/Tools/Camera.hpp index e48ecf2..75a2f84 100644 --- a/Include/Game/Tools/Camera.hpp +++ b/Include/Game/Tools/Camera.hpp @@ -71,14 +71,14 @@ namespace Camera * @param Angle or degree * @return true if it rotates within (+/-) 10 of the passed angle */ - bool RotateTo(std::int32_t Angle); + bool RotateTo(std::int32_t Angle, std::int32_t Tolerance = 10); /** * @brief Rotates the camera to the passed direction (Camera::NORTH/EAST/SOUTH/WEST) * * @param Direction Camera::NORTH / EAST / SOUTH / WEST * @return true if it rotates within (+/-) 10 of the passed direction */ - bool RotateTo(COMPASS_DIRECTION Direction); + bool RotateTo(COMPASS_DIRECTION Direction, std::int32_t Tolerance = 10); /** * @brief Rotates the camera to the passed tile, with an optional desired Angle * @@ -86,7 +86,7 @@ namespace Camera * @param Angle optional desired angle of where the tile should be in relation to the player, defaulted to 0 or North * @return true if it rotates within (+/-) 10 of the passed tile and angle */ - bool RotateTo(const Tile& T, std::int32_t Angle = 0); + bool RotateTo(const Tile& T, std::int32_t Angle = 0, std::int32_t Tolerance = 10); /** * @brief Rotates the camera to the passed tile, with an optional desired direction * @@ -94,7 +94,7 @@ namespace Camera * @param Direction optional desired angle of where the tile should be in relation to the player (NORTH/EAST/SOUTH/WEST), defaulted to North * @return true if it rotates within (+/-) 10 of the passed tile and direction */ - bool RotateTo(const Tile& T, COMPASS_DIRECTION Direction = NORTH); + bool RotateTo(const Tile& T, COMPASS_DIRECTION Direction = NORTH, std::int32_t Tolerance = 10); /** * @brief Sets the pitch of the camera diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index 0a2d36b..fa0176b 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ