Exemplo n.º 1
0
 internal FunctionHook(HookService hookService, IntPtr nativeFuncPtr, T?handler = null)
 {
     this.hookService   = hookService;
     this.nativeFuncPtr = nativeFuncPtr;
     this.handler       = handler;
     CallOriginal       = Marshal.GetDelegateForFunctionPointer <T>(nativeFuncPtr);
 }
Exemplo n.º 2
0
 public ObjectStorageService(HookService hookService)
 {
     objectDestructorHook = hookService.RequestHook <ObjectDestructorHook>(OnObjectDestructor, FunctionsLinux._ZN10CNWSObjectD1Ev, HookOrder.VeryEarly);
     areaDestructorHook   = hookService.RequestHook <AreaDestructorHook>(OnAreaDestructor, FunctionsLinux._ZN8CNWSAreaD1Ev, HookOrder.VeryEarly);
     eatTURDHook          = hookService.RequestHook <EatTURDHook>(OnEatTURD, FunctionsLinux._ZN10CNWSPlayer7EatTURDEP14CNWSPlayerTURD, HookOrder.VeryEarly);
     dropTURDHook         = hookService.RequestHook <DropTURDHook>(OnDropTURD, FunctionsLinux._ZN10CNWSPlayer8DropTURDEv, HookOrder.VeryEarly);
     saveToGffHook        = hookService.RequestHook <SaveToGffHook>(OnSaveToGff, FunctionsLinux._ZN8CNWSUUID9SaveToGffEP7CResGFFP10CResStruct, HookOrder.VeryEarly);
     loadFromGffHook      = hookService.RequestHook <LoadFromGffHook>(OnLoadFromGff, FunctionsLinux._ZN8CNWSUUID11LoadFromGffEP7CResGFFP10CResStruct, HookOrder.VeryEarly);
 }
Exemplo n.º 3
0
 public DialogService(HookService hookService)
 {
     getStartEntryHook         = hookService.RequestHook <GetStartEntryHook>(OnGetStartEntry, FunctionsLinux._ZN10CNWSDialog13GetStartEntryEP10CNWSObject, HookOrder.Early);
     getStartEntryOneLinerHook = hookService.RequestHook <GetStartEntryOneLinerHook>(OnGetStartEntryOneLiner, FunctionsLinux._ZN10CNWSDialog21GetStartEntryOneLinerEP10CNWSObjectR13CExoLocStringR7CResRefS5_R13CExoArrayListI11ScriptParamE, HookOrder.Early);
     sendDialogEntryHook       = hookService.RequestHook <SendDialogEntryHook>(OnSendDialogEntry, FunctionsLinux._ZN10CNWSDialog15SendDialogEntryEP10CNWSObjectjji, HookOrder.Early);
     sendDialogRepliesHook     = hookService.RequestHook <SendDialogRepliesHook>(OnSendDialogReplies, FunctionsLinux._ZN10CNWSDialog17SendDialogRepliesEP10CNWSObjectj, HookOrder.Early);
     handleReplyHook           = hookService.RequestHook <HandleReplyHook>(OnHandleReply, FunctionsLinux._ZN10CNWSDialog11HandleReplyEjP10CNWSObjectjij, HookOrder.Early);
     checkScriptHook           = hookService.RequestHook <CheckScriptHook>(OnCheckScript, FunctionsLinux._ZN10CNWSDialog11CheckScriptEP10CNWSObjectRK7CResRefRK13CExoArrayListI11ScriptParamE, HookOrder.Early);
     runScriptHook             = hookService.RequestHook <RunScriptHook>(OnRunScript, FunctionsLinux._ZN10CNWSDialog9RunScriptEP10CNWSObjectRK7CResRefRK13CExoArrayListI11ScriptParamE, HookOrder.Early);
 }
Exemplo n.º 4
0
        public PlayerNameOverrideService(HookService hookService)
        {
            NwModule.Instance.OnClientLeave += OnClientLeave;

            writeGameObjUpdateUpdateObjectHook           = hookService.RequestHook <WriteGameObjUpdateUpdateObjectHook>(OnWriteGameObjUpdateUpdateObject, FunctionsLinux._ZN11CNWSMessage31WriteGameObjUpdate_UpdateObjectEP10CNWSPlayerP10CNWSObjectP17CLastUpdateObjectjj, HookOrder.Early);
            sendServerToPlayerExamineGuiCreatureDataHook = hookService.RequestHook <SendServerToPlayerExamineGuiCreatureDataHook>(OnSendServerToPlayerExamineGuiCreatureData, FunctionsLinux._ZN11CNWSMessage41SendServerToPlayerExamineGui_CreatureDataEP10CNWSPlayerj, HookOrder.Early);

            sendServerToPlayerPlayerListAllHook    = hookService.RequestHook <SendServerToPlayerPlayerListAllHook>(OnSendServerToPlayerPlayerListAll, FunctionsLinux._ZN11CNWSMessage32SendServerToPlayerPlayerList_AllEP10CNWSPlayer, HookOrder.Early);
            sendServerToPlayerPlayerListAddHook    = hookService.RequestHook <SendServerToPlayerPlayerListAddHook>(OnSendServerToPlayerPlayerListAdd, FunctionsLinux._ZN11CNWSMessage32SendServerToPlayerPlayerList_AddEjP10CNWSPlayer, HookOrder.Early);
            sendServerToPlayerPlayerListDeleteHook = hookService.RequestHook <SendServerToPlayerPlayerListDeleteHook>(OnSendServerToPlayerPlayerListDelete, FunctionsLinux._ZN11CNWSMessage35SendServerToPlayerPlayerList_DeleteEjP10CNWSPlayer, HookOrder.Early);

            sendServerToPlayerDungeonMasterUpdatePartyListHook = hookService.RequestHook <SendServerToPlayerDungeonMasterUpdatePartyListHook>(OnSendServerToPlayerDungeonMasterUpdatePartyList, FunctionsLinux._ZN11CNWSMessage46SendServerToPlayerDungeonMasterUpdatePartyListEj, HookOrder.Early);
            sendServerToPlayerPopUpGUIPanelHook = hookService.RequestHook <SendServerToPlayerPopUpGUIPanelHook>(OnSendServerToPlayerPopUpGUIPanel, FunctionsLinux._ZN11CNWSMessage31SendServerToPlayerPopUpGUIPanelEjiiii10CExoString, HookOrder.Early);

            sendServerToPlayerChatPartyHook = hookService.RequestHook <SendServerToPlayerChatPartyHook>(OnSendServerToPlayerChatParty, FunctionsLinux._ZN11CNWSMessage28SendServerToPlayerChat_PartyEjj10CExoString, HookOrder.Early);
            sendServerToPlayerChatShoutHook = hookService.RequestHook <SendServerToPlayerChatShoutHook>(OnSendServerToPlayerChatShout, FunctionsLinux._ZN11CNWSMessage28SendServerToPlayerChat_ShoutEjj10CExoString, HookOrder.Early);
            sendServerToPlayerChatTellHook  = hookService.RequestHook <SendServerToPlayerChatTellHook>(OnSendServerToPlayerChatTell, FunctionsLinux._ZN11CNWSMessage27SendServerToPlayerChat_TellEjj10CExoString, HookOrder.Early);
        }
Exemplo n.º 5
0
        public ServerLogRedirectorService(HookService hookService)
        {
            switch (EnvironmentConfig.LogMode)
            {
            case LogMode.Default:
                return;

            case LogMode.Duplicate:
                callOriginal = true;
                break;

            case LogMode.Redirect:
                callOriginal = false;
                break;
            }

            writeToLogFileHook            = hookService.RequestHook <WriteToLogFileHook>(OnWriteToLogFile, FunctionsLinux._ZN17CExoDebugInternal14WriteToLogFileERK10CExoString, HookOrder.VeryEarly);
            writeToErrorFileHook          = hookService.RequestHook <WriteToErrorFileHook>(OnWriteToErrorFile, FunctionsLinux._ZN17CExoDebugInternal16WriteToErrorFileERK10CExoString, HookOrder.VeryEarly);
            executeCommandPrintStringHook = hookService.RequestHook <ExecuteCommandPrintStringHook>(OnExecuteCommandPrintString, FunctionsLinux._ZN25CNWVirtualMachineCommands25ExecuteCommandPrintStringEii, HookOrder.VeryEarly);
        }
Exemplo n.º 6
0
        public WeaponService(HookService hookService, EventService eventService)
        {
            this.hookService  = hookService;
            this.eventService = eventService;

            getWeaponFocusHook                    = hookService.RequestHook <GetWeaponFocusHook>(OnGetWeaponFocus, FunctionsLinux._ZN17CNWSCreatureStats14GetWeaponFocusEP8CNWSItem, HookOrder.Late);
            getEpicWeaponFocusHook                = hookService.RequestHook <GetEpicWeaponFocusHook>(OnGetEpicWeaponFocus, FunctionsLinux._ZN17CNWSCreatureStats18GetEpicWeaponFocusEP8CNWSItem, HookOrder.Late);
            getWeaponFinesseHook                  = hookService.RequestHook <GetWeaponFinesseHook>(OnGetWeaponFinesse, FunctionsLinux._ZN17CNWSCreatureStats16GetWeaponFinesseEP8CNWSItem, HookOrder.Final);
            getWeaponImprovedCriticalHook         = hookService.RequestHook <GetWeaponImprovedCriticalHook>(OnGetWeaponImprovedCritical, FunctionsLinux._ZN17CNWSCreatureStats25GetWeaponImprovedCriticalEP8CNWSItem, HookOrder.Late);
            getEpicWeaponOverwhelmingCriticalHook = hookService.RequestHook <GetEpicWeaponOverwhelmingCriticalHook>(OnGetEpicWeaponOverwhelmingCritical, FunctionsLinux._ZN17CNWSCreatureStats33GetEpicWeaponOverwhelmingCriticalEP8CNWSItem, HookOrder.Late);
            getEpicWeaponDevastatingCriticalHook  = hookService.RequestHook <GetEpicWeaponDevastatingCriticalHook>(OnGetEpicWeaponDevastatingCritical, FunctionsLinux._ZN17CNWSCreatureStats32GetEpicWeaponDevastatingCriticalEP8CNWSItem, HookOrder.Late);
            getWeaponSpecializationHook           = hookService.RequestHook <GetWeaponSpecializationHook>(OnGetWeaponSpecialization, FunctionsLinux._ZN17CNWSCreatureStats23GetWeaponSpecializationEP8CNWSItem, HookOrder.Late);
            getEpicWeaponSpecializationHook       = hookService.RequestHook <GetEpicWeaponSpecializationHook>(OnGetEpicWeaponSpecialization, FunctionsLinux._ZN17CNWSCreatureStats27GetEpicWeaponSpecializationEP8CNWSItem, HookOrder.Late);
            getIsWeaponOfChoiceHook               = hookService.RequestHook <GetIsWeaponOfChoiceHook>(OnGetIsWeaponOfChoice, FunctionsLinux._ZN17CNWSCreatureStats19GetIsWeaponOfChoiceEj, HookOrder.Late);
            getDamageBonusHook                    = hookService.RequestHook <GetDamageBonusHook>(OnGetDamageBonus, FunctionsLinux._ZN17CNWSCreatureStats14GetDamageBonusEP12CNWSCreaturei, HookOrder.Late);
            getMeleeDamageBonusHook               = hookService.RequestHook <GetMeleeDamageBonusHook>(OnGetMeleeDamageBonus, FunctionsLinux._ZN17CNWSCreatureStats19GetMeleeDamageBonusEih, HookOrder.Late);
            getRangedDamageBonusHook              = hookService.RequestHook <GetRangedDamageBonusHook>(OnGetRangedDamageBonus, FunctionsLinux._ZN17CNWSCreatureStats20GetRangedDamageBonusEv, HookOrder.Late);
            getMeleeAttackBonusHook               = hookService.RequestHook <GetMeleeAttackBonusHook>(OnGetMeleeAttackBonus, FunctionsLinux._ZN17CNWSCreatureStats19GetMeleeAttackBonusEiii, HookOrder.Late);
            getRangedAttackBonusHook              = hookService.RequestHook <GetRangedAttackBonusHook>(OnGetRangedAttackBonus, FunctionsLinux._ZN17CNWSCreatureStats20GetRangedAttackBonusEii, HookOrder.Late);
            getAttackModifierVersusHook           = hookService.RequestHook <GetAttackModifierVersusHook>(OnGetAttackModifierVersus, FunctionsLinux._ZN17CNWSCreatureStats23GetAttackModifierVersusEP12CNWSCreature, HookOrder.Late);
            getUseMonkAttackTablesHook            = hookService.RequestHook <GetUseMonkAttackTablesHook>(OnGetUseMonkAttackTables, FunctionsLinux._ZN17CNWSCreatureStats22GetUseMonkAttackTablesEi, HookOrder.Final);

            weaponFinesseSizeMap[(uint)BaseItem.Rapier] = (byte)CreatureSize.Medium;
        }
Exemplo n.º 7
0
 public ObjectVisibilityService(HookService hookService)
 {
     testObjectVisibleHook = hookService.RequestHook <TestObjectVisibleHook>(OnTestObjectVisible, FunctionsLinux._ZN11CNWSMessage17TestObjectVisibleEP10CNWSObjectS1_, HookOrder.Late);
 }
Exemplo n.º 8
0
 public PlayerRestDurationOverrideService(HookService hookService)
 {
     aiActionRestHook = hookService.RequestHook <AIActionRestHook>(OnAIActionRest, FunctionsLinux._ZN12CNWSCreature12AIActionRestEP20CNWSObjectActionNode, HookOrder.Late);
 }
 public DamageLevelOverrideService(HookService hookService)
 {
     damageLevelHook = hookService.RequestHook <GetDamageLevel>(OnGetDamageLevel, FunctionsLinux._ZN10CNWSObject14GetDamageLevelEv, HookOrder.Late);
 }
Exemplo n.º 10
0
 public ModuleLoadTracker(HookService hookService)
 {
     this.hookService = hookService;
 }
Exemplo n.º 11
0
 public CreatureWalkRateCapService(HookService hookService)
 {
     walkRateHook = hookService.RequestHook <GetWalkRateHook>(OnGetWalkRate, FunctionsLinux._ZN12CNWSCreature11GetWalkRateEv, HookOrder.Late);
 }
Exemplo n.º 12
0
 public CreatureForceWalkService(HookService hookService)
 {
     removeLimitMovementSpeedHook = hookService.RequestHook <RemoveLimitMovementSpeedHook>(OnRemoveLimitMovementSpeed, FunctionsLinux._ZN21CNWSEffectListHandler26OnRemoveLimitMovementSpeedEP10CNWSObjectP11CGameEffect, HookOrder.Late);
 }
Exemplo n.º 13
0
 public FeedbackService(HookService hookService)
 {
     this.hookService = hookService;
 }
Exemplo n.º 14
0
 public ChatService(HookService hookService, NwServer nwServer)
 {
     this.nwServer = nwServer;
     sendServerToPlayerChatMessageHook = hookService.RequestHook <SendServerToPlayerChatMessageHook>(OnSendServerToPlayerChatMessage, FunctionsLinux._ZN11CNWSMessage29SendServerToPlayerChatMessageEhj10CExoStringjRKS0_, HookOrder.Late);
 }