Merge of rewritten NS module into trunk
This commit is contained in:
@@ -1,3 +1,36 @@
|
||||
/* AMX Mod X
|
||||
* Natural Selection Module
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
*
|
||||
* This file is part of AMX Mod X.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NS_CONST_H
|
||||
#define NS_CONST_H
|
||||
@@ -6,56 +39,156 @@
|
||||
|
||||
// Offsets (used in NPData.cpp)
|
||||
|
||||
#define OFFSET_WIN_RESOURCES 1816 //454 * 4 // est: 454 // CONFIRMED
|
||||
#define OFFSET_LIN_RESOURCES 1836 //459 * 4 // no change
|
||||
#define NEED_TO_FIND 0
|
||||
|
||||
#define OFFSET_WIN_WEAPDMG 408 //100 * 4 // est: 102 // CONFIRMED
|
||||
#define OFFSET_LIN_WEAPDMG 424 //106 * 4 // Changed + 8 Bytes
|
||||
|
||||
#define OFFSET_WIN_WEAPRANGE 404 //99 * 4 // est: 101 // CONFIRMED
|
||||
#define OFFSET_LIN_WEAPRANGE 420 //105 * 4 // Changed + 8 Bytes
|
||||
#define OFFSET_WIN_RESOURCES 1816
|
||||
#define OFFSET_LIN_RESOURCES 1836
|
||||
|
||||
#define OFFSET_WIN_WEAPCLIP 364 //91 * 4 // est: 91 // CONFIRMED
|
||||
#define OFFSET_LIN_WEAPCLIP 380 //95 * 4 // no change
|
||||
#define OFFSET_WIN_WEAPDMG 408
|
||||
#define OFFSET_LIN_WEAPDMG 424
|
||||
|
||||
#define OFFSET_WIN_HIVE_TRAIT 488 //121 * 4 // est: 122 // CONFIRMED
|
||||
#define OFFSET_LIN_HIVE_TRAIT 504 //126 * 4 // Changed + 4 bytes
|
||||
#define OFFSET_WIN_WEAPRANGE 404
|
||||
#define OFFSET_LIN_WEAPRANGE 420
|
||||
|
||||
#define OFFSET_WIN_SCORE 6588 //1639 * 4 // est: 1647 // CONFIRMED
|
||||
#define OFFSET_LIN_SCORE 6608 //1644 * 4 // Changed + 32 bytes
|
||||
#define OFFSET_WIN_WEAPCLIP 364
|
||||
#define OFFSET_LIN_WEAPCLIP 380
|
||||
|
||||
#define OFFSET_WIN_EXP 6512 //1620 * 4 // est: 1628 // CONFIRMED
|
||||
#define OFFSET_LIN_EXP 6532 //1633 * 4 // Changed + 32 bytes
|
||||
#define OFFSET_WIN_WEAPID 324
|
||||
#define OFFSET_LIN_WEAPID 340
|
||||
|
||||
#define OFFSET_WIN_POINTS 6520 //1622 * 4 // est: 1630 // CONFIRMED
|
||||
#define OFFSET_LIN_POINTS 6540 //1635 * 4 // Changed + 32 bytes
|
||||
// Next weapon in the item linked list
|
||||
#define OFFSET_WIN_WEAP_NEXT 320
|
||||
#define OFFSET_LIN_WEAP_NEXT 336
|
||||
|
||||
#define OFFSET_WIN_AMMO_LMG 1116 //279 * 4 // est: 279 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_LMG 1136 //284 * 4 // no change
|
||||
#define OFFSET_WIN_HIVE_TRAIT 488
|
||||
#define OFFSET_LIN_HIVE_TRAIT 504
|
||||
|
||||
#define OFFSET_WIN_AMMO_PISTOL 1120 //280 * 4 // est: 280 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_PISTOL 1140 //285 * 4 // no change
|
||||
#define OFFSET_WIN_SCORE 6588
|
||||
#define OFFSET_LIN_SCORE 6608
|
||||
|
||||
#define OFFSET_WIN_AMMO_SHOTGUN 1124 //281 * 4 // est: 281 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_SHOTGUN 1144 //286 * 4 // no change
|
||||
#define OFFSET_WIN_EXP 6512
|
||||
#define OFFSET_LIN_EXP 6532
|
||||
|
||||
#define OFFSET_WIN_AMMO_HMG 1128 //282 * 4 // est: 282 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_HMG 1148 //287 * 4 // no change
|
||||
#define OFFSET_WIN_POINTS 6520
|
||||
#define OFFSET_LIN_POINTS 6540
|
||||
|
||||
#define OFFSET_WIN_AMMO_GL 1132 //283 * 4 // est: 283 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_GL 1152 //288 * 4 // no change
|
||||
#define OFFSET_WIN_AMMO_LMG 1116
|
||||
#define OFFSET_LIN_AMMO_LMG 1136
|
||||
|
||||
#define OFFSET_WIN_AMMO_HG 1136 //284 * 4 // est: 284 // CONFIRMED
|
||||
#define OFFSET_LIN_AMMO_HG 1156 //289 * 4 // no change
|
||||
#define OFFSET_WIN_AMMO_PISTOL 1120
|
||||
#define OFFSET_LIN_AMMO_PISTOL 1140
|
||||
|
||||
#define OFFSET_WIN_DEATHS 1380 //345 * 4 // est: 345 // CONFIRMED
|
||||
#define OFFSET_LIN_DEATHS 1400 //350 * 4 // no change
|
||||
#define OFFSET_WIN_AMMO_SHOTGUN 1124
|
||||
#define OFFSET_LIN_AMMO_SHOTGUN 1144
|
||||
|
||||
#define OFFSET_WIN_STRUCTOWNER 324 //81 * 4 // est: 81 // CONFIRMED
|
||||
#define OFFSET_LIN_STRUCTOWNER 340 //85 * 4 // no change
|
||||
#define OFFSET_WIN_AMMO_HMG 1128
|
||||
#define OFFSET_LIN_AMMO_HMG 1148
|
||||
|
||||
#define OFFSET_WIN_HIVEABILITY 6248 //1555 * 4 // est: 1562 // CONFIRMED
|
||||
#define OFFSET_LIN_HIVEABILITY 6268 //1567 * 4 // Changed + 28 bytes
|
||||
#define OFFSET_WIN_AMMO_GL 1132
|
||||
#define OFFSET_LIN_AMMO_GL 1152
|
||||
|
||||
#define OFFSET_WIN_AMMO_HG 1136
|
||||
#define OFFSET_LIN_AMMO_HG 1156
|
||||
|
||||
#define OFFSET_WIN_DEATHS 1380
|
||||
#define OFFSET_LIN_DEATHS 1400
|
||||
|
||||
#define OFFSET_WIN_STRUCTOWNER 324
|
||||
#define OFFSET_LIN_STRUCTOWNER 340
|
||||
|
||||
#define OFFSET_WIN_HIVEABILITY 6248
|
||||
#define OFFSET_LIN_HIVEABILITY 6268
|
||||
|
||||
#define OFFSET_WIN_PLAYER_ITEMS 1068
|
||||
#define OFFSET_LIN_PLAYER_ITEMS 1088
|
||||
|
||||
#define OFFSET_WIN_NEXT_WEAPON 1280
|
||||
#define OFFSET_LIN_NEXT_WEAPON 1300
|
||||
|
||||
#define OFFSET_WIN_CURRENT_WEAPON 1092
|
||||
#define OFFSET_LIN_CURRENT_WEAPON 1112 // +4 is the client known weapon if it's ever needed
|
||||
|
||||
#define OFFSET_WIN_LAST_WEAPON 1100
|
||||
#define OFFSET_LIN_LAST_WEAPON 1120
|
||||
|
||||
|
||||
|
||||
#define OFFSET_WIN_ENTVAR 4
|
||||
#define OFFSET_LIN_ENTVAR 4 // first entry in the virtual class (vtable is 0)
|
||||
|
||||
#define OFFSET_WIN_OBS_ENERGY 476
|
||||
#define OFFSET_LIN_OBS_ENERGY 492
|
||||
|
||||
#define OFFSET_WIN_WELD_DONE 128
|
||||
#define OFFSET_LIN_WELD_DONE 144
|
||||
|
||||
#define OFFSET_WIN_WELD_TIME 132
|
||||
#define OFFSET_LIN_WELD_TIME 148
|
||||
|
||||
#define OFFSET_WIN_GHOST_STRUCTURE 472
|
||||
#define OFFSET_LIN_GHOST_STRUCTURE 488
|
||||
|
||||
// The teamnumber for the specified team
|
||||
#define OFFSET_WIN_GAMEPLAY_TEAMA 0x54
|
||||
#define OFFSET_LIN_GAMEPLAY_TEAMA 0x64
|
||||
|
||||
#define OFFSET_WIN_GAMEPLAY_TEAMB 0x58
|
||||
#define OFFSET_LIN_GAMEPLAY_TEAMB 0x68
|
||||
|
||||
|
||||
// TODO: Symbols / signatures instead
|
||||
// Not actually offsets, but easier to use MAKE_OFFSET stuff for this :o
|
||||
// First functions listed in the disassembler
|
||||
#define OFFSET_WIN_BASE "?SUB_CallUseToggle@CBaseEntity@@QAEXXZ"
|
||||
#define OFFSET_LIN_BASE "_init"
|
||||
|
||||
#define OFFSET_LIN_MEMBERFUNCSTART 0x000EDBE8 // The location of _init in the binary
|
||||
#define OFFSET_WIN_MEMBERFUNCSTART 0x00001000 // The location of CBaseEntity::SUB_CallUseToggle
|
||||
|
||||
// NOTE: These addresses are raw offsets, not including the
|
||||
// base addresses! These are the exact offsets that
|
||||
// the disassembler provides.
|
||||
// MAKE_MEMBER_OFFSET will compensate for the base address
|
||||
|
||||
|
||||
// Recycle: void AvHBaseBuildable::StartRecycle(void)
|
||||
#define OFFSET_WIN_MEMBER_RECYCLE MAKE_MEMBER_OFFSET(0x00053950)
|
||||
#define OFFSET_LIN_MEMBER_RECYCLE MAKE_MEMBER_OFFSET(0x00180800)
|
||||
|
||||
|
||||
// Weldable: void AvHWeldable::AddWeldTime(float Time)
|
||||
#define OFFSET_WIN_MEMBER_TRIGGER_WELDABLE MAKE_MEMBER_OFFSET(0x000A0E20)
|
||||
#define OFFSET_LIN_MEMBER_TRIGGER_WELDABLE MAKE_MEMBER_OFFSET(0x00232840)
|
||||
|
||||
|
||||
|
||||
// Game Rules: AvHGameRules *GetGameRules(void)
|
||||
#define OFFSET_WIN_GETGAMERULES MAKE_MEMBER_OFFSET(0x00068000)
|
||||
#define OFFSET_LIN_GETGAMERULES MAKE_MEMBER_OFFSET(0x0019F930)
|
||||
|
||||
// Offset into the gamerules pointer to the TeamA / TeamB class
|
||||
#define GAMERULES_TEAMA_OFFSET 0xCC
|
||||
#define GAMERULES_TEAMB_OFFSET 0x2A8
|
||||
|
||||
#define AVHTEAM_RESOURCES_OFFSET 0x94
|
||||
|
||||
#define GAMERULES_TEAMA_RESOURCES GAMERULES_TEAMA_OFFSET + AVHTEAM_RESOURCES_OFFSET
|
||||
#define GAMERULES_TEAMB_RESOURCES GAMERULES_TEAMB_OFFSET + AVHTEAM_RESOURCES_OFFSET
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
NSGame_CantTell, /**< It is too soon to tell (can't find avhgameplay
|
||||
entity or it doesn't have private data) */
|
||||
|
||||
NSGame_MarineVAlien, /**< Marine vs Aliens (standard) gameplay */
|
||||
NSGame_MarineVMarine, /**< Marine vs Marine */
|
||||
NSGame_AlienVAlien, /**< Alien vs Alien */
|
||||
|
||||
NSGame_Unknown, /**< Can find the gameplay entity, but can't
|
||||
determine gameplay type. */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -63,51 +196,51 @@ enum
|
||||
MASK_SIGHTED = 1,
|
||||
MASK_DETECTED = 2,
|
||||
MASK_BUILDABLE = 4,
|
||||
MASK_BASEBUILD0 = 8, // Base build slot #0
|
||||
MASK_WEAPONS1 = 8, // Marine weapons 1
|
||||
MASK_CARAPACE = 8, // Alien carapace
|
||||
MASK_WEAPONS2 = 16, // Marines weapons 2
|
||||
MASK_REGENERATION = 16, // Alien regeneration
|
||||
MASK_BASEBUILD1 = 16, // Base build slot #1
|
||||
MASK_WEAPONS3 = 32, // Marine weapons 3
|
||||
MASK_REDEMPTION = 32, // Alien redemption
|
||||
MASK_BASEBUILD2 = 32, // Base build slot #2
|
||||
MASK_ARMOR1 = 64, // Marine armor 1
|
||||
MASK_CELERITY = 64, // Alien celerity
|
||||
MASK_BASEBUILD3 = 64, // Base build slot #3
|
||||
MASK_ARMOR2 = 128, // Marine armor 2
|
||||
MASK_ADRENALINE = 128, // Alien adrenaline
|
||||
MASK_BASEBUILD4 = 128, // Base build slot #4
|
||||
MASK_ARMOR3 = 256, // Marine armor 3
|
||||
MASK_SILENCE = 256, // Alien silence
|
||||
MASK_BASEBUILD5 = 256, // Base build slot #5
|
||||
MASK_JETPACK = 512, // Marine jetpacks
|
||||
MASK_CLOAKING = 512, // Alien cloaking
|
||||
MASK_BASEBUILD6 = 512, // Base build slot #6
|
||||
MASK_FOCUS = 1024, // Alien focus
|
||||
MASK_MOTION = 1024, // Marine motion tracking
|
||||
MASK_BASEBUILD7 = 1024, // Base build slot #7
|
||||
MASK_BASEBUILD0 = 8, // Base build slot #0
|
||||
MASK_WEAPONS1 = 8, // Marine weapons 1
|
||||
MASK_CARAPACE = 8, // Alien carapace
|
||||
MASK_WEAPONS2 = 16, // Marines weapons 2
|
||||
MASK_REGENERATION = 16, // Alien regeneration
|
||||
MASK_BASEBUILD1 = 16, // Base build slot #1
|
||||
MASK_WEAPONS3 = 32, // Marine weapons 3
|
||||
MASK_REDEMPTION = 32, // Alien redemption
|
||||
MASK_BASEBUILD2 = 32, // Base build slot #2
|
||||
MASK_ARMOR1 = 64, // Marine armor 1
|
||||
MASK_CELERITY = 64, // Alien celerity
|
||||
MASK_BASEBUILD3 = 64, // Base build slot #3
|
||||
MASK_ARMOR2 = 128, // Marine armor 2
|
||||
MASK_ADRENALINE = 128, // Alien adrenaline
|
||||
MASK_BASEBUILD4 = 128, // Base build slot #4
|
||||
MASK_ARMOR3 = 256, // Marine armor 3
|
||||
MASK_SILENCE = 256, // Alien silence
|
||||
MASK_BASEBUILD5 = 256, // Base build slot #5
|
||||
MASK_JETPACK = 512, // Marine jetpacks
|
||||
MASK_CLOAKING = 512, // Alien cloaking
|
||||
MASK_BASEBUILD6 = 512, // Base build slot #6
|
||||
MASK_FOCUS = 1024, // Alien focus
|
||||
MASK_MOTION = 1024, // Marine motion tracking
|
||||
MASK_BASEBUILD7 = 1024, // Base build slot #7
|
||||
MASK_SCENTOFFEAR = 2048, // Alien scent of fear
|
||||
MASK_DEFENSE2 = 4096, // Defense level 2
|
||||
MASK_DEFENSE3 = 8192, // Defense level 3
|
||||
MASK_DEFENSE2 = 4096, // Defense level 2
|
||||
MASK_DEFENSE3 = 8192, // Defense level 3
|
||||
MASK_ELECTRICITY = 8192, // Electricy
|
||||
MASK_MOVEMENT2 = 16384, // Movement level 2,
|
||||
MASK_MOVEMENT3 = 32768, // Movement level 3
|
||||
MASK_MOVEMENT2 = 16384, // Movement level 2,
|
||||
MASK_MOVEMENT3 = 32768, // Movement level 3
|
||||
MASK_HEAVYARMOR = 32768, // Marine heavy armor
|
||||
MASK_SENSORY2 = 65536, // Sensory level 2
|
||||
MASK_SENSORY3 = 131072, // Sensory level 3
|
||||
MASK_SENSORY2 = 65536, // Sensory level 2
|
||||
MASK_SENSORY3 = 131072, // Sensory level 3
|
||||
MASK_ALIEN_MOVEMENT = 262144, // Onos is charging
|
||||
MASK_WALLSTICKING = 524288, // Flag for wall-sticking
|
||||
MASK_PRIMALSCREAM = 1048576, // Alien is in range of active primal scream
|
||||
MASK_UMBRA = 2097152, // In umbra
|
||||
MASK_UMBRA = 2097152, // In umbra
|
||||
MASK_DIGESTING = 4194304, // When set on a visible player, player is digesting. When set on invisible player, player is being digested
|
||||
MASK_RECYCLING = 8388608, // Building is recycling
|
||||
MASK_TOPDOWN = 16777216, // Commander view
|
||||
MASK_PLAYER_STUNNED = 33554432, // Player has been stunned by stomp
|
||||
MASK_ENSNARED = 67108864, // Webbed
|
||||
MASK_ALIEN_EMBRYO = 134217728, //268435456, // Gestating
|
||||
MASK_SELECTABLE = 268435456, //536870912, // ???
|
||||
MASK_PARASITED = 536870912, //1073741824, // Parasite flag
|
||||
MASK_ALIEN_EMBRYO = 134217728, //268435456, // Gestating
|
||||
MASK_SELECTABLE = 268435456, //536870912, // ???
|
||||
MASK_PARASITED = 536870912, //1073741824, // Parasite flag
|
||||
MASK_SENSORY_NEARBY = 1073741824 //2147483648 // Sensory chamber in range
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user