Пример #1
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);
        }
Пример #2
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);
        }
Пример #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);
 }
Пример #4
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);
 }
Пример #5
0
        /// <summary>
        /// Overrides the max attack distance of ranged weapons.
        /// </summary>
        /// <param name="baseItem">The base item type.</param>
        /// <param name="max">The maximum attack distance. Default is 40.0f.</param>
        /// <param name="maxPassive">The maximum passive attack distance. Default is 20.0f. Seems to be used by the engine to determine a new nearby target when needed.</param>
        /// <param name="preferred">The preferred attack distance. See the PrefAttackDist column in baseitems.2da, default seems to be 30.0f for ranged weapons.</param>
        /// <remarks>maxPassive should probably be lower than max, half of max seems to be a good start. preferred should be at least ~0.5f lower than max.</remarks>
        public void SetMaxRangedAttackDistanceOverride(NwBaseItem baseItem, float max, float maxPassive, float preferred)
        {
            if (!baseItem.IsRangedWeapon)
            {
                return;
            }

            baseItem.PreferredAttackDistance = preferred;

            MaxRangedAttackDistanceOverride overrideData;

            overrideData.MaxRangedAttackDistance        = max;
            overrideData.MaxRangedPassiveAttackDistance = maxPassive;

            maxRangedAttackDistanceOverrideMap[baseItem.Id] = overrideData;
            maxAttackRangeHook ??= hookService.RequestHook <MaxAttackRangeHook>(OnMaxAttackRange, FunctionsLinux._ZN12CNWSCreature14MaxAttackRangeEjii, HookOrder.Final);
        }
Пример #6
0
 public ObjectVisibilityService(HookService hookService)
 {
     testObjectVisibleHook = hookService.RequestHook <TestObjectVisibleHook>(OnTestObjectVisible, FunctionsLinux._ZN11CNWSMessage17TestObjectVisibleEP10CNWSObjectS1_, HookOrder.Late);
 }
Пример #7
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);
 }
Пример #9
0
 void ICoreService.Init()
 {
     loadModuleInProgressHook = hookService.RequestHook <LoadModuleInProgressHook>(OnModuleLoadProgressChange, FunctionsLinux._ZN10CNWSModule20LoadModuleInProgressEii, HookOrder.Earliest);
 }
Пример #10
0
 public CreatureWalkRateCapService(HookService hookService)
 {
     walkRateHook = hookService.RequestHook <GetWalkRateHook>(OnGetWalkRate, FunctionsLinux._ZN12CNWSCreature11GetWalkRateEv, HookOrder.Late);
 }
Пример #11
0
 public CreatureForceWalkService(HookService hookService)
 {
     removeLimitMovementSpeedHook = hookService.RequestHook <RemoveLimitMovementSpeedHook>(OnRemoveLimitMovementSpeed, FunctionsLinux._ZN21CNWSEffectListHandler26OnRemoveLimitMovementSpeedEP10CNWSObjectP11CGameEffect, HookOrder.Late);
 }
Пример #12
0
 public ChatService(HookService hookService, NwServer nwServer)
 {
     this.nwServer = nwServer;
     sendServerToPlayerChatMessageHook = hookService.RequestHook <SendServerToPlayerChatMessageHook>(OnSendServerToPlayerChatMessage, FunctionsLinux._ZN11CNWSMessage29SendServerToPlayerChatMessageEhj10CExoStringjRKS0_, HookOrder.Late);
 }
Пример #13
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;
        }