├── !CREDITS!.txt ├── .gitattributes ├── .gitignore ├── AI_Functions.d ├── EngineClasses_G1 ├── !README!.txt ├── TMobOptPos.d ├── TNpcSlot.d ├── TObjectRoutine.d ├── oAiShoot.d ├── oCDocumentManager.d ├── oCMagFrontier.d ├── oCRtnEntry.d ├── oCRtnManager.d ├── oCViewDocument.d ├── oCVisualFX.d ├── oInventory.d ├── oNpc.d ├── oNpcStates.d ├── oSDamageDescriptor.d ├── oSSpawnNode.d ├── oSpell.d ├── zCAICamera.d ├── zCActiveSnd.d ├── zCCSBlock.d ├── zCConDat.d ├── zCSkyState.d ├── zCSndFrame.d ├── zCViewDialog.d ├── zCVisual.d ├── zCVobSound.d ├── zCVobSpot.d ├── zCWay.d ├── zEventMan.d ├── zModel.d ├── zPhysics.d ├── zTConfig.d ├── zTSound3DParams.d └── zTSpatialState.d ├── EngineClasses_G2 ├── !README!.txt ├── TMobOptPos.d ├── TNpcSlot.d ├── TObjectRoutine.d ├── oAiShoot.d ├── oCMagFrontier.d ├── oCRtnEntry.d ├── oCRtnManager.d ├── oInventory.d ├── oNpc.d ├── oNpcStates.d ├── oSDamageDescriptor.d ├── oSSpawnNode.d ├── oSpell.d ├── zCAICamera.d ├── zCActiveSnd.d ├── zCConDat.d ├── zCSkyState.d ├── zCSndFrame.d ├── zCViewDialog.d ├── zCVisual.d ├── zCVobSound.d ├── zCVobSpot.d ├── zCWay.d ├── zEventMan.d ├── zPhysics.d ├── zTConfig.d ├── zTSound3DParams.d └── zTSpatialState.d ├── G2 NoTR emulation.d ├── ObjectFactory ├── oCAIArrow.d ├── oCAICamera.d ├── oCAIDrop.d ├── oCAIVobMove.d ├── oCAIVobMoveTorch.d ├── oCInfoChoice.d ├── oCMsgAttack.d ├── oCMsgDamage.d ├── oCMsgManipulate.d ├── oCMsgMovement.d ├── oCMsgState.d ├── oCMsgWeapon.d ├── oCSpell.d ├── zCDecal.d ├── zCMaterial.d ├── zCOption.d ├── zCViewText2.d └── zCWaypoint.d ├── Patches ├── G1 │ └── PatchFireDamageMultiplication.d └── G12 │ ├── PatchFightCombos.d │ ├── SetDisplayDialogueDistance.d │ ├── SetDisplayDialogueTime.d │ ├── SetMagBookTurnTime.d │ ├── SetPlayerTurnSpeed.d │ └── SetRainThroughVobs.d ├── Readme ├── API.md ├── G12_Add_Perceptions.md ├── G12_Better_Bars.md ├── G12_CustomItemDescription.md ├── G12_Debugging.md ├── G12_Despawn_Only_If_Empty.md ├── G12_Enable_Player_States.md ├── G12_Enhanced_Information_Manager.md ├── G12_Enhanced_oCTriggerScript.md ├── G12_Equip_Control.md ├── G12_Fade_Away.md ├── G12_Focus.md ├── G12_Inventory_Item_Preview.md ├── G12_Log_Dialogues.md ├── G12_Moon_Phases.md ├── G12_Multi_Teleport.md ├── G12_No_Ammo_Print.md ├── G12_Patch_Fight_Combos.md ├── G12_PickLock_Helper.md ├── G12_Prevent_Looting.md ├── G12_Rain_Control.md ├── G12_Set_Display_Dialogue_Distance.md ├── G12_Set_Display_Dialogue_Time.md ├── G12_Set_Mag_Book_Turn_Time.md ├── G12_Set_Player_Turn_Speed.md ├── G12_Set_Rain_Through_Vobs.md ├── G12_Spacer_Spawn.md ├── G12_Sprint_Mode.md ├── G12_Torch_HotKey.md ├── G12_Vob_Transport.md ├── G1_Better_Inventory_Controls.md ├── G1_Enhanced_PickLocking.md ├── G1_Enhanced_PickPocketing.md ├── G1_Enhanced_Trading.md ├── G1_Ever_Looming_Barrier.md ├── G1_Patch_FireDamage_Multiplication.md ├── G1_Player_Map.md └── G1_Weapon_Stacking.md ├── Resources ├── Scripts │ └── system │ │ ├── PFX │ │ └── pfx_MFX_FIRESPELL_HUMANBURN_TINY.d │ │ └── VISUALFX │ │ ├── visualFX_VOB_BURN_LEFTFOOT.d │ │ └── visualFX_VOB_BURN_RIGHTFOOT.d └── Textures │ ├── BAR_HEALTH_PREVIEW-C.TEX │ ├── BAR_MANA_PREVIEW-C.TEX │ └── BAR_SPRINTMODE_TIMEDOVERLAY-C.TEX ├── ScriptBin ├── convert.d ├── insertAnything.d ├── removeoCVobSafe.d ├── searchVobs.d ├── strings.d └── trafo.d ├── Standalone-Packages ├── BetterInventory.d ├── G1-BetterInventoryControls │ └── betterInventoryControls.d ├── G1-EnhancedPickLocking │ ├── enhancedPickLocking.d │ └── enhancedPickLocking_API.d ├── G1-EnhancedPickPocketing │ ├── enhancedPickPocketing.d │ └── enhancedPickPocketing_API.d ├── G1-EnhancedTrading │ ├── enhancedTrading.d │ └── enhancedTrading_API.d ├── G1-EverloomingBarrier │ └── barrier.d ├── G1-ItemSplitting │ └── itemSplitting.d ├── G1-PlayerMap │ ├── playerMap.d │ └── playerMap_API.d ├── G1-WeaponStacking │ └── weapon_stacking.d ├── G12-AddPerceptions │ └── addPerceptions.d ├── G12-BetterBars │ ├── betterBars.d │ └── betterBars_API.d ├── G12-Debugging │ ├── checkRoutineValidity.d │ ├── compileTex.d │ ├── consoleHistory.d │ ├── create.d │ ├── debugDialogues.d │ ├── debugTextures.d │ ├── despawn.d │ ├── exportImport.d │ ├── focusPlay.d │ ├── gotoNpc.d │ ├── gotoZEN.d │ ├── holdTime.d │ ├── printPos.d │ ├── puppetMaster.d │ ├── setRoutine.d │ ├── setSleepingMode.d │ ├── showAI.d │ ├── testSuite.d │ ├── testSuite_API.d │ ├── unlock.d │ └── vobsCheckProperties.d ├── G12-DespawnOnlyIfEmpty │ └── despawnOnlyIfEmpty.d ├── G12-EnablePlayerStates │ ├── enablePlayerStates.d │ └── enablePlayerStates_API.d ├── G12-EnhancedInfoManager │ ├── colorHelper.d │ ├── enhancedInfoManager.d │ ├── enhancedInfoManager_API.d │ └── stringOverlay.d ├── G12-EnhancedoCTriggerScript │ ├── enhancedoCTriggerScript.d │ ├── example_FirePlaceFireDamage.d │ └── example_FirePlaceSavingPolicy.d ├── G12-EquipControl │ ├── equipControl.d │ └── equipControl_API.d ├── G12-FadeAway │ ├── fadeAway.d │ └── fadeAway_API.d ├── G12-Focus │ ├── focus.d │ └── focus_API.d ├── G12-InvItemPreview │ └── invItemPreview.d ├── G12-LogDialogues │ ├── logDialogues.d │ └── logDialogues_API.d ├── G12-MenuLogAddSectionCount │ ├── menuLogAddSectionCount.d │ └── menuLogAddSectionCount_API.d ├── G12-MoonPhases │ ├── moonPhases.d │ └── moonPhases_API.d ├── G12-MultiTeleport │ └── multiTeleport.d ├── G12-NoAmmoPrint │ ├── noAmmoPrint.d │ └── noAmmoPrint_API.d ├── G12-PickLockHelper │ ├── pickLockHelper.d │ └── pickLockHelper_API.d ├── G12-PreventLooting │ ├── preventLooting.d │ └── preventLooting_API.d ├── G12-RainControl │ ├── rainControl.d │ └── rainControl_API.d ├── G12-SpacerSpawn │ └── spacerSpawn.d ├── G12-SprintMode │ ├── sprintMode.d │ └── sprintMode_API.d ├── G12-TorchHotKey │ ├── torchHotkey.d │ └── torchHotkey_API.d ├── G12-Trialogue │ └── trialogue.d ├── G12-VobThrowing │ ├── testing.d │ └── vobThrowing.d └── G12-VobTransport │ ├── cloneFactory.d │ ├── example #1 vobTransport_API.d │ ├── example #2 vobTransport_API.d │ ├── example #3 vobTransport_API.d │ ├── globals.d │ ├── insertVobCatalogue G1.d │ ├── internalFunctions.d │ ├── printCodeTozSpy.d │ ├── propertiesView.d │ ├── vobTransport.d │ └── vobTransport_API.d ├── _headers_G1_All.src ├── _headers_G2_All.src ├── algebra.d ├── anims_engine.d ├── archiver.d ├── bars.d ├── blood.d ├── camera.d ├── console.d ├── consoleCommands.d ├── constants.d ├── draw3D.d ├── engine_addresses_G1.d ├── engine_addresses_G2.d ├── eventManager.d ├── fight.d ├── files.d ├── fonts.d ├── functions_NPC.d ├── functions_PC.d ├── functions_oCItem.d ├── functions_oCMobInter_engine.d ├── functions_oCNpc_engine.d ├── game_Events_G1.d ├── game_Events_G12.d ├── game_engine.d ├── hlp_functions.d ├── infoManager.d ├── input.d ├── interface.d ├── inventory_oCMob.d ├── inventory_oCNpc.d ├── inventory_sorting_logic_G1.d ├── keys.d ├── list.d ├── magic.d ├── menu.d ├── miscellaneous.d ├── mobFunctions.d ├── options.d ├── ou.d ├── parser.d ├── polygons.d ├── portals.d ├── readme.md ├── render_engine.d ├── routines_waynet.d ├── sound.d ├── spatialState.d ├── spawnManager.d ├── strings.d ├── time.d ├── utils.d ├── vectors.d ├── view.d ├── vobFunctions.d ├── vobThrowing.d ├── world_engine.d └── zError_engine.d /!CREDITS!.txt: -------------------------------------------------------------------------------- 1 | Credits: We are using here many scripts sourced from great Gothic community. None of this would be possible without Ikarus/LeGo and of course without modders willing to share their amazing work/ideas. 2 | Some scripts were slightly altered (added G1 compatibility, safety checks ...) 3 | 4 | ScriptBin\ 5 | Author: szapp (mud-freak) 6 | convert.d 7 | Original post: https://forum.worldofplayers.de/forum/threads/1495001-Scriptsammlung-ScriptBin/page3?p=25717007&viewfull=1#post25717007 8 | 9 | searchVobs.d 10 | Original post: https://forum.worldofplayers.de/forum/threads/1495001-Scriptsammlung-ScriptBin/page3?p=25717007&viewfull=1#post25717007 11 | 12 | insertAnything.d 13 | Original post: https://forum.worldofplayers.de/forum/threads/1495001-Scriptsammlung-ScriptBin/page2?p=25712257&viewfull=1#post25712257 14 | 15 | objCheckInheritance.d 16 | Original post: https://forum.worldofplayers.de/forum/threads/1495001-Scriptsammlung-ScriptBin?p=25548652&viewfull=1#post25548652 17 | 18 | strings.d 19 | Original post: https://forum.worldofplayers.de/forum/threads/1495001-Scriptsammlung-ScriptBin/page3?p=25717007&viewfull=1#post25717007 20 | 21 | Functions: 22 | ---------- 23 | 24 | NPC_GetWalkMode 25 | Author: Dalai Zoll 26 | Original post: https://forum.worldofplayers.de/forum/threads/1090721-Testschleichen?p=17909902&viewfull=1#post17909902 27 | 28 | oCNpc_SetFocusVob 29 | _getInterfaceScaling 30 | Author: szapp (mud-freak) 31 | 32 | PC_SetTurnSpeed 33 | Author: Sektenspinner 34 | Original post: https://forum.worldofplayers.de/forum/threads/879891-Skriptpaket-Ikarus-2/page13?p=14886885#post14886885 35 | 36 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.d text working-tree-encoding=cp1250 git-encoding=UTF-8 2 | *.md text working-tree-encoding=cp1250 git-encoding=UTF-8 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Standalone-Packages/G1-EnhancedPickLocking/enhancedPickLocking_API - ReplayMod.d 2 | Standalone-Packages/G12-VobTransport/vobTransport_API - ReplayMod.d 3 | 4 | _headers_G1_All_ReplayMod.src 5 | _headers_G1_VobTransport_ReplayMod.src 6 | 7 | *.disabled 8 | -------------------------------------------------------------------------------- /EngineClasses_G1/!README!.txt: -------------------------------------------------------------------------------- 1 | Classes defined in this folder might not be properly determined. 2 | Some are not finished. 3 | 4 | Use at your own risk :) -------------------------------------------------------------------------------- /EngineClasses_G1/TMobOptPos.d: -------------------------------------------------------------------------------- 1 | class TMobOptPos { 2 | var int trafo[16]; //zMAT4 3 | var int distance; //int 4 | var int npc; //oCNpc* 5 | var string nodeName; //zSTRING 6 | }; -------------------------------------------------------------------------------- /EngineClasses_G1/TNpcSlot.d: -------------------------------------------------------------------------------- 1 | // sizeof 38h 2 | class TNpcSlot { 3 | var string name; //zSTRING // sizeof 14h offset 00h 4 | var int inInventory; //int // sizeof 04h offset 14h 5 | var int tmpLevel; //int // sizeof 04h offset 18h 6 | var string itemName; //zSTRING // sizeof 14h offset 1Ch 7 | var int vob; //oCVob* // sizeof 04h offset 30h 8 | var int bitfield; 9 | //int wasVobTreeWhenInserted : 1; // sizeof 01h offset bit 10 | }; 11 | -------------------------------------------------------------------------------- /EngineClasses_G1/TObjectRoutine.d: -------------------------------------------------------------------------------- 1 | // sizeof 24h 2 | class TObjectRoutine { 3 | var string objName; //zSTRING // sizeof 14h offset 00h 4 | var int stateNum; //int // sizeof 04h offset 14h 5 | var int hour1; //int // sizeof 04h offset 18h 6 | var int min1; //int // sizeof 04h offset 1Ch 7 | var int type; //int // sizeof 04h offset 20h 8 | }; 9 | -------------------------------------------------------------------------------- /EngineClasses_G1/oCDocumentManager.d: -------------------------------------------------------------------------------- 1 | class oCDocumentManager { 2 | // var int _vtbl; 3 | 4 | // class zCInputCallback { 5 | var int _zCInputCallback_vtbl; 6 | /* 7 | const float VIEW_TIME_PER_CHAR = 100.0f; 8 | const int VIEW_GROUNDED = 1<<3; 9 | const int VIEW_MODAL = 1<<6; 10 | const int VIEW_AUTOSCROLL = 1<<8; 11 | const int VIEW_TXT_CENTER = 1<<9; 12 | const int VIEW_TXT_AUTO = 1<<10; 13 | const int VIEW_STAYONTOP = 1<<11; 14 | const int VIEW_I_TEXT = 1; 15 | const int zInputKeyNext = 0; 16 | const int zInputKeyStop = 1; 17 | 18 | enum zTviewID { 19 | VIEW_SCREEN, 20 | VIEW_VIEWPORT, 21 | VIEW_ITEM 22 | }; 23 | */ 24 | 25 | var int ListDocuments; //zCListSort* ListDocuments; 26 | var int DlgDocumentMain; //zCViewDialog* DlgDocumentMain; 27 | }; 28 | -------------------------------------------------------------------------------- /EngineClasses_G1/oCMagFrontier.d: -------------------------------------------------------------------------------- 1 | const int bitfield_oCMagFrontier_isWarning = 1; 2 | const int bitfield_oCMagFrontier_isShooting = 2; 3 | 4 | // sizeof 10h 5 | class oCMagFrontier { 6 | var int warningFX; //oCVisualFX* // sizeof 04h offset 00h 7 | var int shootFX; //oCVisualFX* // sizeof 04h offset 04h 8 | var int npc; //oCNpc* // sizeof 04h offset 08h 9 | //unsigned char isWarning : 1; // sizeof 01h offset bit 10 | //unsigned char isShooting : 1; // sizeof 01h offset bit 11 | var int bitfield; 12 | }; 13 | -------------------------------------------------------------------------------- /EngineClasses_G1/oCRtnEntry.d: -------------------------------------------------------------------------------- 1 | class oCRtnEntry { 2 | var int hour1; //int hour1; 3 | var int min1; //int min1; 4 | var int hour2; //int hour2; 5 | var int min2; //int min2; 6 | var int f_script; //int f_script; 7 | var string wpname; //zSTRING wpname; 8 | var int inst; //int instance; 9 | var int poi; //zCVob* poi; 10 | var int npc; //oCNpc* npc; 11 | var int cutscene; //oCRtnCutscene* cutscene; 12 | var int overlay; //int overlay; 13 | }; 14 | 15 | instance oCRtnEntry@ (oCRtnEntry); 16 | -------------------------------------------------------------------------------- /EngineClasses_G1/oCRtnManager.d: -------------------------------------------------------------------------------- 1 | //As always no idea if this is correct conversion to primitive types :) 2 | class oCRtnManager { 3 | /* 4 | struct TRtn_WayBoxLimit { 5 | public: 6 | int begin; 7 | zTBBox3D bbox; 8 | float value; 9 | oCNpc* npc; 10 | 11 | // user API 12 | #include "oCRtnManager_TRtn_WayBoxLimit.inl" 13 | }; 14 | */ 15 | 16 | /* 17 | struct TRtn_WayBox { 18 | public: 19 | zTBBox3D bbox; 20 | oCNpc* npc; 21 | int found; 22 | 23 | // user API 24 | #include "oCRtnManager_TRtn_WayBox.inl" 25 | }; 26 | */ 27 | 28 | var int indexStart[3]; //int 29 | var int indexEnd[3]; //int 30 | var int world; //zCWorld* 31 | var int nextEntryNode; //zCListSort* 32 | 33 | //zCListSort rtnList; 34 | var int rtnList_compare; 35 | var int rtnList_data; //oCRtnEntry* 36 | var int rtnList_next; 37 | 38 | //zCListSort wayboxListX; 39 | var int wayboxListX_compare; 40 | var int wayboxListX_data; 41 | var int wayboxListX_next; 42 | 43 | //zCListSort wayboxListY; 44 | var int wayboxListY_compare; 45 | var int wayboxListY_data; 46 | var int wayboxListY_next; 47 | 48 | //zCListSort wayboxListZ; 49 | var int wayboxListZ_compare; 50 | var int wayboxListZ_datal; 51 | var int wayboxListZ_next; 52 | 53 | //zCList activeList; 54 | var int activeList_data; 55 | var int activeList_next; 56 | 57 | //zCArraySort wayboxList[3]; 58 | var int wayboxList0_array; 59 | var int wayboxList0_numAlloc; 60 | var int wayboxList0_numInArray; 61 | var int wayboxList0_compare; 62 | 63 | var int wayboxList1_array; 64 | var int wayboxList1_numAlloc; 65 | var int wayboxList1_numInArray; 66 | var int wayboxList1_compare; 67 | 68 | var int wayboxList2_array; 69 | var int wayboxList2_numAlloc; 70 | var int wayboxList2_numInArray; 71 | var int wayboxList2_compare; 72 | }; 73 | -------------------------------------------------------------------------------- /EngineClasses_G1/oCViewDocument.d: -------------------------------------------------------------------------------- 1 | //class oCViewDocument : public zCViewDialog { 2 | class oCViewDocument { 3 | //class zCViewDialog : public zCViewPrint, public zCInputCallback { 4 | //class zCViewPrint : public zCViewFX { 5 | //class zCViewFX : public zCViewDraw { 6 | //class zCViewDraw : public zCViewObject { 7 | //class zCViewObject : public zCObject, public zCViewBase { 8 | //class zCObject { 9 | var int _vtbl; //0 10 | var int refctr; //4 11 | var int hashindex; //8 12 | var int hashNext; //12 13 | 14 | var string objectName; //16 15 | //} 16 | 17 | var int _zCViewBase_vtbl; //36 18 | 19 | var int virtualPositionX; //zPOS // sizeof 08h offset 28h 20 | var int virtualPositionY; 21 | var int virtualSizeX; //zPOS // sizeof 08h offset 30h 22 | var int virtualSizeY; 23 | 24 | var int pixelPositionX; //zPOS // sizeof 08h offset 38h 25 | var int pixelPositionY; 26 | var int pixelSizeX; //zPOS // sizeof 08h offset 40h 27 | var int pixelSizeY; 28 | 29 | var int ID; //unsigned long // sizeof 04h offset 48h 30 | var int viewParent; //zCViewObject* // sizeof 04h offset 4Ch 31 | 32 | //zCListSort ListChildren; // sizeof 0Ch offset 50h 33 | var int listChildren_compare; 34 | var int listChildren_data; 35 | var int listChildren_next; 36 | //} 37 | 38 | var int textureFuncAlpha; //zTRnd_AlphaBlendFunc // sizeof 04h offset 5Ch 39 | var int texture; //zCTexture* // sizeof 04h offset 60h 40 | var int textureColor; //zCOLOR // sizeof 04h offset 64h 41 | var int textureAlpha; //int // sizeof 04h offset 68h 42 | 43 | //zVEC2 TexturePosition[2]; // sizeof 10h offset 6Ch 44 | var int texturePosition_0[2]; 45 | var int texturePosition_1[2]; 46 | //} 47 | 48 | var int hasOpened; //int // sizeof 04h offset 7Ch 49 | var int hasClosed; //int // sizeof 04h offset 80h 50 | var int timeOpen; //float // sizeof 04h offset 84h 51 | var int timeClose; //float // sizeof 04h offset 88h 52 | var int durationOpen; //float // sizeof 04h offset 8Ch 53 | var int durationClose; //float // sizeof 04h offset 90h 54 | var int modeOpen; //unsigned long // sizeof 04h offset 94h 55 | var int modeClose; //unsigned long // sizeof 04h offset 98h 56 | 57 | //zVEC2 TextureOffset[2]; // sizeof 10h offset 9Ch 58 | var int textureOffset_0[2]; 59 | var int textureOffset_1[2]; 60 | //} 61 | 62 | //zCArray ListTextLines; // sizeof 0Ch offset ACh 63 | var int listTextLines_array; //zCViewText2* 64 | var int listTextLines_numAlloc; //int 65 | var int listTextLines_numInArray;//int 66 | 67 | //zCViewFont ViewFont; // sizeof 14h offset B8h 68 | //class zCViewFont { 69 | var int funcAlphaBlend; //zTRnd_AlphaBlendFunc // sizeof 04h offset 00h 70 | var int font; //zCFont* // sizeof 04h offset 04h 71 | var int color; //zCOLOR // sizeof 04h offset 08h 72 | var int alpha; //int // sizeof 04h offset 0Ch 73 | var int enabledBlend; //int // sizeof 04h offset 10h 74 | //}; 75 | 76 | var int positionCursorX; //zPOS // sizeof 08h offset CCh 77 | var int positionCursorY; 78 | var int offsetTextPixelX; //zPOS // sizeof 08h offset D4h 79 | var int offsetTextPixelY; 80 | var int sizeMargin_0[2]; //zPOS // sizeof 10h offset DCh 81 | var int sizeMargin_1[2]; 82 | //} 83 | 84 | var int zCInputCallback_vtbl; //236 85 | 86 | var int isDone; //int // sizeof 04h offset F0h 87 | var int isActivated; //int // sizeof 04h offset F4h 88 | //} 89 | 90 | var int Pages; //int // sizeof 04h offset F8h 91 | }; 92 | -------------------------------------------------------------------------------- /EngineClasses_G1/oNpc.d: -------------------------------------------------------------------------------- 1 | class oCNpcTimedOverlay { 2 | var string mdsOverlayName; //0 zSTRING mdsOverlayName; 3 | var int timer; //4 float timer; 4 | }; 5 | -------------------------------------------------------------------------------- /EngineClasses_G1/oNpcStates.d: -------------------------------------------------------------------------------- 1 | /* 2 | enum { 3 | AITIME_NO, 4 | AITIME_ONCE, 5 | AITIME_TIMED 6 | }; 7 | 8 | enum { 9 | NPC_AISTATE_ANSWER = -2, 10 | NPC_AISTATE_DEAD = -3, 11 | NPC_AISTATE_UNCONSCIOUS = -4, 12 | NPC_AISTATE_FADEAWAY = -5, 13 | NPC_AISTATE_FOLLOW = -6 14 | }; 15 | */ 16 | 17 | /* 18 | struct TNpcAIState { 19 | public: 20 | int index; 21 | int loop; 22 | int end; 23 | int timeBehaviour; 24 | float restTime; 25 | int phase; 26 | int valid; 27 | zSTRING name; 28 | float stateTime; 29 | int prgIndex; 30 | int isRtnState; 31 | */ 32 | 33 | class oCNpc_States { 34 | var int _vtbl; 35 | 36 | var string name; //zSTRING name; 37 | var int npc; //oCNpc* npc; 38 | 39 | //TNpcAIState curState; 40 | var int curState_index; //int index; 41 | var int curState_loop; //int loop; 42 | var int curState_end; //int end; 43 | var int curState_timeBehaviour; //int timeBehaviour; 44 | var int curState_restTime; //float restTime; 45 | var int curState_phase; //int phase; 46 | //0 loop //_LOOP 47 | //1 end //_END 48 | //2 ended //_INTERRUPT 49 | var int curState_valid; //int valid; 50 | var string curState_name; //zSTRING name; 51 | var int curState_stateTime; //float stateTime; 52 | var int curState_prgIndex; //int prgIndex; 53 | var int curState_isRtnState; //int isRtnState; 54 | //TNpcAIState nextState; 55 | var int nextState_index; //int index; 56 | var int nextState_loop; //int loop; 57 | var int nextState_end; //int end; 58 | var int nextState_timeBehaviour; //int timeBehaviour; 59 | var int nextState_restTime; //float restTime; 60 | var int nextState_phase; //int phase; 61 | //-1 not yet initialized 62 | //1 end previous state properly 63 | //2 end previous state 64 | var int nextState_valid; //int valid; 65 | var string nextState_name; //zSTRING name; 66 | var int nextState_stateTime; //float stateTime; 67 | var int nextState_prgIndex; //int prgIndex; 68 | var int nextState_isRtnState; //int isRtnState; 69 | 70 | var int lastAIState; //int lastAIState; 71 | var int hasRoutine; //int hasRoutine; 72 | var int rtnChanged; //int rtnChanged; 73 | var int rtnBefore; //oCRtnEntry* rtnBefore; 74 | var int rtnNow; //oCRtnEntry* rtnNow; 75 | var int rtnRoute; //zCRoute* rtnRoute; 76 | var int rtnOverlay; //int rtnOverlay; 77 | var int rtnOverlayCount; //int rtnOverlayCount; 78 | var int walkmode_routine; //int walkmode_routine; 79 | var int weaponmode_routine; //int weaponmode_routine; 80 | var int startNewRoutine; //int startNewRoutine; 81 | var int aiStateDriven; //int aiStateDriven; 82 | var int aiStatePosition[3]; //zVEC3 aiStatePosition; float 83 | var int parOther; //oCNpc* parOther; 84 | var int parVictim; //oCNpc* parVictim; 85 | var int parItem; //oCItem* parItem; 86 | var int rntChangeCount; //int rntChangeCount; 87 | }; 88 | -------------------------------------------------------------------------------- /EngineClasses_G1/oSSpawnNode.d: -------------------------------------------------------------------------------- 1 | class oSSpawnNode { 2 | var int npc; //oCNpc* // sizeof 04h offset 00h 3 | var int spawnPos[3]; //zVEC3 // sizeof 0Ch offset 04h 4 | var int timer; //float // sizeof 04h offset 10h 5 | }; 6 | -------------------------------------------------------------------------------- /EngineClasses_G1/oSpell.d: -------------------------------------------------------------------------------- 1 | /* 2 | enum { 3 | SPL_STATUS_DONTINVEST, 4 | SPL_STATUS_CANINVEST, 5 | SPL_STATUS_CAST, 6 | SPL_STATUS_STOP, 7 | SPL_STATUS_NEXTLEVEL 8 | }; 9 | 10 | enum { 11 | SPL_CAT_GOOD, 12 | SPL_CAT_NEUTRAL, 13 | SPL_CAT_BAD 14 | }; 15 | 16 | enum { 17 | TARGET_COLLECT_NONE, 18 | TARGET_COLLECT_CASTER, 19 | TARGET_COLLECT_FOCUS, 20 | TARGET_COLLECT_ALL, 21 | TARGET_COLLECT_FOCUS_FALLBACK_NONE, 22 | TARGET_COLLECT_FOCUS_FALLBACK_CASTER, 23 | TARGET_COLLECT_ALL_FALLBACK_NONE, 24 | TARGET_COLLECT_ALL_FALLBACK_CASTER 25 | }; 26 | 27 | enum { 28 | TARGET_FLAG_NONE, 29 | TARGET_FLAG_ALL, 30 | TARGET_FLAG_ITEMS, 31 | TARGET_FLAG_NPCS = 4, 32 | TARGET_FLAG_ORCS = 8, 33 | TARGET_FLAG_HUMANS = 16, 34 | TARGET_FLAG_UNDEAD = 32, 35 | TARGET_FLAG_LIVING = 64 36 | }; 37 | */ 38 | 39 | class oCSpell { 40 | var int _vtbl; //0 41 | 42 | //class zCObject { 43 | var int refCtr; //4 int refCtr; 44 | var int hashIndex; //8 unsigned short hashIndex; 45 | var int hashNext; //12 zCObject* hashNext; 46 | var string objectName; //16 zSTRING objectName 47 | 48 | //}; 49 | 50 | var int keyNo; //36 int keyNo; 51 | var int effect; //40 oCVisualFX* effect; 52 | var int controlWarnFX; //44 oCVisualFX* controlWarnFX; 53 | var int spellCaster; //48 zCVob* spellCaster; 54 | var int spellCasterNpc; //52 oCNpc* spellCasterNpc; 55 | var int spellTarget; //56 zCVob* spellTarget; 56 | var int spellTargetNpc; //60 oCNpc* spellTargetNpc; 57 | var int saveNpc; //64 oCNpc* saveNpc; 58 | var int manaTimer; //68 float manaTimer; 59 | var int manaInvested; //72 int manaInvested; 60 | var int spellLevel; //76 int spellLevel; 61 | var int spellStatus; //80 int spellStatus; 62 | var int spellID; //84 int spellID; 63 | var int spellInfo; //88 int spellInfo; 64 | var int spellEnabled; //92 int spellEnabled; 65 | var int spellInitDone; //96 int spellInitDone; 66 | var int timerEffect; //100 int timerEffect; 67 | var int canBeDeleted; //104 int canBeDeleted; 68 | var int up; //108 float up; 69 | var int hoverY; //112 float hoverY; 70 | var int hoverOld; //116 float hoverOld; 71 | var int hoverDir; //120 float hoverDir; 72 | var int spellEnergy; //124 int spellEnergy; 73 | //group { 74 | var int manaInvestTime; //128 float manaInvestTime; 75 | var int damagePerLevel; //132 int damagePerLevel; 76 | var int damageType; //136 int damageType; 77 | var int spellType; //140 int spellType; 78 | var int canTurnDuringInvest; //144 int canTurnDuringInvest; 79 | var int canChangeTargetDuringInvest; //148 int canChangeTargetDuringInvest; 80 | var int isMultiEffect; //152 int isMultiEffect; 81 | var int targetCollectAlgo; //156 int targetCollectAlgo; 82 | var int targetCollectType; //160 int targetCollectType; 83 | var int targetCollectRange; //164 int targetCollectRange; 84 | var int targetCollectAzi; //168 int targetCollectAzi; 85 | var int targetCollectElev; //172 int targetCollectElev; 86 | //}; 87 | }; 88 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCActiveSnd.d: -------------------------------------------------------------------------------- 1 | const int bitfield_zCActiveSnd_active = 1; 2 | const int bitfield_zCActiveSnd_looping = 2; 3 | const int bitfield_zCActiveSnd_isAmbient = 4; 4 | const int bitfield_zCActiveSnd_is3D = 8; 5 | const int bitfield_zCActiveSnd_allocated = 16; 6 | const int bitfield_zCActiveSnd_vobSlot = 32; 7 | 8 | // sizeof 54h 9 | class zCActiveSnd { 10 | var int handle; //int // sizeof 04h offset 00h 11 | var int sample; //void* // sizeof 04h offset 04h 12 | var int sample3D; //void* // sizeof 04h offset 08h 13 | var int age; //unsigned long // sizeof 04h offset 0Ch 14 | var int loopType; //zCSoundSystem::zTLoopType // sizeof 04h offset 10h 15 | var int radius; //float // sizeof 04h offset 14h 16 | var int reverbLevel; //float // sizeof 04h offset 18h 17 | var int pitchOffset; //float // sizeof 04h offset 1Ch 18 | var int volWeight; //float // sizeof 04h offset 20h 19 | var int obstruction; //float // sizeof 04h offset 24h 20 | 21 | var int bitfield_zCActiveSnd; 22 | /* 23 | group { 24 | unsigned char active : 1; // sizeof 01h offset bit 1 25 | unsigned char looping : 1; // sizeof 01h offset bit 2 26 | unsigned char isAmbient : 1; // sizeof 01h offset bit 4 27 | unsigned char is3D : 1; // sizeof 01h offset bit 8 28 | unsigned char allocated : 1; // sizeof 01h offset bit 16 29 | unsigned char vobSlot : 3; // sizeof 03h offset bit 32 30 | }; 31 | */ 32 | //Is this correct conversion ?? 33 | var int bitfield; 34 | //unsigned char pan; // sizeof 01h offset 29h 35 | //unsigned char volume; // sizeof 01h offset 2Ah 36 | //unsigned short rate; // sizeof 02h offset 2Ch 37 | 38 | var int muteTime; //int // sizeof 04h offset 30h 39 | var int frameCtr; //int // sizeof 04h offset 34h 40 | var int lastPos[3]; //zVEC3 // sizeof 0Ch offset 38h 41 | var int lastTime; //float // sizeof 04h offset 44h 42 | var int sourceVob; //zCVob* // sizeof 04h offset 48h 43 | var int sourceFrm; //zCSndFrame* // sizeof 04h offset 4Ch 44 | var int sourceSnd; //zCSndFX_MSS* // sizeof 04h offset 50h 45 | }; 46 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCCSBlock.d: -------------------------------------------------------------------------------- 1 | // sizeof 44h 2 | class zCCSBlock { 3 | //class zCCSBlockBase { 4 | //public zCObject { 5 | var int _vtbl; //0 6 | 7 | var int refCtr; //4 int 8 | var int hashIndex; //8 unsigned short 9 | var int hashNext; //12 zCObject* 10 | var string objectName; //16 zSTRING 11 | //}; 12 | //}; 13 | 14 | //zCArray blocks; // sizeof 0Ch offset 24h 15 | var int blocks_array; // zCCSBlockPosition 16 | var int blocks_numAlloc; 17 | var int blocks_numInArray; 18 | 19 | var string roleName; //zSTRING // sizeof 14h offset 30h 20 | }; 21 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCConDat.d: -------------------------------------------------------------------------------- 1 | // sizeof 3Ch 2 | class zCConDat { 3 | var string hint; //zSTRING // sizeof 14h offset 00h 4 | var string name; //zSTRING // sizeof 14h offset 14h 5 | var int type; //int // sizeof 04h offset 28h 6 | var int adr; //void* // sizeof 04h offset 2Ch 7 | var int ele; //int // sizeof 04h offset 30h 8 | var int var; //int // sizeof 04h offset 34h 9 | var int next; //zCConDat* // sizeof 04h offset 38h 10 | }; 11 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCSkyState.d: -------------------------------------------------------------------------------- 1 | /* 2 | const int zSKY_NUM_LAYER = 2; 3 | const int NUM_PLANETS = 2; 4 | 5 | enum zESkyLayerMode { 6 | zSKY_MODE_POLY, 7 | zSKY_MODE_BOX 8 | }; 9 | 10 | enum zTSkyStateEffect { 11 | zSKY_STATE_EFFECT_SUN, 12 | zSKY_STATE_EFFECT_CLOUDSHADOW 13 | }; 14 | */ 15 | 16 | // sizeof C0h 17 | class zCSkyState { 18 | var int time; //float // sizeof 04h offset 00h 19 | var int polyColor[3]; //zVEC3 // sizeof 0Ch offset 04h 20 | var int fogColor[3]; //zVEC3 // sizeof 0Ch offset 10h 21 | var int domeColor1[3]; //zVEC3 // sizeof 0Ch offset 1Ch 22 | var int domeColor0[3]; //zVEC3 // sizeof 0Ch offset 28h 23 | var int fogDist; //float // sizeof 04h offset 34h 24 | var int sunOn; //int // sizeof 04h offset 38h 25 | var int cloudShadowOn; //int // sizeof 04h offset 3Ch 26 | 27 | //zCSkyLayerData layer[zSKY_NUM_LAYER]; // sizeof 80h offset 40h 28 | //class zCSkyLayerData { 29 | var int layer0_skyMode; //64 zESkyLayerMode // sizeof 04h offset 00h 30 | var int layer0_texBox[5]; //68 zCTexture* // sizeof 14h offset 04h 48h 31 | var int layer0_tex; //88 zCTexture* // sizeof 04h offset 18h 32 | var string layer0_texName; //92 zSTRING // sizeof 14h offset 1Ch 33 | var int layer0_texAlpha; //112 float // sizeof 04h offset 30h 34 | var int layer0_texScale; //116 float // sizeof 04h offset 34h 35 | var int layer0_texSpeed[2]; //120 zVEC2 // sizeof 08h offset 38h 36 | 37 | var int layer1_skyMode; //128 zESkyLayerMode // sizeof 04h offset 00h 38 | var int layer1_texBox[5]; //132 zCTexture* // sizeof 14h offset 04h 39 | var int layer1_tex; //152 zCTexture* // sizeof 04h offset 18h 40 | var string layer1_texName; //156 zSTRING // sizeof 14h offset 1Ch 41 | var int layer1_texAlpha; //176 float // sizeof 04h offset 30h 42 | var int layer1_texScale; //180 float // sizeof 04h offset 34h 43 | var int layer1_texSpeed[2]; //184 zVEC2 // sizeof 08h offset 38h 44 | }; 45 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCSndFrame.d: -------------------------------------------------------------------------------- 1 | // sizeof 6Ch 2 | // Same for G1 & G2A 3 | class zCSndFrame { 4 | var string fileName; //zSTRING // sizeof 14h offset 00h 5 | var int pitchOffset; //float // sizeof 04h offset 14h 6 | var int pitchVariance; //float // sizeof 04h offset 18h 7 | var int defVolume; //int // sizeof 04h offset 1Ch 8 | var int looping; //int // sizeof 04h offset 20h 9 | var int loopStartOffset; //int // sizeof 04h offset 24h 10 | var int loopEndOffset; //int // sizeof 04h offset 28h 11 | var int reverbLevel; //float // sizeof 04h offset 2Ch 12 | var string pfxName; //zSTRING // sizeof 14h offset 30h 13 | var int dScriptEnd; //unsigned char // sizeof 01h offset 44h 14 | var string instance; //zSTRING // sizeof 14h offset 48h 15 | var int actVolume; //int // sizeof 04h offset 5Ch 16 | var int actRate; //int // sizeof 04h offset 60h 17 | var int actPan; //int // sizeof 04h offset 64h 18 | var int wav; //zCWaveData* // sizeof 04h offset 68h 19 | }; 20 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCVobSpot.d: -------------------------------------------------------------------------------- 1 | // sizeof 108h 2 | class zCVobSpot { 3 | //class zCVobSpot 4 | //public zCVob { 5 | //public zCObject 6 | var int _vtbl; //0 7 | 8 | var int _zCObject_refCtr; //4 int 9 | var int _zCObject_hashIndex; //8 unsigned short 10 | var int _zCObject_hashNext; //12 zCObject* 11 | var string _zCObject_objectName; //16 zSTRING 12 | //}; 13 | 14 | var int globalVobTreeNode; // 0x0024 zCTree* 15 | var int lastTimeDrawn; // 0x0028 zTFrameCtr 16 | var int lastTimeCollected; // 0x002C zDWORD 17 | // zCArray vobLeafList { 18 | var int vobLeafList_array; // 0x0030 zCBspLeaf** 19 | var int vobLeafList_numAlloc; // 0x0034 int 20 | var int vobLeafList_numInArray; // 0x0038 int 21 | // } 22 | var int trafoObjToWorld[16]; // 0x003C zMATRIX4 23 | // zTBBox3D bbox3D { 24 | var int bbox3D_mins[3]; // 0x007C zPOINT3 25 | var int bbox3D_maxs[3]; // 0x0088 zPOINT3 26 | // } 27 | // zCArray touchVobList { 28 | var int touchVobList_array; // 0x0094 zCVob** 29 | var int touchVobList_numAlloc; // 0x0098 int 30 | var int touchVobList_numInArray; // 0x009C int 31 | // } 32 | var int type; // 0x00A0 zTVobType 33 | var int groundShadowSizePacked; // 0x00A4 zDWORD 34 | var int homeWorld; // 0x00A8 zCWorld* 35 | var int groundPoly; // 0x00AC zCPolygon* 36 | var int callback_ai; // 0x00B0 zCAIBase* 37 | var int trafo; // 0x00B4 zMATRIX4* 38 | var int visual; // 0x00B8 zCVisual* 39 | var int visualAlpha; // 0x00BC zREAL 40 | var int rigidBody; // 0x00C0 zCRigidBody* 41 | var int lightColorStat; // 0x00C4 zCOLOR 42 | var int lightColorDyn; // 0x00C8 zCOLOR 43 | var int lightDirectionStat[3]; // 0x00CC zVEC3 44 | var int vobPresetName; // 0x00D8 zSTRING* 45 | var int eventManager; // 0x00DC zCEventManager* 46 | var int nextOnTimer; // 0x00E0 zREAL 47 | var int bitfield[5]; // 0x00E4 zCVob_bitfieldX_Xxx 48 | var int m_poCollisionObjectClass; // 0x00F8 zCCollisionObjectDef* 49 | var int m_poCollisionObject; // 0x00FC zCCollisionObject* 50 | 51 | //zCVobSpot 52 | var int timerEnd; //float timerEnd; // sizeof 04h offset 100h 53 | var int inUseVob; //zCVob* inUseVob; // sizeof 04h offset 104h 54 | }; 55 | -------------------------------------------------------------------------------- /EngineClasses_G1/zCWay.d: -------------------------------------------------------------------------------- 1 | // sizeof 20h 2 | class zCWay { 3 | var int _vtbl; 4 | var int cost; //int cost; // sizeof 04h offset 04h 5 | var int usedCtr; //int usedCtr; // sizeof 04h offset 08h 6 | var int chasmDepth; //float chasmDepth; // sizeof 04h offset 0Ch 7 | var int chasm; //int chasm; // sizeof 04h offset 10h 8 | var int jump; //int jump; // sizeof 04h offset 14h 9 | var int left; //zCWaypoint* left; // sizeof 04h offset 18h 10 | var int right; //zCWaypoint* right; // sizeof 04h offset 1Ch 11 | }; 12 | 13 | instance zCWay@ (zCWay); -------------------------------------------------------------------------------- /EngineClasses_G1/zModel.d: -------------------------------------------------------------------------------- 1 | class zCModelAni { 2 | var int _vtbl; //0 3 | var int refctr; //4 4 | var int hashindex; //8 5 | var int hashNext; //12 6 | 7 | var string objectName; //16 8193786 8 | 9 | /* 10 | enum { 11 | zMDL_ANI_FLAG_VOB_ROT = 1, 12 | zMDL_ANI_FLAG_VOB_POS = 2, 13 | zMDL_ANI_FLAG_END_SYNC = 4, 14 | zMDL_ANI_FLAG_FLY = 8, 15 | zMDL_ANI_FLAG_IDLE = 16 16 | }; 17 | */ 18 | 19 | var string aniName; // zSTRING 20 | var string ascName; // zSTRING 21 | var int aniID; 22 | var string aliasName; // zSTRING 23 | 24 | //zCList combAniList; 25 | var int combAniList_data; 26 | var int combAniList_next; 27 | 28 | var int layer; 29 | var int blendInSpeed; // float 30 | var int blendOutSpeed; // float 31 | 32 | //zTBBox3D aniBBox3DObjSpace; 33 | var int aniBBox3DObjSpace_mins[3]; 34 | var int aniBBox3DObjSpace_maxs[3]; 35 | 36 | var int collisionVolumeScale; // float 37 | var int nextAni; // zCModelAni* 38 | 39 | var string nextAniName; // zSTRING 40 | var int aniEvents; // zCModelAniEvent* 41 | 42 | var int fpsRate; // float 43 | var int fpsRateSource; // float 44 | 45 | var int rootNodeIndex; 46 | 47 | //zCArray nodeIndexList; 48 | //zCModelNode** nodeList; 49 | var int nodeList_array; // zCModelNode** 50 | var int nodeList_numAlloc; // int 51 | var int nodeList_numInArray; // int 52 | 53 | /* 54 | not finished: 55 | 56 | zTMdl_AniSample* aniSampleMatrix; 57 | float samplePosRangeMin; 58 | float samplePosScaler; 59 | group { 60 | int numFrames : 16; 61 | int numNodes : 16; 62 | zTMdl_AniType aniType : 6; 63 | zTMdl_AniDir aniDir : 2; 64 | int numAniEvents : 6; 65 | }; 66 | group { 67 | byte flagVobRot : 1; 68 | byte flagVobPos : 1; 69 | byte flagEndSync : 1; 70 | byte flagFly : 1; 71 | byte flagIdle : 1; 72 | byte flagInPlace : 1; 73 | byte flagStaticCycle : 1; 74 | } 75 | aniFlags; 76 | */ 77 | }; -------------------------------------------------------------------------------- /EngineClasses_G1/zPhysics.d: -------------------------------------------------------------------------------- 1 | class zCRigidBody { 2 | var int mass; //float 3 | var int massInv; //float 4 | var int iBody[9]; //zMAT3 5 | var int iBodyInv[9]; //zMAT3 6 | var int xPos[3]; //zVEC3 7 | var int RDir[9]; //zMAT3 8 | var int PLinMom[3]; //zVEC3 9 | var int LAngMom[3]; //zVEC3 10 | var int iInv[9]; //zMAT3 11 | var int v[3]; //zVEC3 12 | var int omega[3]; //zVEC3 13 | var int force[3]; //zVEC3 14 | var int torque[3]; //zVEC3 15 | var int gravityScale; //float 16 | var int slideDir[3]; //zVEC3 17 | var int slideAngle; //float 18 | var int bitfield; 19 | /* 20 | unsigned char gravityOn : 1; 21 | unsigned char collisionHad : 1; 22 | unsigned char mode : 1; 23 | unsigned char justSetSliding : 4; 24 | */ 25 | }; -------------------------------------------------------------------------------- /EngineClasses_G1/zTConfig.d: -------------------------------------------------------------------------------- 1 | //Class defintion is same for G1 & G2 NoTR 2 | 3 | /* 4 | enum zEConfigState { 5 | zCONFIG_STATE_STAND, 6 | zCONFIG_STATE_FLY, 7 | zCONFIG_STATE_SLIDE, 8 | zCONFIG_STATE_SWIM, 9 | zCONFIG_STATE_DIVE 10 | }; 11 | */ 12 | 13 | const int bitfield0_m_bTreatWaterAsSolid = ((1 << 1) - 1) << 0; 14 | const int bitfield0_m_bDoWallSliding = ((1 << 1) - 1) << 1; 15 | const int bitfield0_m_bUseSpacingRays = ((1 << 1) - 1) << 2; 16 | const int bitfield0_m_m_bLiftSpacingRayStart = ((1 << 1) - 1) << 3; 17 | const int bitfield0_m_bFloorTooLowIsHardCollision = ((1 << 1) - 1) << 4; 18 | const int bitfield0_m_eDoHeightCorrection = ((1 << 1) - 1) << 5; 19 | const int bitfield0_m_eDoHeightCorrectionSmooth = ((1 << 1) - 1) << 6; 20 | const int bitfield1_m_eState = ((1 << 4) - 1) << 0; 21 | 22 | // sizeof 10h 23 | class zTConfig { 24 | var int m_fMaxGroundAngleWalk; //float // sizeof 04h offset 00h 25 | var int m_fStepHeight; //float // sizeof 04h offset 04h 26 | var int bitfield[2]; 27 | //group { 28 | // unsigned char m_bTreatWaterAsSolid : 1; // sizeof 01h offset bit 29 | // unsigned char m_bDoWallSliding : 1; // sizeof 01h offset bit 30 | // unsigned char m_bUseSpacingRays : 1; // sizeof 01h offset bit 31 | // unsigned char m_bLiftSpacingRayStart : 1; // sizeof 01h offset bit 32 | // unsigned char m_bFloorTooLowIsHardCollision : 1; // sizeof 01h offset bit 33 | // unsigned char m_eDoHeightCorrection : 1; // sizeof 01h offset bit 34 | // unsigned char m_eDoHeightCorrectionSmooth : 1; // sizeof 01h offset bit 35 | // zEConfigState m_eState : 4; // sizeof 04h offset bit 36 | //}; 37 | }; 38 | -------------------------------------------------------------------------------- /EngineClasses_G1/zTSound3DParams.d: -------------------------------------------------------------------------------- 1 | //Same for G1 & G2A 2 | class zTSound3DParams { 3 | var int obstruction; //float obstruction; 4 | var int volume; //float volume; 5 | var int radius; //float radius; 6 | var int loopType; //zTLoopType loopType; 7 | var int coneAngleDeg; //float coneAngleDeg; 8 | var int reverbLevel; //float reverbLevel; 9 | var int isAmbient3D; //int isAmbient3D; 10 | var int pitchOffset; //float pitchOffset; 11 | }; 12 | 13 | instance zTSound3DParams@(zTSound3DParams); 14 | -------------------------------------------------------------------------------- /EngineClasses_G1/zTSpatialState.d: -------------------------------------------------------------------------------- 1 | //Class defintion is same for G1 & G2 NoTR 2 | 3 | // sizeof 20h 4 | class zTSpatialState { 5 | var int m_fFloorY; //float // sizeof 04h offset 00h 6 | var int m_fWaterY; //float // sizeof 04h offset 04h 7 | var int m_fCeilingY; //float // sizeof 04h offset 08h 8 | var int m_fLastFloorY; //float // sizeof 04h offset 0Ch 9 | var int m_poFloorPoly; //zCPolygon* // sizeof 04h offset 10h 10 | var int m_poWaterPoly; //zCPolygon* // sizeof 04h offset 14h 11 | var int m_poCeilingPoly; //zCPolygon* // sizeof 04h offset 18h 12 | var int bitfield; 13 | //group { 14 | // unsigned char m_bFloorIsStair : 1; // sizeof 01h offset bit 15 | // unsigned char m_bFloorIsVob : 1; // sizeof 01h offset bit 16 | // unsigned char m_bIsUninited : 1; // sizeof 01h offset bit 17 | //}; 18 | }; 19 | -------------------------------------------------------------------------------- /EngineClasses_G2/!README!.txt: -------------------------------------------------------------------------------- 1 | Classes defined in this folder might not be properly determined. 2 | Some are not finished. 3 | 4 | Use at your own risk :) -------------------------------------------------------------------------------- /EngineClasses_G2/TMobOptPos.d: -------------------------------------------------------------------------------- 1 | class TMobOptPos { 2 | var int trafo[16]; //zMAT4 3 | var int distance; //int 4 | var int npc; //oCNpc* 5 | var string nodeName; //zSTRING 6 | }; -------------------------------------------------------------------------------- /EngineClasses_G2/TNpcSlot.d: -------------------------------------------------------------------------------- 1 | // sizeof 38h 2 | class TNpcSlot { 3 | var string name; //zSTRING // sizeof 14h offset 00h 4 | var int inInventory; //int // sizeof 04h offset 14h 5 | var int tmpLevel; //int // sizeof 04h offset 18h 6 | var string itemName; //zSTRING // sizeof 14h offset 1Ch 7 | var int vob; //oCVob* // sizeof 04h offset 30h 8 | var int bitfield; 9 | //int wasVobTreeWhenInserted : 1; // sizeof 01h offset bit 10 | }; 11 | -------------------------------------------------------------------------------- /EngineClasses_G2/TObjectRoutine.d: -------------------------------------------------------------------------------- 1 | // sizeof 24h 2 | class TObjectRoutine { 3 | var string objName; //zSTRING // sizeof 14h offset 00h 4 | var int stateNum; //int // sizeof 04h offset 14h 5 | var int hour1; //int // sizeof 04h offset 18h 6 | var int min1; //int // sizeof 04h offset 1Ch 7 | var int type; //int // sizeof 04h offset 20h 8 | }; 9 | -------------------------------------------------------------------------------- /EngineClasses_G2/oCMagFrontier.d: -------------------------------------------------------------------------------- 1 | const int bitfield_oCMagFrontier_isWarning = 1; 2 | const int bitfield_oCMagFrontier_isShooting = 2; 3 | 4 | // sizeof 10h 5 | class oCMagFrontier { 6 | var int warningFX; //oCVisualFX* // sizeof 04h offset 00h 7 | var int shootFX; //oCVisualFX* // sizeof 04h offset 04h 8 | var int npc; //oCNpc* // sizeof 04h offset 08h 9 | //unsigned char isWarning : 1; // sizeof 01h offset bit 10 | //unsigned char isShooting : 1; // sizeof 01h offset bit 11 | var int bitfield; 12 | }; 13 | -------------------------------------------------------------------------------- /EngineClasses_G2/oCRtnEntry.d: -------------------------------------------------------------------------------- 1 | class oCRtnEntry { 2 | var int hour1; //int hour1; 3 | var int min1; //int min1; 4 | var int hour2; //int hour2; 5 | var int min2; //int min2; 6 | var int f_script; //int f_script; 7 | var string wpname; //zSTRING wpname; 8 | var int inst; //int instance; 9 | var int poi; //zCVob* poi; 10 | var int npc; //oCNpc* npc; 11 | var int cutscene; //oCRtnCutscene* cutscene; 12 | var int overlay; //int overlay; 13 | }; 14 | 15 | instance oCRtnEntry@ (oCRtnEntry); 16 | -------------------------------------------------------------------------------- /EngineClasses_G2/oCRtnManager.d: -------------------------------------------------------------------------------- 1 | //As always no idea if this is correct conversion to primitive types :) 2 | class oCRtnManager { 3 | /* 4 | struct TRtn_WayBoxLimit { 5 | public: 6 | int begin; 7 | zTBBox3D bbox; 8 | float value; 9 | oCNpc* npc; 10 | 11 | // user API 12 | #include "oCRtnManager_TRtn_WayBoxLimit.inl" 13 | }; 14 | */ 15 | 16 | /* 17 | struct TRtn_WayBox { 18 | public: 19 | zTBBox3D bbox; 20 | oCNpc* npc; 21 | int found; 22 | 23 | // user API 24 | #include "oCRtnManager_TRtn_WayBox.inl" 25 | }; 26 | */ 27 | 28 | var int indexStart[3]; //int 29 | var int indexEnd[3]; //int 30 | var int world; //zCWorld* 31 | var int nextEntryNode; //zCListSort* 32 | 33 | //zCListSort rtnList; 34 | var int rtnList_compare; 35 | var int rtnList_data; //oCRtnEntry* 36 | var int rtnList_next; 37 | 38 | //zCListSort wayboxListX; 39 | var int wayboxListX_compare; 40 | var int wayboxListX_data; 41 | var int wayboxListX_next; 42 | 43 | //zCListSort wayboxListY; 44 | var int wayboxListY_compare; 45 | var int wayboxListY_data; 46 | var int wayboxListY_next; 47 | 48 | //zCListSort wayboxListZ; 49 | var int wayboxListZ_compare; 50 | var int wayboxListZ_datal; 51 | var int wayboxListZ_next; 52 | 53 | //zCList activeList; 54 | var int activeList_data; 55 | var int activeList_next; 56 | 57 | //zCArraySort wayboxList[3]; 58 | var int wayboxList0_array; 59 | var int wayboxList0_numAlloc; 60 | var int wayboxList0_numInArray; 61 | var int wayboxList0_compare; 62 | 63 | var int wayboxList1_array; 64 | var int wayboxList1_numAlloc; 65 | var int wayboxList1_numInArray; 66 | var int wayboxList1_compare; 67 | 68 | var int wayboxList2_array; 69 | var int wayboxList2_numAlloc; 70 | var int wayboxList2_numInArray; 71 | var int wayboxList2_compare; 72 | }; 73 | -------------------------------------------------------------------------------- /EngineClasses_G2/oNpc.d: -------------------------------------------------------------------------------- 1 | class oCNpcTimedOverlay { 2 | var string mdsOverlayName; //0 zSTRING mdsOverlayName; 3 | var int timer; //4 float timer; 4 | }; 5 | -------------------------------------------------------------------------------- /EngineClasses_G2/oNpcStates.d: -------------------------------------------------------------------------------- 1 | /* 2 | enum { 3 | AITIME_NO, 4 | AITIME_ONCE, 5 | AITIME_TIMED 6 | }; 7 | 8 | enum { 9 | NPC_AISTATE_ANSWER = -2, 10 | NPC_AISTATE_DEAD = -3, 11 | NPC_AISTATE_UNCONSCIOUS = -4, 12 | NPC_AISTATE_FADEAWAY = -5, 13 | NPC_AISTATE_FOLLOW = -6 14 | }; 15 | */ 16 | 17 | /* 18 | struct TNpcAIState { 19 | public: 20 | int index; 21 | int loop; 22 | int end; 23 | int timeBehaviour; 24 | float restTime; 25 | int phase; 26 | int valid; 27 | zSTRING name; 28 | float stateTime; 29 | int prgIndex; 30 | int isRtnState; 31 | */ 32 | 33 | class oCNpc_States { 34 | var int _vtbl; 35 | 36 | var string name; //zSTRING name; 37 | var int npc; //oCNpc* npc; 38 | 39 | //TNpcAIState curState; 40 | var int curState_index; //int index; 41 | var int curState_loop; //int loop; 42 | var int curState_end; //int end; 43 | var int curState_timeBehaviour; //int timeBehaviour; 44 | var int curState_restTime; //float restTime; 45 | var int curState_phase; //int phase; 46 | var int curState_valid; //int valid; 47 | var string curState_name; //zSTRING name; 48 | var int curState_stateTime; //float stateTime; 49 | var int curState_prgIndex; //int prgIndex; 50 | var int curState_isRtnState; //int isRtnState; 51 | //TNpcAIState nextState; 52 | var int nextState_index; //int index; 53 | var int nextState_loop; //int loop; 54 | var int nextState_end; //int end; 55 | var int nextState_timeBehaviour; //int timeBehaviour; 56 | var int nextState_restTime; //float restTime; 57 | var int nextState_phase; //int phase; 58 | var int nextState_valid; //int valid; 59 | var string nextState_name; //zSTRING name; 60 | var int nextState_stateTime; //float stateTime; 61 | var int nextState_prgIndex; //int prgIndex; 62 | var int nextState_isRtnState; //int isRtnState; 63 | 64 | var int lastAIState; //int lastAIState; 65 | var int hasRoutine; //int hasRoutine; 66 | var int rtnChanged; //int rtnChanged; 67 | var int rtnBefore; //oCRtnEntry* rtnBefore; 68 | var int rtnNow; //oCRtnEntry* rtnNow; 69 | var int rtnRoute; //zCRoute* rtnRoute; 70 | var int rtnOverlay; //int rtnOverlay; 71 | var int rtnOverlayCount; //int rtnOverlayCount; 72 | var int walkmode_routine; //int walkmode_routine; 73 | var int weaponmode_routine; //int weaponmode_routine; 74 | var int startNewRoutine; //int startNewRoutine; 75 | var int aiStateDriven; //int aiStateDriven; 76 | var int aiStatePosition[3]; //zVEC3 aiStatePosition; float 77 | var int parOther; //oCNpc* parOther; 78 | var int parVictim; //oCNpc* parVictim; 79 | var int parItem; //oCItem* parItem; 80 | var int rntChangeCount; //int rntChangeCount; 81 | }; 82 | -------------------------------------------------------------------------------- /EngineClasses_G2/oSSpawnNode.d: -------------------------------------------------------------------------------- 1 | class oSSpawnNode { 2 | var int npc; //oCNpc* // sizeof 04h offset 00h 3 | var int spawnPos[3]; //zVEC3 // sizeof 0Ch offset 04h 4 | var int timer; //float // sizeof 04h offset 10h 5 | }; 6 | -------------------------------------------------------------------------------- /EngineClasses_G2/oSpell.d: -------------------------------------------------------------------------------- 1 | /* 2 | enum { 3 | SPL_STATUS_DONTINVEST, 4 | SPL_STATUS_CANINVEST, 5 | SPL_STATUS_CAST, 6 | SPL_STATUS_STOP, 7 | SPL_STATUS_NEXTLEVEL 8 | }; 9 | 10 | enum { 11 | SPL_CAT_GOOD, 12 | SPL_CAT_NEUTRAL, 13 | SPL_CAT_BAD 14 | }; 15 | 16 | enum { 17 | TARGET_COLLECT_NONE, 18 | TARGET_COLLECT_CASTER, 19 | TARGET_COLLECT_FOCUS, 20 | TARGET_COLLECT_ALL, 21 | TARGET_COLLECT_FOCUS_FALLBACK_NONE, 22 | TARGET_COLLECT_FOCUS_FALLBACK_CASTER, 23 | TARGET_COLLECT_ALL_FALLBACK_NONE, 24 | TARGET_COLLECT_ALL_FALLBACK_CASTER 25 | }; 26 | 27 | enum { 28 | TARGET_FLAG_NONE, 29 | TARGET_FLAG_ALL, 30 | TARGET_FLAG_ITEMS, 31 | TARGET_FLAG_NPCS = 4, 32 | TARGET_FLAG_ORCS = 8, 33 | TARGET_FLAG_HUMANS = 16, 34 | TARGET_FLAG_UNDEAD = 32, 35 | TARGET_FLAG_LIVING = 64 36 | }; 37 | */ 38 | 39 | class oCSpell { 40 | var int _vtbl; //0 41 | 42 | //class zCObject { 43 | var int refCtr; //4 int refCtr; 44 | var int hashIndex; //8 unsigned short hashIndex; 45 | var int hashNext; //12 zCObject* hashNext; 46 | var string objectName; //16 zSTRING objectName 47 | 48 | //}; 49 | 50 | var int keyNo; //36 int keyNo; 51 | var int effect; //40 oCVisualFX* effect; 52 | var int controlWarnFX; //44 oCVisualFX* controlWarnFX; 53 | var int spellCaster; //48 zCVob* spellCaster; 54 | var int spellCasterNpc; //52 oCNpc* spellCasterNpc; 55 | var int spellTarget; //56 zCVob* spellTarget; 56 | var int spellTargetNpc; //60 oCNpc* spellTargetNpc; 57 | var int saveNpc; //64 oCNpc* saveNpc; 58 | var int manaTimer; //68 float manaTimer; 59 | var int manaInvested; //72 int manaInvested; 60 | var int spellLevel; //76 int spellLevel; 61 | var int spellStatus; //80 int spellStatus; 62 | var int spellID; //84 int spellID; 63 | var int spellInfo; //88 int spellInfo; 64 | var int spellEnabled; //92 int spellEnabled; 65 | var int spellInitDone; //96 int spellInitDone; 66 | var int timerEffect; //100 int timerEffect; 67 | var int canBeDeleted; //104 int canBeDeleted; 68 | var int up; //108 float up; 69 | var int hoverY; //112 float hoverY; 70 | var int hoverOld; //116 float hoverOld; 71 | var int hoverDir; //120 float hoverDir; 72 | var int spellEnergy; //124 int spellEnergy; 73 | //group { 74 | var int manaInvestTime; //128 float manaInvestTime; 75 | var int damagePerLevel; //132 int damagePerLevel; 76 | var int damageType; //136 int damageType; 77 | var int spellType; //140 int spellType; 78 | var int canTurnDuringInvest; //144 int canTurnDuringInvest; 79 | var int canChangeTargetDuringInvest; //148 int canChangeTargetDuringInvest; 80 | var int isMultiEffect; //152 int isMultiEffect; 81 | var int targetCollectAlgo; //156 int targetCollectAlgo; 82 | var int targetCollectType; //160 int targetCollectType; 83 | var int targetCollectRange; //164 int targetCollectRange; 84 | var int targetCollectAzi; //168 int targetCollectAzi; 85 | var int targetCollectElev; //172 int targetCollectElev; 86 | //}; 87 | }; 88 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCActiveSnd.d: -------------------------------------------------------------------------------- 1 | const int bitfield_zCActiveSnd_active = 1; 2 | const int bitfield_zCActiveSnd_looping = 2; 3 | const int bitfield_zCActiveSnd_isAmbient = 4; 4 | const int bitfield_zCActiveSnd_is3D = 8; 5 | const int bitfield_zCActiveSnd_allocated = 16; 6 | const int bitfield_zCActiveSnd_vobSlot = 32; 7 | 8 | // sizeof 60h 9 | class zCActiveSnd { 10 | var int handle; //int // sizeof 04h offset 00h 11 | var int sample; //void* // sizeof 04h offset 04h 12 | var int sample3D; //void* // sizeof 04h offset 08h 13 | var int age; //unsigned long // sizeof 04h offset 0Ch 14 | var int loopType; //zCSoundSystem::zTLoopType // sizeof 04h offset 10h 15 | var int radius; //float // sizeof 04h offset 14h 16 | var int reverbLevel; //float // sizeof 04h offset 18h 17 | var int pitchOffset; //float // sizeof 04h offset 1Ch 18 | var int volWeight; //float // sizeof 04h offset 20h 19 | var int obstruction; //float // sizeof 04h offset 24h 20 | 21 | //Only in G2A 22 | var int obstructionToGo; //float // sizeof 04h offset 28h 23 | var int volumeToGo; //float // sizeof 04h offset 2Ch 24 | var int autoObstructTimer; //int // sizeof 04h offset 30h 25 | // 26 | 27 | var int bitfield_zCActiveSnd; 28 | /* 29 | group { 30 | unsigned char active : 1; // sizeof 01h offset bit 1 31 | unsigned char looping : 1; // sizeof 01h offset bit 2 32 | unsigned char isAmbient : 1; // sizeof 01h offset bit 4 33 | unsigned char is3D : 1; // sizeof 01h offset bit 8 34 | unsigned char allocated : 1; // sizeof 01h offset bit 16 35 | unsigned char vobSlot : 3; // sizeof 03h offset bit 32 36 | }; 37 | */ 38 | //Is this correct conversion ?? 39 | var int bitfield; 40 | //unsigned char pan; // sizeof 01h offset 35h 41 | //unsigned char volume; // sizeof 01h offset 36h 42 | //unsigned short rate; // sizeof 02h offset 38h 43 | 44 | var int muteTime; //int // sizeof 04h offset 3Ch 45 | var int frameCtr; //int // sizeof 04h offset 40h 46 | var int lastPos[3]; //zVEC3 // sizeof 0Ch offset 44h 47 | var int lastTime; //float // sizeof 04h offset 50h 48 | var int sourceVob; //zCVob* // sizeof 04h offset 54h 49 | var int sourceFrm; //zCSndFrame* // sizeof 04h offset 58h 50 | var int sourceSnd; //zCSndFX_MSS* // sizeof 04h offset 5Ch 51 | }; 52 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCConDat.d: -------------------------------------------------------------------------------- 1 | // sizeof 3Ch 2 | class zCConDat { 3 | var string hint; //zSTRING // sizeof 14h offset 00h 4 | var string name; //zSTRING // sizeof 14h offset 14h 5 | var int type; //int // sizeof 04h offset 28h 6 | var int adr; //void* // sizeof 04h offset 2Ch 7 | var int ele; //int // sizeof 04h offset 30h 8 | var int var; //int // sizeof 04h offset 34h 9 | var int next; //zCConDat* // sizeof 04h offset 38h 10 | }; 11 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCSkyState.d: -------------------------------------------------------------------------------- 1 | /* 2 | const int zSKY_NUM_LAYER = 2; 3 | const int NUM_PLANETS = 2; 4 | const int zEFFECT_BOX_SIDES = 2500; 5 | const int zEFFECT_BOX_HEIGHT = 1000; 6 | const int zMAX_FLY_PARTICLE = 1024; 7 | const int zMAX_IMPACT_PARTICLE = 1024; 8 | const int zCACHE_SIZE = 512; 9 | 10 | enum zESkyLayerMode { 11 | zSKY_MODE_POLY, 12 | zSKY_MODE_BOX 13 | }; 14 | 15 | enum zTSkyStateEffect { 16 | zSKY_STATE_EFFECT_SUN, 17 | zSKY_STATE_EFFECT_CLOUDSHADOW 18 | }; 19 | */ 20 | 21 | // sizeof 98h 22 | class zCSkyState { 23 | var int time; //float // sizeof 04h offset 00h 24 | var int polyColor[3]; //zVEC3 // sizeof 0Ch offset 04h 25 | var int fogColor[3]; //zVEC3 // sizeof 0Ch offset 10h 26 | var int domeColor1[3]; //zVEC3 // sizeof 0Ch offset 1Ch 27 | var int domeColor0[3]; //zVEC3 // sizeof 0Ch offset 28h 28 | var int fogDist; //float // sizeof 04h offset 34h 29 | var int sunOn; //int // sizeof 04h offset 38h 30 | var int cloudShadowOn; //int // sizeof 04h offset 3Ch 31 | 32 | var int layer0_skyMode; //zESkyLayerMode // sizeof 04h offset 00h 33 | var int layer0_tex; //zCTexture* // sizeof 04h offset 04h 34 | var string layer0_texName; //zSTRING // sizeof 14h offset 08h 35 | var int layer0_texAlpha; //float // sizeof 04h offset 1Ch 36 | var int layer0_texScale; //float // sizeof 04h offset 20h 37 | var int layer0_texSpeed[2]; //zVEC2 // sizeof 08h offset 24h 38 | 39 | var int layer1_skyMode; //zESkyLayerMode // sizeof 04h offset 00h 40 | var int layer1_tex; //zCTexture* // sizeof 04h offset 04h 41 | var string layer1_texName; //zSTRING // sizeof 14h offset 08h 42 | var int layer1_texAlpha; //float // sizeof 04h offset 1Ch 43 | var int layer1_texScale; //float // sizeof 04h offset 20h 44 | var int layer1_texSpeed[2]; //zVEC2 // sizeof 08h offset 24h 45 | }; 46 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCSndFrame.d: -------------------------------------------------------------------------------- 1 | // sizeof 6Ch 2 | // Same for G1 & G2A 3 | class zCSndFrame { 4 | var string fileName; //zSTRING // sizeof 14h offset 00h 5 | var int pitchOffset; //float // sizeof 04h offset 14h 6 | var int pitchVariance; //float // sizeof 04h offset 18h 7 | var int defVolume; //int // sizeof 04h offset 1Ch 8 | var int looping; //int // sizeof 04h offset 20h 9 | var int loopStartOffset; //int // sizeof 04h offset 24h 10 | var int loopEndOffset; //int // sizeof 04h offset 28h 11 | var int reverbLevel; //float // sizeof 04h offset 2Ch 12 | var string pfxName; //zSTRING // sizeof 14h offset 30h 13 | var int dScriptEnd; //unsigned char // sizeof 01h offset 44h 14 | var string instance; //zSTRING // sizeof 14h offset 48h 15 | var int actVolume; //int // sizeof 04h offset 5Ch 16 | var int actRate; //int // sizeof 04h offset 60h 17 | var int actPan; //int // sizeof 04h offset 64h 18 | var int wav; //zCWaveData* // sizeof 04h offset 68h 19 | }; 20 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCVobSpot.d: -------------------------------------------------------------------------------- 1 | // sizeof 128h 2 | 3 | class zCVobSpot { 4 | //class zCVobSpot : public zCVob { 5 | //zCObject { 6 | var int _vtbl; 7 | var int _zCObject_refCtr; 8 | var int _zCObject_hashIndex; 9 | var int _zCObject_hashNext; 10 | var string _zCObject_objectName; 11 | //} 12 | var int globalVobTreeNode; // 0x0024 zCTree* 13 | var int lastTimeDrawn; // 0x0028 zTFrameCtr 14 | var int lastTimeCollected; // 0x002C zDWORD 15 | //zCArray { 16 | var int vobLeafList_array; // 0x0030 zCBspLeaf** 17 | var int vobLeafList_numAlloc; // 0x0034 int 18 | var int vobLeafList_numInArray; // 0x0038 int 19 | //} 20 | var int trafoObjToWorld[16]; // 0x003C zMATRIX4 21 | //zTBBox3D { 22 | var int bbox3D_mins[3]; // 0x007C zPOINT3 23 | var int bbox3D_maxs[3]; // 0x0088 zPOINT3 24 | //} 25 | //zTBSphere3D { 26 | var int bsphere3D_center[3]; // 0x0094 zPOINT3 27 | var int bsphere3D_radius; // 0x00A0 zVALUE 28 | //} 29 | //zCArray { 30 | var int touchVobList_array; // 0x00A4 zCVob** 31 | var int touchVobList_numAlloc; // 0x00A8 int 32 | var int touchVobList_numInArray; // 0x00AC int 33 | //} 34 | var int type; // 0x00B0 zTVobType 35 | var int groundShadowSizePacked; // 0x00B4 zDWORD 36 | var int homeWorld; // 0x00B8 zCWorld* 37 | var int groundPoly; // 0x00BC zCPolygon* 38 | var int callback_ai; // 0x00C0 zCAIBase* 39 | var int trafo; // 0x00C4 zMATRIX4* 40 | var int visual; // 0x00C8 zCVisual* 41 | var int visualAlpha; // 0x00CC zREAL 42 | var int m_fVobFarClipZScale; // 0x00D0 zREAL 43 | var int m_AniMode; // 0x00D4 zTAnimationMode 44 | var int m_aniModeStrength; // 0x00D8 zREAL 45 | var int m_zBias; // 0x00DC int 46 | var int rigidBody; // 0x00E0 zCRigidBody* 47 | var int lightColorStat; // 0x00E4 zCOLOR 48 | var int lightColorDyn; // 0x00E8 zCOLOR 49 | var int lightDirectionStat[3]; // 0x00EC zVEC3 50 | var int vobPresetName; // 0x00F8 zSTRING* 51 | var int eventManager; // 0x00FC zCEventManager* 52 | var int nextOnTimer; // 0x0100 zREAL 53 | var int bitfield[5]; // 0x0104 zCVob_bitfieldX_Xxx 54 | var int m_poCollisionObjectClass; // 0x0118 zCCollisionObjectDef* 55 | var int m_poCollisionObject; // 0x011C zCCollisionObject* 56 | 57 | var int timerEnd; //float // sizeof 04h offset 120h 58 | var int inUseVob; //zCVob* // sizeof 04h offset 124h 59 | }; 60 | -------------------------------------------------------------------------------- /EngineClasses_G2/zCWay.d: -------------------------------------------------------------------------------- 1 | // sizeof 20h 2 | class zCWay { 3 | var int _vtbl; 4 | var int cost; //int cost; // sizeof 04h offset 04h 5 | var int usedCtr; //int usedCtr; // sizeof 04h offset 08h 6 | var int chasmDepth; //float chasmDepth; // sizeof 04h offset 0Ch 7 | var int chasm; //int chasm; // sizeof 04h offset 10h 8 | var int jump; //int jump; // sizeof 04h offset 14h 9 | var int left; //zCWaypoint* left; // sizeof 04h offset 18h 10 | var int right; //zCWaypoint* right; // sizeof 04h offset 1Ch 11 | }; 12 | 13 | instance zCWay@ (zCWay); -------------------------------------------------------------------------------- /EngineClasses_G2/zPhysics.d: -------------------------------------------------------------------------------- 1 | class zCRigidBody { 2 | var int mass; //float 3 | var int massInv; //float 4 | var int iBody[9]; //zMAT3 5 | var int iBodyInv[9]; //zMAT3 6 | var int xPos[3]; //zVEC3 7 | var int RDir[9]; //zMAT3 8 | var int PLinMom[3]; //zVEC3 9 | var int LAngMom[3]; //zVEC3 10 | var int iInv[9]; //zMAT3 11 | var int v[3]; //zVEC3 12 | var int omega[3]; //zVEC3 13 | var int force[3]; //zVEC3 14 | var int torque[3]; //zVEC3 15 | var int gravityScale; //float 16 | var int slideDir[3]; //zVEC3 17 | var int slideAngle; //float 18 | var int bitfield; 19 | /* 20 | unsigned char gravityOn : 1; 21 | unsigned char collisionHad : 1; 22 | unsigned char mode : 1; 23 | unsigned char justSetSliding : 4; 24 | */ 25 | }; -------------------------------------------------------------------------------- /EngineClasses_G2/zTConfig.d: -------------------------------------------------------------------------------- 1 | //Class defintion is same for G1 & G2 NoTR 2 | 3 | /* 4 | enum zEConfigState { 5 | zCONFIG_STATE_STAND, 6 | zCONFIG_STATE_FLY, 7 | zCONFIG_STATE_SLIDE, 8 | zCONFIG_STATE_SWIM, 9 | zCONFIG_STATE_DIVE 10 | }; 11 | */ 12 | 13 | const int bitfield0_m_bTreatWaterAsSolid = ((1 << 1) - 1) << 0; 14 | const int bitfield0_m_bDoWallSliding = ((1 << 1) - 1) << 1; 15 | const int bitfield0_m_bUseSpacingRays = ((1 << 1) - 1) << 2; 16 | const int bitfield0_m_m_bLiftSpacingRayStart = ((1 << 1) - 1) << 3; 17 | const int bitfield0_m_bFloorTooLowIsHardCollision = ((1 << 1) - 1) << 4; 18 | const int bitfield0_m_eDoHeightCorrection = ((1 << 1) - 1) << 5; 19 | const int bitfield0_m_eDoHeightCorrectionSmooth = ((1 << 1) - 1) << 6; 20 | const int bitfield1_m_eState = ((1 << 4) - 1) << 0; 21 | 22 | // sizeof 10h 23 | class zTConfig { 24 | var int m_fMaxGroundAngleWalk; //float // sizeof 04h offset 00h 25 | var int m_fStepHeight; //float // sizeof 04h offset 04h 26 | var int bitfield[2]; 27 | //group { 28 | // unsigned char m_bTreatWaterAsSolid : 1; // sizeof 01h offset bit 29 | // unsigned char m_bDoWallSliding : 1; // sizeof 01h offset bit 30 | // unsigned char m_bUseSpacingRays : 1; // sizeof 01h offset bit 31 | // unsigned char m_bLiftSpacingRayStart : 1; // sizeof 01h offset bit 32 | // unsigned char m_bFloorTooLowIsHardCollision : 1; // sizeof 01h offset bit 33 | // unsigned char m_eDoHeightCorrection : 1; // sizeof 01h offset bit 34 | // unsigned char m_eDoHeightCorrectionSmooth : 1; // sizeof 01h offset bit 35 | // zEConfigState m_eState : 4; // sizeof 04h offset bit 36 | //}; 37 | }; 38 | -------------------------------------------------------------------------------- /EngineClasses_G2/zTSound3DParams.d: -------------------------------------------------------------------------------- 1 | //Same for G1 & G2A 2 | class zTSound3DParams { 3 | var int obstruction; //float obstruction; 4 | var int volume; //float volume; 5 | var int radius; //float radius; 6 | var int loopType; //zTLoopType loopType; 7 | var int coneAngleDeg; //float coneAngleDeg; 8 | var int reverbLevel; //float reverbLevel; 9 | var int isAmbient3D; //int isAmbient3D; 10 | var int pitchOffset; //float pitchOffset; 11 | }; 12 | 13 | instance zTSound3DParams@(zTSound3DParams); 14 | -------------------------------------------------------------------------------- /EngineClasses_G2/zTSpatialState.d: -------------------------------------------------------------------------------- 1 | //Class defintion is same for G1 & G2 NoTR 2 | 3 | // sizeof 20h 4 | class zTSpatialState { 5 | var int m_fFloorY; //float // sizeof 04h offset 00h 6 | var int m_fWaterY; //float // sizeof 04h offset 04h 7 | var int m_fCeilingY; //float // sizeof 04h offset 08h 8 | var int m_fLastFloorY; //float // sizeof 04h offset 0Ch 9 | var int m_poFloorPoly; //zCPolygon* // sizeof 04h offset 10h 10 | var int m_poWaterPoly; //zCPolygon* // sizeof 04h offset 14h 11 | var int m_poCeilingPoly; //zCPolygon* // sizeof 04h offset 18h 12 | var int bitfield; 13 | //group { 14 | // unsigned char m_bFloorIsStair : 1; // sizeof 01h offset bit 15 | // unsigned char m_bFloorIsVob : 1; // sizeof 01h offset bit 16 | // unsigned char m_bIsUninited : 1; // sizeof 01h offset bit 17 | //}; 18 | }; 19 | -------------------------------------------------------------------------------- /G2 NoTR emulation.d: -------------------------------------------------------------------------------- 1 | /* 2 | * G1 does not have all functions that G2 NoTR has ... 3 | * - so here we will try to emulate some of them - as they are useful 4 | */ 5 | 6 | /* 7 | * Function checks if Active spell is scroll (all scrolls should have ITEM_MULTI flag) 8 | * G1 does not have this function. 9 | */ 10 | func int Npc_GetActiveSpellIsScroll_G1 (var int slfInstance) { 11 | var oCNPC slf; slf = Hlp_GetNPC (slfInstance); 12 | 13 | if (!Hlp_IsValidNPC (slf)) { return FALSE; }; 14 | 15 | if (slf.fMode != FMODE_MAGIC) { return FALSE; }; 16 | 17 | if (!slf.mag_book) { return FALSE; }; 18 | 19 | var oCMag_Book magBook; 20 | magBook = _^ (slf.mag_book); 21 | 22 | if (!magBook.spellitems_array) { return FALSE; }; 23 | 24 | var int selectedSpell; selectedSpell = MEM_ReadIntArray (magBook.spellitems_array, magBook.spellnr); 25 | 26 | var oCItem spell; spell = _^ (selectedSpell); 27 | 28 | return (spell.flags & ITEM_MULTI); 29 | }; 30 | 31 | /* 32 | * Function returns TRUE if it is raining 33 | */ 34 | func int Wld_IsRaining_G1 () { 35 | //this should work :) (for both G1 & G2A) 36 | return (gf (MEM_SkyController.rainFX_outdoorRainFXWeight, FLOATNULL)); 37 | }; 38 | 39 | /* 40 | * Function stops animation + deletes any event message that is still queued in EM 41 | */ 42 | func void Npc_StopAni_G1 (var int slfInstance, var string aniName) { 43 | var oCNpc slf; slf = Hlp_GetNPC (slfInstance); 44 | if (!Hlp_IsValidNPC (slf)) { return; }; 45 | 46 | aniName = STR_Upper (aniName); 47 | 48 | NPC_StopAni_ByAniName (slf, aniName); 49 | 50 | var int eMgr; eMgr = zCVob_GetEM (_@ (slf)); 51 | 52 | if (!Hlp_Is_zCEventManager (eMgr)) { return; }; 53 | 54 | var int eventTotal; eventTotal = zCEventManager_GetNumMessages (eMgr); 55 | 56 | if (eventTotal == 0) { return; }; 57 | 58 | var int eMsg; 59 | 60 | //Loop through Event Messages 61 | var int i; i = 0; 62 | 63 | while (i < eventTotal); 64 | eMsg = zCEventManager_GetEventMessage (eMgr, i); 65 | 66 | if (Hlp_Is_oCMsgConversation (eMsg)) { 67 | if (zCEventMessage_GetSubType (eMsg) == EV_PLAYANI_NOOVERLAY) { 68 | var oCMsgConversation msg; msg = _^ (eMsg); 69 | 70 | if (Hlp_StrCmp (msg.name, aniName)) { 71 | zCEventManager_Delete(eMgr, eMsg); 72 | continue; 73 | }; 74 | }; 75 | }; 76 | 77 | i += 1; 78 | end; 79 | }; 80 | -------------------------------------------------------------------------------- /ObjectFactory/oCAIArrow.d: -------------------------------------------------------------------------------- 1 | //0x00618D50 public: virtual void __thiscall oCAIArrowBase::ReportCollisionToAI(class zCCollisionReport const &) 2 | 3 | //0x006195E0 public: virtual void __thiscall oCAIArrow::ReportCollisionToAI(class zCCollisionReport const &) 4 | 5 | //class oCAIArrow : public oCAIArrowBase : oCAIArrowBase : public oCAISound : public zCAIBase : public zCObject { 6 | 7 | func int oCAIArrow_Create () { 8 | var int ai; ai = CreateNewInstanceByString ("oCAIArrow"); 9 | return +ai; 10 | }; 11 | 12 | func void oCAIArrow_Init (var int ai, var int arrowVobPtr, var int ownerVobPtr, var int targetVobPtr) { 13 | //0x006190E0 public: void __thiscall oCAIArrow::SetTarget(class zCVob *) 14 | //const int oCAIArrow__SetTarget_G1 = 6394080; 15 | 16 | //0x006A0FF0 public: void __thiscall oCAIArrow::SetTarget(class zCVob *) 17 | //const int oCAIArrow__SetTarget_G2 = 6950896; 18 | 19 | //0x006191D0 public: void __thiscall oCAIArrow::SetupAIVob(class zCVob *,class zCVob *,class zCVob *) 20 | const int oCAIArrow__SetupAIVob_G1 = 6394320; 21 | 22 | //0x006A10E0 public: void __thiscall oCAIArrow::SetupAIVob(class zCVob *,class zCVob *,class zCVob *) 23 | const int oCAIArrow__SetupAIVob_G2 = 6951136; 24 | 25 | if (!ai) { return; }; 26 | if (!arrowVobPtr) { return; }; 27 | if (!ownerVobPtr) { return; }; 28 | if (!targetVobPtr) { return; }; 29 | 30 | const int call = 0; 31 | if (CALL_Begin (call)) { 32 | CALL_PtrParam (_@ (targetVobPtr)); 33 | CALL_PtrParam (_@ (ownerVobPtr)); 34 | CALL_PtrParam (_@ (arrowVobPtr)); 35 | 36 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIArrow__SetupAIVob_G1, oCAIArrow__SetupAIVob_G2)); 37 | call = CALL_End (); 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /ObjectFactory/oCAICamera.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCAICamera_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCAICamera"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCAICamera_Create () { 13 | var int ptr; ptr = oCAICamera_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x00616500 public: __thiscall oCAICamera::oCAICamera(void) 18 | const int oCAICamera__oCAICamera_G1 = 6382848; 19 | 20 | //0x0069DD00 public: __thiscall oCAICamera::oCAICamera(void) 21 | const int oCAICamera__oCAICamera_G2 = 6937856; 22 | 23 | const int call = 0; 24 | if (CALL_Begin (call)) { 25 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCAICamera__oCAICamera_G1, oCAICamera__oCAICamera_G2)); 26 | call = CALL_End(); 27 | }; 28 | 29 | return ptr; 30 | }; 31 | -------------------------------------------------------------------------------- /ObjectFactory/oCAIDrop.d: -------------------------------------------------------------------------------- 1 | //0x0061A040 public: virtual void __thiscall oCAIDrop::ReportCollisionToAI(class zCCollisionReport const &) 2 | 3 | //class oCAIDrop : public oCAISound : public zCAIBase : public zCObject { 4 | 5 | func int oCAIDrop_Create () { 6 | var int ai; ai = CreateNewInstanceByString ("oCAIDrop"); 7 | return +ai; 8 | }; 9 | 10 | func void oCAIDrop_Init (var int ai, var int vobPtr, var int ownerVobPtr, var int startPosPtr, var int angleF, var int velocityF) { 11 | //0x00619D90 public: void __thiscall oCAIDrop::SetupAIVob(class zCVob *,class zCVob *) 12 | const int oCAIDrop__SetupAIVob_G1 = 6397328; 13 | 14 | //0x006A21C0 public: void __thiscall oCAIDrop::SetupAIVob(class zCVob *,class zCVob *) 15 | const int oCAIDrop__SetupAIVob_G2 = 6955456; 16 | 17 | if (!ai) { return; }; 18 | if (!vobPtr) { return; }; 19 | if (!ownerVobPtr) { return; }; 20 | if (!startPosPtr) { return; }; 21 | 22 | const int call = 0; 23 | if (CALL_Begin (call)) { 24 | CALL_PtrParam (_@ (ownerVobPtr)); 25 | CALL_PtrParam (_@ (vobPtr)); 26 | 27 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIDrop__SetupAIVob_G1, oCAIDrop__SetupAIVob_G2)); 28 | call = CALL_End (); 29 | }; 30 | 31 | //0x0061A130 public: void __thiscall oCAIDrop::SetStartPosition(class zVEC3 &) 32 | const int oCAIDrop__SetStartPosition_G1 = 6398256; 33 | 34 | //0x006A2590 public: void __thiscall oCAIDrop::SetStartPosition(class zVEC3 &) 35 | const int oCAIDrop__SetStartPosition_G2 = 6956432; 36 | 37 | const int call2 = 0; 38 | if (CALL_Begin (call2)) { 39 | CALL_PtrParam (_@ (startPosPtr)); 40 | 41 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIDrop__SetStartPosition_G1, oCAIDrop__SetStartPosition_G2)); 42 | call2 = CALL_End (); 43 | }; 44 | 45 | //0x0061A080 public: void __thiscall oCAIDrop::SetVelocity(float,float) 46 | const int oCAIDrop__SetVelocity_G1 = 6398080; 47 | 48 | //0x006A24E0 public: void __thiscall oCAIDrop::SetVelocity(float,float) 49 | const int oCAIDrop__SetVelocity_G2 = 6398080; 50 | 51 | const int call3 = 0; 52 | if (CALL_Begin (call3)) { 53 | CALL_FloatParam (_@ (angleF)); //Angle 54 | CALL_FloatParam (_@ (velocityF)); //Velocity 55 | 56 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIDrop__SetVelocity_G1, oCAIDrop__SetVelocity_G2)); 57 | call3 = CALL_End (); 58 | }; 59 | }; 60 | -------------------------------------------------------------------------------- /ObjectFactory/oCAIVobMove.d: -------------------------------------------------------------------------------- 1 | //0x006176C0 public: __thiscall oCAIVobMove::oCAIVobMove(void) 2 | 3 | func int oCAIVobMove_Create () { 4 | var int ai; ai = CreateNewInstanceByString ("oCAIVobMove"); 5 | return +ai; 6 | }; 7 | 8 | func void oCAIVobMove_Init (var int ai, var int vobPtr, var int ownerVobPtr, var int startPosPtr, var int angleF, var int velocityF, var int trafoPtr) { 9 | //0x006179E0 public: virtual void __thiscall oCAIVobMove::Init(class zCVob *,class zCVob *,class zVEC3 &,float,float,class zMAT4 *) 10 | const int oCAIVobMove__Init_G1 = 6388192; 11 | 12 | //0x0069F540 public: virtual void __thiscall oCAIVobMove::Init(class zCVob *,class zCVob *,class zVEC3 &,float,float,class zMAT4 *) 13 | const int oCAIVobMove__Init_G2 = 6944064; 14 | 15 | if (!ai) { return; }; 16 | if (!vobPtr) { return; }; 17 | if (!ownerVobPtr) { return; }; 18 | if (!startPosPtr) { return; }; 19 | if (!trafoPtr) { return; }; 20 | 21 | const int call = 0; 22 | if (CALL_Begin (call)) { 23 | CALL_PtrParam (_@ (trafoPtr)); //Direction 24 | 25 | CALL_FloatParam (_@ (velocityF)); //Velocity 26 | CALL_FloatParam (_@ (angleF)); //Angle 27 | 28 | CALL_PtrParam (_@ (startPosPtr)); 29 | 30 | CALL_PtrParam (_@ (ownerVobPtr)); 31 | CALL_PtrParam (_@ (vobPtr)); 32 | 33 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIVobMove__Init_G1, oCAIVobMove__Init_G2)); 34 | call = CALL_End (); 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /ObjectFactory/oCAIVobMoveTorch.d: -------------------------------------------------------------------------------- 1 | //class oCAIVobMoveTorch : public oCAIVobMove : public oCAISound : public zCAIBase : public zCObject { 2 | 3 | /* 4 | func void _oCAIVobMoveTorch_CreateIntoPtr (var int ai) { 5 | //0x006180A0 public: __thiscall oCAIVobMoveTorch::oCAIVobMoveTorch(void) 6 | const int oCAIVobMoveTorch__oCAIVobMoveTorch_G1 = 6389920; 7 | 8 | //0x0069FC60 public: __thiscall oCAIVobMoveTorch::oCAIVobMoveTorch(void) 9 | const int oCAIVobMoveTorch__oCAIVobMoveTorch_G2 = 6945888; 10 | 11 | CALL__thiscall (ai, MEMINT_SwitchG1G2 (oCAIVobMoveTorch__oCAIVobMoveTorch_G1, oCAIVobMoveTorch__oCAIVobMoveTorch_G2)); 12 | }; 13 | */ 14 | 15 | func int oCAIVobMoveTorch_Create () { 16 | var int ai; ai = CreateNewInstanceByString ("oCAIVobMoveTorch"); 17 | 18 | //Seems like CreateNewInstanceByString takes care of everything, we don't need to call constructor here :thinking: 19 | //_oCAIVobMoveTorch_CreateIntoPtr (ai); 20 | 21 | return +ai; 22 | }; 23 | 24 | func void oCAIVobMoveTorch_Init (var int ai, var int vobPtr, var int ownerVobPtr, var int startPosPtr, var int angleF, var int velocityF, var int trafoPtr) { 25 | //0x00618280 public: virtual void __thiscall oCAIVobMoveTorch::Init(class zCVob *,class zCVob *,class zVEC3 &,float,float,class zMAT4 *) 26 | const int oCAIVobMoveTorch__Init_G1 = 6390400; 27 | 28 | //0x0069FE40 public: virtual void __thiscall oCAIVobMoveTorch::Init(class zCVob *,class zCVob *,class zVEC3 &,float,float,class zMAT4 *) 29 | const int oCAIVobMoveTorch__Init_G2 = 6946368; 30 | 31 | if (!ai) { return; }; 32 | if (!vobPtr) { return; }; 33 | if (!ownerVobPtr) { return; }; 34 | if (!startPosPtr) { return; }; 35 | if (!trafoPtr) { return; }; 36 | 37 | const int call = 0; 38 | if (CALL_Begin (call)) { 39 | CALL_PtrParam (_@ (trafoPtr)); //Direction 40 | 41 | CALL_FloatParam (_@ (velocityF)); //Velocity 42 | CALL_FloatParam (_@ (angleF)); //Angle 43 | 44 | CALL_PtrParam (_@ (startPosPtr)); 45 | 46 | CALL_PtrParam (_@ (ownerVobPtr)); 47 | CALL_PtrParam (_@ (vobPtr)); 48 | 49 | CALL__thiscall (_@ (ai), MEMINT_SwitchG1G2 (oCAIVobMoveTorch__Init_G1, oCAIVobMoveTorch__Init_G2)); 50 | call = CALL_End (); 51 | }; 52 | }; 53 | -------------------------------------------------------------------------------- /ObjectFactory/oCInfoChoice.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCInfoChoice_New () { 5 | //Does not work with oCInfoChoice 6 | //var int ptr; ptr = CreateNewInstanceByString ("oCInfoChoice"); 7 | 8 | //Same for G1 & G2A 9 | const int sizeof_oCInfoChoice = 24; 10 | 11 | var int ptr; ptr = MEM_Alloc (sizeof_oCInfoChoice); 12 | return ptr; 13 | }; 14 | 15 | /* 16 | * Wrapper function for initialization 17 | */ 18 | func int oCInfoChoice_Create (var string text, var int funcID) { 19 | var int ptr; ptr = oCInfoChoice_New (); 20 | 21 | if (!ptr) { return 0; }; 22 | 23 | var oCInfoChoice infoChoice; 24 | infoChoice = _^ (ptr); 25 | 26 | infoChoice.text = text; 27 | infoChoice.Function = funcID; 28 | 29 | return ptr; 30 | }; 31 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgAttack.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCMsgAttack_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgAttack"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCMsgAttack_Create (var int subType, var int targetVob, var int startFrameF, var int ani, var int combo) { 13 | var int ptr; ptr = oCMsgAttack_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | /* 18 | //0x006BFF90 public: __thiscall oCMsgAttack::oCMsgAttack(enum oCMsgAttack::TAttackSubType,class zCVob *,float) 19 | const int oCMsgAttack__oCMsgAttack_G1 = 7077776; 20 | 21 | //0x00767130 public: __thiscall oCMsgAttack::oCMsgAttack(enum oCMsgAttack::TAttackSubType,class zCVob *,float) 22 | const int oCMsgAttack__oCMsgAttack_G2 = 7762224; 23 | 24 | const int call = 0; 25 | if (CALL_Begin (call)) { 26 | CALL_FloatParam (_@ (startFrameF)); 27 | CALL_IntParam (_@ (targetVob)); 28 | CALL_IntParam (_@ (subType)); 29 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgAttack__oCMsgAttack_G1, oCMsgAttack__oCMsgAttack_G2)); 30 | call = CALL_End(); 31 | }; 32 | */ 33 | 34 | //0x006BFEC0 public: __thiscall oCMsgAttack::oCMsgAttack(enum oCMsgAttack::TAttackSubType,int,int) 35 | const int oCMsgAttack__oCMsgAttack2_G1 = 7077568; 36 | 37 | //0x00767060 public: __thiscall oCMsgAttack::oCMsgAttack(enum oCMsgAttack::TAttackSubType,int,int) 38 | const int oCMsgAttack__oCMsgAttack2_G2 = 7762016; 39 | 40 | const int call = 0; 41 | if (CALL_Begin (call)) { 42 | CALL_IntParam (_@ (combo)); 43 | CALL_IntParam (_@ (ani)); 44 | CALL_IntParam (_@ (subType)); 45 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgAttack__oCMsgAttack2_G1, oCMsgAttack__oCMsgAttack2_G2)); 46 | call = CALL_End(); 47 | }; 48 | 49 | //Setup additional parameters 50 | var oCMsgAttack msg; msg = _^ (ptr); 51 | 52 | msg.target = targetVob; 53 | msg.startFrame = startFrameF; 54 | 55 | return ptr; 56 | }; 57 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgDamage.d: -------------------------------------------------------------------------------- 1 | //0x006BDE70 protected: __thiscall oCMsgDamage::oCMsgDamage(void) 2 | //0x006BDF70 protected: __thiscall oCMsgDamage::oCMsgDamage(enum oCMsgDamage::TDamageSubType) 3 | 4 | //0x00765010 protected: __thiscall oCMsgDamage::oCMsgDamage(void) 5 | //0x00765110 protected: __thiscall oCMsgDamage::oCMsgDamage(enum oCMsgDamage::TDamageSubType) 6 | 7 | /* 8 | * Create object 9 | */ 10 | func int oCMsgDamage_New () { 11 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgDamage"); 12 | return ptr; 13 | }; 14 | 15 | /* 16 | * Wrapper function for initialization 17 | */ 18 | func int oCMsgDamage_Create (var int subType, var int ddPtr) { 19 | var int ptr; ptr = oCMsgDamage_New (); 20 | 21 | if (!ptr) { return 0; }; 22 | 23 | //0x006BE040 public: __thiscall oCMsgDamage::oCMsgDamage(enum oCMsgDamage::TDamageSubType,struct oCNpc::oSDamageDescriptor const &) 24 | const int oCMsgDamage__oCMsgDamage_G1 = 7069760; 25 | 26 | //0x007651E0 public: __thiscall oCMsgDamage::oCMsgDamage(enum oCMsgDamage::TDamageSubType,struct oCNpc::oSDamageDescriptor const &) 27 | const int oCMsgDamage__oCMsgDamage_G2 = 7754208; 28 | 29 | const int call = 0; 30 | if (CALL_Begin (call)) { 31 | CALL_PtrParam (_@ (ddPtr)); 32 | CALL_IntParam (_@ (subType)); 33 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgDamage__oCMsgDamage_G1, oCMsgDamage__oCMsgDamage_G2)); 34 | call = CALL_End(); 35 | }; 36 | 37 | return ptr; 38 | }; 39 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgManipulate.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCMsgManipulate_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgManipulate"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCMsgManipulate_Create (var int subType, var string scemeName, var int targetVob, var int targetState, var string itemName, var string slotName) { 13 | var int ptr; ptr = oCMsgManipulate_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x006C16D0 public: __thiscall oCMsgManipulate::oCMsgManipulate(enum oCMsgManipulate::TManipulateSubType) 18 | const int oCMsgManipulate__oCMsgManipulate_G1 = 7083728; 19 | 20 | //0x00768870 public: __thiscall oCMsgManipulate::oCMsgManipulate(enum oCMsgManipulate::TManipulateSubType) 21 | const int oCMsgManipulate__oCMsgManipulate_G2 = 7768176; 22 | 23 | const int call = 0; 24 | if (CALL_Begin (call)) { 25 | CALL_IntParam (_@ (subType)); 26 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgManipulate__oCMsgManipulate_G1, oCMsgManipulate__oCMsgManipulate_G2)); 27 | call = CALL_End(); 28 | }; 29 | 30 | //Setup additional parameters 31 | var oCMsgManipulate msg; 32 | msg = _^ (ptr); 33 | 34 | msg.name = scemeName; 35 | msg.targetVob = targetVob; 36 | msg.targetState = targetState; 37 | 38 | //TODO: Seems like npcSlot also has to be set to targetState in G1, what about G2A? Will this cause any issues? 39 | msg.npcSlot = targetState; 40 | 41 | //Seems like itemName is also stored in .name property - let's update it only for certain subTypes 42 | //TODO: will this work ? 43 | 44 | if (subType == EV_USEITEM) 45 | || (subType == EV_INSERTINTERACTITEM) 46 | || (subType == EV_REMOVEINTERACTITEM) 47 | || (subType == EV_CREATEINTERACTITEM) 48 | || (subType == EV_DESTROYINTERACTITEM) 49 | || (subType == EV_PLACEINTERACTITEM) 50 | || (subType == EV_EXCHANGEINTERACTITEM) { 51 | msg.name = itemName; 52 | msg.slot = slotName; 53 | }; 54 | 55 | // 56 | if (subType == EV_USEMOB) { 57 | msg.name = itemName; 58 | }; 59 | 60 | return ptr; 61 | }; 62 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgMovement.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCMsgMovement_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgMovement"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCMsgMovement_Create (var int subType, var string targetName, var int targetVob, var int posPtr, var int angleF, var int targetMode) { 13 | var int ptr; ptr = oCMsgMovement_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x006BE4B0 public: __thiscall oCMsgMovement::oCMsgMovement(void) 18 | const int oCMsgMovement__oCMsgMovement_G1 = 7070896; 19 | 20 | //0x00765650 public: __thiscall oCMsgMovement::oCMsgMovement(void) 21 | const int oCMsgMovement__oCMsgMovement_G2 = 7755344; 22 | 23 | const int call = 0; 24 | if (CALL_Begin (call)) { 25 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgMovement__oCMsgMovement_G1, oCMsgMovement__oCMsgMovement_G2)); 26 | call = CALL_End(); 27 | }; 28 | 29 | //Setup additional parameters 30 | var oCMsgMovement msg; 31 | msg = _^ (ptr); 32 | 33 | msg.subType = subType; 34 | 35 | //EV_GOTOFP, EV_GOROUTE, EV_BEAMTO 36 | msg.targetName = targetName; 37 | 38 | //EV_GOTOVOB, EV_TURNTOVOB, EV_TURNAWAY, EV_WHIRLAROUND 39 | msg.targetVob = targetVob; 40 | 41 | //We don't really need targetVobName, do we? 42 | msg.targetVobName = targetName; 43 | 44 | //EV_GOTOPOS, EV_TURNTOPOS, EV_JUMP 45 | //Get target pos of vobPointer 46 | if (targetVob) { 47 | //TODO: will this work ? 48 | //func int zCVob_GetPositionWorld (var int vobPtr) { 49 | 50 | //0x0051B3C0 public: class zVEC3 __thiscall zCVob::GetPositionWorld(void)const 51 | const int zCVob__GetPositionWorld_G1 = 5354432; 52 | 53 | //0x0052DC90 public: class zVEC3 __thiscall zCVob::GetPositionWorld(void)const 54 | const int zCVob__GetPositionWorld_G2 = 5430416; 55 | 56 | //if (!vobPtr) { return 0; }; 57 | 58 | CALL_RetValIsStruct (12); 59 | CALL__thiscall (targetVob, MEMINT_SwitchG1G2 (zCVob__GetPositionWorld_G1, zCVob__GetPositionWorld_G2)); 60 | var int vobPosPtr; vobPosPtr = CALL_RetValAsPtr (); 61 | 62 | MEM_CopyBytes (vobPosPtr, _@ (msg.targetPos), 12); 63 | MEM_Free (vobPosPtr); 64 | //}; 65 | }; 66 | 67 | if (posPtr) { 68 | MEM_CopyBytes (posPtr, _@ (msg.targetPos), 12); 69 | }; 70 | 71 | if (subType == EV_TURN) { 72 | msg.angle = angleF; 73 | }; 74 | 75 | //EV_SETWALKMODE 76 | if (subType == EV_SETWALKMODE) { 77 | msg.targetMode = targetMode; 78 | }; 79 | 80 | return ptr; 81 | }; 82 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgState.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCMsgState_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgState"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCMsgState_Create (var int subType, var int funcID, var int endOldState, var string wp) { 13 | var int ptr; ptr = oCMsgState_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x006C0D60 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,float) 18 | //0x00767F00 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,float) 19 | 20 | /* 21 | //0x006C0E40 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,int) 22 | const int oCMsgState__oCMsgState_G1 = 7081536; 23 | 24 | //0x00767FE0 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,int) 25 | const int oCMsgState__oCMsgState_G2 = 7765984; 26 | 27 | const int call = 0; 28 | if (CALL_Begin (call)) { 29 | CALL_IntParam (_@ (funcID)); 30 | CALL_IntParam (_@ (subType)); 31 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgState__oCMsgState_G1, oCMsgState__oCMsgState_G2)); 32 | call = CALL_End(); 33 | }; 34 | 35 | */ 36 | //0x006C0F20 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,int,int,class zSTRING const &) 37 | const int oCMsgState__oCMsgState_G1 = 7081760; 38 | 39 | //0x007680C0 public: __thiscall oCMsgState::oCMsgState(enum oCMsgState::TStateSubType,int,int,class zSTRING const &) 40 | const int oCMsgState__oCMsgState_G2 = 7766208; 41 | 42 | CALL_zStringPtrParam (wp); 43 | CALL_IntParam (endOldState); 44 | CALL_IntParam (funcID); 45 | CALL_IntParam (subType); 46 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (oCMsgState__oCMsgState_G1, oCMsgState__oCMsgState_G2)); 47 | 48 | return ptr; 49 | }; 50 | -------------------------------------------------------------------------------- /ObjectFactory/oCMsgWeapon.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCMsgWeapon_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCMsgWeapon"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCMsgWeapon_Create (var int subType, var int targetMode, var int useFist) { 13 | var int ptr; ptr = oCMsgWeapon_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x006BF630 public: __thiscall oCMsgWeapon::oCMsgWeapon(enum oCMsgWeapon::TWeaponSubType,int,int) 18 | const int oCMsgWeapon__oCMsgWeapon_G1 = 7075376; 19 | 20 | //0x007667D0 public: __thiscall oCMsgWeapon::oCMsgWeapon(enum oCMsgWeapon::TWeaponSubType,int,int) 21 | const int oCMsgWeapon__oCMsgWeapon_G2 = 7759824; 22 | 23 | const int call = 0; 24 | if (CALL_Begin (call)) { 25 | CALL_IntParam (_@ (useFist)); 26 | CALL_IntParam (_@ (targetMode)); 27 | CALL_IntParam (_@ (subType)); 28 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCMsgWeapon__oCMsgWeapon_G1, oCMsgWeapon__oCMsgWeapon_G2)); 29 | call = CALL_End(); 30 | }; 31 | 32 | return ptr; 33 | }; 34 | -------------------------------------------------------------------------------- /ObjectFactory/oCSpell.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create object 3 | */ 4 | func int oCSpell_New () { 5 | var int ptr; ptr = CreateNewInstanceByString ("oCSpell"); 6 | return ptr; 7 | }; 8 | 9 | /* 10 | * Wrapper function for initialization 11 | */ 12 | func int oCSpell_Create (var int spellID) { 13 | var int ptr; ptr = oCSpell_New (); 14 | 15 | if (!ptr) { return 0; }; 16 | 17 | //0x0047B9F0 public: __thiscall oCSpell::oCSpell(int) 18 | const int oCSpell__oCSpell_G1 = 4700656; 19 | 20 | //0x00483DD0 public: __thiscall oCSpell::oCSpell(int) 21 | const int oCSpell__oCSpell_G2 = 4734416; 22 | 23 | const int call = 0; 24 | if (CALL_Begin (call)) { 25 | CALL_IntParam (_@ (spellID)); 26 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCSpell__oCSpell_G1, oCSpell__oCSpell_G2)); 27 | call = CALL_End(); 28 | }; 29 | 30 | return ptr; 31 | }; 32 | -------------------------------------------------------------------------------- /ObjectFactory/zCDecal.d: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | */ 4 | func void zCDecal_SetTexture (var int ptr, var string textureName) { 5 | //0x00542240 public: void __thiscall zCDecal::SetTexture(class zSTRING &) 6 | const int zCDecal__SetTexture_G1 = 5513792; 7 | 8 | //0x00556950 public: void __thiscall zCDecal::SetTexture(class zSTRING &) 9 | const int zCDecal__SetTexture_G2 = 5597520; 10 | 11 | CALL_zStringPtrParam (textureName); 12 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCDecal__SetTexture_G1, zCDecal__SetTexture_G2)); 13 | }; 14 | 15 | func void zCDecal_SetTextureByPtr (var int ptr, var int texturePtr) { 16 | //0x00542250 public: void __thiscall zCDecal::SetTexture(class zCTexture *) 17 | const int zCDecal__SetTexture_G1 = 5513808; 18 | 19 | //0x00556960 public: void __thiscall zCDecal::SetTexture(class zCTexture *) 20 | const int zCDecal__SetTexture_G2 = 5597536; 21 | 22 | CALL_PtrParam (texturePtr); 23 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCDecal__SetTexture_G1, zCDecal__SetTexture_G2)); 24 | }; 25 | 26 | func void zCDecal_SetDecalDim (var int ptr, var int dimX, var int dimY) { 27 | //0x00542260 public: void __thiscall zCDecal::SetDecalDim(float,float) 28 | const int zCDecal__SetDecalDim_G1 = 5513824; 29 | 30 | //0x00556970 public: void __thiscall zCDecal::SetDecalDim(float,float) 31 | const int zCDecal__SetDecalDim_G2 = 5597552; 32 | 33 | CALL_FloatParam (dimY); 34 | CALL_FloatParam (dimX); 35 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCDecal__SetDecalDim_G1, zCDecal__SetDecalDim_G2)); 36 | }; 37 | 38 | func void _zCDecalPtr_CreateIntoPtr (var int ptr) { 39 | //0x00541E20 public: __thiscall zCDecal::zCDecal(void) 40 | const int zCDecal__zCDecal_G1 = 5512736; 41 | 42 | //0x00556570 public: __thiscall zCDecal::zCDecal(void) 43 | const int zCDecal__zCDecal_G2 = 5596528; 44 | 45 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCDecal__zCDecal_G1, zCDecal__zCDecal_G2)); 46 | }; 47 | 48 | instance zCDecal@ (zCDecal); 49 | 50 | func int zCDecal_Create (var string textureName, var int dimX, var int dimY) { 51 | var int ptr; ptr = create (zCDecal@); 52 | 53 | _zCDecalPtr_CreateIntoPtr (ptr); 54 | 55 | zCDecal_SetTexture (ptr, textureName); 56 | zCDecal_SetDecalDim (ptr, dimX, dimY); 57 | 58 | return ptr; 59 | }; 60 | -------------------------------------------------------------------------------- /ObjectFactory/zCMaterial.d: -------------------------------------------------------------------------------- 1 | instance zCMaterial@ (zCMaterial); 2 | 3 | func void _zCMaterial_CreateIntoPtr (var int ptr) { 4 | //0x0054CFC0 public: __thiscall zCMaterial::zCMaterial(void) 5 | const int zCMaterial__zCMaterial_G1 = 5558208; 6 | 7 | //0x00563E00 public: __thiscall zCMaterial::zCMaterial(void) 8 | const int zCMaterial__zCMaterial_G2 = 5651968; 9 | 10 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCMaterial__zCMaterial_G1, zCMaterial__zCMaterial_G2)); 11 | }; 12 | 13 | //0x0054D0A0 public: __thiscall zCMaterial::zCMaterial(class zSTRING const &) 14 | 15 | //0x0054DC30 public: void __thiscall zCMaterial::SetTexture(class zCTexture *) 16 | //0x0054DD60 public: void __thiscall zCMaterial::SetDetailTexture(class zSTRING &) 17 | //0x0054DE40 public: void __thiscall zCMaterial::SetDetailTexture(class zCTexture *) 18 | //0x0054DE80 private: void __thiscall zCMaterial::AutoAssignDetailTexture(void) 19 | //0x0054DF80 public: class zVEC2 __thiscall zCMaterial::GetTexScale(void) 20 | //0x0054DFE0 public: void __thiscall zCMaterial::SetTexScale(class zVEC2) 21 | //0x0054E000 public: void __thiscall zCMaterial::RemoveTexture(void) 22 | //0x0054E030 public: class zSTRING const & __thiscall zCMaterial::GetTextureName(void) 23 | //0x0054E050 public: static class zCMaterial * __cdecl zCMaterial::SearchName(class zSTRING &) 24 | //0x0054E100 public: static class zSTRING const & __cdecl zCMaterial::GetMatGroupString(enum zTMat_Group) 25 | //0x0054E150 public: class zSTRING const & __thiscall zCMaterial::GetMatGroupString(void)const 26 | //0x0054E1A0 public: void __thiscall zCMaterial::SetMatGroupByString(class zSTRING const &) 27 | //0x0054E360 public: void __thiscall zCMaterial::RefreshAvgColorFromTexture(void) 28 | 29 | func int zCMaterial_Create () { 30 | var int ptr; ptr = create (zCMaterial@); 31 | 32 | _zCMaterial_CreateIntoPtr (ptr); 33 | 34 | return ptr; 35 | }; 36 | 37 | func void zCMaterial_SetTexture (var int ptr, var string textureName) { 38 | //0x0054DAC0 public: void __thiscall zCMaterial::SetTexture(class zSTRING &) 39 | const int zCMaterial__SetTexture_G1 = 5561024; 40 | 41 | //0x005649E0 public: void __thiscall zCMaterial::SetTexture(class zSTRING &) 42 | const int zCMaterial__SetTexture_G2 = 5655008; 43 | 44 | if (!ptr) { return; }; 45 | 46 | //textureName = STR_Upper (textureName); 47 | 48 | CALL_zStringPtrParam (textureName); 49 | CALL__thiscall (ptr, MEMINT_SwitchG1G2 (zCMaterial__SetTexture_G1, zCMaterial__SetTexture_G2)); 50 | }; 51 | -------------------------------------------------------------------------------- /ObjectFactory/zCOption.d: -------------------------------------------------------------------------------- 1 | func int zCOption_New() { 2 | // sizeof 280h 3 | const int sizeOf_zCOption_G1 = 640; 4 | 5 | // sizeof 298h 6 | const int sizeOf_zCOption_G2 = 664; 7 | 8 | var int ptr; ptr = MEM_Alloc(MEMINT_SwitchG1G2(sizeOf_zCOption_G1, sizeOf_zCOption_G2)); 9 | return ptr; 10 | }; 11 | 12 | func int zCOption_Create() { 13 | //0x0045ADD0 public: __thiscall zCOption::zCOption(void) 14 | const int zCOption__zCOption_G1 = 4566480; 15 | 16 | //0x00460350 public: __thiscall zCOption::zCOption(void) 17 | const int zCOption__zCOption_G2 = 4588368; 18 | 19 | var int ptr; ptr = zCOption_New(); 20 | if (!ptr) { return 0; }; 21 | 22 | CALL__thiscall(ptr, MEMINT_SwitchG1G2(zCOption__zCOption_G1, zCOption__zCOption_G2)); 23 | 24 | return + ptr; 25 | }; 26 | -------------------------------------------------------------------------------- /ObjectFactory/zCViewText2.d: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | */ 4 | instance zCViewText2@ (zCViewText2); 5 | 6 | func int zCViewText2_New() { 7 | var int ptr; ptr = create(zCViewText2@); 8 | return ptr; 9 | }; 10 | 11 | func int zCViewText2_Create(var string text, var int pposX, var int pposY, var int font, var int color, var int alpha, var int funcAlphaBlend) { 12 | var int ptr; ptr = zCViewText2_New(); 13 | if (!ptr) { return 0; }; 14 | 15 | var zCViewText2 v; v = _^(ptr); 16 | v.text = text; 17 | v.pixelPositionX = pposX; 18 | v.pixelPositionY = pposY; 19 | 20 | if (color != -1) { 21 | v.color = color; 22 | v.enabledColor = TRUE; 23 | }; 24 | 25 | v.font = font; 26 | 27 | if (alpha != -1) { 28 | v.alpha = alpha; 29 | }; 30 | 31 | if (funcAlphaBlend > 0) { 32 | v.enabledBlend = TRUE; 33 | v.funcAlphaBlend = funcAlphaBlend; 34 | }; 35 | 36 | return ptr; 37 | }; 38 | -------------------------------------------------------------------------------- /ObjectFactory/zCWaypoint.d: -------------------------------------------------------------------------------- 1 | func int zCWaypoint_Create () { 2 | var int ptr; ptr = CreateNewInstanceByString ("zCWaypoint"); 3 | return +ptr; 4 | }; 5 | 6 | func void zCWaypoint_Init (var int wpPtr, var string waypointName, var int vobWaypointPtr, var int x, var int y, var int z) { 7 | if (!wpPtr) { return; }; 8 | 9 | if (vobWaypointPtr) { 10 | //0x00705D70 public: void __thiscall zCWaypoint::Init(class zCVobWaypoint *) 11 | const int zCWaypoint__Init_VobWp_G1 = 7363952; 12 | 13 | //0x007AF970 public: void __thiscall zCWaypoint::Init(class zCVobWaypoint *) 14 | const int zCWaypoint__Init_VobWp_G2 = 8059248; 15 | 16 | CALL_PtrParam (vobWaypointPtr); 17 | CALL__thiscall (wpPtr, MEMINT_SwitchG1G2 (zCWaypoint__Init_VobWp_G1, zCWaypoint__Init_VobWp_G2)); 18 | } else { 19 | //0x00705D00 public: void __thiscall zCWaypoint::Init(float,float,float) 20 | const int zCWaypoint__Init_G1 = 7363840; 21 | 22 | //0x007AF900 public: void __thiscall zCWaypoint::Init(float,float,float) 23 | const int zCWaypoint__Init_G2 = 8059136; 24 | 25 | CALL_FloatParam (z); 26 | CALL_FloatParam (y); 27 | CALL_FloatParam (x); 28 | 29 | CALL__thiscall (wpPtr, MEMINT_SwitchG1G2 (zCWaypoint__Init_G1, zCWaypoint__Init_G2)); 30 | }; 31 | 32 | //0x00705FB0 public: void __thiscall zCWaypoint::SetName(class zSTRING &) 33 | const int zCWaypoint__SetName_G1 = 7364528; 34 | 35 | //0x007AFBB0 public: void __thiscall zCWaypoint::SetName(class zSTRING &) 36 | const int zCWaypoint__SetName_G2 = 8059824; 37 | 38 | CALL_zStringPtrParam (waypointName); 39 | CALL__thiscall (wpPtr, MEMINT_SwitchG1G2 (zCWaypoint__SetName_G1, zCWaypoint__SetName_G2)); 40 | }; -------------------------------------------------------------------------------- /Patches/G12/PatchFightCombos.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Patch fixing fight combos 3 | * - with this patch Npcs can now use combos! :) 4 | * 5 | * - G1 FAI uses combos - defined FAI_HUMAN_MASTER.D - but they were not working ... 6 | * - G2 NOTR DOES NOT USE combos by default - you will have to update your Fight AI logic 7 | * 8 | * MOVE_MASTERATTACK is the one that performs combo: 9 | * 10 | * Fight AI entries: 11 | * 12 | * MOVE_SIDEATTACK Left --> Right 13 | * MOVE_FRONTATTACK Left --> Foward 14 | * or Foward --> Right 15 | * 16 | * MOVE_TRIPLEATTACK Foward --> Right -->Left 17 | * or Left --> Right --> Foward 18 | * 19 | * MOVE_WHIRLATTACK Left --> Right --> Left --> Right 20 | * MOVE_MASTERATTACK Left --> Right --> [Foward --> Foward --> Foward --> Foward] == combo 21 | * 22 | */ 23 | 24 | 25 | /* 26 | Usage - call from Init_Global after Ikarus & LeGo initialization 27 | 28 | func void Init_Global () { 29 | //Ikarus initialization 30 | MEM_InitAll(); 31 | 32 | //LeGo intializatoin 33 | LeGo_Init (yourflags | 34 | LeGo_HookEngine 35 | ); 36 | 37 | //Patch fight combos 38 | G12_PatchFightCombos (); 39 | }; 40 | 41 | */ 42 | 43 | func void _hook_oCNpc_EV_AttackForward_HitCombo_Npc () { 44 | if (!ECX) { return; }; 45 | var oCAniCtrl_Human aniCtrl; aniCtrl = _^ (ECX); 46 | 47 | if (!aniCtrl.npc) { return; }; 48 | var oCNpc slf; slf = _^ (aniCtrl.npc); 49 | 50 | //If Npc is in combo animation 51 | if (oCAniCtrl_Human_IsInCombo (ECX)) { 52 | //Some fight styles don't have combos - if we would enable combo - Npc would freeze in their animation 53 | //Check if combo can be enabled 54 | if (aniCtrl.comboNr + 1 < aniCtrl.comboMax) { 55 | //Enable combo :) 56 | const int canEnableNextCombo = 1; 57 | aniCtrl.bitfield = aniCtrl.bitfield | canEnableNextCombo; 58 | }; 59 | }; 60 | }; 61 | 62 | func void G12_PatchFightCombos () { 63 | const int once = 0; 64 | if (!once) { 65 | 66 | //In engine there is an incorrect condition check (< instead of >) ... we need to swap EAX - EDX comparison to fix it 67 | //3b c2 CMP EAX, EDX 68 | //3b d0 CMP EDX, EAX 69 | 70 | //006aae8f 71 | const int oCNpc__EV_AttackForward_ComboCheck_G1 = 6991503; 72 | 73 | //0074ff77 74 | const int oCNpc__EV_AttackForward_ComboCheck_G2 = 7667575; 75 | 76 | var int addr; addr = MEMINT_SwitchG1G2 (oCNpc__EV_AttackForward_ComboCheck_G1, oCNpc__EV_AttackForward_ComboCheck_G2); 77 | 78 | MemoryProtectionOverride (addr + 1, 1); 79 | MEM_WriteByte (addr + 1, 208); //D0 80 | 81 | //Additionally we need to add canEnableNextCombo flag to aniCtrl if aniCtrl is in combo animation ... this is handled by hook below 82 | //006aae99 83 | const int oCNpc__EV_AttackForward_HitCombo_Npc_G1 = 6991513; 84 | 85 | //0074ff81 86 | const int oCNpc__EV_AttackForward_HitCombo_Npc_G2 = 7667585; 87 | 88 | HookEngine (MEMINT_SwitchG1G2 (oCNpc__EV_AttackForward_HitCombo_Npc_G1, oCNpc__EV_AttackForward_HitCombo_Npc_G2), 5, "_hook_oCNpc_EV_AttackForward_HitCombo_Npc"); 89 | 90 | once = 1; 91 | }; 92 | }; 93 | -------------------------------------------------------------------------------- /Patches/G12/SetDisplayDialogueDistance.d: -------------------------------------------------------------------------------- 1 | /* 2 | * G1 default display dialogue distance is 500 in-game cm ... that's not enough - very often subtitles are disappearing because of that 3 | * - this simple 'patch' will override dialogue distance with new value 4 | */ 5 | 6 | /* 7 | Usage - call from Init_Global after Ikarus initialization 8 | 9 | func void Init_Global () { 10 | //Ikarus initialization 11 | MEM_InitAll(); 12 | 13 | //Update display dialogue distance. Default G1 500 14 | G12_SetDisplayDialogueDistance (1500); 15 | }; 16 | 17 | */ 18 | 19 | var int MAX_DISPLAYDIALOGUEDISTANCE; 20 | 21 | func int G12_GetDefaultDialogueDistance () { //int 22 | //006b2a07 + 2 23 | const int EV_PlaySound_DisplayDialogueDist_Addr_G1 = 7023111; 24 | 25 | //00758740 + 2 26 | const int EV_PlaySound_DisplayDialogueDist_Addr_G2 = 7702336; 27 | 28 | var int addr; addr = MEMINT_SwitchG1G2 (EV_PlaySound_DisplayDialogueDist_Addr_G1, EV_PlaySound_DisplayDialogueDist_Addr_G2) + 2; 29 | var int dist; dist = MEM_ReadInt (MEM_ReadInt (addr)); 30 | 31 | dist = sqrtf (dist); 32 | 33 | return + roundF (dist); 34 | }; 35 | 36 | func void G12_SetDisplayDialogueDistance (var int newDistance) { //int 37 | //006b2a07 + 2 38 | const int EV_PlaySound_DisplayDialogueDist_Addr_G1 = 7023111; 39 | 40 | //00758740 + 2 41 | const int EV_PlaySound_DisplayDialogueDist_Addr_G2 = 7702336; 42 | 43 | var int addr; addr = MEMINT_SwitchG1G2 (EV_PlaySound_DisplayDialogueDist_Addr_G1, EV_PlaySound_DisplayDialogueDist_Addr_G2) + 2; 44 | 45 | MAX_DISPLAYDIALOGUEDISTANCE = mkf (newDistance * newDistance); 46 | 47 | //Override with pointer of our own variable 48 | MemoryProtectionOverride (addr, 4); 49 | MEM_WriteInt (addr, _@ (MAX_DISPLAYDIALOGUEDISTANCE)); 50 | }; 51 | -------------------------------------------------------------------------------- /Patches/G12/SetDisplayDialogueTime.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Display time for subtitles (min / max time in ms) 3 | * - this simple 'patch' allows us to update min and max display time in-game 4 | */ 5 | 6 | /* 7 | Usage - call from Init_Global after Ikarus initialization 8 | 9 | func void Init_Global () { 10 | //Ikarus initialization 11 | MEM_InitAll(); 12 | 13 | //Update display dialogue min / max time 14 | G12_SetDisplayDialogueTime (1500, 30000); 15 | }; 16 | 17 | */ 18 | 19 | func void G12_SetDisplayDialogueTime (var int minTime, var int maxtime) { 20 | //Default 1000 ms 21 | const int NPC_TALK_TIME_MIN_addr_G1 = 8707632; 22 | const int NPC_TALK_TIME_MIN_addr_G2 = 9142536; 23 | 24 | //Default 8000 ms 25 | const int NPC_TALK_TIME_MAX_addr_G1 = 8707636; 26 | const int NPC_TALK_TIME_MAX_addr_G2 = 9142540; 27 | 28 | MEM_WriteInt (MEMINT_SwitchG1G2 (NPC_TALK_TIME_MIN_addr_G1, NPC_TALK_TIME_MIN_addr_G2), mkf(minTime)); 29 | MEM_WriteInt (MEMINT_SwitchG1G2 (NPC_TALK_TIME_MAX_addr_G1, NPC_TALK_TIME_MAX_addr_G2), mkf(maxtime)); 30 | }; 31 | -------------------------------------------------------------------------------- /Patches/G12/SetMagBookTurnTime.d: -------------------------------------------------------------------------------- 1 | /* 2 | * G12_SetMagBookTurnTime 3 | */ 4 | var int MAGBOOK_TURNTIME; 5 | 6 | func void G12_SetMagBookTurnTime(var int newTurnTime) { 7 | //00472099 d8 35 dc FDIV dword ptr [DAT_007d1edc ] 8 | // 1e 7d 00 9 | const int oCMag_Book__DoTurn_MAG_SELECT_TIME_addr_G1 = 4661401; 10 | 11 | //00478d59 d8 35 60 FDIV dword ptr [DAT_00830060 ] 12 | // 00 83 00 13 | const int oCMag_Book__DoTurn_MAG_SELECT_TIME_addr_G2 = 4689241; 14 | 15 | MAGBOOK_TURNTIME = mkf(newTurnTime); 16 | 17 | var int addr; addr = MEMINT_SwitchG1G2(oCMag_Book__DoTurn_MAG_SELECT_TIME_addr_G1, oCMag_Book__DoTurn_MAG_SELECT_TIME_addr_G2) + 2; 18 | MemoryProtectionOverride(addr, 4); 19 | MEM_WriteInt(addr, _@(MAGBOOK_TURNTIME)); //original value 250 20 | }; 21 | 22 | -------------------------------------------------------------------------------- /Patches/G12/SetRainThroughVobs.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by Showdown & Lehona 3 | * Original post: https://forum.worldofplayers.de/forum/threads/1299679-Skriptpaket-Ikarus-4/page11?p=24735929&viewfull=1#post24735929 4 | * I just added G1 address 5 | */ 6 | 7 | /* 8 | Usage - call from Init_Global after Ikarus initialization 9 | 10 | func void Init_Global () { 11 | //Ikarus initialization 12 | MEM_InitAll(); 13 | 14 | //Turn off raining through vobs (why would this be enabled?) 15 | G12_SetRainThroughVobs (FALSE); 16 | }; 17 | 18 | */ 19 | 20 | func void G12_SetRainThroughVobs (var int bool) { 21 | const int Raincheck_G1 = 6000805; 22 | const int Raincheck_G2 = 6169210; 23 | 24 | MemoryProtectionOverride (MEMINT_SwitchG1G2(Raincheck_G1, Raincheck_G2), 4); 25 | 26 | //enum zTTraceRayFlags { 27 | const int zTRACERAY_VOB_IGNORE_NO_CD_DYN = 1 << 0; 28 | const int zTRACERAY_VOB_IGNORE = 1 << 1; 29 | const int zTRACERAY_VOB_BBOX = 1 << 2; 30 | const int zTRACERAY_VOB_OBB = 1 << 3; 31 | const int zTRACERAY_STAT_IGNORE = 1 << 4; 32 | const int zTRACERAY_STAT_POLY = 1 << 5; 33 | const int zTRACERAY_STAT_PORTALS = 1 << 6; 34 | const int zTRACERAY_POLY_NORMAL = 1 << 7; 35 | const int zTRACERAY_POLY_IGNORE_TRANSP = 1 << 8; 36 | const int zTRACERAY_POLY_TEST_WATER = 1 << 9; 37 | const int zTRACERAY_POLY_2SIDED = 1 << 10; 38 | const int zTRACERAY_VOB_IGNORE_CHARACTER = 1 << 11; 39 | const int zTRACERAY_FIRSTHIT = 1 << 12; 40 | const int zTRACERAY_VOB_TEST_HELPER_VISUALS = 1 << 13; 41 | 42 | //G2A only! 43 | const int zTRACERAY_VOB_IGNORE_PROJECTILES = 1 << 14; 44 | //}; 45 | 46 | if (!bool) { 47 | //New traceray flags - don't ignore vobs 48 | //224 zTRACERAY_STAT_POLY | zTRACERAY_POLY_NORMAL | zTRACERAY_POLY_TEST_WATER | zTRACERAY_STAT_PORTALS 49 | MEM_WriteInt (MEMINT_SwitchG1G2 (Raincheck_G1, Raincheck_G2), zTRACERAY_STAT_POLY | zTRACERAY_POLY_NORMAL | zTRACERAY_POLY_TEST_WATER | zTRACERAY_STAT_PORTALS); 50 | } else { 51 | //Original traceray flags - raining through vobs 52 | //226 zTRACERAY_STAT_POLY | zTRACERAY_VOB_IGNORE | zTRACERAY_POLY_NORMAL | zTRACERAY_POLY_TEST_WATER | zTRACERAY_STAT_PORTALS 53 | MEM_WriteInt (MEMINT_SwitchG1G2 (Raincheck_G1, Raincheck_G2), zTRACERAY_STAT_POLY | zTRACERAY_VOB_IGNORE | zTRACERAY_POLY_NORMAL | zTRACERAY_POLY_TEST_WATER | zTRACERAY_STAT_PORTALS); 54 | }; 55 | }; 56 | -------------------------------------------------------------------------------- /Readme/API.md: -------------------------------------------------------------------------------- 1 | ## API files 2 | Many features have customization options, some of them will not work without you customizing them. 3 | 4 | For example [G12 No ammo print](G12_No_Ammo_Print.md) - simple feature that will 'print' info for player not having ammo for ranged weapons. 5 | Text has to be translated to other languagues, you might have your own types of ammo (poisoned arrows, magical arrows, exploding arrows etc.) 6 | 7 | **This is why we have introduced 'API' (application programming interface) files.** 8 | 9 | These files are basically examples of customization. Copy them to separate folder, customize them and link them to `Gothic.src`. 10 | With next update of AFSP where you will download latest version your customization will stay intact. 11 | 12 | Have a look at **G12 No ammo print** [API file](../Standalone-Packages/G12-NoAmmoPrint/noAmmoPrint_API.d) to get better idea on how it should work. -------------------------------------------------------------------------------- /Readme/G12_Add_Perceptions.md: -------------------------------------------------------------------------------- 1 | ## G12 Add Perceptions 2 | - allows you to insert 'new' perception functions to `oCNpc.percList` 3 | - newly added perception functions are always active, called all the time 4 | 5 | Init function: `G12_AddPerceptions_Init();` 6 | -------------------------------------------------------------------------------- /Readme/G12_Better_Bars.md: -------------------------------------------------------------------------------- 1 | ## G12 Better Bars 2 | 3 | ## :construction: :construction_worker: :construction: README UNDER CONSTRUCTION :construction: :construction_worker: :construction: 4 | 5 | - This feature 'replaces' original Gothic health and mana bars with LeGo bars where we can control textures, alpha values and when bars should be displayed. 6 | This feature adds 4 visualization options: 7 | - Standard (same as in vanilla Gothic) 8 | - Dynamic: 9 | * Health bar is visible if player is hurt, in fight mode, in inventory or when health changes 10 | * Mana bar is visible in magic fight mode, in inventory or when mana changes 11 | - Always on 12 | - Only in the inventory 13 | 14 | - This also adds health & mana bar preview in combination with `G12-InvItemPreview`, additional texture indicates how much health or mana item in inventory recovers: 15 | 16 | [![G1&2 Better Bars](https://img.youtube.com/vi/4hbQxHU-Utw/0.jpg)](https://www.youtube.com/watch?v=4hbQxHU-Utw) 17 | 18 | Init function: `G12_BetterBars_Init();` 19 | 20 | [API file](../Standalone-Packages/G12-BetterBars/betterBars_API.d) 21 | -------------------------------------------------------------------------------- /Readme/G12_CustomItemDescription.md: -------------------------------------------------------------------------------- 1 | ## G12 Custom item description 2 | 3 | [![G12 Custom item description](https://img.youtube.com/vi/y1TmdG1t1qs/0.jpg)](https://www.youtube.com/watch?v=y1TmdG1t1qs) 4 | 5 | [Github repo](https://github.com/Bad-Scientists/G1-Improved-AI/tree/Custom-item-description) 6 | 7 | Example for [Old Sword](https://github.com/Bad-Scientists/G1-Improved-AI/blob/Custom-item-description/_work/Data/Scripts/content/MOD/Examples/ItMw_1H_Sword_OLD_01.d). 8 | 9 | Example for [Uriziel](https://github.com/Bad-Scientists/G1-Improved-AI/blob/Custom-item-description/_work/Data/Scripts/content/MOD/Examples/Mythrilklinge02.d). 10 | 11 | Example for [Circle 1 book being un/read](https://github.com/Bad-Scientists/G1-Improved-AI/blob/Custom-item-description/_work/Data/Scripts/content/MOD/Examples/ItWr_Book_Circle_01.d). 12 | -------------------------------------------------------------------------------- /Readme/G12_Despawn_Only_If_Empty.md: -------------------------------------------------------------------------------- 1 | ## G12 Despawn only if empty 2 | - Prevents dead bodies from despawning if they have items in inventory. 3 | 4 | Init function: `G12_DespawnOnlyIfEmpty_Init();` 5 | -------------------------------------------------------------------------------- /Readme/G12_Enable_Player_States.md: -------------------------------------------------------------------------------- 1 | ## G12 Enable Player States 2 | - AI states that you can use on player character are hardcoded in the engine. Following states are used in vanilla: 3 | * G1: `ZS_ASSESSMAGIC, ZS_ASSESSSTOPMAGIC, ZS_MAGICFREEZE, ZS_SHORTZAPPED, ZS_ZAPPED, ZS_PYRO, ZS_MAGICSLEEP, ZS_MAGICFEAR` 4 | * G2: `ZS_ASSESSMAGIC, ZS_ASSESSSTOPMAGIC, ZS_MAGICFREEZE, ZS_WHIRLWIND, ZS_SHORTZAPPED, ZS_ZAPPED, ZS_PYRO, ZS_MAGICSLEEP` 5 | 6 | - this feature allows you to enable additional AI states via API function `C_CanPlayerUseAIState` 7 | 8 | Init function: `G12_EnablePlayerStates_Init ();` 9 | 10 | [API file](../Standalone-Packages/G12-EnablePlayerStates/enablePlayerStates_API.d) 11 | -------------------------------------------------------------------------------- /Readme/G12_Enhanced_Information_Manager.md: -------------------------------------------------------------------------------- 1 | ## G12 Enhanced Information Manager 2 | 3 | ## :construction: :construction_worker: :construction: README UNDER CONSTRUCTION :construction: :construction_worker: :construction: 4 | 5 | - Package adds several features for Information Manager: 6 | - Simple dialog color, font and text alignment control using dialog description. 7 | - Answering system and Input fields. 8 | - Spinner system. 9 | - Dialog control with numeric keys (1 .. 9). 10 | - Dialog overlays with which you can simply change color for specific words. 11 | 12 | [More on this feature here](https://forum.worldofplayers.de/forum/threads/1571033-AFSP-ScriptPacket?p=26905995&viewfull=1#post26905995) 13 | 14 | Init function: `G12_EnhancedInfoManager_Init();` 15 | 16 | [API file](../Standalone-Packages/G12-EnhancedInfoManager/enhancedInfoManager_API.d) 17 | -------------------------------------------------------------------------------- /Readme/G12_Enhanced_oCTriggerScript.md: -------------------------------------------------------------------------------- 1 | ## G12 Enhanced oCTriggerScript 2 | - Package adds new options for `oCTriggerScript` objects: 3 | - `zCTrigger_bitfield_callEventFuncs` flag will call additional event functions `oCTriggerScript.scriptFunc` + `_OnTouch`, `_OnTrigger`, `_OnContact`, `_OnUnTouch`. 4 | - `zCTrigger_bitfield_reactToOnContact` flag introduces `_OnContact` event. It repeatedly fires as long as there is any object in `oCTriggerScript._zCVob_touchVobList_numInArray`. 5 | 6 | `_OnTouch`, `_OnUnTouch` events 7 | 8 | [example_FirePlaceSavingPolicy.d](../Standalone-Packages/G12-EnhancedoCTriggerScript/example_FirePlaceSavingPolicy.d) 9 | - demonstrates how you can add `oCTriggerScript` objects to all fireplaces in your world which will allow you to only save game near a fireplace: 10 | 11 | [![G1&2 Enhanced oCTriggerScript](https://img.youtube.com/vi/U9IVhqSixW0/0.jpg)](https://www.youtube.com/watch?v=U9IVhqSixW0) 12 | 13 | `_OnContact` event 14 | 15 | [example_FirePlaceFireDamage.d](../Standalone-Packages/G12-EnhancedoCTriggerScript/example_FirePlaceFireDamage.d) 16 | - demonstrates how you can add `oCTriggerScript` objects to all fireplaces in your world that will burn every Npc that is **in contact** with such fireplace: 17 | 18 | [![G1&2 Enhanced oCTriggerScript](https://img.youtube.com/vi/7KYLjUITbi4/0.jpg)](https://www.youtube.com/watch?v=7KYLjUITbi4) 19 | 20 | Init function: `G12_EnhancedoCTriggerScript_Init ();` 21 | -------------------------------------------------------------------------------- /Readme/G12_Equip_Control.md: -------------------------------------------------------------------------------- 1 | ## G&2 Equip Control 2 | - Simple feature that allows you to control what items can be equipped / unequipped. 3 | 4 | Init function: `G12_EquipControl_Init();` 5 | 6 | [API file](../Standalone-Packages/G12-EquipControl/equipControl_API.d) -------------------------------------------------------------------------------- /Readme/G12_Fade_Away.md: -------------------------------------------------------------------------------- 1 | ## G12 Fade away 2 | - Gothic engine has most likely unfinished built-in feature which fades away dead Npcs and removes their bodies 3 | - this feature uses API function `C_Npc_IsSummoned` to recognize which creatures (I expect mostly summoned) can be faded away 4 | - you can however use `oCNpc_StartFadeAway(self);` on any Npc that you want to fade away. (for example from `ZS_Dead` state, or from whenever you want :smile:) 5 | 6 | [![G1&2 Fade away](https://img.youtube.com/vi/0MdiT97w59c/0.jpg)](https://www.youtube.com/watch?v=0MdiT97w59c) 7 | 8 | :warning: Warning :warning: do not use with `hero` game will crash if you call it with player. 9 | 10 | Init function: `G12_FadeAway_Init();` 11 | 12 | [API file](../Standalone-Packages/G12-FadeAway/fadeAway_API.d) 13 | 14 | You can use these extra functions to work with fade away feature: 15 | ```c++ 16 | //fadeAwayTimeF is Ikarus float miliseconds mkf(8000) - 8 seconds 17 | void oCNpc_StartFadeAway(var int slfInstance); //Npc will fade away (default engine time 5s) 18 | void oCNpc_StartFadeAway_Ext(var int slfInstance, var int fadeAwayTimeF); //Npc will fade away, but you can specify time by yourself 19 | int oCNpc_IsFadingAway(var int slfInstance); //returns true if Npc is fading away 20 | ``` 21 | -------------------------------------------------------------------------------- /Readme/G12_Focus.md: -------------------------------------------------------------------------------- 1 | ## G12 Focus 2 | - Slightly improved version of LeGo focusnames feature: 3 | - color of focus is changed: 4 | * to orange if chest/mob is locked by special key, cannot be picklocked and player does not have key 5 | * to yellow if chest/mob is locked by special key and player does not have key but it can be picklocked 6 | * to yellow if chest/mob can be picklocked 7 | * to green if chest/mob is unlocked and not empty 8 | 9 | - renames chests from `MOBNAME_CHEST` to `MOBNAME_CHEST_EMPTY` and crates from `MOBNAME_CRATE` to `MOBNAME_CRATE_EMPTY` when they are empty and vice versa. 10 | 11 | Init function: `G12_Focus_Init();` 12 | 13 | Should not be used together with LeGo flag `LeGo_Focusnames`. 14 | 15 | [API file](../Standalone-Packages/G12-Focus/focus_API.d) 16 | -------------------------------------------------------------------------------- /Readme/G12_Inventory_Item_Preview.md: -------------------------------------------------------------------------------- 1 | ## G12 Inventory Item preview 2 | - This feature updates global variables `PC_ItemPreviewMana` and `PC_ItemPreviewHealth` with HP and Mana values read out of `oCItem.count[]` property using `oCItem.text[]` property to recognize relevant values. 3 | 4 | Init function: `G12_InvItemPreview_Init ();` 5 | -------------------------------------------------------------------------------- /Readme/G12_Log_Dialogues.md: -------------------------------------------------------------------------------- 1 | ## G12 Log Dialogues 2 | - simple feature that writes all dialogues as player's log 3 | - feature uses API file `GetLogTopicName__LogDialogs(var C_NPC npc, var C_NPC her)` to determine which logs are note-worthy and will be written to section `LOG_SECTIONFORDIALOGUES` 4 | 5 | [![G1&2 Log Dialogues](https://img.youtube.com/vi/RG1UBn53ZpY/0.jpg)](https://www.youtube.com/watch?v=RG1UBn53ZpY) 6 | 7 | Init function: `G12_LogDialogue_Init();` 8 | 9 | [API file](../Standalone-Packages/G12-LogDialogues/logDialogues_API.d) 10 | -------------------------------------------------------------------------------- /Readme/G12_Moon_Phases.md: -------------------------------------------------------------------------------- 1 | ## G12 Moon phases 2 | - simple ambient feature that adds moon phases to the game. (allows you to update moon textures) 3 | 4 | [![G1&2 Moon phases](https://img.youtube.com/vi/zc3lch6syaY/0.jpg)](https://www.youtube.com/watch?v=zc3lch6syaY) 5 | 6 | Init function: `G12_MoonPhases_Init();` 7 | 8 | [API file](../Standalone-Packages/G12-MoonPhases/moonPhases_API.d) 9 | 10 | -------------------------------------------------------------------------------- /Readme/G12_Multi_Teleport.md: -------------------------------------------------------------------------------- 1 | ## G12 Multi-teleport 2 | - feature adds multi-teleport to key `3` (which, let's be honest no one was using anyway :smile: ) 3 | - it automatically registers all `TELEPORT*` spells in your inventory to separate spell book - you can use arrows to navigate through teleportation spells 4 | 5 | G1 example: 6 | 7 | [![G1&2 Multi-teleport](https://img.youtube.com/vi/demCXdvHAng/0.jpg)](https://www.youtube.com/watch?v=demCXdvHAng) 8 | 9 | G2 example: 10 | 11 | [![G1&2 Multi-teleport](https://img.youtube.com/vi/Eedb8wE0OhY/0.jpg)](https://www.youtube.com/watch?v=Eedb8wE0OhY) 12 | 13 | Init function: `G12_MultiTeleport_Init ();` 14 | 15 | Recommendation: use patch [G12_SetMagBookTurnTime](../Readme/G12_Set_Mag_Book_Turn_Time.md) to update speed with which mag book moves from one spell to another. -------------------------------------------------------------------------------- /Readme/G12_No_Ammo_Print.md: -------------------------------------------------------------------------------- 1 | ## G12 No ammo print 2 | - Simple feature that displays a message when you are out of ammo & attempting to put ranged weapon in hand. 3 | 4 | Init function: `G12_NoAmmoPrint_Init ();` 5 | 6 | [API file](../Standalone-Packages/G12-NoAmmoPrint/noAmmoPrint_API.d) 7 | -------------------------------------------------------------------------------- /Readme/G12_Patch_Fight_Combos.md: -------------------------------------------------------------------------------- 1 | ## G12 Patch fight combos 2 | - with this patch Npcs can now use combos! :smile: 3 | 4 | 1H example 5 | 6 | [![G1&2 Patch fight combos 1H](https://img.youtube.com/vi/HCvjVH-VwQE/0.jpg)](https://www.youtube.com/watch?v=HCvjVH-VwQE) 7 | 8 | 2H example 9 | 10 | [![G1&2 Patch fight combos 2H](https://img.youtube.com/vi/kAyYs_UJVfQ/0.jpg)](https://www.youtube.com/watch?v=kAyYs_UJVfQ) 11 | 12 | Init function: `G12_PatchFightCombos();` 13 | 14 | - G1 FAI uses combos - defined FAI_HUMAN_MASTER.D - but they were not working ... 15 | - G2 NOTR **DOES NOT USE** combos by default - you will have to update your Fight AI logic 16 | 17 | ``` 18 | MOVE_MASTERATTACK is the one that performs combo: 19 | Fight AI entries: 20 | MOVE_SIDEATTACK Left --> Right 21 | MOVE_FRONTATTACK Left --> Foward 22 | or Foward --> Right 23 | 24 | MOVE_TRIPLEATTACK Foward --> Right -->Left 25 | or Left --> Right --> Foward 26 | 27 | MOVE_WHIRLATTACK Left --> Right --> Left --> Right 28 | MOVE_MASTERATTACK Left --> Right --> [Foward --> Foward --> Foward --> Foward] == combo 29 | ``` 30 | -------------------------------------------------------------------------------- /Readme/G12_PickLock_Helper.md: -------------------------------------------------------------------------------- 1 | ## G12 Pick Lock Helper 2 | - Simple feature that shows picklock combination progress: 3 | 4 | [![G1&2 Pick Lock Helper](https://img.youtube.com/vi/kdX9e3QlAbg/0.jpg)](https://www.youtube.com/watch?v=kdX9e3QlAbg) 5 | 6 | Init function: `G12_PickLockHelper_Init();` 7 | 8 | [API file](../Standalone-Packages/G12-PickLockHelper/pickLockHelper_API.d) 9 | -------------------------------------------------------------------------------- /Readme/G12_Prevent_Looting.md: -------------------------------------------------------------------------------- 1 | ## G12 Prevent Looting 2 | - Simple feature that allows you to control which Npcs can be looted via API function `C_Npc_PreventLooting` 3 | 4 | Init function: `G12_PreventLooting_Init();` 5 | 1. Required LeGo flags: `LeGo_HookEngine | LeGo_View`. 6 | 7 | [API file](../Standalone-Packages/G12-PreventLooting/preventLooting_API.d) 8 | -------------------------------------------------------------------------------- /Readme/G12_Rain_Control.md: -------------------------------------------------------------------------------- 1 | ## G12 Rain Control 2 | - Allows you to control weather via API function `RainControl_SetupRain` 3 | 4 | Init function: `G12_RainControl_Init();` 5 | 6 | [API file](../Standalone-Packages/G12-RainControl/rainControl_API.d) 7 | 8 | Additionaly you can interact with Rain using these functions: 9 | 10 | ```c++ 11 | //weatherType = [zTWEATHER_SNOW, zTWEATHER_RAIN] 12 | void Wld_ResetWeather(); //resets weather overrides enabled by this feature. 13 | void Wld_SetWeatherType(weatherType); //G2 NoTR only - sets weather type: snow or rain 14 | void Wld_ForceWeatherType(weatherType); //G2 NoTR only - forces weather type: snow or rain 15 | void Wld_SetDontRain(RainControl_DontRain); //if set to true - it will never rain 16 | void Wld_SetRainForever(RainControl_RainForever); //if set to true - it will always rain 17 | void Wld_SetRainOff(); //shuts off rain immediately 18 | void Wld_SetRainOn(); //turns on rain immediately 19 | void Wld_StartRain(newDuration); //fades in rain smoothly - for specified newDuration time (in minutes) 20 | void Wld_StopRain(); //fades out rain smoothly - within next 5 in-game minutes 21 | int Wld_SetRainTime(start_hr, start_min, end_hr, end_min); //if we are within specified time-range, then this function will turn on rain. Returns true if we are within time-range 22 | ``` 23 | -------------------------------------------------------------------------------- /Readme/G12_Set_Display_Dialogue_Distance.md: -------------------------------------------------------------------------------- 1 | ## G12 Set display dialogue distance 2 | - G1 dialogue distance is by default `500` ... that's not enough, very often because of this distance subtitles will not display at all when talking to Npc. 3 | - this 'patch' allows you to set custom distance: 4 | 5 | Usage: 6 | ```c++ 7 | func void Init_Global() { 8 | //Ikarus initialization 9 | MEM_InitAll(); 10 | 11 | //Update display dialogue distance. Default G1 500 12 | G12_SetDisplayDialogueDistance(1500); 13 | }; 14 | ``` -------------------------------------------------------------------------------- /Readme/G12_Set_Display_Dialogue_Time.md: -------------------------------------------------------------------------------- 1 | ## G12 Set display dialogue distance 2 | - this 'patch' allows you to adjust min max display time for subtitles 3 | - default Gothic display time is min: `1000` and max `8000` ms 4 | - if you don't have audio voice over and you have long sentences subtitles will cut off after 8 seconds ... 5 | 6 | Usage: 7 | ```c++ 8 | func void Init_Global() { 9 | //Ikarus initialization 10 | MEM_InitAll(); 11 | 12 | //Update display dialogue min / max time 13 | G12_SetDisplayDialogueTime(1500, 30000); 14 | }; 15 | ``` -------------------------------------------------------------------------------- /Readme/G12_Set_Mag_Book_Turn_Time.md: -------------------------------------------------------------------------------- 1 | ## G12 Set mag book turn time 2 | - this 'patch' allows you to adjust time it takes for mag book to turn between spell items 3 | - default Gothic turn time speed is 250 ms 4 | 5 | Usage: 6 | ```c++ 7 | func void Init_Global() { 8 | //Ikarus initialization 9 | MEM_InitAll(); 10 | 11 | //Update turn time speed 12 | G12_SetMagBookTurnTime(500); 13 | }; 14 | ``` -------------------------------------------------------------------------------- /Readme/G12_Set_Player_Turn_Speed.md: -------------------------------------------------------------------------------- 1 | ## G12 Set player turn speed 2 | - this 'patch' allows you to adjust players turning speed 3 | - default Gothic turn speed is: `0.1` - fairly slow if you are using only keyboard 4 | 5 | Usage: 6 | ```c++ 7 | func void Init_Global() { 8 | //Ikarus initialization 9 | MEM_InitAll(); 10 | 11 | //Default turn speed is 0.1 12 | G12_SetPlayerTurnSpeed(castToIntF(0.18)); 13 | }; 14 | ``` -------------------------------------------------------------------------------- /Readme/G12_Set_Rain_Through_Vobs.md: -------------------------------------------------------------------------------- 1 | ## G12 Set rain through vobs 2 | - this 'patch' enables/disables raytrace check ignoring vobs - by deault it is raining through vobs in Gothic (probably an oversight) 3 | - created by **Showdown & Lehona** [(original post)](https://forum.worldofplayers.de/forum/threads/1299679-Skriptpaket-Ikarus-4/page11?p=24735929&viewfull=1#post24735929) 4 | 5 | Usage: 6 | ```c++ 7 | func void Init_Global() { 8 | //Ikarus initialization 9 | MEM_InitAll(); 10 | 11 | //Turn off raining through vobs 12 | G12_SetRainThroughVobs(FALSE); 13 | }; 14 | ``` -------------------------------------------------------------------------------- /Readme/G12_Spacer_Spawn.md: -------------------------------------------------------------------------------- 1 | ## G12 Spacer spawn 2 | - Spacer allows you to insert Npcs into the `.ZEN` world. The game will, however, not spawn them in the world by default, which can be solved with this simple hooked spawn function: 3 | 4 | [![G1&2 Spacer spawn](https://img.youtube.com/vi/ytQtkdkwtv0/0.jpg)](https://www.youtube.com/watch?v=ytQtkdkwtv0) 5 | 6 | Init function: `G12_SpacerSpawn_Init();` 7 | 8 | -------------------------------------------------------------------------------- /Readme/G12_Sprint_Mode.md: -------------------------------------------------------------------------------- 1 | ## G12 Sprint mode 2 | 3 | ## :construction: :construction_worker: :construction: README UNDER CONSTRUCTION :construction: :construction_worker: :construction: 4 | 5 | - Enables simple sprint mode: 6 | - adds stamina bar on screen 7 | - depleting stamina bar will result in sprint being disabled together with 4 seconds cooldown period 8 | - jumping and fighting consumes significant amount of stamina 9 | - potions of speed disable stamina consumption with the potions still having the same effect 10 | - potions of speed have their own texture of stamina bar - you will see how much time is left from potion effect 11 | - this feature restores speed potion effect (timed overlay) on game load 12 | - it also fixes error where multiple potion effects (multiple timed overlays with different times) would remove overlay 13 | 14 | ```c++ 15 | /* 16 | * Sprint mode 17 | * - toggle 'afsp.keySprintModeToggleKey' key to enable/disable sprint mode 18 | * - 'afsp.keySprintModeToggleKey' can be defined either in Gothic.ini file section [KEYS] or mod.ini file section [KEYS]. (master is Gothic.ini) 19 | * - if 'afsp.keySprintModeToggleKey' is not defined then by default KEY_RSHIFT will be used for toggling 20 | * 21 | * - you need to maintain stamina levels for player by yourself - set PC_SprintModeStaminaMax to whatever value makes sense to you at the beginning of the game in your STARTUP function: 22 | * PC_SprintModeStaminaMax = 80; //Max stamina level 23 | * PC_SprintModeStamina = PC_SprintModeStaminaMax; //Current stamina level 24 | * PC_SprintModeConsumeStamina = TRUE; //Make sure this is set to true 25 | * 26 | * Requires LeGo flags: LeGo_HookEngine | LeGo_FrameFunctions | LeGo_Bars 27 | */ 28 | ``` 29 | 30 | [![G1&2 Sprint mode](https://img.youtube.com/vi/x8N7AS1mawo/0.jpg)](https://www.youtube.com/watch?v=x8N7AS1mawo) 31 | 32 | Init function: `G12_SprintMode_Init();` 33 | 1. Required LeGo flags: `LeGo_HookEngine | LeGo_FrameFunctions | LeGo_Bars`. 34 | 35 | [API file](../Standalone-Packages/G12-SprintMode/sprintMode_API.d) 36 | -------------------------------------------------------------------------------- /Readme/G12_Torch_HotKey.md: -------------------------------------------------------------------------------- 1 | ## G12 Torch HotKey 2 | 3 | ## :construction: :construction_worker: :construction: README UNDER CONSTRUCTION :construction: :construction_worker: :construction: 4 | 5 | - Simple feature for improving torches: 6 | - Adds hotkey 'keyTorchToggleKey' for putting on and removing torch (`T` key by default). 7 | - Fixes issue of disappearing torches in G2 NoTR. 8 | - Compatible with sprint mode. It reapplies overlay HUMANS_SPRINT.MDS when torch is removed & equipped. 9 | - Rekindles all vobs that were lit by player. List can be maintained in 'torchHotKey_API.d' file in array TORCH_ASC_MODELS []; 10 | - Ctrl + 'keyTorchToggleKey' will put torch to right hand - you can throw torch away in G1 with Union. 11 | 12 | ```c++ 13 | /* 14 | * Torch HotKey 15 | * - enables hotkey 'keyTorchToggleKey' equipping torches 16 | * - 'keyTorchToggleKey' can be defined either in Gothic.ini file section [KEYS] or mod.ini file section [KEYS] (master is Gothic.ini) 17 | * - if 'keyTorchToggleKey' is not defined then by default KEY_T will be used for toggling 18 | * - fixes issue of disappearing torches in G2A (by removing DontWriteIntoArchive flag from ItLsTorchBurning) 19 | * - number of torches in players inventory will be stored prior game saving 20 | * - when game is loaded script will compare number of torches in players inventory, if there is torch missing it will add it back 21 | * - if player was carrying torch, script will put it back to hand 22 | * - compatible with sprint mode (reapplies overlay HUMANS_SPRINT.MDS when torch is removed/equipped) 23 | * - will re-lit all mobs, that were previously lit by player (list can be maintained in file 'torchHotKey_API.d' in array TORCH_ASC_MODELS []; 24 | * - Ctrl + 'keyTorchToggleKey' will put torch to right hand (with Union you can throw torch away in G1) 25 | */ 26 | ``` 27 | 28 | Init function: `G12_TorchHotKey_Init ();` 29 | 1. Required LeGo flags: `LeGo_HookEngine | LeGo_Gamestate`. 30 | -------------------------------------------------------------------------------- /Readme/G12_Vob_Transport.md: -------------------------------------------------------------------------------- 1 | ## G12 Vob Transport 2 | 3 | ## :construction: :construction_worker: :construction: README UNDER CONSTRUCTION :construction: :construction_worker: :construction: 4 | 5 | - Allows player to move, clone, delete or buy objects such as Vobs, Mobs, Items etc. in game. Hands down one of the coolest features :smirk: 6 | 7 | [![G1&2 Vob Transport](https://img.youtube.com/vi/S4mboOKGvHo/0.jpg)](https://www.youtube.com/watch?v=S4mboOKGvHo) 8 | 9 | Init function: `G12_VobTransport_Init();` 10 | 1. Required LeGo flags: `LeGo_FrameFunctions | LeGo_View`. 11 | 12 | [API file](../Standalone-Packages/G12-VobTransport/vobTransport_API.d) 13 | -------------------------------------------------------------------------------- /Readme/G1_Better_Inventory_Controls.md: -------------------------------------------------------------------------------- 1 | ## G1 Better Inventory Controls 2 | - Enables better navigation in inventories: 3 | - Use home/end keys to navigate to first/last item. 4 | - Use page up/page down keys to scroll faster through inventory. 5 | 6 | - Players inventory: 7 | - Key `E` will put `1` piece to hand. 8 | - Key `Q` will drop `1` piece from inventory slot. 9 | - Key `Left Alt` will drop `all` pieces from inventory slot. 10 | 11 | - All other inventories, such as: **looting Npcs**, **looting chests** or while **trading**: 12 | - Key `Q` quick loots items from the inventory, ending interaction with that inventory. 13 | - Key `Left Ctrl` will move `1` piece to the opposite container. 14 | - Key `Spacebar` will move `10` pieces to the opposite container. 15 | - Key `Left Alt` will move `all` item pieces to the opposite container. 16 | 17 | Init function: `G1_BetterInventoryControls_Init ();` 18 | -------------------------------------------------------------------------------- /Readme/G1_Enhanced_PickLocking.md: -------------------------------------------------------------------------------- 1 | ## G1 Enhanced Pick Locking 2 | - Package emulates G2 NoTR behavior for PickLocking: 3 | 4 | - If `oCMobLockable` requires special key that is not in hero's inventory, he cannot interact with locked doors or chests. This interaction won't break any picklocks. 5 | - If players `NPC_TALENT_PICKLOCK` level > 0 BUT does not have pickLocks, he will not be able to interact with locked doors/chests. 6 | - Hero will say whether he needs to learn skill, get picklocks, or specific key. 7 | - The pickLock failrate (breaking) is based on players' dexterity. Higher the stat, lower the chance to break picklocks. 8 | - Customizable minimal failrate. 9 | - Customizable option to prevent player from picklocking if players talent `NPC_TALENT_PICKLOCK` level is 0. 10 | - If player has key that can open doors/chests, he can interact with the object without talent `NPC_TALENT_PICKLOCK`. 11 | - Customizable option that allows player to open any lock with `ItKe_MasterKey` 12 | 13 | Init function: `G1_EnhancedPickLocking_Init();` 14 | 15 | [API file](../Standalone-Packages/G1-EnhancedPickLocking/enhancedPickLocking_API.d) 16 | -------------------------------------------------------------------------------- /Readme/G1_Enhanced_PickPocketing.md: -------------------------------------------------------------------------------- 1 | ## G1 Enhanced Pickpocketing 2 | - Improves pickpocketing: 3 | - patches additional body-states in which player can pickpocket Npcs. (vanilla `BS_STAND, BS_ITEMINTERACT` + patched `BS_SIT, BS_LIE, BS_MOBINTERACT, BS_MOBINTERACT_INTERRUPT` where Npc is interacting with mobs) 4 | - adds API function for failed pickpocketing attempt if Npc is too far `void EnhancedPickPocketing_TooFar()` 5 | - fixes behaviour for failed pickpocketing attempts Npc is aware of. In vanilla only `T_DONTKNOW` animation would be played and nothing would happen. We call `oCNpc_StopTheft` which will send perception `PERC_CATCHTHIEF` to victim. 6 | - we allow inventory opening even when Npc does not have any items. Vanilla would only play `T_DONTKNOW` ani. 7 | - we allow player to insert items into Npc inventory. Vanilla would allow only stealing. 8 | 9 | - we are using 2 API functions to determine whether item can be 10 | - stolen from Npc `C_PP_CanBeStolenFromInventory(var C_NPC npc, var int itemPtr)` 11 | - put into Npc inventory `C_PP_CanBePutToInventory(var C_NPC npc, var int itemPtr)` 12 | - if these 2 functions return `false` - if player fails to steal/put items into inventory, they will be caught. 13 | 14 | - customizable option to allow player stealing item even when they will get caught via variable `EnhancedPickpocketing_StealItemAnyway` 15 | - if this option is enabled feature also calls API function `EnhancedPickPocketing_DoStealItemAnyway(var C_NPC npc, var int itemPtr)` when player gets caught 16 | 17 | Init function: `G1_EnhancedPickPocketing_Init();` 18 | 19 | [API file](../Standalone-Packages/G1-EnhancedPickPocketing/enhancedPickPocketing_API.d) 20 | -------------------------------------------------------------------------------- /Readme/G1_Enhanced_Trading.md: -------------------------------------------------------------------------------- 1 | ## G1 Enhanced Trading 2 | - Improves G1 trading: 3 | - ore is exchanged automatically. 4 | - you can define item-specific & npc-specific rules for selling & buying multiplier. 5 | - you can prevent selling items to Npc. 6 | 7 | [![G1 Enhanced trading](https://img.youtube.com/vi/UYOnmEBdUC0/0.jpg)](https://www.youtube.com/watch?v=UYOnmEBdUC0) 8 | 9 | Init function: `G1_EnhancedTrading_Init();` 10 | 11 | [API file](../Standalone-Packages/G1-EnhancedTrading/enhancedTrading_API.d) 12 | -------------------------------------------------------------------------------- /Readme/G1_Ever_Looming_Barrier.md: -------------------------------------------------------------------------------- 1 | ## G1 Ever looming barrier 2 | - Hooks Barrier render function and prevents Barrier from disappearing completely. \#immersion 3 | 4 | [![G1 Ever looming barrier](https://img.youtube.com/vi/ZEyFpN-f0Y8/0.jpg)](https://www.youtube.com/watch?v=ZEyFpN-f0Y8) 5 | 6 | Init function: `G1_BarrierEverlooming_Init ();` 7 | 8 | Additionaly you can interact with Barrier using these functions: 9 | ```c++ 10 | //use fadeState -1 to start from current fade state 11 | //max fadeState value is 120 12 | 13 | void oCBarrier_Hide(); //hides Barrier immediately. Barrier will reappear after a while. (vanilla cycle) 14 | void oCBarrier_FadeIn(var int fadeState); //fades in Barrier from fadeState 15 | void oCBarrier_FadeOut(var int fadeState); //fades out Barrier from fadeState 16 | ``` -------------------------------------------------------------------------------- /Readme/G1_Patch_FireDamage_Multiplication.md: -------------------------------------------------------------------------------- 1 | ## G1 Patch firedamage multiplication 2 | - this patch fixes fire damage multiplication exploit: 3 | - function `oCNpc::OnDamage_Hit` checks for weapon mode 4 | - if attackers **current** weapon mode is `3`, `4`, `5`, `6` (`NPC_WEAPON_1HS`, `NPC_WEAPON_2HS`, `NPC_WEAPON_BOW`, `NPC_WEAPON_CBOW`) 5 | - if attackers talent skill for specified weapon > 0, then damage multiplier is multiplied by `DAM_CRITICAL_MULTIPLIER` 6 | - problem occurs when damage was caused by fire spells - which will create event `EV_DAMAGE_PER_FRAME` with reference to attacker 7 | - as soon as attacker draws melee weapon for example, this burning event will multiply damage by multiplier `DAM_CRITICAL_MULTIPLIER` causing exponential increased of dealt damage 8 | 9 | Init function: `G1_PatchFireDamageMultiplication();` 10 | -------------------------------------------------------------------------------- /Readme/G1_Player_Map.md: -------------------------------------------------------------------------------- 1 | ## G1 Player Map 2 | - Improves Map handling on key `M`: 3 | - player's animation will not be reset if he does not have map. This removes exploit in which pressing `M` repeatedly would allow you to jump in air. 4 | - with API function `PlayerMap_GetMapInstance` you can define which map will be opened (in each world you can open different default map) 5 | - if `PlayerMap_GetMapInstance` does not specify priority - then we reopen last used map. 6 | - by default we use vanilla logic - we try to open: `ITWRWORLDMAP_ORC`, then `ITWRWORLDMAP` 7 | - if none of aboce are in the inventory, first available map in inventory is selected. 8 | 9 | Init function: `G1_PlayerMap_Init();` 10 | 11 | [API file](../Standalone-Packages/G1-PlayerMap/playerMap_API.d) 12 | -------------------------------------------------------------------------------- /Readme/G1_Weapon_Stacking.md: -------------------------------------------------------------------------------- 1 | ## G1 Weapon stacking / splitting 2 | - Emulates G2 NoTR inventory behavior for weapons in G1: Stackable weapons `ITEM_MULTI` will be split into their own inventory slot when equipped. 3 | - You should add to all your weapons `ITEM_MULTI` flag. Vanilla G1 has inventory limitation, if you have too many items in the inventory in separate slots they will cause Gothic to crash on load/save of the game. 4 | 5 | [![G1 Weapon stacking / splitting](https://img.youtube.com/vi/V3EHcfDa3GY/0.jpg)](https://www.youtube.com/watch?v=V3EHcfDa3GY) 6 | 7 | Init function: `G1_WeaponStacking_Init();` 8 | -------------------------------------------------------------------------------- /Resources/Scripts/system/PFX/pfx_MFX_FIRESPELL_HUMANBURN_TINY.d: -------------------------------------------------------------------------------- 1 | //copied from MFX_FIRESPELL_HUMANBURN 2 | instance MFX_FIRESPELL_HUMANBURN_TINY (C_PARTICLEFX) 3 | { 4 | ppsvalue = 4.000000000; 5 | ppsscalekeys_s = "1 1"; //number of effect loops? 6 | ppsissmooth = 1; 7 | ppsfps = 2.000000000; 8 | shptype_s = "BOX"; 9 | shpfor_s = "object"; 10 | shpoffsetvec_s = "0 0 0"; 11 | shpdistribtype_s = "RAND"; 12 | shpdim_s = "30 5 5"; 13 | shpscalekeys_s = "1"; 14 | shpscaleislooping = 1; 15 | shpscaleissmooth = 1; 16 | shpscalefps = 2.000000000; 17 | dirmode_s = "DIR"; 18 | dirmodetargetfor_s = "OBJECT"; 19 | dirmodetargetpos_s = "0 0 400"; 20 | dirangleelev = 90.000000000; 21 | velavg = 0.100000001; 22 | lsppartavg = 1000.000000000; 23 | lsppartvar = 50.000000000; 24 | flygravity_s = "0 0.0002 0"; 25 | visname_s = "HUMANBURN.TGA"; 26 | visorientation_s = "VELO"; 27 | vistexisquadpoly = 1; 28 | vistexanifps = 5.000000000; 29 | vistexaniislooping = 1; 30 | vistexcolorstart_s = "255 255 255"; 31 | vistexcolorend_s = "255 200 0"; 32 | vissizestart_s = "5 5"; 33 | vissizeendscale = 30.000000000; 34 | visalphafunc_s = "ADD"; 35 | visalphastart = 255.000000000; 36 | }; 37 | -------------------------------------------------------------------------------- /Resources/Scripts/system/VISUALFX/visualFX_VOB_BURN_LEFTFOOT.d: -------------------------------------------------------------------------------- 1 | INSTANCE VOB_BURN_LEFTFOOT (CFx_Base_Proto) 2 | { 3 | emTrjOriginNode = "BIP01 L FOOT"; 4 | visname_S = "MFX_FIRESPELL_HUMANBURN_TINY"; 5 | //emFXCreate_S = "VOB_BURN_CHILD6"; 6 | emFXCreatedOwnTrj = 1; 7 | emtrjmode_s = "FIXED"; 8 | emtrjdynupdatedelay = 0.; 9 | //emAdjustShpToOrigin = 1; 10 | }; 11 | -------------------------------------------------------------------------------- /Resources/Scripts/system/VISUALFX/visualFX_VOB_BURN_RIGHTFOOT.d: -------------------------------------------------------------------------------- 1 | INSTANCE VOB_BURN_RIGHTFOOT (CFx_Base_Proto) 2 | { 3 | emTrjOriginNode = "BIP01 R FOOT"; 4 | visname_S = "MFX_FIRESPELL_HUMANBURN_TINY"; 5 | //emFXCreate_S = "spellFX_Firespell_HUMANSMOKE"; 6 | emFXCreatedOwnTrj = 1; 7 | emtrjmode_s = "FIXED"; 8 | emtrjdynupdatedelay = 0.; 9 | //emAdjustShpToOrigin = 1; 10 | }; -------------------------------------------------------------------------------- /Resources/Textures/BAR_HEALTH_PREVIEW-C.TEX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Resources/Textures/BAR_HEALTH_PREVIEW-C.TEX -------------------------------------------------------------------------------- /Resources/Textures/BAR_MANA_PREVIEW-C.TEX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Resources/Textures/BAR_MANA_PREVIEW-C.TEX -------------------------------------------------------------------------------- /Resources/Textures/BAR_SPRINTMODE_TIMEDOVERLAY-C.TEX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Resources/Textures/BAR_SPRINTMODE_TIMEDOVERLAY-C.TEX -------------------------------------------------------------------------------- /ScriptBin/removeoCVobSafe.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: szapp (mud-freak) 3 | * I was not able to find original post though. 4 | */ 5 | func void RemoveoCVobSafe (var int vobPtr, var int purgeChildren) { 6 | if (!vobPtr) { return; }; 7 | 8 | var int worldPtr; worldPtr = _@ (MEM_World); 9 | 10 | if (purgeChildren) { 11 | var int vobTreePtr; vobTreePtr = MEM_ReadInt (vobPtr+36); 12 | 13 | //0x005F55F0 public: virtual int __thiscall zCWorld::DisposeVobs(class zCTree *) 14 | const int zCWorld__DisposeVobs_G1 = 6247920; 15 | 16 | //0x00623960 public: virtual int __thiscall zCWorld::DisposeVobs(class zCTree *) 17 | const int zCWorld__DisposeVobs_G2 = 6437216; 18 | 19 | const int call = 0; 20 | if (CALL_Begin(call)) { 21 | CALL_PtrParam (_@(vobTreePtr)); 22 | CALL__thiscall (_@(worldPtr), MEMINT_SwitchG1G2 (zCWorld__DisposeVobs_G1, zCWorld__DisposeVobs_G2)); 23 | call = CALL_End(); 24 | }; 25 | return; 26 | }; 27 | 28 | //0x006D6EF0 public: virtual void __thiscall oCWorld::RemoveVob(class zCVob *) 29 | const int oCWorld__RemoveVob_G1 = 7171824; 30 | 31 | //0x007800C0 public: virtual void __thiscall oCWorld::RemoveVob(class zCVob *) 32 | const int oCWorld__RemoveVob_G2 = 7864512; 33 | 34 | const int call2 = 0; 35 | if (CALL_Begin(call2)) { 36 | CALL_PtrParam (_@(vobPtr)); 37 | CALL__thiscall (_@(worldPtr), MEMINT_SwitchG1G2 (oCWorld__RemoveVob_G1, oCWorld__RemoveVob_G2)); 38 | call2 = CALL_End(); 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /Standalone-Packages/BetterInventory.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Standalone-Packages/BetterInventory.d -------------------------------------------------------------------------------- /Standalone-Packages/G1-EnhancedPickPocketing/enhancedPickPocketing_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Enhanced Pickpocketing 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (translate to your own language, define rules for pickpocketing) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | //If this constant is set to true - then even if theft attempt has failed, hero will steal item (and will be caught) 11 | const int ENHANCEDPICKPOCKETING_STEALITEMANYWAY = 1; 12 | 13 | //API function 14 | //Called when victim is out of pickpocketing range 15 | func void EnhancedPickPocketing_TooFar () { 16 | PrintScreen("You're too far away!", -1, 45, ENHANCEDTRADING_FONT, _TIME_MESSAGE_LOGENTRY); 17 | }; 18 | 19 | //API function 20 | //Called when player steals item and is caught when stealing 21 | func void EnhancedPickPocketing_DoStealItemAnyway(var C_NPC npc, var int itemPtr) { 22 | //Additional action when player steals item and is caught 23 | }; 24 | 25 | /* 26 | * Example 27 | * Here we will not allow player to steal from/put into inventory ItMiNugget 28 | */ 29 | //API function 30 | //This is where you can define Npc&Item-specific rules for pickpocketing - putting items to victim's inventory 31 | func int C_PP_CanBePutToInventory(var C_NPC npc, var int itemPtr) { 32 | var oCItem itm; itm = _^(itemPtr); 33 | 34 | //Do not allow to insert ItMiNuggets 35 | if (Hlp_GetInstanceID(itm) == ItMiNugget) { 36 | return FALSE; 37 | }; 38 | 39 | return TRUE; 40 | }; 41 | 42 | //API function 43 | //This is where you can define Npc&Item-specific rules for pickpocketing - taking items from victim's inventory 44 | func int C_PP_CanBeStolenFromInventory(var C_NPC npc, var int itemPtr) { 45 | var oCItem itm; itm = _^(itemPtr); 46 | 47 | //Do not allow to steal ItMiNuggets 48 | if (Hlp_GetInstanceID(itm) == ItMiNugget) { 49 | return FALSE; 50 | }; 51 | 52 | return TRUE; 53 | }; 54 | -------------------------------------------------------------------------------- /Standalone-Packages/G1-EverloomingBarrier/barrier.d: -------------------------------------------------------------------------------- 1 | var int Barrier_FadeStateMin; //Min alpha value (cannot be 0! otherwise Barrier will disappear) 2 | 3 | /* 4 | * Function will start Barriers fade in effect 5 | * fadeState - fadeState in which Fade In effect should start. Use -1 to start from current fadeState. Max fadeState value == 120 6 | */ 7 | func void oCBarrier_FadeIn (var int fadeState){ 8 | if (!MEM_SkyController.barrier) { return; }; 9 | var oCBarrier b; b = _^ (MEM_SkyController.barrier); 10 | 11 | //Start fade in 12 | MEM_SkyController.bFadeInOut = TRUE; 13 | b.fadeIn = TRUE; 14 | b.fadeOut = FALSE; 15 | 16 | if (fadeState >= 0) { 17 | b.fadeState = fadeState; 18 | }; 19 | }; 20 | 21 | /* 22 | * Function will start Barriers fade out effect 23 | * fadeState - fadeState in which Fade In effect should start. Use -1 to start from current fadeState. Max fadeState value == 120 24 | */ 25 | func void oCBarrier_FadeOut (var int fadeState){ 26 | if (!MEM_SkyController.barrier) { return; }; 27 | var oCBarrier b; b = _^ (MEM_SkyController.barrier); 28 | 29 | //Start fade out 30 | MEM_SkyController.bFadeInOut = TRUE; 31 | b.fadeIn = FALSE; 32 | b.fadeOut = TRUE; 33 | 34 | if (fadeState >= 0) { 35 | b.fadeState = fadeState; 36 | }; 37 | }; 38 | 39 | /* 40 | * Function will hide Barrier. Barrier will re-appear after a while. 41 | */ 42 | func void oCBarrier_Hide (){ 43 | MEM_SkyController.bFadeInOut = FALSE; 44 | }; 45 | 46 | func void _hook_oCBarrier_Render (){ 47 | var oCBarrier b; b = _^ (ECX); 48 | 49 | if (b.fadeOut) { 50 | //If Barrier.fadeState == 0 then Barrier disappears completely 51 | //We don't want that, set our minimal acceptable value Barrier_FadeStateMin = 1 52 | if (Barrier_FadeStateMin == 0) { 53 | Barrier_FadeStateMin = 1; 54 | }; 55 | 56 | //If we reached our minimal acceptable fade value - stop fading out 57 | if (b.fadeState <= Barrier_FadeStateMin) { 58 | b.fadeState = Barrier_FadeStateMin; 59 | b.fadeOut = FALSE; 60 | }; 61 | }; 62 | }; 63 | 64 | func void G1_BarrierEverlooming_Init (){ 65 | const int once = 0; 66 | 67 | if (!once){ 68 | Barrier_FadeStateMin = Hlp_Random (15) + 1; //Random minimal fadeState 1 - 15 69 | //Hook makes sure that Barrier will never disappear completely 70 | 71 | //0x006307C0 public: int __thiscall oCBarrier::Render(struct zTRenderContext &,int,int) 72 | const int oCBarrier__Render_G1 = 6490048; 73 | 74 | HookEngine(oCBarrier__Render_G1, 6, "_hook_oCBarrier_Render"); 75 | once = 1; 76 | }; 77 | }; -------------------------------------------------------------------------------- /Standalone-Packages/G1-PlayerMap/playerMap.d: -------------------------------------------------------------------------------- 1 | var int oCDocumentManager_LastMapInstance; 2 | 3 | //Remember which map was opened last time 4 | //Called on Doc_CreateMap 5 | func void _hook_oCDocumentManager_CreateMap () { 6 | //item - last used 7 | if (Hlp_IsValidItem (item)) { 8 | //One more check - is this MAP ? 9 | if (item.mainflag & ITEM_KAT_DOCS) && (Hlp_StrCmp (item.scemeName, "MAP")) { 10 | oCDocumentManager_LastMapInstance = Hlp_GetInstanceID (item); 11 | }; 12 | }; 13 | }; 14 | 15 | func void _hook_oCNPC_OpenScreen_Map () { 16 | if (!Hlp_Is_oCNpc (ECX)) { return; }; 17 | 18 | var oCNPC slf; slf = _^ (ECX); 19 | 20 | if (NPC_IsPlayer (slf)) { 21 | //Is there any specific map that player should open ? 22 | var int mapInstanceName; mapInstanceName = -1; 23 | 24 | const int symbID = 0; 25 | 26 | if (!symbID) { 27 | symbID = MEM_FindParserSymbol ("PLAYERMAP_GETMAPINSTANCE"); 28 | }; 29 | 30 | if (symbID != -1) { 31 | MEM_CallByID (symbID); 32 | mapInstanceName = MEM_PopIntResult (); 33 | }; 34 | 35 | if (mapInstanceName != -1) { 36 | //Get item 37 | if (NPC_GetInvItem (slf, mapInstanceName)) { 38 | //t_MAP_Stand_2_S0 39 | AI_UseItemToState (slf, item, -1); 40 | AI_UseItemToState (slf, item, 0); 41 | return; 42 | }; 43 | }; 44 | 45 | //Reopen last map 46 | //Get item 47 | if (NPC_GetInvItem (slf, oCDocumentManager_LastMapInstance)) { 48 | //t_MAP_Stand_2_S0 49 | AI_UseItemToState (slf, item, -1); 50 | AI_UseItemToState (slf, item, 0); 51 | return; 52 | }; 53 | 54 | //Original behavior for ITWRWORLDMAP_ORC & ITWRWORLDMAP 55 | //Get map from players inventory 56 | //1. prio ITWRWORLDMAP_ORC 57 | if (NPC_HasItemInstanceName (slf, "ITWRWORLDMAP_ORC")) { 58 | //t_MAP_Stand_2_S0 59 | AI_UseItemToState (slf, item, -1); 60 | AI_UseItemToState (slf, item, 0); 61 | return; 62 | }; 63 | 64 | //2. prio ITWRWORLDMAP 65 | if (NPC_HasItemInstanceName (slf, "ITWRWORLDMAP")) { 66 | //t_MAP_Stand_2_S0 67 | AI_UseItemToState (slf, item, -1); 68 | AI_UseItemToState (slf, item, 0); 69 | return; 70 | }; 71 | 72 | //3. ... get first available map from inventory 73 | var int itmSlot; itmSlot = 0; 74 | var int count; 75 | 76 | count = NPC_GetInvItemBySlot (slf, INV_DOC, itmSlot); 77 | 78 | while (count); 79 | if (Hlp_StrCmp (item.scemeName, "MAP")) { 80 | //t_MAP_Stand_2_S0 81 | AI_UseItemToState (slf, item, -1); 82 | AI_UseItemToState (slf, item, 0); 83 | break; 84 | }; 85 | 86 | itmSlot += 1; 87 | count = NPC_GetInvItemBySlot (slf, INV_DOC, itmSlot); 88 | end; 89 | }; 90 | }; 91 | 92 | func void G1_PlayerMap_Init () { 93 | const int once = 0; 94 | if (!once) { 95 | //Add hook which will recognize latest map 96 | HookEngine (oCDocumentManager__CreateMap, 6, "_hook_oCDocumentManager_CreateMap"); 97 | 98 | //Replace original function for opening map 99 | ReplaceEngineFunc (oCNPC__OpenScreen_Map, 0, "_hook_oCNPC_OpenScreen_Map"); 100 | 101 | once = 1; 102 | }; 103 | }; 104 | -------------------------------------------------------------------------------- /Standalone-Packages/G1-PlayerMap/playerMap_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Enhanced Trading system 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (define priority of maps to be displayed) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | func int PlayerMap_GetMapInstance () { 11 | return -1; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /Standalone-Packages/G1-WeaponStacking/weapon_stacking.d: -------------------------------------------------------------------------------- 1 | /* 2 | * 2021-01-07 Weapon Stacking v0.01 for Gothic 1 3 | * 4 | * Authors: Auronen & Fawkes 5 | * This little package allows you to use ITEM_MULTI flag with melee weapons in Gothic 1. 6 | * Hooked functions oCNpc::EquipWeapon & oCNPC::UnequipItem will emulate same behaviour as you can see in G2A. If you have 10 weapons in 1 item slot, when equipped 1 weapon will move to it's own slot. 7 | * You can then sell 9 unequipped items without additional hassle of well ... unequipping :) 8 | */ 9 | 10 | //Backwards compatibility (bruh) 11 | func void G1_WeaponStacking_Init() { 12 | //Item-splitting is doing same thing - but it works for weapons, amulets, rings & potentially belts 13 | G1_ItemSplitting_Init(); 14 | }; 15 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-BetterBars/betterBars_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Better bars 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | const string BETTERBARS_FONT = "FONT_OLD_10_WHITE.TGA"; 11 | 12 | const string TEXTURE_BARPREVIEW_HEALTBAR = "BAR_HEALTH_PREVIEW.TGA"; 13 | const string TEXTURE_BARPREVIEW_MANABAR = "BAR_MANA_PREVIEW.TGA"; 14 | 15 | const int HEALTHBAR_DISPLAYWHENHURT_PERCENTAGE = 50; 16 | 17 | const int HEALTHBAR_DISPLAYMETHOD = BarDisplay_Standard; 18 | const int HEALTHBAR_PREVIEWEFFECT = BarPreviewEffect_FadeInOut; 19 | 20 | const int HEALTHBAR_DISPLAYVALUES = 1; 21 | const int HEALTHBAR_VIEW_ALPHAFUNC = 2; //ALPHA_FUNC_BLEND 22 | const string HEALTHBAR_DISPLAYVALUES_COLOR = "FFFFFF"; 23 | 24 | const int HEALTHBAR_PPOSX = -1; 25 | const int HEALTHBAR_PPOSY = -1; 26 | 27 | const int HEALTHBAR_VPOSX = -1; 28 | const int HEALTHBAR_VPOSY = -1; 29 | 30 | const int HEALTHBAR_DISPLAYVALUEOFFSETX = 0; 31 | const int HEALTHBAR_DISPLAYVALUEOFFSETY = -1; 32 | 33 | const int MANABAR_DISPLAYMETHOD = BarDisplay_Standard; 34 | const int MANABAR_PREVIEWEFFECT = BarPreviewEffect_FadeInOut; 35 | 36 | const int MANABAR_DISPLAYVALUES = 1; 37 | const int MANABAR_VIEW_ALPHAFUNC = 2; //ALPHA_FUNC_BLEND 38 | const string MANABAR_DISPLAYVALUES_COLOR = "FFFFFF"; 39 | 40 | const int MANABAR_PPOSX = -1; 41 | const int MANABAR_PPOSY = -1; 42 | 43 | const int MANABAR_VPOSX = -1; 44 | const int MANABAR_VPOSY = -1; 45 | 46 | const int MANABAR_DISPLAYVALUEOFFSETX = 0; 47 | const int MANABAR_DISPLAYVALUEOFFSETY = -1; 48 | 49 | const int SWIMBAR_DISPLAYVALUES = 1; 50 | const int SWIMBAR_VIEW_ALPHAFUNC = 2; //ALPHA_FUNC_BLEND 51 | const string SWIMBAR_DISPLAYVALUES_COLOR = "FFFFFF"; 52 | 53 | const int SWIMBAR_PPOSX = -1; 54 | const int SWIMBAR_PPOSY = -1; 55 | 56 | const int SWIMBAR_VPOSX = -1; 57 | const int SWIMBAR_VPOSY = -1; 58 | 59 | const int SWIMBAR_DISPLAYVALUEOFFSETX = 0; 60 | const int SWIMBAR_DISPLAYVALUEOFFSETY = -1; 61 | 62 | const int FOCUSBAR_DISPLAYVALUES = 1; 63 | const int FOCUSBAR_VIEW_ALPHAFUNC = 2; //ALPHA_FUNC_BLEND 64 | const string FOCUSBAR_DISPLAYVALUES_COLOR = "FFFFFF"; 65 | 66 | const int FOCUSBAR_PPOSX = -1; 67 | const int FOCUSBAR_PPOSY = -1; 68 | 69 | const int FOCUSBAR_VPOSX = -1; 70 | const int FOCUSBAR_VPOSY = -1; 71 | 72 | const int FOCUSBAR_DISPLAYVALUEOFFSETX = 0; 73 | const int FOCUSBAR_DISPLAYVALUEOFFSETY = +1; 74 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/compileTex.d: -------------------------------------------------------------------------------- 1 | /* 2 | * marvin command: compile tex filename.tga 3 | */ 4 | func string CC_CompileTex (var string param) { 5 | param = STR_TrimChar(param, CHR_SPACE); 6 | 7 | var string fileName; 8 | 9 | var int count; count = STR_SplitCount(param, STR_SPACE); 10 | if (count > 0) { 11 | fileName = STR_Split(param, STR_SPACE, 0); 12 | } else { 13 | return "You have to specify texture name."; 14 | }; 15 | 16 | var int retVal; 17 | 18 | //0x005CAA20 private: static int __cdecl zCTexture::ConvertTexture(class zSTRING const &) 19 | const int zCTexture__ConvertTexture_G1 = 6072864; 20 | 21 | //0x005F59F0 private: static int __cdecl zCTexture::ConvertTexture(class zSTRING const &) 22 | const int zCTexture__ConvertTexture_G2 = 6248944; 23 | 24 | CALL_PutRetValTo(_@(retVal)); 25 | CALL_zStringPtrParam(fileName); 26 | CALL__cdecl(MEMINT_SwitchG1G2(zCTexture__ConvertTexture_G1, zCTexture__ConvertTexture_G2)); 27 | 28 | if (!retVal) { 29 | return "Not successfull - please check if file exists."; 30 | }; 31 | 32 | return "Success!"; 33 | }; 34 | 35 | func void CC_CompileTex_Init () { 36 | CC_Register (CC_CompileTex, "compile tex", "compiles texture."); 37 | }; 38 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/create.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Create 3 | * - will 'create' specified amount of items either in inventory of NPC in players focus or in players inventory if there is no NPC in focus 4 | */ 5 | 6 | func string CC_Create (var string param) { 7 | param = STR_TrimChar (param, CHR_SPACE); 8 | param = STR_Upper (param); 9 | 10 | var string msg; 11 | 12 | var oCNpc her; her = Hlp_GetNpc (hero); 13 | var oCNpc npc; npc = Hlp_GetNpc (hero); 14 | 15 | if (Hlp_Is_oCNpc (her.focus_vob)) { 16 | npc = _^ (her.focus_vob); 17 | }; 18 | 19 | var string instanceName; instanceName = STR_EMPTY; 20 | var string amount; amount = "1"; 21 | 22 | var int count; count = STR_SplitCount (param, STR_SPACE); 23 | if (count > 0) { 24 | instanceName = STR_Split (param, STR_SPACE, 0); 25 | instanceName = STR_TrimChar (instanceName, CHR_SPACE); 26 | }; 27 | 28 | if (count > 1) { 29 | amount = STR_Split (param, STR_SPACE, 1); 30 | amount = STR_TrimChar (amount, CHR_SPACE); 31 | 32 | if (!STR_IsNumeric (amount)) { 33 | amount = "1"; 34 | }; 35 | }; 36 | 37 | var int qty; qty = STR_ToInt (amount); 38 | if (qty < 1) { qty = 1; }; 39 | 40 | if (Hlp_StrCmp(instanceName, "USEWITHITEM")) { 41 | if (!Hlp_Is_oCMobInter(her.focus_vob)) { 42 | return "No oCMobInter object in focus."; 43 | }; 44 | 45 | var oCMobInter mobInter; mobInter = _^(her.focus_vob); 46 | 47 | var int itemInstanceID; 48 | 49 | if (!STR_Len(mobInter.useWithItem)) { 50 | return "UseWithItem is blank."; 51 | }; 52 | 53 | itemInstanceID = MEM_GetSymbolIndex(mobInter.useWithItem); 54 | 55 | if (itemInstanceID == -1) { 56 | msg = ConcatStrings("No valid item instance found for useWithItem: '", mobInter.useWithItem); 57 | msg = ConcatStrings(msg, "'"); 58 | return msg; 59 | }; 60 | 61 | CreateInvItems(hero, itemInstanceID, qty); 62 | 63 | msg = mobInter.useWithItem; 64 | 65 | msg = ConcatStrings ("x ", msg); 66 | msg = ConcatStrings (IntToString (qty), msg); 67 | msg = ConcatStrings (msg, " created in my inventory."); 68 | 69 | return msg; 70 | }; 71 | 72 | msg = instanceName; 73 | 74 | var int symbID; symbID = MEM_GetSymbolIndex (instanceName); 75 | if (symbID > 0) && (symbID < currSymbolTableLength) { 76 | CreateInvItems (npc, symbID, qty); 77 | 78 | msg = ConcatStrings ("x ", msg); 79 | msg = ConcatStrings (IntToString (qty), msg); 80 | msg = ConcatStrings (msg, " created in "); 81 | if (Npc_IsPlayer (npc)) { 82 | msg = ConcatStrings (msg, "my inventory."); 83 | } else { 84 | msg = ConcatStrings (msg, npc.Name); 85 | msg = ConcatStrings (msg, "'s inventory."); 86 | }; 87 | } else { 88 | msg = ConcatStrings ("Item ", msg); 89 | msg = ConcatStrings (msg, " does not exist."); 90 | }; 91 | 92 | return msg; 93 | }; 94 | 95 | func void CC_Create_Init () { 96 | CC_Register (CC_Create, "create", "Create items for player/Npc in focus."); 97 | CC_RegisterMulti (CC_Create, "create useWithItem", "Create items required for interaction with oCMobInter in focus."); 98 | }; 99 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/despawn.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Despawn 3 | * - will 'despawn' npc in focus 4 | */ 5 | 6 | func string CC_Despawn (var string param) { 7 | var oCNpc her; her = Hlp_GetNpc (hero); 8 | var int slfPtr; slfPtr = her.focus_vob; 9 | 10 | if (!Hlp_Is_oCNpc(slfPtr)) { 11 | return "Focus_vob is not an NPC."; 12 | }; 13 | 14 | var oCNpc slf; slf = _^(slfPtr); 15 | var string s; s = ConcatStrings(GetSymbolName(Hlp_GetInstanceID(slf)), " despawned."); 16 | 17 | Wld_DespawnNpc(slf); 18 | 19 | return s; 20 | }; 21 | 22 | func void CC_Despawn_Init () { 23 | CC_Register(CC_Despawn, "despawn", "Will despawn Npc in focus."); 24 | }; 25 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/exportImport.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Export/Import vob 3 | * - allows you to export/import vobs in focus to/from EXPORTED_VOBS.ZEN file 4 | */ 5 | 6 | func string CC_ExportFocusVob (var string param) { 7 | var oCNpc her; her = Hlp_GetNpc (hero); 8 | if (!her.focus_vob) { return "There is nothing in the focus."; }; 9 | 10 | //Remove horcruxes 11 | if (Hlp_Is_oCItem(her.focus_vob)) { 12 | zCVob_SetAI(her.focus_vob, 0); 13 | }; 14 | 15 | var string filePath; 16 | var string fileName; fileName = "EXPORTED_VOBS.ZEN"; 17 | 18 | //_work\Data\Worlds\ 19 | filePath = zCOption_GetDirString(MEMINT_SwitchG1G2(DIR_G1_WORLD, DIR_G2_WORLD)); 20 | filePath = ConcatStrings(filePath, fileName); 21 | 22 | Wld_ExportVobPtr(her.focus_vob, filePath, 1); 23 | return "Done."; 24 | }; 25 | 26 | func string CC_ImportFocusVob (var string param) { 27 | var string filePath; 28 | var string fileName; fileName = "EXPORTED_VOBS.ZEN"; 29 | 30 | //_work\Data\Worlds\ 31 | filePath = zCOption_GetDirString(MEMINT_SwitchG1G2(DIR_G1_WORLD, DIR_G2_WORLD)); 32 | filePath = ConcatStrings(filePath, fileName); 33 | 34 | var int arrPtr; arrPtr = Wld_ImportVobPtr(filePath); //function creates an array 35 | if (!arrPtr) { return "Nothing was imported."; }; 36 | if (arrPtr) { MEM_ArrayFree(arrPtr); arrPtr = 0; }; 37 | return "Done."; 38 | }; 39 | 40 | func void CC_Focus_ExportImport_Init () { 41 | CC_Register(CC_ExportFocusVob, "focus export", "Will export object in focus to _work\Data\Worlds\EXPORTED_VOBS.ZEN file."); 42 | CC_Register(CC_ImportFocusVob, "focus import", "Will import _work\Data\Worlds\EXPORTED_VOBS.ZEN file to the world."); 43 | }; 44 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/focusPlay.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Focus Play Ani 3 | * - will play animation on focused NPC 4 | */ 5 | func string CC_FocusPlayAni (var string param) { 6 | param = STR_TrimChar (param, CHR_SPACE); 7 | param = STR_Upper (param); 8 | 9 | var oCNpc npc; 10 | var oCNpc her; her = Hlp_GetNpc (hero); 11 | 12 | if (!Hlp_Is_oCNpc (her.focus_vob)) { 13 | return "No NPC in the focus."; 14 | }; 15 | 16 | npc = _^ (her.focus_vob); 17 | 18 | var string aniName; aniName = STR_EMPTY; 19 | 20 | var int count; count = STR_SplitCount (param, STR_SPACE); 21 | if (count > 0) { 22 | aniName = STR_Split (param, STR_SPACE, 0); 23 | aniName = STR_TrimChar (aniName, CHR_SPACE); 24 | }; 25 | 26 | if (!STR_Len (aniName)) { 27 | return "No animation specified."; 28 | }; 29 | 30 | var int aniFrame; aniFrame = FLOATNULL; 31 | var string aniFrameS; aniFrameS = STR_EMPTY; 32 | 33 | if (count > 1) { 34 | aniFrameS = STR_Split (param, STR_SPACE, 1); 35 | aniFrameS = STR_TrimChar (aniFrameS, CHR_SPACE); 36 | aniFrame = STR_ToFloat (aniFrameS); 37 | }; 38 | 39 | if (!STR_Len (aniFrameS)) { 40 | Npc_ClearAIQueue (npc); 41 | AI_Wait (npc, 10); 42 | Npc_PlayAni (npc, aniName); 43 | } else { 44 | //Default ani dir - forward 45 | var int aniDir; aniDir = AniDir_Forward; 46 | 47 | //Play ani with Frame offset 48 | //TODO: 49 | NPC_StartAniWithFrameOffset(npc, aniName, aniFrame, aniDir); 50 | }; 51 | 52 | var string msg; 53 | 54 | if (NPC_IsAniActive_ByAniName (npc, aniName)) { 55 | msg = ConcatStrings ("Animation ", aniName); 56 | msg = ConcatStrings (msg, " started."); 57 | } else { 58 | msg = ConcatStrings ("Animation ", aniName); 59 | msg = ConcatStrings (msg, " could not be started. (does not exist?)"); 60 | }; 61 | 62 | return msg; 63 | }; 64 | 65 | /* 66 | * Focus Play Effect 67 | * - will play effect on focused NPC 68 | */ 69 | func string CC_FocusPlayEffect (var string param) { 70 | param = STR_TrimChar (param, CHR_SPACE); 71 | param = STR_Upper (param); 72 | 73 | var oCNpc npc; 74 | var oCNpc her; her = Hlp_GetNpc (hero); 75 | 76 | if (!Hlp_Is_oCNpc (her.focus_vob)) { 77 | return "No NPC in the focus."; 78 | }; 79 | 80 | npc = _^ (her.focus_vob); 81 | 82 | var string effectName; effectName = STR_EMPTY; 83 | 84 | var int count; count = STR_SplitCount (param, STR_SPACE); 85 | if (count > 0) { 86 | effectName = STR_Split (param, STR_SPACE, 0); 87 | effectName = STR_TrimChar (effectName, CHR_SPACE); 88 | }; 89 | 90 | if (!STR_Len (effectName)) { 91 | return "No effect specified."; 92 | }; 93 | 94 | Wld_PlayEffect(effectName, npc, npc, 0, 0, 0, FALSE); 95 | 96 | var string msg; 97 | msg = ConcatStrings ("Effect ", effectName); 98 | msg = ConcatStrings (msg, " started."); 99 | 100 | return msg; 101 | }; 102 | 103 | func void CC_FocusPlay_Init () { 104 | CC_Register (CC_FocusPlayAni, "focus play ani", "Plays animation on Npc in focus."); 105 | CC_Register (CC_FocusPlayEffect, "focus play effect", "Plays effect on Npc in focus."); 106 | }; 107 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/gotoZEN.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple debugging feature that allows you to switch between ZEN worlds from console. 3 | */ 4 | func string CC_GotoZEN (var string param) { 5 | param = STR_TrimChar (param, CHR_SPACE); 6 | param = STR_Upper (param); 7 | 8 | var int count; count = STR_SplitCount (param, STR_SPACE); 9 | var string levelName; levelName = STR_EMPTY; 10 | var string vobName; vobName = STR_EMPTY; 11 | 12 | //Get first parameter 13 | if (count > 0) { 14 | levelName = STR_Split (param, STR_SPACE, 0); 15 | levelName = STR_TrimChar (levelName, CHR_SPACE); 16 | levelName = STR_Upper (levelName); 17 | 18 | //Get second parameter 19 | if (count > 1) { 20 | vobName = STR_Split (param, STR_SPACE, 1); 21 | vobName = STR_TrimChar (vobName, CHR_SPACE); 22 | vobName = STR_Upper (vobName); 23 | } else { 24 | //If second parameter was not supplied ... figure it out :) 25 | param = "GOTO ZEN "; 26 | param = ConcatStrings (param, levelName); 27 | 28 | vobName = CC_GetAutoCompletedQuery (param); 29 | 30 | if (STR_Len (vobName)) { 31 | var int cmdLen; cmdLen = STR_Len (param); 32 | var int qryLen; qryLen = STR_Len (vobName); 33 | 34 | vobName = STR_SubStr( vobName, cmdLen, qryLen - cmdLen); 35 | vobName = STR_TrimChar (vobName, CHR_SPACE); 36 | vobName = STR_Upper (vobName); 37 | }; 38 | }; 39 | }; 40 | 41 | if ((STR_Len (levelName)) && (STR_Len (vobName))) { 42 | var string msg; 43 | msg = ConcatStrings ("oCGame_TriggerChangeLevel ", levelName); 44 | msg = ConcatStrings (msg, STR_SPACE); 45 | msg = ConcatStrings (msg, vobName); 46 | 47 | MEM_Info (msg); 48 | 49 | oCGame_TriggerChangeLevel (levelName, vobName); 50 | 51 | return "Done."; 52 | }; 53 | 54 | return "ZEN not found."; 55 | }; 56 | 57 | func void CC_GotoZEN_Init () { 58 | //Register basic call 59 | CC_Register (CC_GotoZEN, "goto ZEN", "Will teleport player to specific ZEN world."); 60 | 61 | //Register consequently all levels - using existing oCTriggerChangeLevel objects 62 | var int vobListPtr; vobListPtr = MEM_ArrayCreate (); 63 | 64 | if (!SearchVobsByClass ("oCTriggerChangeLevel", vobListPtr)) { 65 | MEM_Info ("CC_GotoZEN_Init: No oCTriggerChangeLevel objects found."); 66 | MEM_ArrayFree (vobListPtr); 67 | return; 68 | }; 69 | 70 | var int vobPtr; 71 | var zCArray vobList; vobList = _^ (vobListPtr); 72 | 73 | var int i; i = 0; 74 | 75 | var int count; count = vobList.numInArray; 76 | 77 | while (i < count); 78 | //Read vobPtr from vobList array 79 | vobPtr = MEM_ArrayRead (vobListPtr, i); 80 | 81 | if (vobPtr) { 82 | var oCTriggerChangeLevel trigger; trigger = _^ (vobPtr); 83 | var string autoCompletion; 84 | 85 | autoCompletion = "goto ZEN "; 86 | autoCompletion = ConcatStrings (autoCompletion, trigger.levelName); 87 | autoCompletion = ConcatStrings (autoCompletion, STR_SPACE); 88 | autoCompletion = ConcatStrings (autoCompletion, trigger.startVob); 89 | 90 | MEM_Info (ConcatStrings ("CC_GotoZEN_Init register: ", autoCompletion)); 91 | 92 | //We have to use our own function to be able to register same function with different parameters 93 | CC_RegisterMulti (CC_GotoZEN, autoCompletion, "Will teleport player to specific ZEN world."); 94 | }; 95 | 96 | i += 1; 97 | end; 98 | 99 | MEM_ArrayFree (vobListPtr); 100 | }; 101 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/holdTime.d: -------------------------------------------------------------------------------- 1 | var int holdTime_On; 2 | 3 | var int holdTime_Hour; 4 | var int holdTime_Min; 5 | 6 | func void _hook_zCWorld_AdvanceClock () { 7 | if (holdTime_On) { 8 | oCWorldTimer_SetTime (holdTime_Hour, holdTime_Min); 9 | }; 10 | }; 11 | 12 | func string CC_HoldTime (var string param) { 13 | holdTime_On = !holdTime_On; 14 | 15 | if (holdTime_On) { 16 | oCWorldTimer_GetTime (_@ (holdTime_Hour), _@ (holdTime_Min)); 17 | return "Hold time - on."; 18 | }; 19 | 20 | return "Hold time - off."; 21 | }; 22 | 23 | func void CC_HoldTime_Init () { 24 | CC_Register (CC_HoldTime, "hold time", "Freezes time in place."); 25 | 26 | const int once = 0; 27 | if (!once) { 28 | //0x005F7A80 public: void __thiscall zCWorld::AdvanceClock(float) 29 | const int zCWorld__AdvanceClock_G1 = 6257280; 30 | 31 | //0x006260E0 public: void __thiscall zCWorld::AdvanceClock(float) 32 | const int zCWorld__AdvanceClock_G2 = 6447328; 33 | 34 | HookEngine (MEMINT_SwitchG1G2 (zCWorld__AdvanceClock_G1, zCWorld__AdvanceClock_G2), 10, "_hook_zCWorld_AdvanceClock"); 35 | once = 1; 36 | }; 37 | }; 38 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/printPos.d: -------------------------------------------------------------------------------- 1 | /* 2 | * PrintPos 3 | * - will print to zSpy position of focused object. 4 | */ 5 | 6 | func string CC_PrintTrafoWrapper (var string param, var int printTrafo) { 7 | param = STR_TrimChar (param, CHR_SPACE); 8 | 9 | var oCNpc her; her = Hlp_GetNpc (hero); 10 | 11 | var int count; count = STR_SplitCount (param, STR_SPACE); 12 | var string objectName; objectName = STR_EMPTY; 13 | 14 | if (count > 0) { 15 | objectName = STR_Split (param, STR_SPACE, 0); 16 | objectName = STR_TrimChar (objectName, CHR_SPACE); 17 | }; 18 | 19 | var string msg; 20 | 21 | if (her.focus_vob) { 22 | var int oldErrorLevel; oldErrorLevel = zERROR_GetFilterLevel (); 23 | zERROR_SetFilterLevel (1); 24 | 25 | //Print Trafo 26 | if (printTrafo) { 27 | msg = "const string descRot"; 28 | 29 | if (STR_Len (objectName)) { 30 | msg = ConcatStrings (msg, "_"); 31 | msg = ConcatStrings (msg, objectName); 32 | }; 33 | 34 | msg = ConcatStrings (msg, " = "); 35 | msg = ConcatStrings (msg, BtoC(34)); 36 | msg = ConcatStrings (msg, Vob_GetDescriptionRot (her.focus_vob)); 37 | msg = ConcatStrings (msg, BtoC(34)); 38 | msg = ConcatStrings (msg, ";"); 39 | 40 | MEM_Info (msg); 41 | 42 | msg = "const string descPos"; 43 | 44 | if (STR_Len (objectName)) { 45 | msg = ConcatStrings (msg, "_"); 46 | msg = ConcatStrings (msg, objectName); 47 | }; 48 | 49 | msg = ConcatStrings (msg, " = "); 50 | msg = ConcatStrings (msg, BtoC(34)); 51 | msg = ConcatStrings (msg, Vob_GetDescriptionPos (her.focus_vob)); 52 | msg = ConcatStrings (msg, BtoC(34)); 53 | msg = ConcatStrings (msg, ";"); 54 | 55 | MEM_Info (msg); 56 | } else 57 | //Print Pos 58 | { 59 | var int pos[3]; 60 | if (zCVob_GetPositionWorldToPos (her.focus_vob, _@ (pos))) { 61 | msg = "const float pos"; 62 | if (STR_Len (objectName)) { 63 | msg = ConcatStrings (msg, "_"); 64 | msg = ConcatStrings (msg, objectName); 65 | }; 66 | 67 | msg = ConcatStrings (msg, "[3] = {"); 68 | msg = ConcatStrings (msg, toStringF (pos[0])); 69 | msg = ConcatStrings (msg, ", "); 70 | msg = ConcatStrings (msg, toStringF (pos[1])); 71 | msg = ConcatStrings (msg, ", "); 72 | msg = ConcatStrings (msg, toStringF (pos[2])); 73 | msg = ConcatStrings (msg, "};"); 74 | 75 | MEM_Info (msg); 76 | }; 77 | }; 78 | 79 | zERROR_SetFilterLevel (oldErrorLevel); 80 | } else { 81 | msg = "Nothing in focus."; 82 | }; 83 | 84 | return msg; 85 | }; 86 | 87 | func string CC_PrintPos (var string param) { 88 | return CC_PrintTrafoWrapper (param, 0); 89 | }; 90 | 91 | func string CC_PrintTrafo (var string param) { 92 | return CC_PrintTrafoWrapper (param, 1); 93 | }; 94 | 95 | func void CC_PrintPos_Init () { 96 | CC_Register (CC_PrintPos, "print pos", "Will print to zSpy position of focused object."); 97 | CC_Register (CC_PrintTrafo, "print trafo", "Will print to zSpy position & rotation of focused object."); 98 | }; 99 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/setRoutine.d: -------------------------------------------------------------------------------- 1 | func string CC_ShowRoutine (var string newRtn) { 2 | var oCNPC her; her = Hlp_GetNPC (hero); 3 | 4 | if (!Hlp_Is_oCNpc (her.focus_vob)) { return "No NPC in focus."; }; 5 | 6 | var C_NPC npc; npc = _^ (her.focus_vob); 7 | var string curRtn; curRtn = NPC_GetRoutineName (npc); 8 | return curRtn; 9 | }; 10 | 11 | func string CC_SetRoutine (var string newRtn) { 12 | var oCNPC her; her = Hlp_GetNPC (hero); 13 | 14 | if (!Hlp_Is_oCNpc (her.focus_vob)) { return "No NPC in focus."; }; 15 | 16 | //Hmmm seems like parameter has extra leading space 17 | newRtn = STR_TrimChar (newRtn, CHR_SPACE); 18 | 19 | var C_NPC npc; npc = _^ (her.focus_vob); 20 | 21 | NPC_ClearAIQueue (npc); 22 | AI_StandUp (npc); 23 | 24 | Npc_ExchangeRoutine (npc, newRtn); 25 | AI_ContinueRoutine (npc); 26 | 27 | var string curRtn; curRtn = NPC_GetRoutineName (npc); 28 | 29 | //Function above returns routine in full format: RTN_ & routineName & _ID 30 | //In order to compare routines, we have to convert our newRtn to correct format as well 31 | newRtn = ConcatStrings ("RTN_", newRtn); 32 | newRtn = ConcatStrings (newRtn, "_"); 33 | newRtn = ConcatStrings (newRtn, IntToString (npc.ID)); 34 | 35 | var string msg; 36 | 37 | if (Hlp_StrCmp (newRtn, curRtn)) { 38 | msg = "Done. New routine: "; 39 | msg = ConcatStrings (msg, newRtn); 40 | return msg; 41 | }; 42 | 43 | msg = ConcatStrings ("Routine ", newRtn); 44 | msg = ConcatStrings (newRtn, " does not exist."); 45 | 46 | return msg; 47 | }; 48 | 49 | func void CC_SetRoutine_Init () { 50 | CC_Register (CC_ShowRoutine, "show routine", "Display NPC routine."); 51 | CC_Register (CC_SetRoutine, "set routine", "Change NPC routine."); 52 | }; 53 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/setSleepingMode.d: -------------------------------------------------------------------------------- 1 | func string CC_SetSleepingMode (var string param) { 2 | var oCNPC her; her = Hlp_GetNPC (hero); 3 | 4 | if (!her.focus_vob) { return "Nothing in focus."; }; 5 | 6 | var int vobPtr; vobPtr = her.focus_vob; 7 | var int isSleeping; isSleeping = zCVob_IsSleeping (vobPtr); 8 | 9 | isSleeping = !isSleeping; 10 | 11 | zCVob_SetSleeping (vobPtr, isSleeping); 12 | 13 | if (!isSleeping) { 14 | return "Vob set to 'awake' mode."; 15 | }; 16 | 17 | return "Vob set to 'sleeping' mode. "; 18 | }; 19 | 20 | func void CC_SetSleepingMode_Init () { 21 | CC_Register (CC_SetSleepingMode, "set sleepingMode", "Toggle vob sleeping mode."); 22 | }; 23 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/showAI.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Show AI 3 | * - will display AI details for NPC in focus 4 | */ 5 | 6 | var int showAI_LastFocus; 7 | 8 | func string CC_ShowAI (var string param) { 9 | var string msg; 10 | 11 | var oCNPC npc; 12 | var oCNPC her; her = Hlp_GetNPC (hero); 13 | 14 | if (Hlp_Is_oCNpc (showAI_LastFocus)) { 15 | npc = _^ (showAI_LastFocus); 16 | 17 | if (NPC_GetShowAI (npc)) { 18 | NPC_SetShowAI (npc, 0); 19 | msg = "Hiding AI info."; 20 | showAI_LastFocus = 0; 21 | return msg; 22 | }; 23 | }; 24 | 25 | showAI_LastFocus = 0; 26 | 27 | if (her.focus_vob) { 28 | showAI_LastFocus = her.focus_vob; 29 | 30 | if (Hlp_Is_oCNpc (showAI_LastFocus)) { 31 | npc = _^ (showAI_LastFocus); 32 | 33 | if (NPC_GetShowAI (npc)) { 34 | NPC_SetShowAI (npc, 0); 35 | msg = "Hiding AI info."; 36 | } else { 37 | NPC_SetShowAI (npc, 1); 38 | msg = GetSymbolName (Hlp_GetInstanceID (npc)); 39 | msg = ConcatStrings (msg, STR_SPACE); 40 | msg = ConcatStrings (msg, NPC_GetRoutineName (npc)); 41 | msg = ConcatStrings (msg, " show AI info."); 42 | }; 43 | } else { 44 | msg = "hero.focus_vob is not an NPC."; 45 | }; 46 | } else { 47 | msg = "Nothing in focus."; 48 | }; 49 | 50 | return msg; 51 | }; 52 | 53 | func void CC_ShowAI_Init () { 54 | CC_Register (CC_ShowAI, "show AI", "Show AI for NPC in focus."); 55 | //Reset last focus 56 | showAI_LastFocus = 0; 57 | }; 58 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/testSuite_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | Copy this function outside of the script packet - define your own logic if required. 3 | 4 | Aivars are variables - they are unpredictable and thus modder should NEVER expect them to be same across all Gothic scripts 5 | In Replay Mod - I am using my own logic for aivars (using getter & setter methods, using bitmask to store multiple true/false 'aivars' in one variable ...) 6 | 7 | func void Hero_SetInvincible (var int value) { 8 | hero.aivar [AIV_Invincible] = value; 9 | }; 10 | */ 11 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Debugging/unlock.d: -------------------------------------------------------------------------------- 1 | /* 2 | * marvin command: lock pickLockStr keyInstance 3 | * - if you don't want to change pickLockStr then use minus sign instead of pickLockStr combination 4 | * lock pickLockStr - keyInstance 5 | */ 6 | func string CC_Lock (var string param) { 7 | param = STR_TrimChar (param, CHR_SPACE); 8 | 9 | var string msg; 10 | var oCNpc her; her = Hlp_GetNPC (hero); 11 | 12 | if (her.focus_vob) { 13 | if (Hlp_Is_oCMobLockable (her.focus_vob)) { 14 | var string pickLockStr; pickLockStr = STR_EMPTY; 15 | var string keyInstance; keyInstance = STR_EMPTY; 16 | 17 | var int count; count = STR_SplitCount (param, STR_SPACE); 18 | if (count > 0) { 19 | pickLockStr = STR_Split (param, STR_SPACE, 0); 20 | }; 21 | 22 | if (count > 1) { 23 | keyInstance = STR_Split (param, STR_SPACE, 1); 24 | }; 25 | 26 | if (Hlp_StrCmp (pickLockStr, "-")) { 27 | pickLockStr = STR_EMPTY; 28 | }; 29 | 30 | //Lock 31 | var oCMobLockable mob; mob = _^ (her.focus_vob); 32 | mob.bitfield = (mob.bitfield | oCMobLockable_bitfield_locked); 33 | 34 | //Reset picklockNr 35 | mob.bitfield = mob.bitfield & 3; 36 | 37 | //Get name 38 | msg = ConcatStrings ("Mob: '", mob._zCObject_objectName); 39 | msg = ConcatStrings (msg, "'"); 40 | 41 | msg = ConcatStrings (msg, " locked with pickLockStr combination: "); 42 | msg = ConcatStrings (msg, pickLockStr); 43 | 44 | msg = ConcatStrings (msg, " and keyInstance: "); 45 | msg = ConcatStrings (msg, keyInstance); 46 | 47 | mob.pickLockStr = pickLockStr; 48 | mob.keyInstance = keyInstance; 49 | } else { 50 | msg = "hero.focus_vob is not oCMobLockable object."; 51 | }; 52 | } else { 53 | msg = "Nothing in focus."; 54 | }; 55 | 56 | return msg; 57 | }; 58 | 59 | func string CC_UnLock (var string param) { 60 | var string msg; 61 | var oCNpc her; her = Hlp_GetNPC (hero); 62 | 63 | if (her.focus_vob) { 64 | if (Hlp_Is_oCMobLockable (her.focus_vob)) { 65 | //Unlock 66 | var oCMobLockable mob; mob = _^ (her.focus_vob); 67 | mob.bitfield = (mob.bitfield & ~ oCMobLockable_bitfield_locked); 68 | 69 | //Get name 70 | msg = ConcatStrings ("Mob: '", mob._zCObject_objectName); 71 | msg = ConcatStrings (msg, "'"); 72 | 73 | //Get key 74 | msg = ConcatStrings (msg, ", key: '"); 75 | msg = ConcatStrings (msg, mob.keyInstance); 76 | msg = ConcatStrings (msg, "'"); 77 | 78 | //Get picklock combination 79 | msg = ConcatStrings (msg, ", pickLockStr: '"); 80 | msg = ConcatStrings (msg, mob.pickLockStr); 81 | msg = ConcatStrings (msg, "'"); 82 | 83 | msg = ConcatStrings (msg, " unlocked."); 84 | 85 | if (STR_Len (mob.keyInstance)) { 86 | var int keyIsValid; keyIsValid = MEM_FindParserSymbol (mob.keyInstance); 87 | if (keyIsValid == -1) { 88 | msg = ConcatStrings (msg, " Invalid key - item does not exist!"); 89 | }; 90 | }; 91 | } else { 92 | msg = "hero.focus_vob is not oCMobLockable object."; 93 | }; 94 | } else { 95 | msg = "Nothing in focus."; 96 | }; 97 | 98 | return msg; 99 | }; 100 | 101 | func void CC_UnLock_Init () { 102 | CC_Register (CC_Lock, "lock", "Lock mob in focus."); 103 | CC_Register (CC_UnLock, "unlock", "Unlock mob in focus."); 104 | }; 105 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-DespawnOnlyIfEmpty/despawnOnlyIfEmpty.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple feature preventing despawn of dead NPCs, if they have anything in their inventory 3 | */ 4 | func void _hook_oCSpawnManager_CheckInsertNpc_HasMissionItem () { 5 | //ECX 0x007DDF34 const oCNpc::`vftable' 6 | 7 | //0x0066D550 public: virtual int __thiscall oCNpcInventory::IsEmpty(void) 8 | 9 | //ignoreArmor, ignoreActive 10 | //0x0070D1A0 public: virtual int __thiscall oCNpcInventory::IsEmpty(int,int) 11 | 12 | if (!Hlp_Is_oCNpc (ECX)) { return; }; 13 | var oCNpc slf; slf = _^ (ECX); 14 | 15 | //If inventory is not empty - prevent despawn 16 | if (!NPC_InventoryIsEmpty (slf, 0, 0, TRUE)) { 17 | //Return TRUE 18 | EAX = 1; 19 | return; 20 | }; 21 | 22 | //Return FALSE; 23 | EAX = 0; 24 | }; 25 | 26 | func void G12_DespawnOnlyIfEmpty_Init () { 27 | const int once = 0; 28 | if (!once) { 29 | //0x006CFDE0 private: void __thiscall oCSpawnManager::CheckInsertNpc(void) 30 | 31 | //006cfe3b 32 | const int oCSpawnManager__CheckInsertNpc_HasMissionItem_G1 = 7142971; 33 | 34 | //00778227 35 | const int oCSpawnManager__CheckInsertNpc_HasMissionItem_G2 = 7832103; 36 | 37 | var int addr; addr = MEMINT_SwitchG1G2 (oCSpawnManager__CheckInsertNpc_HasMissionItem_G1, oCSpawnManager__CheckInsertNpc_HasMissionItem_G2); 38 | 39 | MEM_WriteNOP (addr, 5); 40 | HookEngine (addr, 5, "_hook_oCSpawnManager_CheckInsertNpc_HasMissionItem"); 41 | 42 | //const int spawnRemoveNpcOnlyIfEmpty_addr_G2 = 9153756; 43 | //MemoryProtectionOverride(spawnRemoveNpcOnlyIfEmpty_addr_G2, 1); 44 | //MEM_WriteByte (spawnRemoveNpcOnlyIfEmpty_addr_G2, 1); 45 | 46 | once = 1; 47 | }; 48 | }; 49 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-EnablePlayerStates/enablePlayerStates.d: -------------------------------------------------------------------------------- 1 | /* 2 | As per conversation with NicoDE player AI states are hardcoded in engine: 3 | https://forum.worldofplayers.de/forum/threads/1533803-G1-AI_StartState-hardcoded-ZS-states-for-Player?p=26034737&viewfull=1#post26034737 4 | 5 | G1 6 | const int NPC_PLAYER_STATES_ENABLED_MAX = 8; 7 | 8 | const zSTRING strPlayerStatesEnabled[NPC_PLAYER_STATES_ENABLED_MAX] = { 9 | "ZS_ASSESSMAGIC", 10 | "ZS_ASSESSSTOPMAGIC", 11 | "ZS_MAGICFREEZE", 12 | "ZS_SHORTZAPPED", 13 | "ZS_ZAPPED", 14 | "ZS_PYRO", 15 | "ZS_MAGICSLEEP", 16 | "ZS_MAGICFEAR" 17 | }; 18 | 19 | //G2A 20 | const int NPC_PLAYER_STATES_ENABLED_MAX = 9; 21 | 22 | const zSTRING strPlayerStatesEnabled[NPC_PLAYER_STATES_ENABLED_MAX] = { 23 | "ZS_ASSESSMAGIC", 24 | "ZS_ASSESSSTOPMAGIC", 25 | "ZS_MAGICFREEZE", 26 | "ZS_WHIRLWIND", 27 | "ZS_SHORTZAPPED", 28 | "ZS_ZAPPED", 29 | "ZS_PYRO", 30 | "ZS_MAGICSLEEP" 31 | // NULL 32 | }; 33 | */ 34 | 35 | func int CanPlayerUseAIState (var string AIStateName) { 36 | const int symbID = 0; 37 | 38 | if (!symbID) { 39 | symbID = MEM_FindParserSymbol ("C_CanPlayerUseAIState"); 40 | }; 41 | 42 | var int retVal; retVal = 0; 43 | 44 | if (symbID != -1) { 45 | MEM_PushStringParam (AIStateName); 46 | MEM_CallByID (symbID); 47 | retVal = MEM_PopIntResult (); 48 | }; 49 | 50 | return + retVal; 51 | }; 52 | 53 | func void _hook_oCNpc_States_DoAIState_CanPlayerUseAIState () { 54 | //Return 1 if player can't use state 55 | EAX = 1; 56 | 57 | if (!EBP) { return; }; 58 | var oCNpc_States npcStates; npcStates = _^ (EBP); 59 | 60 | //Return 0 if player can use state 61 | if (CanPlayerUseAIState (npcStates.nextState_name)) { 62 | EAX = 0; 63 | }; 64 | }; 65 | 66 | func void G12_EnablePlayerStates_Init () { 67 | const int once = 0; 68 | 69 | if (!once) { 70 | var int addr; 71 | 72 | //006C5F00 73 | const int oCNpc_States__DoAIState_CheckStates_G1 = 7102208; 74 | 75 | //0076d440 76 | const int oCNpc_States__DoAIState_CheckStates_G2 = 7787584; 77 | 78 | addr = MEMINT_SwitchG1G2 (oCNpc_States__DoAIState_CheckStates_G1, oCNpc_States__DoAIState_CheckStates_G2); 79 | MEM_WriteNOP (addr, 10); 80 | 81 | HookEngine (addr, 5, "_hook_oCNpc_States_DoAIState_CanPlayerUseAIState"); 82 | 83 | //85 C0 test EAX, EAX 84 | MEM_WriteByte (addr + 8, 133); 85 | MEM_WriteByte (addr + 9, 192); 86 | 87 | //Nuke loop 88 | const int oCNpc_States__DoAIState_CheckStatesLoop_G1 = 7102224; 89 | 90 | const int oCNpc_States__DoAIState_CheckStatesLoop_G2 = 7787600; 91 | 92 | addr = MEMINT_SwitchG1G2 (oCNpc_States__DoAIState_CheckStatesLoop_G1, oCNpc_States__DoAIState_CheckStatesLoop_G2); 93 | MEM_WriteNOP (addr, 10); 94 | 95 | once = 1; 96 | }; 97 | }; 98 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-EnablePlayerStates/enablePlayerStates_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Enable player states 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (define your own ZS states) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | func int C_CanPlayerUseAIState(var string AIStateName) { 11 | //Default engine ZS states [do not change these] 12 | if (Hlp_StrCmp(AIStateName, "ZS_ASSESSMAGIC")) 13 | || (Hlp_StrCmp(AIStateName, "ZS_ASSESSSTOPMAGIC")) 14 | || (Hlp_StrCmp(AIStateName, "ZS_MAGICFREEZE")) 15 | || (Hlp_StrCmp(AIStateName, "ZS_SHORTZAPPED")) 16 | || (Hlp_StrCmp(AIStateName, "ZS_ZAPPED")) 17 | || (Hlp_StrCmp(AIStateName, "ZS_PYRO")) 18 | || (Hlp_StrCmp(AIStateName, "ZS_MAGICSLEEP")) 19 | || (Hlp_StrCmp(AIStateName, "ZS_MAGICBURN")) 20 | 21 | // Additional - add as many as you need ... 22 | || (Hlp_StrCmp(AIStateName, "ZS_MAGICFEAR")) //G1 vanilla only 23 | || (Hlp_StrCmp(AIStateName, "ZS_WHIRLWIND")) //G2 NoTR vanilla only 24 | 25 | || (Hlp_StrCmp(AIStateName, "ZS_PC_CONTROLLING")) //G1 oversight - fix it :) 26 | { 27 | return TRUE; 28 | }; 29 | 30 | return FALSE; 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-EnhancedInfoManager/enhancedInfoManager_API.d: -------------------------------------------------------------------------------- 1 | //Default dialog colors 2 | //G1 standard dialog - white color FFFFFF 3 | const string InfoManagerDefaultDialogColorSelected = "FFFFFF"; 4 | //G1 standard dialog - grey color C8C8C8 5 | const string InfoManagerDefaultColorDialogGrey = "C8C8C8"; 6 | 7 | //Default font for selected dialog choice (if blank default Gothic version will be used) 8 | const string InfoManagerDefaultFontDialogSelected = STR_EMPTY; 9 | //Default font for greyed (if blank default Gothic version will be used) 10 | const string InfoManagerDefaultFontDialogGrey = STR_EMPTY; 11 | 12 | //Disabled color - selected 13 | const string InfoManagerDisabledDialogColorSelected = "808080"; 14 | //Disabled color - grey 15 | const string InfoManagerDisabledColorDialogGrey = "666666"; 16 | 17 | //Default text alignment 18 | //ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT defined in LeGo 19 | const int InfoManagerDefaultDialogAlignment = ALIGN_LEFT; 20 | 21 | //Default color for 'answer' and 'spinner' indicator - if empty it will be same as underlying dialog 22 | const string InfoManagerIndicatorColorDefault = "C8C8C8"; 23 | //Default alpha value for 'answer' and 'spinner' indicator 24 | const int InfoManagerIndicatorAlpha = 196; 25 | 26 | //Default spinner indicator (non animated) 27 | const string InfoManagerSpinnerIndicatorString = "<-- -->"; 28 | //Default answer/input field indicator 29 | const string InfoManagerAnswerIndicatorString = "..."; 30 | 31 | //Set to TRUE if you want animated spinner 32 | const int InfoManagerSpinnerIndicatorAnimation = 1; 33 | const int InfoManagerAnswerAnimation = 1; 34 | 35 | //Dialog 'NumKey' controls [WIP] 36 | //Set to TRUE if you want to enable num key support for dialogs 37 | const int InfoManagerNumKeysControls = 1; 38 | //Set to TRUE if you want to add dialog numbers next to each dialog (formatted in function InfoManagerNumKeyString) 39 | const int InfoManagerNumKeysNumbers = 0; 40 | 41 | //const int ALPHA_FUNC_MAT_DEFAULT = 0; 42 | //const int ALPHA_FUNC_NONE = 1; 43 | //const int ALPHA_FUNC_BLEND = 2; 44 | //const int ALPHA_FUNC_ADD = 3; 45 | //const int ALPHA_FUNC_SUB = 4; 46 | //const int ALPHA_FUNC_MUL = 5; 47 | //const int ALPHA_FUNC_MUL2 = 6; 48 | //const int ALPHA_FUNC_TEST = 7; 49 | 50 | //ALPHA_FUNC_NONE (is Gothic default), ALPHA_FUNC_ADD (is kinda nicer :) ) 51 | const int InfoManagerAlphaBlendFunc = 3; 52 | 53 | //const int cIM_RememberSelectedChoice_None = 0; //Does nothing (default vanilla behaviour) 54 | //const int cIM_RememberSelectedChoice_All = 1; //Moves cursor to last selected choice 55 | //const int cIM_RememberSelectedChoice_Spinners = 2; //Moves cursor to last selected choice only when used with spinners 56 | const int InfoManagerRememberSelectedChoice = cIM_RememberSelectedChoice_Spinners; 57 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-EquipControl/equipControl.d: -------------------------------------------------------------------------------- 1 | func void _hook_oCNpc_EquipControl () { 2 | //Same for G1 & G2A 3 | const int ITM_FLAG_ACTIVE = 1 << 30; 4 | 5 | if (!Hlp_Is_oCNpc (ECX)) { return; }; 6 | 7 | var int itemPtr; itemPtr = MEM_ReadInt (ESP + 4); 8 | if (!Hlp_Is_oCItem (itemPtr)) { return; }; 9 | 10 | var C_NPC slf; slf = _^ (ECX); 11 | 12 | const int symbID = 0; 13 | var int retVal; retVal = 0; 14 | 15 | if (!symbID) { 16 | symbID = MEM_FindParserSymbol ("C_Npc_CanEquip"); 17 | }; 18 | 19 | if (symbID != -1) { 20 | MEM_PushInstParam (slf); 21 | MEM_PushIntParam (itemPtr); 22 | 23 | MEM_CallByID (symbID); 24 | retVal = MEM_PopIntResult (); 25 | }; 26 | 27 | if (retVal) { 28 | //Null item pointer - this will cancel equip action (everything handled from function C_Npc_CanEquip - no need to let engine do it) 29 | MEM_WriteInt (ESP + 4, 0); 30 | }; 31 | }; 32 | 33 | func void G12_EquipControl_Init () { 34 | const int once = 0; 35 | if (!once) { 36 | //0x006968F0 public: void __thiscall oCNpc::Equip(class oCItem *) 37 | const int oCNpc__Equip_G1 = 6908144; 38 | 39 | //0x00739C90 public: void __thiscall oCNpc::Equip(class oCItem *) 40 | const int oCNpc__Equip_G2 = 7576720; 41 | 42 | HookEngine (MEMINT_SwitchG1G2 (oCNpc__Equip_G1, oCNpc__Equip_G2), 5, "_hook_oCNpc_EquipControl"); 43 | 44 | once = 1; 45 | }; 46 | }; 47 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-FadeAway/fadeAway_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Fade away 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | //Should Npc drop weapon? 11 | const int FADEAWAY_DROPWEAPON = FALSE; 12 | 13 | //Should Npc drop inventory? 14 | const int FADEAWAY_DROPINVENTORY = TRUE; 15 | const int FADEAWAY_DONTDROPFLAGS = 0; 16 | const int FADEAWAY_DONTDROPMAINFLAG = 0; 17 | 18 | const string FADEAWAY_ITEMSLOTNAME = "BIP01"; 19 | 20 | /* 21 | * In this example SummonedByPC_StoneGolem will be faded away 22 | */ 23 | func int C_Npc_IsSummoned(var C_NPC slf) { 24 | if (Hlp_GetInstanceID(slf) == SummonedByPC_StoneGolem) 25 | { 26 | return TRUE; 27 | }; 28 | 29 | return FALSE; 30 | }; 31 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-Focus/focus_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Focus 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | const string MOBNAME_CRATE_EMPTY = "Empty box"; 11 | const string MOBNAME_CHEST_EMPTY = "Empty chest"; 12 | 13 | //Possible options: 14 | //PC_CHANGEFOCUS_LOCKABLE - locks 15 | //PC_CHANGEFOCUS_NPCATTITUDE - attitude 16 | //PC_CHANGEFOCUS_RENAMEEMPTYCHESTS - renames empty chests 17 | const int PC_CHANGEFOCUS_FLAGS = PC_CHANGEFOCUS_LOCKABLE | PC_CHANGEFOCUS_RENAMEEMPTYCHESTS; 18 | 19 | const string PC_CHANGEFOCUS_COLOR_DEFAULT = "FFFFFF"; //White 20 | const string PC_CHANGEFOCUS_COLOR_LOCKEDKEY = "FF8000"; //Orange 21 | const string PC_CHANGEFOCUS_COLOR_LOCKEDPICKLOCKS = "FFFF00"; //Yellow 22 | const string PC_CHANGEFOCUS_COLOR_LOCKEDKEYPICKLOCKS = "FFFF00"; //Yellow 23 | const string PC_CHANGEFOCUS_COLOR_LOCKEDHASKEY = "FFFF00"; //Yellow 24 | 25 | //-- 26 | 27 | const string PC_CHANGEFOCUS_COLOR_CONTAINERUNLOCKED = "66FFB2"; //Green 28 | const string PC_CHANGEFOCUS_COLOR_CONTAINERUNLOCKEDEMPTY = "FFFFFF"; //White 29 | 30 | //-- 31 | 32 | const string PC_CHANGEFOCUS_COLOR_FRIENDLY = "66FFB2"; //Green 33 | const string PC_CHANGEFOCUS_COLOR_NEUTRAL = "FFFFFF"; //White 34 | const string PC_CHANGEFOCUS_COLOR_ANGRY = "FF8000"; //Orange 35 | const string PC_CHANGEFOCUS_COLOR_HOSTILE = "FF4646"; //Red 36 | 37 | //API function 38 | //This is where you can define your own logic for determining focus color 39 | func int C_Npc_GetFocusColor(var C_NPC oth) { 40 | var int att; att = Npc_GetPermAttitude(hero, oth); 41 | 42 | if (((att == ATT_NEUTRAL) && (oth.npcType == NpcType_Friend)) 43 | || ((att == ATT_FRIENDLY))) 44 | { 45 | return RGBA(102, 255, 178, 255); //66FFB2 green 46 | }; 47 | 48 | if ((att == ATT_ANGRY))) 49 | { 50 | return RGBA(255, 128, 000, 255); //FF8000 orange 51 | }; 52 | 53 | if ((att == ATT_HOSTILE))) 54 | { 55 | return RGBA(255, 070, 070, 255); //FF4646 red 56 | }; 57 | 58 | //Default - white 59 | return RGBA(255, 255, 255, 255); 60 | }; 61 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-LogDialogues/logDialogues_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Log dialogues 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | //const int LOG_MISSION = 0; 11 | //const int LOG_NOTE = 1; 12 | 13 | const int LOG_SECTIONFORDIALOGUES = 1; //log to notes by default 14 | 15 | //Define conditions for log name here 16 | //For example: we don't need dialogues with ambient NPCs ... 17 | //return STR_EMPTY blank string if you don't want to log dialogue, otherwise return log name (by default, we return NPC name) 18 | 19 | func string GetLogTopicName__LogDialogs(var C_NPC npc, var C_NPC her) { 20 | if (MEMINT_SwitchG1G2(1, 0)) { 21 | //G1 22 | //const int npctype_ambient = 0; 23 | //const int Npctype_MINE_Ambient = 4; 24 | //const int NPCTYPE_OW_AMBIENT = 6; 25 | if ((npc.npcType == 0) || (npc.npcType == 4) || (npc.npcType == 6)) { 26 | return STR_EMPTY; 27 | }; 28 | } else { 29 | //G2A 30 | //const int NPCTYPE_AMBIENT = 0; 31 | //const int NPCTYPE_OCAMBIENT = 3; 32 | //const int NPCTYPE_BL_AMBIENT = 5;//Addon 33 | //const int NPCTYPE_TAL_AMBIENT = 6;//Addon 34 | if ((npc.npcType == 0) || (npc.npcType == 3) || (npc.npcType == 5) || (npc.npcType == 6)) { 35 | return STR_EMPTY; 36 | }; 37 | }; 38 | 39 | return npc.Name; 40 | }; 41 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-MenuLogAddSectionCount/menuLogAddSectionCount_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | //Copy this function outside of the script packet - define your own rules and values :) 3 | 4 | const string MENUADDSECTIONCOUNT_SETUP = "MENU_ITEM_SEL_MISSIONS_ACT LOG_MISSION LOG_RUNNING|MENU_ITEM_SEL_MISSIONS_OLD LOG_MISSION LOG_SUCCESS|MENU_ITEM_SEL_MISSIONS_FAILED LOG_MISSION LOG_FAILED|MENU_ITEM_SEL_LOG LOG_NOTE -1"; 5 | */ 6 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-MoonPhases/moonPhases.d: -------------------------------------------------------------------------------- 1 | /* 2 | * MEM_SkyController.masterTime (float) 3 | * 0.50 = 00:00 4 | * 0.75 = 06:00 5 | * 0.00 = 12:00 6 | * 0.25 = 18:00 7 | * 8 | * 19:45 moonrise 04:15 moonset 9 | * 05:20 sunrise 18:40 sunset 10 | */ 11 | 12 | var int moonPhase; 13 | var int forceMoonPhaseUpdate; 14 | 15 | func void Moon_SetTexture (var string textureName) { 16 | //Check mesh pointer 17 | if (!MEM_SkyController.Moon_mesh) { return; }; 18 | 19 | //Get polygon pointer 20 | var int polyPtr; polyPtr = zCMesh_SharePoly (MEM_SkyController.Moon_mesh, 0); 21 | if (!polyPtr) { return; }; 22 | 23 | var zCPolygon poly; poly = _^ (polyPtr); 24 | 25 | //Update material texture 26 | zCMaterial_SetTexture (poly.material, textureName); 27 | }; 28 | 29 | func void _hook_zSkyCtrlOtdr_RenderSkyPre__MoonPhases () { 30 | const int updated = 0; 31 | 32 | //Call 'API' function 33 | const int symbID = 0; 34 | if (!symbID) { 35 | symbID = MEM_FindParserSymbol ("MOON_CALCMOONPHASE"); 36 | }; 37 | 38 | if (symbID != -1) { 39 | MEM_CallByID (symbID); 40 | }; 41 | 42 | var int lastMoonPhase; 43 | 44 | if (lastMoonPhase != moonPhase) { 45 | lastMoonPhase = moonPhase; 46 | updated = 0; 47 | }; 48 | 49 | //Update only when texture should change 50 | if (updated) { return; }; 51 | 52 | //Check mesh pointer 53 | if (!MEM_SkyController.Moon_mesh) { return; }; 54 | 55 | //Update only if moon is not already visible! (during the day) 56 | if (!Hlp_Is_zCSkyControler_Outdoor (MEM_World.activeSkyControler)) { return; }; 57 | 58 | //06:00 - 18:00 - allow texture update 59 | if (gf (MEM_SkyController.masterTime, divf (mkf (75), mkf (100)))) 60 | || (lf (MEM_SkyController.masterTime, divf (mkf (25), mkf (100)))) 61 | || (forceMoonPhaseUpdate) //or force it 62 | { 63 | forceMoonPhaseUpdate = FALSE; 64 | } else { 65 | return; 66 | }; 67 | 68 | //Call 'API' function 69 | const int symbID2 = 0; 70 | 71 | if (!symbID2) { 72 | symbID2 = MEM_FindParserSymbol ("MOON_UPDATETEXTURE"); 73 | }; 74 | 75 | if (symbID2 != -1) { 76 | MEM_CallByID (symbID2); 77 | }; 78 | 79 | updated = 1; 80 | }; 81 | 82 | func void G12_MoonPhases_Init () { 83 | const int once = 0; 84 | if (!once) { 85 | HookEngine (zCSkyControler_Outdoor__RenderSkyPre, 7, "_hook_zSkyCtrlOtdr_RenderSkyPre__MoonPhases"); 86 | once = 1; 87 | }; 88 | }; 89 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-MoonPhases/moonPhases_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Moon phases 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (define your own logic and textures) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | var int overrideMoonPhase; 11 | 12 | //API function 13 | func void Moon_CalcMoonPhase() { 14 | if (overrideMoonPhase) { return; }; 15 | 16 | var int currentPhase; currentPhase = Wld_GetDay(); 17 | if (currentPhase > 24) { currentPhase = currentPhase % 24; }; 18 | 19 | currentPhase = currentPhase / 3; 20 | if (currentPhase < 0) { currentPhase = 0; }; 21 | if (currentPhase > 8) { currentPhase = 0; }; 22 | 23 | moonPhase = currentPhase; 24 | }; 25 | 26 | //API function 27 | func void Moon_UpdateTexture() { 28 | if (moonPhase == 0) { Moon_SetTexture("Moon_Phase1_WaxingCrescent.tga"); }; 29 | if (moonPhase == 1) { Moon_SetTexture("Moon_Phase2_FirstQuarter.tga"); }; 30 | if (moonPhase == 2) { Moon_SetTexture("Moon_Phase3_WaxingGibous.tga"); }; 31 | if (moonPhase == 3) { Moon_SetTexture("Moon_Phase4_FullMoon.tga"); }; 32 | if (moonPhase == 4) { Moon_SetTexture("Moon_Phase5_WaningGibous.tga"); }; 33 | if (moonPhase == 5) { Moon_SetTexture("Moon_Phase6_LastQuarter.tga"); }; 34 | if (moonPhase == 6) { Moon_SetTexture("Moon_Phase7_WaningCrescent.tga"); }; 35 | if (moonPhase == 7) { Moon_SetTexture("Moon_Phase8_NewMoon.tga"); }; 36 | 37 | if (moonPhase == 8) { Moon_SetTexture("Moon_Trollface.tga"); }; 38 | }; 39 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-NoAmmoPrint/noAmmoPrint.d: -------------------------------------------------------------------------------- 1 | //int __thiscall oCNpc::IsMunitionAvailable(class oCItem *) 2 | func void _hook_oCNpc_IsMunitionAvailable () { 3 | if (!Hlp_Is_oCNpc (ECX)) { return; }; 4 | 5 | var int weaponPtr; weaponPtr = MEM_ReadInt (ESP + 4); 6 | 7 | if (!Hlp_Is_oCItem (weaponPtr)) { return; }; 8 | 9 | var oCNpc slf; slf = _^ (ECX); 10 | 11 | if (!Hlp_IsValidNPC (slf)) { return; }; 12 | 13 | if (NPC_IsPlayer (slf)) { 14 | var oCItem weapon; weapon = _^ (weaponPtr); 15 | 16 | //Get qty from inventory 17 | var int count; count = NPC_HasItems (slf, weapon.munition); 18 | 19 | //Get qty in hand 20 | if (!count) { 21 | var oCItem ammo; 22 | 23 | var int rightHandVobPtr; rightHandVobPtr = oCNpc_GetSlotItem (slf, NPC_NODE_RIGHTHAND); 24 | var int leftHandVobPtr; leftHandVobPtr = oCNpc_GetSlotItem (slf, NPC_NODE_LEFTHAND); 25 | 26 | if (Hlp_Is_oCItem(rightHandVobPtr)) { 27 | ammo = _^ (rightHandVobPtr); 28 | if (Hlp_GetInstanceID(ammo) == weapon.munition) { 29 | count += ammo.amount; 30 | }; 31 | }; 32 | 33 | if (Hlp_Is_oCItem(leftHandVobPtr)) { 34 | ammo = _^ (leftHandVobPtr); 35 | if (Hlp_GetInstanceID(ammo) == weapon.munition) { 36 | count += ammo.amount; 37 | }; 38 | }; 39 | }; 40 | 41 | //No ammo 42 | if (!count) { 43 | var string instName; instName = GetSymbolName (weapon.munition); 44 | 45 | const int symbID = 0; 46 | 47 | if (!symbID) { 48 | symbID = MEM_FindParserSymbol ("NOAMMOPRINT_AMMOMISSING"); 49 | }; 50 | 51 | if (symbID != -1) { 52 | MEM_PushStringParam (instName); 53 | MEM_CallByID (symbID); 54 | }; 55 | }; 56 | }; 57 | }; 58 | 59 | func void G12_NoAmmoPrint_Init () { 60 | const int once = 0; 61 | if (!once) { 62 | HookEngine (oCNpc__IsMunitionAvailable , 6, "_hook_oCNpc_IsMunitionAvailable"); 63 | once = 1; 64 | }; 65 | }; 66 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-NoAmmoPrint/noAmmoPrint_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * 1. Copy this file outside of script-packet 3 | * 2. Customize it (translate to your own language and add new ammo types if you need them) 4 | * 3. Link it to Gothic.src 5 | * 4. Profit 6 | */ 7 | 8 | //API function 9 | func void NoAmmoPrint_AmmoMissing(var string instName) { 10 | if (Hlp_StrCmp(instName, "ITAMARROW") || Hlp_StrCmp(instName, "ITRW_ARROW")) { 11 | PrintS("You're out of arrows!"); 12 | return; 13 | }; 14 | 15 | if (Hlp_StrCmp(instName, "ITRW_ADDON_MAGICARROW")) { 16 | PrintS("You're out of magical arrows!"); 17 | return; 18 | }; 19 | 20 | if (Hlp_StrCmp(instName, "ITRW_ADDON_FIREARROW")) { 21 | PrintS("You're out of fire arrows!"); 22 | return; 23 | }; 24 | 25 | if (Hlp_StrCmp(instName, "ITAMBOLT") || Hlp_StrCmp(instName, "ITRW_BOLT")) { 26 | PrintS("You're out of bolts!"); 27 | return; 28 | }; 29 | 30 | if (Hlp_StrCmp(instName, "ITRW_ADDON_MAGICBOLT")) { 31 | PrintS("You're out of magical bolts!"); 32 | return; 33 | }; 34 | 35 | PrintS("You're out of ammo!"); 36 | }; 37 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-PickLockHelper/pickLockHelper_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Picklock helper 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (translate to your own language, define your own rules for traders) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | //Toggle option - should last failed attempt be displayed? 11 | const int PICKLOCKHELPER_SHOWFAILEDATTEMPT = 1; 12 | 13 | const string PICKLOCKHELPER_FONTNAME = "FONT_OLD_10_WHITE.TGA"; 14 | const string PICKLOCKHELPER_FRAMETEX = "DLG_NOISE.TGA"; 15 | const int PICKLOCKHELPER_ALPHA = 192; 16 | 17 | //Localization 18 | const string PICKLOCKHELPER_LEFTKEY = "L"; 19 | const string PICKLOCKHELPER_RIGHTKEY = "R"; 20 | 21 | //PickLockHelper position 22 | //X position, if not defined (-1) then it will be in a middle of screen on X axis 23 | const int PICKLOCKHELPER_PPOSX = 0; 24 | //Y position, if not defined (-1) then it will be in a middle of screen on Y axis 25 | const int PICKLOCKHELPER_PPOSY = -1; 26 | 27 | //Virtual positions have higher prio than pixel positions. 28 | //if not defined (-1) then pickLockHelper_PPosX will be taken into consideration. Virtual coordinates 29 | const int PICKLOCKHELPER_VPOSX = -1; 30 | //if not defined (-1) then pickLockHelper_PPosY will be taken into consideration. Virtual coordinates 31 | const int PICKLOCKHELPER_VPOSY = -1; 32 | 33 | //Should picklockhelper view align automatically with inventory category view? (once inventory opens) 34 | const int PICKLOCKHELPER_ALINGWITHINVCATVIEW = 1; 35 | 36 | //default Width in pixels 37 | const int PICKLOCKHELPER_WIDTHPXL = 160; 38 | 39 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-PreventLooting/preventLooting.d: -------------------------------------------------------------------------------- 1 | func void _eventOpenDeadNPC (var int dummyVariable) { 2 | if (!Hlp_Is_oCNPC (ECX)) { return; }; 3 | 4 | var oCNPC slf; slf = _^ (ECX); 5 | 6 | if (NPC_IsPlayer (slf)) { 7 | if (!Hlp_Is_oCNPC (slf.focus_vob)) { return; }; 8 | 9 | var C_NPC oth; oth = _^ (slf.focus_vob); 10 | 11 | const int symbID = 0; 12 | var int retVal; retVal = 0; 13 | 14 | if (!symbID) { 15 | symbID = MEM_FindParserSymbol ("C_Npc_PreventLooting"); 16 | }; 17 | 18 | if (symbID != -1) { 19 | MEM_PushInstParam (oth); 20 | MEM_CallByID (symbID); 21 | retVal = MEM_PopIntResult (); 22 | }; 23 | 24 | if (retVal) { 25 | oCNpc_SetFocusVob (slf, 0); 26 | }; 27 | }; 28 | }; 29 | 30 | func void G12_PreventLooting_Init () { 31 | G12_OpenDeadNPCEvent_Init (); 32 | 33 | //HookEngine (oCNPC__OpenDeadNPC, MEMINT_SwitchG1G2 (7, 6), "_hook_oCNPC_OpenDeadNPC"); 34 | OpenDeadNPCEvent_AddListener (_eventOpenDeadNPC); 35 | }; 36 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-PreventLooting/preventLooting_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Prevent looting 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (define your own logic for when Npc cannot be looted) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | func int C_Npc_PreventLooting(var C_NPC slf) { 11 | //Prevent looting from traders 12 | if (Npc_IsTrader(slf)) { 13 | return TRUE; 14 | }; 15 | 16 | //Don't prevent looting 17 | return FALSE; 18 | }; 19 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-RainControl/rainControl_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Rain control 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it (define your own rules for when it should be raining) 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | /* 11 | * Example 12 | * Here it will be raining during specified time period 13 | */ 14 | func void RainControl_SetupRain () { 15 | if (Wld_SetRainTime (04, 30, 05, 30)) { 16 | } else if (Wld_SetRainTime (09, 30, 10, 30)) { 17 | } else if (Wld_SetRainTime (12, 30, 13, 30)) { 18 | } else if (Wld_SetRainTime (16, 30, 17, 30)) { 19 | } else if (Wld_SetRainTime (19, 30, 20, 30)) { 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-SpacerSpawn/spacerSpawn.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Spacer spawn 3 | * - super simple feature that will insert into the world NPCs previously inserted via Spacer. 4 | * 5 | * Principle: 6 | * - NPC inserted in Spacer does not have starting waypoint, it does not even have state_aiStatePosition, but it seems to retain its position, stored in _zCVob_trafoObjToWorld 7 | * - NPCs inserted into the world have either routine (oCNPC_States.hasRoutine) or ai state (oCNPC_States.aiStateDriven) 8 | * - whenever game tries to spawn an NPC it checks whether NPC has routine or ai state 9 | * - seems like NPC inserted via Spacer does not have any of these 10 | * - so in hooked function below we will check both properties - if NPC does not have routine and it does not have ai state - then we know this is NPC inserted via Spacer 11 | * - we can update it's spawn position state_aiStatePosition with it's 'physical' position _zCVob_trafoObjToWorld 12 | * - then we can update its aiStateDriven value to true - this will make sure NPC is inserted into the world by Gothic engine 13 | */ 14 | func void _hook_oCSpawnManager_SpawnNpc__SpacerSpawn () { 15 | var int slfPtr; slfPtr = MEM_ReadInt (ESP + 4); 16 | if (!Hlp_Is_oCNpc (slfPtr)) { return; }; 17 | 18 | var oCNpc slf; slf = _^ (slfPtr); 19 | 20 | var int statePtr; statePtr = NPC_GetNPCState (slf); 21 | if (!statePtr) { return; }; 22 | var oCNPC_States state; state = _^ (statePtr); 23 | 24 | //If NPC does not have routine and it does not have ai state --> then it was inserted from Spacer 25 | if ((!state.hasRoutine) && (!state.aiStateDriven)) { 26 | //Update aiStateDriven - to kick in ai state 27 | state.aiStateDriven = 1; 28 | 29 | slf.state_aiStatePosition[0] = slf._zCVob_trafoObjToWorld[3]; 30 | slf.state_aiStatePosition[1] = slf._zCVob_trafoObjToWorld[7]; 31 | slf.state_aiStatePosition[2] = slf._zCVob_trafoObjToWorld[11]; 32 | }; 33 | }; 34 | 35 | func void G12_SpacerSpawn_Init () { 36 | const int once = 0; 37 | if (!once) { 38 | //0x006D0710 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zVEC3 const &,float) 39 | const int oCSpawnManager__SpawnNpc_G1 = 7145232; 40 | 41 | //0x00778E70 public: void __thiscall oCSpawnManager::SpawnNpc(class oCNpc *,class zVEC3 const &,float) 42 | const int oCSpawnManager__SpawnNpc_G2 = 7835248; 43 | 44 | HookEngine (MEMINT_SwitchG1G2 (oCSpawnManager__SpawnNpc_G1, oCSpawnManager__SpawnNpc_G2), 6, "_hook_oCSpawnManager_SpawnNpc__SpacerSpawn"); 45 | 46 | once = 1; 47 | }; 48 | }; 49 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-SprintMode/sprintMode_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Sprint mode 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | //If not defined script will put bar right underneath health bar 11 | const int PC_SPRINTMODEBAR_PPOSX = -1; 12 | //If not defined script will put bar right underneath health bar 13 | const int PC_SPRINTMODEBAR_PPOSY = -1; 14 | 15 | //Virtual positions have higher prio than pixel positions. 16 | //if not defined (-1) then PC_SprintModeBar_PPosX will be taken into consideration. Virtual coordinates 17 | const int PC_SPRINTMODEBAR_VPOSX = -1; 18 | //if not defined (-1) then PC_SprintModeBar_PPosY will be taken into consideration. Virtual coordinates 19 | const int PC_SPRINTMODEBAR_VPOSY = -1; 20 | 21 | //Bar texture for stamina 22 | const int BAR_TEX_SPRINTMODE_STAMINA = 0; 23 | //Bar texture for timed overlays (potions) 24 | const int BAR_TEX_SPRINTMODE_TIMEDOVERLAY = 1; 25 | 26 | const string PC_SPRINTMODEBAR_TEX = "BAR_MISC.TGA"; 27 | const string PC_SPRINTMODEBAR_TIMED_TEX = "BAR_SPRINTMODE_TIMEDOVERLAY.TGA"; 28 | 29 | //Default sprint mode overlay 30 | const string PC_SPRINTMODEOVERLAYNAME = "HUMANS_SPRINT.MDS"; 31 | const string PC_SPRINTMODETIMEDOVERLAYNAME = "HUMANS_SPRINT.MDS"; 32 | 33 | //Don't activate sprint mode if already in sprint mode - or if drunk :) 34 | const int PC_SPRINTMODE_IGNOREWITHOVERLAYS_COUNT = 2; 35 | 36 | const string PC_SPRINTMODE_IGNOREWITHOVERLAYS0 = "HUMANS_SPRINT.MDS"; 37 | const string PC_SPRINTMODE_IGNOREWITHOVERLAYS1 = "HUMANS_DRUNKEN.MDS"; 38 | 39 | //When removing duplicate timed overlays script can either sum up all timers or get max value 40 | //0 get max value 41 | //1 sum up all timers 42 | const int PC_SPRINTMODEBAR_TIMEDOVERLAY_STACKING = 0; 43 | 44 | //Initial stamina 45 | const int PC_SPRINTMODE_STAMINAMAX_DEFAULT = 80; 46 | const int PC_SPRINTMODE_CONSUMESTAMINA_DEFAULT = TRUE; 47 | 48 | const string PC_SPRINTMODE_FONT = "FONT_OLD_10_WHITE.TGA"; 49 | 50 | const int SPRINTBAR_DISPLAYMETHOD = BarDisplay_DynamicUpdate; 51 | const int SPRINTBAR_PREVIEWEFFECT = BarPreviewEffect_FadeInOut; 52 | 53 | const int SPRINTBAR_DISPLAYVALUES = 1; 54 | const int SPRINTBAR_VIEW_ALPHAFUNC = 2; //ALPHA_FUNC_BLEND 55 | const string SPRINTBAR_DISPLAYVALUES_COLOR = "FFFFFF"; 56 | 57 | const int SPRINTBAR_DISPLAYVALUEOFFSETX = 0; 58 | const int SPRINTBAR_DISPLAYVALUEOFFSETY = -1; 59 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-TorchHotKey/torchHotkey_API.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Torch hotkey 3 | * 4 | * 1. Copy this file outside of script-packet 5 | * 2. Customize it 6 | * 3. Link it to Gothic.src 7 | * 4. Profit 8 | */ 9 | 10 | const int TORCHHOTKEY_RELITMOBS = 1; 11 | 12 | const int TORCHHOTKEY_RELITMOBS_ASCMODELS_COUNT = 11; 13 | 14 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS0 = "FIREPLACE_GROUND.ASC"; 15 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS1 = "FIREPLACE_GROUND2.ASC"; 16 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS2 = "FIREPLACE_GROUND_USE.ASC"; 17 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS3 = "FIREPLACE_HIGH.ASC"; 18 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS4 = "FIREPLACE_HIGH2.ASC"; 19 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS5 = "FIREPLACE_NCSTONE.ASC"; 20 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS6 = "FIREPLACE_NCSTONE2.ASC"; 21 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS7 = "FIREPLACE_PCHIGH.ASC"; 22 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS8 = "FIREPLACE_PCHIGH2.ASC"; 23 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS9 = "FIREPLACE_MIDDLE.ASC"; 24 | const string TORCHHOTKEY_RELITMOBS_ASCMODELS10 = "FIREPLACE_ORCSTAND.ASC"; 25 | 26 | //We need to make sure these overlays are re-applied when removing / drawing torch 27 | const int TORCHHOTKEY_REAPPLYOVERLAYS_COUNT = 1; 28 | const string TORCHHOTKEY_REAPPLYOVERLAYS0 = "HUMANS_SPRINT.MDS"; 29 | -------------------------------------------------------------------------------- /Standalone-Packages/G12-VobThrowing/testing.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Standalone-Packages/G12-VobThrowing/testing.d -------------------------------------------------------------------------------- /Standalone-Packages/G12-VobTransport/example #1 vobTransport_API.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/Standalone-Packages/G12-VobTransport/example #1 vobTransport_API.d -------------------------------------------------------------------------------- /Standalone-Packages/G12-VobTransport/internalFunctions.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Custom function recognizing Vobs that can be moved around 3 | */ 4 | func int Hlp_Is_zCVob__vobTransport (var int vobPtr) { 5 | if (!vobPtr) { return FALSE; }; 6 | 7 | //0x007DB44C const zCVob::`vftable' 8 | //const int zCVob_vtbl_G1 = 8238156; 9 | 10 | //0x0083997C const zCVob::`vftable' 11 | //const int zCVob_vtbl_G2 = 8624508; 12 | 13 | // 14 | //if (MEM_ReadInt (vobPtr) == MEMINT_SwitchG1G2 (zCVob_vtbl_G1, zCVob_vtbl_G2)) { 15 | 16 | if (Hlp_Is_zCVob (vobPtr)) { 17 | //Not yet supported 18 | if (Hlp_Is_zCParticleFX (vobPtr)) { return FALSE; }; 19 | 20 | //All other zCVob objects should be supported 21 | //MEM_Info (IntToString (MEM_ReadInt (vobPtr))); 22 | //return TRUE; 23 | 24 | var zCVob vob; vob = _^ (vobPtr); 25 | if (vob.type == 0) { 26 | /* 27 | enum zTVobType { 28 | zVOB_TYPE_NORMAL, //0 29 | zVOB_TYPE_LIGHT, //1 30 | zVOB_TYPE_SOUND, //2 31 | zVOB_TYPE_LEVEL_COMPONENT, //3 32 | zVOB_TYPE_SPOT, //4 33 | zVOB_TYPE_CAMERA, //5 34 | zVOB_TYPE_STARTPOINT, //6 35 | zVOB_TYPE_WAYPOINT, //7 36 | zVOB_TYPE_MARKER, //8 37 | zVOB_TYPE_SEPARATOR = 127, 38 | zVOB_TYPE_MOB, //128 39 | zVOB_TYPE_ITEM, //129 40 | zVOB_TYPE_NSC //130 41 | */ 42 | 43 | //Ignore all vobs without visual (I noticed weird behaviour - game crashed sometimes - not sure what kind of vobs these are :-/) 44 | //Camera vob ... 45 | var string visualName; visualName = Vob_GetVisualName (vobPtr); 46 | if (STR_Len (visualName)) { 47 | return TRUE; 48 | }; 49 | }; 50 | }; 51 | 52 | return FALSE; 53 | }; 54 | -------------------------------------------------------------------------------- /consoleCommands.d: -------------------------------------------------------------------------------- 1 | /* 2 | * Modified version of LeGo CC_Active function, checks existence of both function and commandPrefix 3 | */ 4 | func int CC_Exists(var func function, var string commandPrefix) { 5 | if (!_CC_List) { 6 | return FALSE; 7 | }; 8 | 9 | var int symID; symID = MEM_GetFuncID(function); 10 | 11 | commandPrefix = STR_Upper (commandPrefix); 12 | 13 | // Iterate over all registered CCs 14 | var zCArray a; a = _^(_CC_List); 15 | repeat(i, a.numInArray); var int i; 16 | var CCItem cc; cc = _^(MEM_ReadIntArray(a.array, i)); 17 | if ((cc.fncID == symID) && (Hlp_StrCmp (cc.cmd, commandPrefix))) { 18 | return TRUE; 19 | }; 20 | end; 21 | 22 | return FALSE; 23 | }; 24 | 25 | /* 26 | * Modified version of LeGo CC_Register function - allows multiple entries for same function (because of autocompletion :) ) 27 | */ 28 | func void CC_RegisterMulti(var func function, var string commandPrefix, var string description) { 29 | //If function was already registered ... then we cannot use LeGo version - as it does not allow multiple console commands for same function :-/ 30 | if (CC_Active(function)) { 31 | //Allow only unique entries 32 | if (CC_Exists (function, commandPrefix)) { 33 | return; 34 | }; 35 | 36 | commandPrefix = STR_Upper (commandPrefix); 37 | 38 | CC_AutoComplete (commandPrefix, description); 39 | 40 | var int symID; symID = MEM_GetFuncID(function); 41 | 42 | // Create CC object 43 | var int ccPtr; ccPtr = create(CCItem@); 44 | var CCItem cc; cc = _^(ccPtr); 45 | cc.fncID = symID; 46 | cc.cmd = commandPrefix; 47 | 48 | // Add CC to 'list' 49 | MEM_ArrayInsert(_CC_List, ccPtr); 50 | return; 51 | }; 52 | 53 | CC_Register (function, commandPrefix, description); 54 | }; 55 | 56 | /* 57 | * Function returns auto-completed command from CC_List 58 | */ 59 | func string CC_GetAutoCompletedQuery (var string query) { 60 | if (!_CC_List) { return query; }; 61 | 62 | // Iterate over all registered CCs 63 | var zCArray a; a = _^(_CC_List); 64 | repeat(i, a.numInArray); var int i; 65 | var CCItem cc; cc = _^(MEM_ReadIntArray(a.array, i)); 66 | if (STR_StartsWith (cc.cmd, query)) { 67 | return cc.cmd; 68 | }; 69 | end; 70 | 71 | return query; 72 | }; 73 | -------------------------------------------------------------------------------- /draw3D.d: -------------------------------------------------------------------------------- 1 | func void zCLineCache_Line3D (var int fromPosPtr, var int toPosPtr, var int color, var int useZBuffer) { 2 | //0x004FBA10 public: void __thiscall zCLineCache::Line3D(class zVEC3 const &,class zVEC3 const &,struct zCOLOR,int) 3 | const int zCLineCache__Line3D_G1 = 5224976; 4 | 5 | //0x0050B450 public: void __thiscall zCLineCache::Line3D(class zVEC3 const &,class zVEC3 const &,struct zCOLOR,int) 6 | const int zCLineCache__Line3D_G2 = 5289040; 7 | 8 | const int call = 0; 9 | if (CALL_Begin(call)) { 10 | CALL_IntParam(_@(useZBuffer)); 11 | CALL_IntParam(_@(color)); // zCOLOR 12 | CALL_PtrParam(_@(toPosPtr)); // zVEC3* 13 | CALL_PtrParam(_@(fromPosPtr)); // zVEC3* 14 | CALL__thiscall(_@(zlineCache), MEMINT_SwitchG1G2 (zCLineCache__Line3D_G1, zCLineCache__Line3D_G2)); 15 | call = CALL_End(); 16 | }; 17 | }; 18 | 19 | func void zTBBox3D_Draw (var int bboxPtr, var int color) { 20 | //0x00531E90 public: void __thiscall zTBBox3D::Draw(struct zCOLOR const &)const 21 | const int zTBBox3D__Draw_G1 = 5447312; 22 | 23 | //0x00545EE0 public: void __thiscall zTBBox3D::Draw(struct zCOLOR const &)const 24 | const int zTBBox3D__Draw_G2 = 5529312; 25 | 26 | const int colorPtr = 0; 27 | 28 | if (!colorPtr) { 29 | colorPtr = MEM_Alloc (4); 30 | }; 31 | 32 | MEM_WriteInt (colorPtr, color); 33 | 34 | const int call = 0; 35 | if (CALL_Begin(call)) { 36 | CALL_PtrParam(_@(colorPtr)); 37 | CALL__thiscall(_@(bboxPtr), MEMINT_SwitchG1G2 (zTBBox3D__Draw_G1, zTBBox3D__Draw_G2)); 38 | call = CALL_End(); 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /functions_PC.d: -------------------------------------------------------------------------------- 1 | /* 2 | * PC_PutInSleepingMode will freeze player in place (he will not move) 3 | */ 4 | func void PC_PutInSleepingMode () { 5 | if (!Hlp_IsValidNPC (hero)) { return; }; 6 | 7 | var oCNpc her; her = Hlp_GetNpc (hero); 8 | her._zCVob_bitfield[2] = (her._zCVob_bitfield[2] & ~ zCVob_bitfield2_sleepingMode) | 0; 9 | NPC_ClearAIQueue (hero); 10 | }; 11 | 12 | /* 13 | * PC_RemoveFromSleepingMode will unfreeze player 14 | */ 15 | func void PC_RemoveFromSleepingMode () { 16 | if (!Hlp_IsValidNPC (hero)) { return; }; 17 | 18 | var oCNpc her; her = Hlp_GetNpc (hero); 19 | her._zCVob_bitfield[2] = (her._zCVob_bitfield[2] & ~ zCVob_bitfield2_sleepingMode) | 1; 20 | NPC_ClearAIQueue (hero); 21 | }; 22 | -------------------------------------------------------------------------------- /game_engine.d: -------------------------------------------------------------------------------- 1 | func void oCGame_TriggerChangeLevel (var string levelName, var string vobName) { 2 | //0x0063D480 public: virtual void __thiscall oCGame::TriggerChangeLevel(class zSTRING const &,class zSTRING const &) 3 | const int oCGame__TriggerChangeLevel_G1 = 6542464; 4 | 5 | //0x006C7AF0 public: virtual void __thiscall oCGame::TriggerChangeLevel(class zSTRING const &,class zSTRING const &) 6 | const int oCGame__TriggerChangeLevel_G2 = 7109360; 7 | 8 | vobName = STR_Upper (vobName); 9 | levelName = STR_Upper (levelName); 10 | 11 | //Safety check - game crashes if you try to trigger change to current world 12 | var string thisLevelName; thisLevelName = oCWorld_GetWorldFilename (); 13 | 14 | if (Hlp_StrCmp (thisLevelName, levelName)) { 15 | if (STR_Len (vobName)) { 16 | Npc_BeamToKeepQueue (hero, vobName); 17 | }; 18 | } else { 19 | CALL_zStringPtrParam (vobName); 20 | CALL_zStringPtrParam (levelName); 21 | CALL__thiscall (_@(MEM_Game), MEMINT_SwitchG1G2 (oCGame__TriggerChangeLevel_G1, oCGame__TriggerChangeLevel_G2)); 22 | }; 23 | }; 24 | 25 | /* 26 | enum oHEROSTATUS { 27 | oHERO_STATUS_STD, 0 28 | oHERO_STATUS_THR, 1 29 | oHERO_STATUS_FGT 2 30 | }; 31 | */ 32 | 33 | /* 34 | * Function tells us whether player is being attacked 35 | */ 36 | func int oCGame_GetHeroStatus () { 37 | //0x00638B60 public: enum oHEROSTATUS __thiscall oCGame::GetHeroStatus(void) 38 | const int oCGame__GetHeroStatus_G1 = 6523744; 39 | 40 | //0x006C2D10 public: enum oHEROSTATUS __thiscall oCGame::GetHeroStatus(void) 41 | const int oCGame__GetHeroStatus_G2 = 7089424; 42 | 43 | var int ptr; ptr = _@ (MEM_Game); 44 | 45 | const int call = 0; 46 | if (CALL_Begin (call)) { 47 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCGame__GetHeroStatus_G1, oCGame__GetHeroStatus_G2)); 48 | call = CALL_End (); 49 | }; 50 | 51 | return CALL_RetValAsInt (); 52 | }; 53 | 54 | /* 55 | * Function updates attitudes of all Npcs 56 | */ 57 | func void oCGame_InitNpcAttitudes () { 58 | //0x0063BD00 public: void __thiscall oCGame::InitNpcAttitudes(void) 59 | const int oCGame__InitNpcAttitudes_G1 = 6536448; 60 | 61 | //0x006C61D0 public: void __thiscall oCGame::InitNpcAttitudes(void) 62 | const int oCGame__InitNpcAttitudes_G2 = 7102928; 63 | 64 | var int ptr; ptr = _@ (MEM_Game); 65 | 66 | const int call = 0; 67 | if (CALL_Begin (call)) { 68 | CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (oCGame__InitNpcAttitudes_G1, oCGame__InitNpcAttitudes_G2)); 69 | call = CALL_End (); 70 | }; 71 | }; 72 | 73 | /* 74 | * Function returns TRUE if chapter is yet to be introduced 75 | */ 76 | func int CGameManager_GetChapterIntroduce() 77 | { 78 | //0085e9e0 79 | const int s_chapter_introduce_addr_G1 = 8776160; 80 | 81 | //008c2954 82 | const int s_chapter_introduce_addr_G2 = 9185620; 83 | 84 | return + MEM_ReadByte(MEMINT_SwitchG1G2(s_chapter_introduce_addr_G1, s_chapter_introduce_addr_G2)); 85 | }; 86 | -------------------------------------------------------------------------------- /keys.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/keys.d -------------------------------------------------------------------------------- /list.d: -------------------------------------------------------------------------------- 1 | /* 2 | * zCListSort functions (I don't like LeGo ListS functions ... I mean why would you not start properly from index 0? :)) 3 | */ 4 | 5 | /* 6 | * zCListSort_GetNode 7 | */ 8 | func int zCListSort_GetNode(var int list, var int nr) { 9 | if (!list) { return 0; }; 10 | if (nr < 0) { return 0; }; 11 | 12 | var int i; i = 0; 13 | var int ptr; ptr = list; 14 | 15 | while (ptr); 16 | ptr = MEM_ReadInt(ptr + 8); 17 | 18 | if (i == nr) { 19 | return ptr; 20 | }; 21 | 22 | i += 1; 23 | end; 24 | 25 | return 0; 26 | }; 27 | 28 | /* 29 | * zCListSort_GetData 30 | */ 31 | func int zCListSort_GetData(var int list, var int nr) { 32 | if (!list) { return 0; }; 33 | 34 | var int nodePtr; nodePtr = zCListSort_GetNode(list, nr); 35 | if (!nodePtr) { return 0; }; 36 | 37 | nodePtr = MEM_ReadInt(nodePtr + 4); 38 | return + nodePtr; 39 | }; 40 | 41 | /* 42 | * zCListSort_GetLength 43 | */ 44 | func int zCListSort_GetLength(var int list) { 45 | if (!list) { return 0; }; 46 | 47 | var int nr; nr = 0; 48 | var int ptr; ptr = list; 49 | 50 | while(ptr); 51 | ptr = MEM_ReadInt(ptr + 8); 52 | nr += 1; 53 | end; 54 | 55 | return nr; 56 | }; 57 | -------------------------------------------------------------------------------- /parser.d: -------------------------------------------------------------------------------- 1 | /* 2 | * zCMenu_GetParser 3 | * - returns menu parser 4 | */ 5 | func int zCMenu_GetParser () { 6 | //0x004CE530 public: static class zCParser * __cdecl zCMenu::GetParser(void) 7 | const int zCMenu__GetParser_G1 = 5039408; 8 | 9 | //0x004DB130 public: static class zCParser * __cdecl zCMenu::GetParser(void) 10 | const int zCMenu__GetParser_G2 = 5091632; 11 | 12 | var int retVal; 13 | 14 | const int call = 0; 15 | if (CALL_Begin (call)) { 16 | CALL_PutRetValTo(_@(retVal)); 17 | CALL__cdecl(MEMINT_SwitchG1G2(zCMenu__GetParser_G1, zCMenu__GetParser_G2)); 18 | call = CALL_End (); 19 | }; 20 | 21 | return +retVal; 22 | }; 23 | 24 | /* 25 | * zCParser_GetSymbol 26 | * - returns parser symbol 27 | */ 28 | func int zCParser_GetSymbol(var int parserPtr, var string symbolName) { 29 | //0x006EA520 public: class zCPar_Symbol * __thiscall zCParser::GetSymbol(class zSTRING const &) 30 | const int zCParser__GetSymbol_G1 = 7251232; 31 | 32 | //0x007938D0 public: class zCPar_Symbol * __thiscall zCParser::GetSymbol(class zSTRING const &) 33 | const int zCParser__GetSymbol_G2 = 7944400; 34 | 35 | if (!parserPtr) { return 0; }; 36 | 37 | CALL_zStringPtrParam(symbolName); 38 | CALL__thiscall(parserPtr, MEMINT_SwitchG1G2(zCParser__GetSymbol_G1, zCParser__GetSymbol_G2)); 39 | return CALL_RetValAsPtr (); 40 | }; 41 | 42 | /* 43 | * zCParser_AutoCompletion 44 | * - default automcompletion used by console (reading symbol table) 45 | */ 46 | func int zCParser_AutoCompletion (var int parserPtr, var int wordPtr) { 47 | //0x006EB440 public: int __thiscall zCParser::AutoCompletion(class zSTRING &) 48 | const int zCParser__AutoCompletion_G1 = 7255104; 49 | 50 | //0x00794950 public: int __thiscall zCParser::AutoCompletion(class zSTRING &) 51 | const int zCParser__AutoCompletion_G2 = 7948624; 52 | 53 | var int retVal; 54 | 55 | const int call = 0; 56 | if (CALL_Begin(call)) { 57 | CALL_PutRetValTo (_@ (retVal)); 58 | CALL_PtrParam(_@(wordPtr)); 59 | CALL__thiscall(_@(parserPtr), MEMINT_SwitchG1G2 (zCParser__AutoCompletion_G1, zCParser__AutoCompletion_G2)); 60 | call = CALL_End(); 61 | }; 62 | 63 | return +retVal; 64 | }; 65 | -------------------------------------------------------------------------------- /polygons.d: -------------------------------------------------------------------------------- 1 | func void zCPolygon_GetCenter (var int polyPtr, var int targetPosPtr) { 2 | //0x00598870 public: class zVEC3 __thiscall zCPolygon::GetCenter(void) 3 | const int zCPolygon__GetCenter_G1 = 5867632; 4 | 5 | //0x005BA2F0 public: class zVEC3 __thiscall zCPolygon::GetCenter(void) 6 | const int zCPolygon__GetCenter_G2 = 6005488; 7 | 8 | if (!polyPtr) { return; }; 9 | 10 | //CALL_RetValIsStruct only supported in disposable calls 11 | CALL_RetValIsStruct (12); 12 | CALL__thiscall (polyPtr, MEMINT_SwitchG1G2 (zCPolygon__GetCenter_G1, zCPolygon__GetCenter_G2)); 13 | var int posPtr; posPtr = CALL_RetValAsPtr (); 14 | MEM_CopyBytes (posPtr, targetPosPtr, 12); 15 | MEM_Free (posPtr); 16 | }; 17 | -------------------------------------------------------------------------------- /render_engine.d: -------------------------------------------------------------------------------- 1 | // Render functions 2 | 3 | /* 4 | 5 | 0x0061B910 public: float __thiscall zCVob::GetDistanceToVob(class zCVob &) 6 | 0x0061B970 public: float __thiscall zCVob::GetDistanceToVobApprox(class zCVob &) 7 | 0x0061BA40 public: float __thiscall zCVob::GetDistanceToVob2(class zCVob &) 8 | 9 | 10 | 0x004BE400 public: static class zCVob * __cdecl zCCSCamera::GetPlayerVob(void) 11 | 12 | 13 | */ 14 | 15 | /* 16 | https://github.com/ataulien/GD3D11/blob/master/D3D11Engine/zTypes.h 17 | struct zTRenderContext 18 | { 19 | int ClipFlags; //clip flags - No idea 20 | zCVob *Vob; // zCVob ptr - Vob that we want to render?? 21 | zCWorld* world; // zCWorld ptr - 22 | zCCamera* cam; // zCCamera ptr - 23 | float distVobToCam; // distance to camera, so the vob renders at the correct size?? 24 | 25 | // More not needed stuff here 26 | }; 27 | */ 28 | 29 | FUNC INT zcVob_Render (var int vobPtr, var int renderContext) 30 | { 31 | //005D6090 .text Debug data ?Render@zCVob@@UAIHAAUzTRenderContext@@@Z 32 | const int zcVob__Render_G1 = 6119568; 33 | 34 | //0x006015D0 public: virtual int __fastcall zCVob::Render(struct zTRenderContext &) 35 | const int zcVob__Render_G2 = 6297040; 36 | 37 | const int call = 0; 38 | if (CALL_Begin(call)) { 39 | CALL__fastcall(_@(vobPtr), _@(renderContext), MEMINT_SwitchG1G2 (zcVob__Render_G1, zcVob__Render_G2)); 40 | call = CALL_End(); 41 | }; 42 | 43 | return CALL_RetValAsInt(); 44 | }; 45 | -------------------------------------------------------------------------------- /strings.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/strings.d -------------------------------------------------------------------------------- /vobThrowing.d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bad-Scientists/AF-Script-Packet/ccd03070914bce6695b7e8fbc876e257618623c5/vobThrowing.d -------------------------------------------------------------------------------- /zError_engine.d: -------------------------------------------------------------------------------- 1 | func int zERROR_GetFilterLevel () { 2 | //0x008699D8 class zERROR zerr 3 | const int zerr_G1 = 8821208; 4 | //0x008CDCD0 class zERROR zerr 5 | const int zerr_G2 = 9231568; 6 | 7 | var int zerr; zerr = MEMINT_SwitchG1G2 (zerr_G1, zerr_G2); 8 | 9 | //0x0057E350 public: int __thiscall zERROR::GetFilterLevel(void) 10 | const int zERROR__GetFilterLevel_G1 = 5759824; 11 | //0x0059D130 public: int __thiscall zERROR::GetFilterLevel(void) 12 | const int zERROR__GetFilterLevel_G2 = 5886256; 13 | 14 | var int retVal; 15 | 16 | const int call = 0; 17 | if (CALL_Begin(call)) { 18 | CALL_PutRetValTo (_@ (retVal)); 19 | CALL__thiscall (_@ (zerr), MEMINT_SwitchG1G2 (zERROR__GetFilterLevel_G1, zERROR__GetFilterLevel_G2)); 20 | call = CALL_End(); 21 | }; 22 | 23 | return + retVal; 24 | }; 25 | 26 | func void zERROR_SetFilterLevel (var int errorLevel) { 27 | //0x008699D8 class zERROR zerr 28 | const int zerr_G1 = 8821208; 29 | //0x008CDCD0 class zERROR zerr 30 | const int zerr_G2 = 9231568; 31 | 32 | var int zerr; zerr = MEMINT_SwitchG1G2 (zerr_G1, zerr_G2); 33 | 34 | //0x00449680 public: void __thiscall zERROR::SetFilterLevel(int) 35 | const int zERROR__SetFilterLevel_G1 = 4494976; 36 | //0x0044DDA0 public: void __thiscall zERROR::SetFilterLevel(int) 37 | const int zERROR__SetFilterLevel_G2 = 4513184; 38 | 39 | const int call = 0; 40 | if (CALL_Begin(call)) { 41 | CALL_IntParam (_@ (errorLevel)); 42 | CALL__thiscall (_@ (zerr), MEMINT_SwitchG1G2 (zERROR__SetFilterLevel_G1, zERROR__SetFilterLevel_G2)); 43 | call = CALL_End(); 44 | }; 45 | }; 46 | 47 | func int zERROR_SearchForSpy () { 48 | //0x008699D8 class zERROR zerr 49 | const int zerr_G1 = 8821208; 50 | //0x008CDCD0 class zERROR zerr 51 | const int zerr_G2 = 9231568; 52 | 53 | var int zerr; zerr = MEMINT_SwitchG1G2 (zerr_G1, zerr_G2); 54 | 55 | //0x00449EB0 public: bool __thiscall zERROR::SearchForSpy(void) 56 | const int zERROR__SearchForSpy_G1 = 4497072; 57 | //0x0044E640 public: bool __thiscall zERROR::SearchForSpy(void) 58 | const int zERROR__SearchForSpy_G2 = 4515392; 59 | 60 | var int retVal; 61 | 62 | const int call = 0; 63 | if (CALL_Begin(call)) { 64 | CALL_PutRetValTo (_@ (retVal)); 65 | CALL__thiscall (_@ (zerr), MEMINT_SwitchG1G2 (zERROR__SearchForSpy_G1, zERROR__SearchForSpy_G2)); 66 | call = CALL_End(); 67 | }; 68 | 69 | return + retVal; 70 | }; 71 | 72 | func void zSpy_Info (var string s) { 73 | //Backup error level 74 | var int errorLevel; errorLevel = zERROR_GetFilterLevel (); 75 | //Set error level to 1 (minimum) 76 | if (errorLevel < 1) { 77 | zERROR_SetFilterLevel (1); 78 | }; 79 | 80 | MEM_Info (s); 81 | 82 | //Restore error level 83 | if (errorLevel < 1) { 84 | zERROR_SetFilterLevel (errorLevel); 85 | }; 86 | }; 87 | --------------------------------------------------------------------------------