├── LICENSE ├── Project SyPB ├── AMXX │ ├── SyPB Extras - CSBTE Firmware │ │ ├── SyPB_BTESetting.ini │ │ ├── plugins-sypbfw.ini │ │ ├── sypb_bte_basefw.amxx │ │ └── sypb_bte_basefw.sma │ ├── swnpc.inc │ ├── swnpc_preview.sma │ ├── sypb.inc │ └── sypb_api_test.sma ├── Project_OutPut │ ├── SwNPC_amxx.dll │ ├── sypb.dll │ └── sypb_amxx.dll ├── Project_SyPB.sln ├── SwNPC │ ├── SwNPC.vcxproj │ ├── SwNPC.vcxproj.filters │ ├── SwNPC.vcxproj.user │ ├── sdk │ │ ├── common │ │ │ ├── beamdef.h │ │ │ ├── cl_entity.h │ │ │ ├── com_model.h │ │ │ ├── con_nprint.h │ │ │ ├── const.h │ │ │ ├── crc.h │ │ │ ├── cvardef.h │ │ │ ├── demo_api.h │ │ │ ├── director_cmds.h │ │ │ ├── dlight.h │ │ │ ├── dll_state.h │ │ │ ├── engine_launcher_api.h │ │ │ ├── entity_state.h │ │ │ ├── entity_types.h │ │ │ ├── event_api.h │ │ │ ├── event_args.h │ │ │ ├── event_flags.h │ │ │ ├── exefuncs.h │ │ │ ├── hltv.h │ │ │ ├── in_buttons.h │ │ │ ├── interface.cpp │ │ │ ├── interface.h │ │ │ ├── ivoicetweak.h │ │ │ ├── mathlib.h │ │ │ ├── net_api.h │ │ │ ├── netadr.h │ │ │ ├── nowin.h │ │ │ ├── particledef.h │ │ │ ├── pmtrace.h │ │ │ ├── qfont.h │ │ │ ├── r_efx.h │ │ │ ├── r_studioint.h │ │ │ ├── ref_params.h │ │ │ ├── screenfade.h │ │ │ ├── studio_event.h │ │ │ ├── triangleapi.h │ │ │ ├── usercmd.h │ │ │ └── weaponinfo.h │ │ ├── engine │ │ │ ├── Sequence.h │ │ │ ├── anorms.h │ │ │ ├── archtypes.h │ │ │ ├── cdll_int.h │ │ │ ├── custom.h │ │ │ ├── customentity.h │ │ │ ├── edict.h │ │ │ ├── eiface.h │ │ │ ├── keydefs.h │ │ │ ├── progdefs.h │ │ │ ├── progs.h │ │ │ ├── shake.h │ │ │ └── studio.h │ │ ├── pm_shared │ │ │ ├── pm_defs.h │ │ │ ├── pm_info.h │ │ │ └── pm_movevars.h │ │ └── sdk │ │ │ ├── activity.h │ │ │ ├── basemonster.h │ │ │ ├── cbase.h │ │ │ ├── cdll_dll.h │ │ │ ├── dllapi.h │ │ │ ├── engine_api.h │ │ │ ├── enginecallback.h │ │ │ ├── enginecallbacks.h │ │ │ ├── extdll.h │ │ │ ├── log_meta.h │ │ │ ├── meta_api.h │ │ │ ├── mhook.h │ │ │ ├── monsterevent.h │ │ │ ├── mreg.h │ │ │ ├── mutil.h │ │ │ ├── osdep.h │ │ │ ├── plinfo.h │ │ │ ├── saverestore.h │ │ │ ├── sdk_util.h │ │ │ ├── types_meta.h │ │ │ ├── util.h │ │ │ └── vector.h │ └── source │ │ ├── amxxmodule.cpp │ │ ├── amxxmodule.h │ │ ├── api.cpp │ │ ├── base.cpp │ │ ├── core.h │ │ ├── main.cpp │ │ ├── main.h │ │ ├── moduleconfig.h │ │ ├── npc_ai.cpp │ │ ├── npc_control.cpp │ │ ├── swnpc.rc │ │ ├── sypbload.cpp │ │ └── waypoint.cpp ├── SyPB_API │ ├── SyPB API.vcxproj │ ├── SyPB API.vcxproj.filters │ ├── SyPB API.vcxproj.user │ ├── sdk │ │ ├── CString.h │ │ ├── CVector.h │ │ ├── amxxmodule.cpp │ │ ├── amxxmodule.h │ │ ├── hlsdk │ │ │ ├── archtypes.h │ │ │ ├── const.h │ │ │ ├── eiface.h │ │ │ ├── enginecallback.h │ │ │ ├── extdll.h │ │ │ ├── progdefs.h │ │ │ ├── util.h │ │ │ └── vector.h │ │ ├── metamod │ │ │ ├── dllapi.h │ │ │ ├── meta_api.h │ │ │ ├── mutil.h │ │ │ ├── plinfo.h │ │ │ └── sdk_util.h │ │ └── moduleconfig.h │ └── source │ │ ├── base.cpp │ │ ├── main.cpp │ │ ├── main.h │ │ └── sypb_api.rc ├── SyPB_BOT │ ├── SyPB Bot.vcxproj │ ├── SyPB Bot.vcxproj.filters │ ├── SyPB Bot.vcxproj.user │ ├── include │ │ ├── Experience.h │ │ ├── core.h │ │ ├── engine.h │ │ ├── globals.h │ │ ├── platform.h │ │ ├── runtime.h │ │ ├── sypb.aps │ │ └── sypb.rc │ └── source │ │ ├── Experience.cpp │ │ ├── basecode.cpp │ │ ├── chatlib.cpp │ │ ├── combat.cpp │ │ ├── control.cpp │ │ ├── engine.cpp │ │ ├── globals.cpp │ │ ├── interface.cpp │ │ ├── navigate.cpp │ │ ├── netmsg.cpp │ │ ├── support.cpp │ │ └── waypoint.cpp └── version.h └── README.md /Project SyPB/AMXX/SyPB Extras - CSBTE Firmware/SyPB_BTESetting.ini: -------------------------------------------------------------------------------- 1 | ; SyPB Extras - CSBTE Base Firmware 1.30 2 | ; Game Data File 3 | ; HsK-Dev Blog By CCN 4 | ; 5 | ; cstrike\addons\amxmodx\configs\ 6 | 7 | ; Weapon Model, Clip 8 | [Gun Data] 9 | v_m3dragon,8 10 | v_starchasersr,15 11 | v_ddeagle,28 12 | v_mp7a1,20 13 | v_cannonexgold,45 14 | v_cannonex_d3a3,45 15 | v_snakegun,20 16 | v_tmpdragon,30 17 | v_m95xmas,5 18 | v_crow5,50 19 | v_halo_smg,60 20 | v_m3,8 21 | v_sgmissile,30 22 | v_gunkata,36 23 | v_mp40,32 24 | v_cannon,20 25 | v_musket,10 26 | v_janus11,15 27 | v_m16a1ep,31 28 | v_qbz95b,35 29 | v_desperado,7 30 | v_buffaktw_6,62 31 | v_lightzg,30 32 | v_crow1,50 33 | v_lugers,16 34 | v_buffm4tw_6,62 35 | v_m134ex,200 36 | v_augex,30 37 | v_galil,35 38 | v_m950se,58 39 | v_sterlingbayonet,50 40 | v_crow3,64 41 | v_m134xmas,200 42 | v_dualkriss,50 43 | v_mp5,30 44 | v_mk3a1,10 45 | v_crow11,20 46 | v_k1ase,30 47 | v_infinitysr,15 48 | v_plasmagun,45 49 | v_crow7,100 50 | v_m249,100 51 | v_scout,10 52 | v_tknifeex2,30 53 | v_m60,100 54 | v_tmp,30 55 | v_trg42,10 56 | v_firecracker,5 57 | v_ump45,25 58 | v_mp7a160r,60 59 | v_horsegun,20 60 | v_buffak,50 61 | v_at4,1 62 | v_k1a,30 63 | v_kingcobrag,7 64 | v_mp7a1_2,20 65 | v_mp5tiger,30 66 | v_kriss,30 67 | v_thompson,50 68 | v_cartblue,30 69 | v_sfpistol,50 70 | v_thompsongold,50 71 | v_coilgun,100 72 | v_watergun,40 73 | v_railcannon,24 74 | v_mp5g,30 75 | v_tknife,30 76 | v_p90,50 77 | v_skull8,120 78 | v_luger,8 79 | v_p90lapin,50 80 | v_anaconda,7 81 | v_thanatos5,30 82 | v_m134,200 83 | v_aug,30 84 | v_infinitysb,8 85 | v_norinco86s,30 86 | v_waterpistol,40 87 | v_infinityss,8 88 | v_at4ex,1 89 | v_skull1,7 90 | v_lugerg,8 91 | v_m79g,6 92 | v_catapult,10 93 | v_kingcobra,7 94 | v_m79,5 95 | v_fnp45,15 96 | v_tknifeex,30 97 | v_janus1,5 98 | v_infinityex2,40 99 | v_infinityex1,40 100 | v_m32,6 101 | v_infinity,30 102 | v_mg36g,100 103 | v_fglauncher,10 104 | v_bazooka,20 105 | v_flamethrower,100 106 | v_watercannon,100 107 | v_m1918bar,20 108 | v_k3,70 109 | v_an94,30 110 | v_g_ak47,30 111 | v_ak47,30 112 | v_ak47dragon,30 113 | v_m4a1dragon,30 114 | v_g_m4a1,30 115 | v_m4a1gold,30 116 | v_akm,30 117 | v_m4a1,30 118 | v_awp,10 119 | v_g_deagle,7 120 | v_deagle,7 121 | v_sfgun,45 122 | v_spas12excraft,20 123 | v_sfsmg,35 124 | v_buffm4,50 125 | v_sfmg,200 126 | v_sfsniper,20 127 | v_p228,13 128 | v_skull4,48 129 | v_skull5,24 130 | v_zgun,10 131 | v_skull6,100 132 | v_m249ex,120 133 | v_skull11,28 134 | v_skull3,35 135 | v_skull3_2,70 136 | v_balrog1,10 137 | v_guillotine,10 138 | v_balrog3,30 139 | v_balrog5,40 140 | v_balrog7,120 141 | v_balrog11,7 142 | v_speargun,30 143 | v_bow,60 144 | v_drillgun,1 145 | v_chainsaw,200 146 | v_crossbow,50 147 | v_mac10,30 148 | v_gatling,40 149 | v_glock18,20 150 | v_as50,5 151 | v_psg1,5 152 | v_g3sg1,20 153 | v_usp,12 154 | v_f2000,30 155 | v_scar,30 156 | v_mauserc96,10 157 | v_mg42,95 158 | v_mosin,5 159 | v_petrolboomer,20 160 | v_coilmg,100 161 | v_dualkrisshero,50 162 | v_turbulent7,100 163 | v_tar21,30 164 | v_m1garand,8 165 | v_gilboa,30 166 | v_awpcamo,10 167 | v_m1911a1,8 168 | v_fnc,35 169 | v_m950,50 170 | v_spsmg,30 171 | v_sapientia,7 172 | v_rpg7,1 173 | v_mk48,120 174 | v_pgm,7 175 | v_ozwpnset1,20 176 | v_stenmk2,32 177 | v_uzi,32 178 | v_gilboaex,60 179 | v_destroyer,3 180 | v_sgdrill,35 181 | v_airburster,100 182 | v_blockar1,40 183 | v_blocksmg1,80 184 | v_blocksmg2,80 185 | v_turbulent5,30 186 | v_bloodhunter,30 187 | v_janusmk5,30 188 | v_thanatos1,7 189 | v_thanatos7,120 190 | v_buffawp,20 191 | v_cannonex,30 192 | v_m16a1,31 193 | v_buffsg552,50 194 | v_mp5_spectre,35 195 | v_usas12camo,20 196 | v_usas,20 197 | v_m1887,8 198 | v_hk23g,120 199 | v_m1887g,8 200 | v_m1887xmas,8 201 | v_ksg12,15 202 | v_ksg12g,15 203 | v_dbarrel,2 204 | v_dbarrelg,2 205 | v_tbarrel,3 206 | v_rainbowgun,8 207 | v_uts15,15 208 | v_spas12,8 209 | v_spas12ex,8 210 | v_groza,20 211 | v_mg3_xmas,200 212 | v_m14ebr,20 213 | v_m14ebrgold,20 214 | v_stg44,30 215 | v_stg44g,30 216 | v_svd,10 217 | v_m16a4,30 218 | v_scar_2,20 219 | v_xm8,30 220 | v_xm8_2,30 221 | v_heavyzg,35 222 | v_cartblue_2,30 223 | v_cartred,30 224 | v_cartred_2,30 225 | v_guitar,30 226 | v_ethereal,30 227 | v_g11,50 228 | v_violingun,30 229 | v_oicw,30 230 | v_arx160,30 231 | v_ak74u,30 232 | v_cheytaclrrs,30 233 | v_sl8,20 234 | v_sl8ex,25 235 | v_sl8g,25 236 | v_wa2000,12 237 | v_wa2000g,15 238 | v_as50g,5 239 | v_dmp7a1,80 240 | v_m24,10 241 | v_m2,250 242 | v_xm2010,5 243 | v_m82,10 244 | v_m95,5 245 | v_trg42g,10 246 | v_m400,10 247 | v_vsk94,20 248 | v_sprifle,7 249 | v_mg3,200 250 | v_mg3g,200 251 | v_janus7,200 252 | v_hk23,100 253 | v_mg36,100 254 | v_mg36xmas,100 255 | v_m60g,100 256 | v_pkm,150 257 | v_m249camo,100 258 | v_m249ep,100 259 | v_qbb95,75 260 | v_qbb95ex,80 261 | v_famas,25 262 | v_elite,30 263 | v_fiveseven,20 264 | v_xm1014,7 265 | v_sg552,30 266 | v_sg550,30 267 | v_automagv,7 268 | v_hk416,30 269 | v_l85a2,30 270 | v_aw50,5 271 | v_r93,5 272 | v_svdex,20 273 | v_qbarrel,4 274 | v_ak47_long,60 275 | v_poisongun,200 276 | 277 | ; Weapon Model, Kad1, Kad2 278 | [Knife Data] 279 | v_dualsword,130,120 280 | v_stormgiant,110,110 281 | v_crow9,115,75 282 | v_horseaxe,45,65 283 | v_tomahawk,45,65 284 | v_knifedragon,48,35 285 | v_snakesword,50,20 286 | v_axe,60,40 287 | v_hdagger,48,35 288 | v_katana,50,20 289 | v_combatknife,60,45 290 | v_mastercombatknife,80,65 291 | v_dragonsword,50,95 292 | v_hammer,75,80 293 | v_strong_knife,50,55 294 | v_jknife,40,35 295 | v_zsh_crowbar,1,48 296 | v_zsh_machete,62,45 297 | v_zsh_clawhammer,45,55 298 | v_balrog9,50,85 299 | v_sfsword,65,40 300 | v_skullaxe,95,75 301 | v_janus9,60,90 302 | v_thanatos9,119,147 303 | v_runeblade,110,205 304 | 305 | -------------------------------------------------------------------------------- /Project SyPB/AMXX/SyPB Extras - CSBTE Firmware/plugins-sypbfw.ini: -------------------------------------------------------------------------------- 1 | sypb_bte_basefw.amxx debug -------------------------------------------------------------------------------- /Project SyPB/AMXX/SyPB Extras - CSBTE Firmware/sypb_bte_basefw.amxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/AMXX/SyPB Extras - CSBTE Firmware/sypb_bte_basefw.amxx -------------------------------------------------------------------------------- /Project SyPB/AMXX/SyPB Extras - CSBTE Firmware/sypb_bte_basefw.sma: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * SyPB Extras - CSBTE Base Firmware 4 | 5 | * Support Version 6 | * SyPB Version: Beta 1.50 or new veriosn 7 | * SyPB API Version: 1.50 or new veriosn 8 | * CSBTE: N/A 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define PLUGIN "SyPB Extras - CSBTE Base Firmware" 17 | #define VERSION "1.30" 18 | #define AUTHOR "HsK-Dev Blog By'CCN" 19 | 20 | // Base for Firmware 21 | new bool:g_runSyPB = false; 22 | new bool:g_baseFirmware = false; 23 | 24 | // Get BTE Data 25 | new g_weaponCount, g_weaponModel[1024][255], g_weaponClip[1024]; 26 | new g_knifeCount, g_knifeModel[1024][255], g_knifeAttackDistance[1024][2]; 27 | 28 | // BTE Weapon Data 29 | new m_weaponname[32][64]; 30 | 31 | // CVAR 32 | new cvar_devmode; 33 | 34 | public plugin_init() 35 | { 36 | register_plugin(PLUGIN, VERSION, AUTHOR); 37 | 38 | cvar_devmode = register_cvar("sypbapi_bte_dev","0"); 39 | 40 | register_event("CurWeapon", "event_cur_weapon", "be", "1=1"); 41 | 42 | // Check SyPB Running 43 | g_runSyPB = is_run_sypb (); 44 | 45 | firmwareCheck (); 46 | } 47 | 48 | public firmwareCheck () 49 | { 50 | server_print("*** [SyPB Extras] CSBTE Firmware Loading..... ***"); 51 | 52 | if (!g_runSyPB) // Server has not run SyPB, The firmware stop 53 | { 54 | server_print("*** [SyPB Extras] Cannot find SyPB or SyPB API ***"); 55 | server_print("*** [SyPB Extras] CSBTE Firmware Stop ***"); 56 | return; 57 | } 58 | 59 | g_weaponCount = 0; 60 | 61 | if (!LoadINIFile ()) 62 | { 63 | server_print("*** [SyPB Extras] Setting File Wrong ***"); 64 | server_print("*** [SyPB Extras] CSBTE Firmware Stop ***"); 65 | return; 66 | } 67 | 68 | g_baseFirmware = true; 69 | server_print("*** [SyPB Extras] CSBTE Firmware Loading - Done ***"); 70 | server_print("*** [SyPB Extras] CSBTE Firmware Running ***"); 71 | } 72 | 73 | LoadINIFile () 74 | { 75 | new path[64]; 76 | get_configsdir(path, charsmax(path)); 77 | format(path, charsmax(path), "%s/SyPB_BTESetting.ini", path); 78 | 79 | if (!file_exists(path)) 80 | return false; 81 | 82 | new file, linedata[1024], section = 0; 83 | file = fopen(path, "rt"); 84 | 85 | while (file && !feof(file)) 86 | { 87 | fgets(file, linedata, charsmax(linedata)); 88 | replace(linedata, charsmax(linedata), "^n", ""); 89 | trim(linedata); 90 | 91 | if(!linedata[0] || linedata[0] == ';' || (linedata[0] == '/' && linedata[1] == '/')) continue; 92 | 93 | if (linedata[0] == '[') 94 | { 95 | section += 1; 96 | continue; 97 | } 98 | 99 | switch(section) 100 | { 101 | // Gun Data 102 | case 1: 103 | { 104 | new weaponModel[255], weaponClip[4]; 105 | strtok(linedata, weaponModel, charsmax(weaponModel), weaponClip, charsmax(weaponClip), ','); 106 | format(g_weaponModel[g_weaponCount], 254, "models/%s.mdl", weaponModel); 107 | g_weaponClip[g_weaponCount] = str_to_num(weaponClip); 108 | g_weaponCount++; 109 | } 110 | // Knife Data 111 | case 2: 112 | { 113 | new weaponModel[255], attack1Distance[4], attack2Distance[4], value[255]; 114 | strtok(linedata, weaponModel, charsmax(weaponModel), value, charsmax(value), ','); 115 | strtok(value, attack1Distance, charsmax(attack1Distance), attack2Distance, charsmax(attack2Distance), ','); 116 | format(g_knifeModel[g_knifeCount], 254, "models/%s.mdl", weaponModel); 117 | g_knifeAttackDistance[g_knifeCount][0] = str_to_num(attack1Distance); 118 | g_knifeAttackDistance[g_knifeCount][1] = str_to_num(attack2Distance); 119 | g_knifeCount++; 120 | } 121 | } 122 | } 123 | if (file) fclose(file) 124 | 125 | if (g_weaponCount <= 0 && g_knifeCount <= 0) 126 | return false; 127 | 128 | server_print("*** [SyPB Extras] CSBTE Firmware Weapon Data: %d ***", g_weaponCount); 129 | server_print("*** [SyPB Extras] CSBTE Firmware Knife Data: %d ***", g_knifeCount); 130 | 131 | return true; 132 | } 133 | 134 | public event_cur_weapon(id) 135 | { 136 | if (!g_baseFirmware) 137 | return; 138 | 139 | if (!is_user_alive(id)) 140 | return; 141 | 142 | new weap_id, weap_clip, weap_bpammo; 143 | weap_id = get_user_weapon(id, weap_clip, weap_bpammo); 144 | if ((1< 15 | #include 16 | #include 17 | 18 | #define PLUGIN "SwNPC Preview Plug-in [Demo]" 19 | #define VERSION "1.50.45234.141" 20 | #define AUTHOR "CCN@HsK" 21 | 22 | new bool:g_testStart = false; 23 | new Float:g_spawns[128][3], g_spawnCount; // Random Spawn Point 24 | 25 | new g_testOnlyNPC; 26 | 27 | new const team1_model[] = "models/player/zombie_source/zombie_source.mdl" 28 | new const team2_model[] = "models/player/vip/vip.mdl" 29 | 30 | public plugin_init() 31 | { 32 | register_plugin(PLUGIN, VERSION, AUTHOR); 33 | 34 | register_event("HLTV", "event_new_round", "a", "1=0", "2=0"); 35 | 36 | g_testOnlyNPC = -1; 37 | load_ranspawn (); 38 | } 39 | 40 | public plugin_precache() 41 | { 42 | precache_model(team1_model); 43 | precache_model(team2_model); 44 | precache_sound ("zombie_plague/zombie_die3.wav"); 45 | } 46 | 47 | public SwNPC_Add (npcId) 48 | { 49 | client_print(0, print_chat, "new npc %d", npcId); 50 | } 51 | 52 | public SwNPC_Remove (npcId) 53 | { 54 | client_print(0, print_chat, "remove npc %d", npcId); 55 | } 56 | 57 | public SwNPC_Think_Pre (npcId) 58 | { 59 | if (npcId != g_testOnlyNPC) 60 | return; 61 | 62 | if (swnpc_get_follow_entity(npcId) != 1) 63 | swnpc_set_follow_entity (npcId, 1); 64 | } 65 | 66 | public SwNPC_Kill_Pre (victim, killer) 67 | { 68 | if (victim == g_testOnlyNPC) 69 | add_followme_npc (); 70 | } 71 | 72 | public SwNPC_TakeDamage_Pre(victim, attack, damage) 73 | { 74 | //client_print(0, print_chat, "TakeDamage_Pre | attack:%d | victim:%d | damage:%d", attack, victim, damage); 75 | 76 | 77 | //if (victim == 1 || attack == 1) 78 | //return PLUGIN_HANDLED; // < block attack 79 | //SetDamageValue (2/damage); // Chanage damage value 80 | 81 | return PLUGIN_CONTINUE; 82 | } 83 | 84 | public SwNPC_PlaySound (npcId, soundClass, soundChannel) 85 | { 86 | // if tr swnpc play dead sound, block it 87 | // and play new sound 88 | if (soundClass == NS_DEAD && swnpc_get_team (npcId) == TEAM_TR) 89 | { 90 | swnpc_emit_sound (npcId, soundChannel, "zombie_plague/zombie_die3.wav"); 91 | return PLUGIN_HANDLED; 92 | } 93 | 94 | // Blcok all damage sound 95 | //if (soundClass == NS_DAMAGE) 96 | // return PLUGIN_HANDLED; 97 | 98 | return PLUGIN_CONTINUE; 99 | } 100 | 101 | public event_new_round() 102 | { 103 | if (!g_testStart) 104 | { 105 | g_testStart = true; 106 | set_task (0.5, "add_swnpc_team_tr"); 107 | set_task (0.5, "add_swnpc_team_ct"); 108 | add_followme_npc (); 109 | } 110 | } 111 | 112 | public add_followme_npc () 113 | { 114 | g_testOnlyNPC = -1; 115 | 116 | new Float:origin[3]; 117 | origin = g_spawns[random_num(0, g_spawnCount - 1)]; 118 | 119 | g_testOnlyNPC = swnpc_add_npc ("testOnlySwNPC", team2_model, 200.0, 220.0, TEAM_OTHER, origin); 120 | swnpc_set_find_enemy_mode (g_testOnlyNPC, 0); 121 | swnpc_set_follow_entity (g_testOnlyNPC, 0); 122 | } 123 | 124 | public add_swnpc_team_tr () 125 | { 126 | new Float:origin[3]; 127 | origin = g_spawns[random_num(0, g_spawnCount - 1)]; 128 | 129 | new ent = swnpc_add_npc ("swnpc_team_tr", team1_model, 200.0, 240.0, TEAM_TR, origin); 130 | 131 | // TR NPC attack damage 10 132 | swnpc_set_attack_damage (ent, 10.0); 133 | 134 | swnpc_set_add_frags (ent, 1); 135 | swnpc_set_add_money (ent, 1000); 136 | swnpc_set_dead_remove_time (ent, 10.0); 137 | swnpc_set_need_footstep (ent, 0); 138 | //swnpc_set_sequence_name (ent, AS_MOVE, ASS_UP, "walk"); 139 | 140 | set_task (5.0, "add_swnpc_team_tr"); 141 | } 142 | 143 | public add_swnpc_team_ct () 144 | { 145 | new Float:origin[3]; 146 | origin = g_spawns[random_num(0, g_spawnCount - 1)]; 147 | 148 | new ent = swnpc_add_npc ("swnpc_team_ct", team2_model, 100.0, 220.0, TEAM_CT, origin); 149 | 150 | // CT NPC attack damage 5, but attack count is 2 151 | swnpc_set_attack_distance (ent, 9999.0); 152 | swnpc_set_attack_damage (ent, 6.0); 153 | swnpc_set_attack_count (ent, 3); 154 | 155 | swnpc_set_add_frags (ent, 1); 156 | swnpc_set_add_money (ent, 1000); 157 | swnpc_set_dead_remove_time (ent, 10.0); 158 | swnpc_set_has_weapon (ent, "models/p_mp5.mdl"); 159 | 160 | set_task (5.0, "add_swnpc_team_ct"); 161 | } 162 | 163 | 164 | // Use DM:KD Spawn Point To try swnpc 165 | stock load_ranspawn() 166 | { 167 | new cfgdir[32], mapname[32], filepath[100], linedata[64]; 168 | get_configsdir(cfgdir, charsmax(cfgdir)); 169 | get_mapname(mapname, charsmax(mapname)); 170 | formatex(filepath, charsmax(filepath), "%s/Dm_KD/spawn/%s.cfg", cfgdir, mapname); 171 | 172 | if (file_exists(filepath)) 173 | { 174 | new data[10][6], file = fopen(filepath,"rt"); 175 | 176 | while (file && !feof(file)) 177 | { 178 | fgets(file, linedata, charsmax(linedata)); 179 | 180 | if(!linedata[0] || str_count(linedata,' ') < 2) continue; 181 | 182 | parse(linedata,data[0],5,data[1],5,data[2],5); 183 | 184 | g_spawns[g_spawnCount][0] = str_to_float(data[0]); 185 | g_spawns[g_spawnCount][1] = str_to_float(data[1]); 186 | g_spawns[g_spawnCount][2] = str_to_float(data[2]); //floatstr 187 | 188 | g_spawnCount++; 189 | if (g_spawnCount >= sizeof g_spawns) 190 | break; 191 | } 192 | if (file) fclose(file); 193 | 194 | server_print("=========================="); 195 | server_print("= [Deathmatch: Kill Duty] "); 196 | server_print("= MAP : %s", mapname); 197 | server_print("= Load Spawns....."); 198 | server_print("= Spawn Count Is %d", g_spawnCount); 199 | server_print("=========================="); 200 | } 201 | } 202 | 203 | stock str_count(const str[], searchchar) 204 | { 205 | new count, i, len = strlen(str) 206 | 207 | for (i = 0; i <= len; i++) 208 | { 209 | if(str[i] == searchchar) 210 | count++ 211 | } 212 | 213 | return count; 214 | } -------------------------------------------------------------------------------- /Project SyPB/Project_OutPut/SwNPC_amxx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/Project_OutPut/SwNPC_amxx.dll -------------------------------------------------------------------------------- /Project SyPB/Project_OutPut/sypb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/Project_OutPut/sypb.dll -------------------------------------------------------------------------------- /Project SyPB/Project_OutPut/sypb_amxx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/Project_OutPut/sypb_amxx.dll -------------------------------------------------------------------------------- /Project SyPB/Project_SyPB.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33213.308 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "1.SyPB Bot", "SyPB_BOT\SyPB Bot.vcxproj", "{C232645A-3B99-48F4-A1F3-F20CF0A9568B}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2.SyPB API", "SyPB_API\SyPB API.vcxproj", "{4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3.SwNPC", "SwNPC\SwNPC.vcxproj", "{05330595-B76E-4838-9C03-7D49168F206F}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. Base", "0. Base", "{4B6F2887-AAD5-48DC-A08B-B2F26717F6AF}" 13 | ProjectSection(SolutionItems) = preProject 14 | version.h = version.h 15 | EndProjectSection 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | SyPB_Debug|Win32 = SyPB_Debug|Win32 20 | SyPB_Release|Win32 = SyPB_Release|Win32 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {C232645A-3B99-48F4-A1F3-F20CF0A9568B}.SyPB_Debug|Win32.ActiveCfg = Debug|Win32 24 | {C232645A-3B99-48F4-A1F3-F20CF0A9568B}.SyPB_Debug|Win32.Build.0 = Debug|Win32 25 | {C232645A-3B99-48F4-A1F3-F20CF0A9568B}.SyPB_Debug|Win32.Deploy.0 = Debug|Win32 26 | {C232645A-3B99-48F4-A1F3-F20CF0A9568B}.SyPB_Release|Win32.ActiveCfg = Release|Win32 27 | {C232645A-3B99-48F4-A1F3-F20CF0A9568B}.SyPB_Release|Win32.Build.0 = Release|Win32 28 | {4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876}.SyPB_Debug|Win32.ActiveCfg = Debug|Win32 29 | {4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876}.SyPB_Debug|Win32.Build.0 = Debug|Win32 30 | {4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876}.SyPB_Release|Win32.ActiveCfg = Release|Win32 31 | {4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876}.SyPB_Release|Win32.Build.0 = Release|Win32 32 | {05330595-B76E-4838-9C03-7D49168F206F}.SyPB_Debug|Win32.ActiveCfg = Debug|Win32 33 | {05330595-B76E-4838-9C03-7D49168F206F}.SyPB_Debug|Win32.Build.0 = Debug|Win32 34 | {05330595-B76E-4838-9C03-7D49168F206F}.SyPB_Release|Win32.ActiveCfg = Release|Win32 35 | {05330595-B76E-4838-9C03-7D49168F206F}.SyPB_Release|Win32.Build.0 = Release|Win32 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {28C95CC5-02CC-4598-88A1-F08802FDD69F} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/SwNPC.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source 6 | 7 | 8 | Source 9 | 10 | 11 | Source 12 | 13 | 14 | Source 15 | 16 | 17 | Source 18 | 19 | 20 | Source 21 | 22 | 23 | Source 24 | 25 | 26 | Source 27 | 28 | 29 | 30 | 31 | Include 32 | 33 | 34 | Include 35 | 36 | 37 | Include 38 | 39 | 40 | Include 41 | 42 | 43 | 44 | 45 | {bb4db6ca-2f7b-4a3a-9b2d-b36ca610e38b} 46 | 47 | 48 | {103e6dbf-260b-470a-aa13-9a45e3b3ffc3} 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/SwNPC.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/beamdef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( BEAMDEFH ) 16 | #define BEAMDEFH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | #define FBEAM_STARTENTITY 0x00000001 24 | #define FBEAM_ENDENTITY 0x00000002 25 | #define FBEAM_FADEIN 0x00000004 26 | #define FBEAM_FADEOUT 0x00000008 27 | #define FBEAM_SINENOISE 0x00000010 28 | #define FBEAM_SOLID 0x00000020 29 | #define FBEAM_SHADEIN 0x00000040 30 | #define FBEAM_SHADEOUT 0x00000080 31 | #define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet? 32 | #define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet? 33 | #define FBEAM_ISACTIVE 0x40000000 34 | #define FBEAM_FOREVER 0x80000000 35 | 36 | typedef struct beam_s BEAM; 37 | struct beam_s 38 | { 39 | BEAM *next; 40 | int type; 41 | int flags; 42 | vec3_t source; 43 | vec3_t target; 44 | vec3_t delta; 45 | float t; // 0 .. 1 over lifetime of beam 46 | float freq; 47 | float die; 48 | float width; 49 | float amplitude; 50 | float r, g, b; 51 | float brightness; 52 | float speed; 53 | float frameRate; 54 | float frame; 55 | int segments; 56 | int startEntity; 57 | int endEntity; 58 | int modelIndex; 59 | int frameCount; 60 | struct model_s *pFollowModel; 61 | struct particle_s *particles; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/cl_entity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // cl_entity.h 16 | #if !defined( CL_ENTITYH ) 17 | #define CL_ENTITYH 18 | #ifdef _WIN32 19 | #ifndef __MINGW32__ 20 | #pragma once 21 | #endif /* not __MINGW32__ */ 22 | #endif 23 | 24 | typedef struct efrag_s 25 | { 26 | struct mleaf_s *leaf; 27 | struct efrag_s *leafnext; 28 | struct cl_entity_s *entity; 29 | struct efrag_s *entnext; 30 | } efrag_t; 31 | 32 | typedef struct 33 | { 34 | byte mouthopen; // 0 = mouth closed, 255 = mouth agape 35 | byte sndcount; // counter for running average 36 | int sndavg; // running average 37 | } mouth_t; 38 | 39 | typedef struct 40 | { 41 | float prevanimtime; 42 | float sequencetime; 43 | byte prevseqblending[2]; 44 | vec3_t prevorigin; 45 | vec3_t prevangles; 46 | 47 | int prevsequence; 48 | float prevframe; 49 | 50 | byte prevcontroller[4]; 51 | byte prevblending[2]; 52 | } latchedvars_t; 53 | 54 | typedef struct 55 | { 56 | // Time stamp for this movement 57 | float animtime; 58 | 59 | vec3_t origin; 60 | vec3_t angles; 61 | } position_history_t; 62 | 63 | typedef struct cl_entity_s cl_entity_t; 64 | 65 | #define HISTORY_MAX 64 // Must be power of 2 66 | #define HISTORY_MASK ( HISTORY_MAX - 1 ) 67 | 68 | 69 | #if !defined( ENTITY_STATEH ) 70 | #include "entity_state.h" 71 | #endif 72 | 73 | #if !defined( PROGS_H ) 74 | #include "progs.h" 75 | #endif 76 | 77 | struct cl_entity_s 78 | { 79 | int index; // Index into cl_entities ( should match actual slot, but not necessarily ) 80 | 81 | qboolean player; // True if this entity is a "player" 82 | 83 | entity_state_t baseline; // The original state from which to delta during an uncompressed message 84 | entity_state_t prevstate; // The state information from the penultimate message received from the server 85 | entity_state_t curstate; // The state information from the last message received from server 86 | 87 | int current_position; // Last received history update index 88 | position_history_t ph[ HISTORY_MAX ]; // History of position and angle updates for this player 89 | 90 | mouth_t mouth; // For synchronizing mouth movements. 91 | 92 | latchedvars_t latched; // Variables used by studio model rendering routines 93 | 94 | // Information based on interplocation, extrapolation, prediction, or just copied from last msg received. 95 | // 96 | float lastmove; 97 | 98 | // Actual render position and angles 99 | vec3_t origin; 100 | vec3_t angles; 101 | 102 | // Attachment points 103 | vec3_t attachment[4]; 104 | 105 | // Other entity local information 106 | int trivial_accept; 107 | 108 | struct model_s *model; // cl.model_precache[ curstate.modelindes ]; all visible entities have a model 109 | struct efrag_s *efrag; // linked list of efrags 110 | struct mnode_s *topnode; // for bmodels, first world node that splits bmodel, or NULL if not split 111 | 112 | float syncbase; // for client-side animations -- used by obsolete alias animation system, remove? 113 | int visframe; // last frame this entity was found in an active leaf 114 | colorVec cvFloorColor; 115 | }; 116 | 117 | #endif // !CL_ENTITYH 118 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/con_nprint.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( CON_NPRINTH ) 16 | #define CON_NPRINTH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct con_nprint_s 24 | { 25 | int index; // Row # 26 | float time_to_live; // # of seconds before it dissappears 27 | float color[ 3 ]; // RGB colors ( 0.0 -> 1.0 scale ) 28 | } con_nprint_t; 29 | 30 | void Con_NPrintf( int idx, char *fmt, ... ); 31 | void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... ); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/crc.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | /* crc.h */ 16 | #ifndef CRC_H 17 | #define CRC_H 18 | #ifdef _WIN32 19 | #ifndef __MINGW32__ 20 | #pragma once 21 | #endif /* not __MINGW32__ */ 22 | #endif 23 | 24 | // MD5 Hash 25 | typedef struct 26 | { 27 | unsigned int buf[4]; 28 | unsigned int bits[2]; 29 | unsigned char in[64]; 30 | } MD5Context_t; 31 | 32 | 33 | typedef unsigned long CRC32_t; 34 | void CRC32_Init(CRC32_t *pulCRC); 35 | CRC32_t CRC32_Final(CRC32_t pulCRC); 36 | void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); 37 | void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); 38 | int CRC_File(CRC32_t *crcvalue, char *pszFileName); 39 | 40 | unsigned char COM_BlockSequenceCRCByte (unsigned char *base, int length, int sequence); 41 | 42 | void MD5Init(MD5Context_t *context); 43 | void MD5Update(MD5Context_t *context, unsigned char const *buf, 44 | unsigned int len); 45 | void MD5Final(unsigned char digest[16], MD5Context_t *context); 46 | void Transform(unsigned int buf[4], unsigned int const in[16]); 47 | 48 | int MD5_Hash_File(unsigned char digest[16], char *pszFileName, int bUsefopen, int bSeed, unsigned int seed[4]); 49 | char *MD5_Print(unsigned char hash[16]); 50 | int MD5_Hash_CachedFile(unsigned char digest[16], unsigned char *pCache, int nFileSize, int bSeed, unsigned int seed[4]); 51 | 52 | int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/cvardef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CVARDEF_H 16 | #define CVARDEF_H 17 | 18 | #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc 19 | #define FCVAR_USERINFO (1<<1) // changes the client's info string 20 | #define FCVAR_SERVER (1<<2) // notifies players when changed 21 | #define FCVAR_EXTDLL (1<<3) // defined by external DLL 22 | #define FCVAR_CLIENTDLL (1<<4) // defined by the client dll 23 | #define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value 24 | #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. 25 | #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). 26 | #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log 27 | 28 | typedef struct cvar_s 29 | { 30 | char *name; 31 | char *string; 32 | int flags; 33 | float value; 34 | struct cvar_s *next; 35 | } cvar_t; 36 | #endif 37 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/demo_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DEMO_APIH ) 16 | #define DEMO_APIH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct demo_api_s 24 | { 25 | int ( *IsRecording ) ( void ); 26 | int ( *IsPlayingback ) ( void ); 27 | int ( *IsTimeDemo ) ( void ); 28 | void ( *WriteBuffer ) ( int size, unsigned char *buffer ); 29 | } demo_api_t; 30 | 31 | extern demo_api_t demoapi; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/director_cmds.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/director_cmds.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/dlight.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DLIGHTH ) 16 | #define DLIGHTH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct dlight_s 24 | { 25 | vec3_t origin; 26 | float radius; 27 | color24 color; 28 | float die; // stop lighting after this time 29 | float decay; // drop this each second 30 | float minlight; // don't add when contributing less 31 | int key; 32 | qboolean dark; // subtracts light instead of adding 33 | } dlight_t; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/dll_state.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/dll_state.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/engine_launcher_api.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/engine_launcher_api.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/entity_state.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( ENTITY_STATEH ) 16 | #define ENTITY_STATEH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | // For entityType below 24 | #define ENTITY_NORMAL (1<<0) 25 | #define ENTITY_BEAM (1<<1) 26 | 27 | // Entity state is used for the baseline and for delta compression of a packet of 28 | // entities that is sent to a client. 29 | typedef struct entity_state_s entity_state_t; 30 | 31 | struct entity_state_s 32 | { 33 | // Fields which are filled in by routines outside of delta compression 34 | int entityType; 35 | // Index into cl_entities array for this entity. 36 | int number; 37 | float msg_time; 38 | 39 | // Message number last time the player/entity state was updated. 40 | int messagenum; 41 | 42 | // Fields which can be transitted and reconstructed over the network stream 43 | vec3_t origin; 44 | vec3_t angles; 45 | 46 | int modelindex; 47 | int sequence; 48 | float frame; 49 | int colormap; 50 | short skin; 51 | short solid; 52 | int effects; 53 | float scale; 54 | 55 | byte eflags; 56 | 57 | // Render information 58 | int rendermode; 59 | int renderamt; 60 | color24 rendercolor; 61 | int renderfx; 62 | 63 | int movetype; 64 | float animtime; 65 | float framerate; 66 | int body; 67 | byte controller[4]; 68 | byte blending[4]; 69 | vec3_t velocity; 70 | 71 | // Send bbox down to client for use during prediction. 72 | vec3_t mins; 73 | vec3_t maxs; 74 | 75 | int aiment; 76 | // If owned by a player, the index of that player ( for projectiles ). 77 | int owner; 78 | 79 | // Friction, for prediction. 80 | float friction; 81 | // Gravity multiplier 82 | float gravity; 83 | 84 | // PLAYER SPECIFIC 85 | int team; 86 | int playerclass; 87 | int health; 88 | qboolean spectator; 89 | int weaponmodel; 90 | int gaitsequence; 91 | // If standing on conveyor, e.g. 92 | vec3_t basevelocity; 93 | // Use the crouched hull, or the regular player hull. 94 | int usehull; 95 | // Latched buttons last time state updated. 96 | int oldbuttons; 97 | // -1 = in air, else pmove entity number 98 | int onground; 99 | int iStepLeft; 100 | // How fast we are falling 101 | float flFallVelocity; 102 | 103 | float fov; 104 | int weaponanim; 105 | 106 | // Parametric movement overrides 107 | vec3_t startpos; 108 | vec3_t endpos; 109 | float impacttime; 110 | float starttime; 111 | 112 | // For mods 113 | int iuser1; 114 | int iuser2; 115 | int iuser3; 116 | int iuser4; 117 | float fuser1; 118 | float fuser2; 119 | float fuser3; 120 | float fuser4; 121 | vec3_t vuser1; 122 | vec3_t vuser2; 123 | vec3_t vuser3; 124 | vec3_t vuser4; 125 | }; 126 | 127 | #include "pm_info.h" 128 | 129 | typedef struct clientdata_s 130 | { 131 | vec3_t origin; 132 | vec3_t velocity; 133 | 134 | int viewmodel; 135 | vec3_t punchangle; 136 | int flags; 137 | int waterlevel; 138 | int watertype; 139 | vec3_t view_ofs; 140 | float health; 141 | 142 | int bInDuck; 143 | 144 | int weapons; // remove? 145 | 146 | int flTimeStepSound; 147 | int flDuckTime; 148 | int flSwimTime; 149 | int waterjumptime; 150 | 151 | float maxspeed; 152 | 153 | float fov; 154 | int weaponanim; 155 | 156 | int m_iId; 157 | int ammo_shells; 158 | int ammo_nails; 159 | int ammo_cells; 160 | int ammo_rockets; 161 | float m_flNextAttack; 162 | 163 | int tfstate; 164 | 165 | int pushmsec; 166 | 167 | int deadflag; 168 | 169 | char physinfo[ MAX_PHYSINFO_STRING ]; 170 | 171 | // For mods 172 | int iuser1; 173 | int iuser2; 174 | int iuser3; 175 | int iuser4; 176 | float fuser1; 177 | float fuser2; 178 | float fuser3; 179 | float fuser4; 180 | vec3_t vuser1; 181 | vec3_t vuser2; 182 | vec3_t vuser3; 183 | vec3_t vuser4; 184 | } clientdata_t; 185 | 186 | #include "weaponinfo.h" 187 | 188 | typedef struct local_state_s 189 | { 190 | entity_state_t playerstate; 191 | clientdata_t client; 192 | weapon_data_t weapondata[ 32 ]; 193 | } local_state_t; 194 | 195 | #endif // !ENTITY_STATEH 196 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/entity_types.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // entity_types.h 16 | #if !defined( ENTITY_TYPESH ) 17 | #define ENTITY_TYPESH 18 | 19 | #define ET_NORMAL 0 20 | #define ET_PLAYER 1 21 | #define ET_TEMPENTITY 2 22 | #define ET_BEAM 3 23 | // BMODEL or SPRITE that was split across BSP nodes 24 | #define ET_FRAGMENTED 4 25 | 26 | #endif // !ENTITY_TYPESH 27 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/event_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( EVENT_APIH ) 16 | #define EVENT_APIH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | #define EVENT_API_VERSION 1 24 | 25 | typedef struct event_api_s 26 | { 27 | int version; 28 | void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); 29 | void ( *EV_StopSound ) ( int ent, int channel, const char *sample ); 30 | int ( *EV_FindModelIndex )( const char *pmodel ); 31 | int ( *EV_IsLocal ) ( int playernum ); 32 | int ( *EV_LocalPlayerDucking ) ( void ); 33 | void ( *EV_LocalPlayerViewheight ) ( float * ); 34 | void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs ); 35 | int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace ); 36 | struct physent_s *( *EV_GetPhysent ) ( int idx ); 37 | void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient ); 38 | void ( *EV_PushPMStates ) ( void ); 39 | void ( *EV_PopPMStates ) ( void ); 40 | void ( *EV_SetSolidPlayers ) (int playernum); 41 | void ( *EV_SetTraceHull ) ( int hull ); 42 | void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr ); 43 | void ( *EV_WeaponAnimation ) ( int sequence, int body ); 44 | unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz ); 45 | void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); 46 | const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend ); 47 | void ( *EV_StopAllSounds ) ( int entnum, int entchannel ); 48 | void ( *EV_KillEvents ) ( int entnum, const char *eventname ); 49 | } event_api_t; 50 | 51 | extern event_api_t eventapi; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/event_args.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_ARGSH ) 16 | #define EVENT_ARGSH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | // Event was invoked with stated origin 24 | #define FEVENT_ORIGIN ( 1<<0 ) 25 | 26 | // Event was invoked with stated angles 27 | #define FEVENT_ANGLES ( 1<<1 ) 28 | 29 | typedef struct event_args_s 30 | { 31 | int flags; 32 | 33 | // Transmitted 34 | int entindex; 35 | 36 | float origin[3]; 37 | float angles[3]; 38 | float velocity[3]; 39 | 40 | int ducking; 41 | 42 | float fparam1; 43 | float fparam2; 44 | 45 | int iparam1; 46 | int iparam2; 47 | 48 | int bparam1; 49 | int bparam2; 50 | } event_args_t; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/event_flags.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_FLAGSH ) 16 | #define EVENT_FLAGSH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | // Skip local host for event send. 24 | #define FEV_NOTHOST (1<<0) 25 | 26 | // Send the event reliably. You must specify the origin and angles and use 27 | // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything 28 | // that depends on the event origin/angles. I.e., the origin/angles are not 29 | // taken from the invoking edict for reliable events. 30 | #define FEV_RELIABLE (1<<1) 31 | 32 | // Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC 33 | // sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ). 34 | #define FEV_GLOBAL (1<<2) 35 | 36 | // If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate 37 | // 38 | #define FEV_UPDATE (1<<3) 39 | 40 | // Only send to entity specified as the invoker 41 | #define FEV_HOSTONLY (1<<4) 42 | 43 | // Only send if the event was created on the server. 44 | #define FEV_SERVER (1<<5) 45 | 46 | // Only issue event client side ( from shared code ) 47 | #define FEV_CLIENT (1<<6) 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/exefuncs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/exefuncs.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/hltv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/hltv.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/in_buttons.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef IN_BUTTONS_H 16 | #define IN_BUTTONS_H 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | #define IN_ATTACK (1 << 0) 24 | #define IN_JUMP (1 << 1) 25 | #define IN_DUCK (1 << 2) 26 | #define IN_FORWARD (1 << 3) 27 | #define IN_BACK (1 << 4) 28 | #define IN_USE (1 << 5) 29 | #define IN_CANCEL (1 << 6) 30 | #define IN_LEFT (1 << 7) 31 | #define IN_RIGHT (1 << 8) 32 | #define IN_MOVELEFT (1 << 9) 33 | #define IN_MOVERIGHT (1 << 10) 34 | #define IN_ATTACK2 (1 << 11) 35 | #define IN_RUN (1 << 12) 36 | #define IN_RELOAD (1 << 13) 37 | #define IN_ALT1 (1 << 14) 38 | #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down 39 | 40 | #endif // IN_BUTTONS_H 41 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/interface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/interface.cpp -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/interface.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/ivoicetweak.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/ivoicetweak.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/mathlib.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // mathlib.h 16 | 17 | typedef float vec_t; 18 | typedef vec_t vec3_t[3]; 19 | typedef vec_t vec4_t[4]; // x,y,z,w 20 | typedef vec_t vec5_t[5]; 21 | 22 | typedef short vec_s_t; 23 | typedef vec_s_t vec3s_t[3]; 24 | typedef vec_s_t vec4s_t[4]; // x,y,z,w 25 | typedef vec_s_t vec5s_t[5]; 26 | 27 | typedef int fixed4_t; 28 | typedef int fixed8_t; 29 | typedef int fixed16_t; 30 | 31 | #ifndef M_PI 32 | #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h 33 | #endif 34 | 35 | struct mplane_s; 36 | 37 | extern vec3_t vec3_origin; 38 | extern int nanmask; 39 | 40 | #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) 41 | 42 | #ifndef VECTOR_H 43 | #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) 44 | #endif 45 | 46 | #define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} 47 | #define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} 48 | #define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} 49 | #define VectorClear(a) {(a)[0]=0.0;(a)[1]=0.0;(a)[2]=0.0;} 50 | 51 | void VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc); 52 | 53 | vec_t _DotProduct (vec3_t v1, vec3_t v2); 54 | void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out); 55 | void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out); 56 | void _VectorCopy (vec3_t in, vec3_t out); 57 | 58 | int VectorCompare (const vec3_t v1, const vec3_t v2); 59 | float Length (const vec3_t v); 60 | void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross); 61 | float VectorNormalize (vec3_t v); // returns vector length 62 | void VectorInverse (vec3_t v); 63 | void VectorScale (const vec3_t in, vec_t scale, vec3_t out); 64 | int Q_log2(int val); 65 | 66 | void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); 67 | void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); 68 | 69 | // Here are some "manual" INLINE routines for doing floating point to integer conversions 70 | extern short new_cw, old_cw; 71 | 72 | typedef union DLONG { 73 | int i[2]; 74 | double d; 75 | float f; 76 | } DLONG; 77 | 78 | extern DLONG dlong; 79 | 80 | #ifdef _WIN32 81 | void __inline set_fpu_cw(void) 82 | { 83 | _asm 84 | { wait 85 | fnstcw old_cw 86 | wait 87 | mov ax, word ptr old_cw 88 | or ah, 0xc 89 | mov word ptr new_cw,ax 90 | fldcw new_cw 91 | } 92 | } 93 | 94 | int __inline quick_ftol(float f) 95 | { 96 | _asm { 97 | // Assumes that we are already in chop mode, and only need a 32-bit int 98 | fld DWORD PTR f 99 | fistp DWORD PTR dlong 100 | } 101 | return dlong.i[0]; 102 | } 103 | 104 | void __inline restore_fpu_cw(void) 105 | { 106 | _asm fldcw old_cw 107 | } 108 | #else 109 | #define set_fpu_cw() /* */ 110 | #define quick_ftol(f) ftol(f) 111 | #define restore_fpu_cw() /* */ 112 | #endif 113 | 114 | void FloorDivMod (double numer, double denom, int *quotient, 115 | int *rem); 116 | fixed16_t Invert24To16(fixed16_t val); 117 | int GreatestCommonDivisor (int i1, int i2); 118 | 119 | void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); 120 | void AngleVectorsTranspose (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); 121 | #define AngleIVectors AngleVectorsTranspose 122 | 123 | void AngleMatrix (const vec3_t angles, float (*matrix)[4] ); 124 | void AngleIMatrix (const vec3_t angles, float (*matrix)[4] ); 125 | void VectorTransform (const vec3_t in1, float in2[3][4], vec3_t out); 126 | 127 | void NormalizeAngles( vec3_t angles ); 128 | void InterpolateAngles( vec3_t start, vec3_t end, vec3_t output, float frac ); 129 | float AngleBetweenVectors( const vec3_t v1, const vec3_t v2 ); 130 | 131 | 132 | void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up); 133 | void VectorAngles( const vec3_t forward, vec3_t angles ); 134 | 135 | int InvertMatrix( const float * m, float *out ); 136 | 137 | int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane); 138 | float anglemod(float a); 139 | 140 | 141 | 142 | #define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ 143 | (((p)->type < 3)? \ 144 | ( \ 145 | ((p)->dist <= (emins)[(p)->type])? \ 146 | 1 \ 147 | : \ 148 | ( \ 149 | ((p)->dist >= (emaxs)[(p)->type])?\ 150 | 2 \ 151 | : \ 152 | 3 \ 153 | ) \ 154 | ) \ 155 | : \ 156 | BoxOnPlaneSide( (emins), (emaxs), (p))) 157 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/net_api.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/net_api.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/netadr.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // netadr.h 16 | #ifndef NETADR_H 17 | #define NETADR_H 18 | #ifdef _WIN32 19 | #ifndef __MINGW32__ 20 | #pragma once 21 | #endif /* not __MINGW32__ */ 22 | #endif 23 | 24 | typedef enum 25 | { 26 | NA_UNUSED, 27 | NA_LOOPBACK, 28 | NA_BROADCAST, 29 | NA_IP, 30 | NA_IPX, 31 | NA_BROADCAST_IPX, 32 | } netadrtype_t; 33 | 34 | typedef struct netadr_s 35 | { 36 | netadrtype_t type; 37 | unsigned char ip[4]; 38 | unsigned char ipx[10]; 39 | unsigned short port; 40 | } netadr_t; 41 | 42 | #endif // NETADR_H 43 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/nowin.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/nowin.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/particledef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PARTICLEDEFH ) 16 | #define PARTICLEDEFH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef enum { 24 | pt_static, 25 | pt_grav, 26 | pt_slowgrav, 27 | pt_fire, 28 | pt_explode, 29 | pt_explode2, 30 | pt_blob, 31 | pt_blob2, 32 | pt_vox_slowgrav, 33 | pt_vox_grav, 34 | pt_clientcustom // Must have callback function specified 35 | } ptype_t; 36 | 37 | // !!! if this is changed, it must be changed in d_ifacea.h too !!! 38 | typedef struct particle_s 39 | { 40 | // driver-usable fields 41 | vec3_t org; 42 | short color; 43 | short packedColor; 44 | // drivers never touch the following fields 45 | struct particle_s *next; 46 | vec3_t vel; 47 | float ramp; 48 | float die; 49 | ptype_t type; 50 | void (*deathfunc)( struct particle_s *particle ); 51 | 52 | // for pt_clientcusttom, we'll call this function each frame 53 | void (*callback)( struct particle_s *particle, float frametime ); 54 | 55 | // For deathfunc, etc. 56 | unsigned char context; 57 | } particle_t; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/pmtrace.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PMTRACEH ) 16 | #define PMTRACEH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct 24 | { 25 | vec3_t normal; 26 | float dist; 27 | } pmplane_t; 28 | 29 | typedef struct pmtrace_s pmtrace_t; 30 | 31 | struct pmtrace_s 32 | { 33 | qboolean allsolid; // if true, plane is not valid 34 | qboolean startsolid; // if true, the initial point was in a solid area 35 | qboolean inopen, inwater; // End point is in empty space or in water 36 | float fraction; // time completed, 1.0 = didn't hit anything 37 | vec3_t endpos; // final position 38 | pmplane_t plane; // surface normal at impact 39 | int ent; // entity at impact 40 | vec3_t deltavelocity; // Change in player's velocity caused by impact. 41 | // Only run on server. 42 | int hitgroup; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/qfont.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( QFONTH ) 16 | #define QFONTH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | // Font stuff 24 | 25 | #define NUM_GLYPHS 256 26 | 27 | typedef struct 28 | { 29 | short startoffset; 30 | short charwidth; 31 | } charinfo; 32 | 33 | typedef struct qfont_s 34 | { 35 | int width, height; 36 | int rowcount; 37 | int rowheight; 38 | charinfo fontinfo[ NUM_GLYPHS ]; 39 | byte data[4]; 40 | } qfont_t; 41 | 42 | #endif // qfont.h 43 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/r_studioint.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/r_studioint.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/ref_params.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( REF_PARAMSH ) 16 | #define REF_PARAMSH 17 | 18 | typedef struct ref_params_s 19 | { 20 | // Output 21 | float vieworg[3]; 22 | float viewangles[3]; 23 | 24 | float forward[3]; 25 | float right[3]; 26 | float up[3]; 27 | 28 | // Client frametime; 29 | float frametime; 30 | // Client time 31 | float time; 32 | 33 | // Misc 34 | int intermission; 35 | int paused; 36 | int spectator; 37 | int onground; 38 | int waterlevel; 39 | 40 | float simvel[3]; 41 | float simorg[3]; 42 | 43 | float viewheight[3]; 44 | float idealpitch; 45 | 46 | float cl_viewangles[3]; 47 | 48 | int health; 49 | float crosshairangle[3]; 50 | float viewsize; 51 | 52 | float punchangle[3]; 53 | int maxclients; 54 | int viewentity; 55 | int playernum; 56 | int max_entities; 57 | int demoplayback; 58 | int hardware; 59 | 60 | int smoothing; 61 | 62 | // Last issued usercmd 63 | struct usercmd_s *cmd; 64 | 65 | // Movevars 66 | struct movevars_s *movevars; 67 | 68 | int viewport[4]; // the viewport coordinates x ,y , width, height 69 | 70 | int nextView; // the renderer calls ClientDLL_CalcRefdef() and Renderview 71 | // so long in cycles until this value is 0 (multiple views) 72 | int onlyClientDraw; // if !=0 nothing is drawn by the engine except clientDraw functions 73 | } ref_params_t; 74 | 75 | #endif // !REF_PARAMSH 76 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/screenfade.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/common/screenfade.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/studio_event.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( STUDIO_EVENTH ) 16 | #define STUDIO_EVENTH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct mstudioevent_s 24 | { 25 | int frame; 26 | int event; 27 | int type; 28 | char options[64]; 29 | } mstudioevent_t; 30 | 31 | #endif // STUDIO_EVENTH 32 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/triangleapi.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( TRIANGLEAPIH ) 16 | #define TRIANGLEAPIH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef enum 24 | { 25 | TRI_FRONT = 0, 26 | TRI_NONE = 1, 27 | } TRICULLSTYLE; 28 | 29 | #define TRI_API_VERSION 1 30 | 31 | #define TRI_TRIANGLES 0 32 | #define TRI_TRIANGLE_FAN 1 33 | #define TRI_QUADS 2 34 | #define TRI_POLYGON 3 35 | #define TRI_LINES 4 36 | #define TRI_TRIANGLE_STRIP 5 37 | #define TRI_QUAD_STRIP 6 38 | 39 | typedef struct triangleapi_s 40 | { 41 | int version; 42 | 43 | void ( *RenderMode )( int mode ); 44 | void ( *Begin )( int primitiveCode ); 45 | void ( *End ) ( void ); 46 | 47 | void ( *Color4f ) ( float r, float g, float b, float a ); 48 | void ( *Color4ub ) ( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); 49 | void ( *TexCoord2f ) ( float u, float v ); 50 | void ( *Vertex3fv ) ( float *worldPnt ); 51 | void ( *Vertex3f ) ( float x, float y, float z ); 52 | void ( *Brightness ) ( float brightness ); 53 | void ( *CullFace ) ( TRICULLSTYLE style ); 54 | int ( *SpriteTexture ) ( struct model_s *pSpriteModel, int frame ); 55 | int ( *WorldToScreen ) ( float *world, float *screen ); // Returns 1 if it's z clipped 56 | void ( *Fog ) ( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b. 57 | void ( *ScreenToWorld ) ( float *screen, float *world ); 58 | 59 | } triangleapi_t; 60 | 61 | #endif // !TRIANGLEAPIH 62 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/usercmd.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef USERCMD_H 16 | #define USERCMD_H 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct usercmd_s 24 | { 25 | short lerp_msec; // Interpolation time on client 26 | byte msec; // Duration in ms of command 27 | vec3_t viewangles; // Command view angles. 28 | 29 | // intended velocities 30 | float forwardmove; // Forward velocity. 31 | float sidemove; // Sideways velocity. 32 | float upmove; // Upward velocity. 33 | byte lightlevel; // Light level at spot where we are standing. 34 | unsigned short buttons; // Attack buttons 35 | byte impulse; // Impulse command issued. 36 | byte weaponselect; // Current weapon id 37 | 38 | // Experimental player impact stuff. 39 | int impact_index; 40 | vec3_t impact_position; 41 | } usercmd_t; 42 | 43 | #endif // USERCMD_H 44 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/common/weaponinfo.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( WEAPONINFOH ) 16 | #define WEAPONINFOH 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | // Info about weapons player might have in his/her possession 24 | typedef struct weapon_data_s 25 | { 26 | int m_iId; 27 | int m_iClip; 28 | 29 | float m_flNextPrimaryAttack; 30 | float m_flNextSecondaryAttack; 31 | float m_flTimeWeaponIdle; 32 | 33 | int m_fInReload; 34 | int m_fInSpecialReload; 35 | float m_flNextReload; 36 | float m_flPumpTime; 37 | float m_fReloadTime; 38 | 39 | float m_fAimedDamage; 40 | float m_fNextAimBonus; 41 | int m_fInZoom; 42 | int m_iWeaponState; 43 | 44 | int iuser1; 45 | int iuser2; 46 | int iuser3; 47 | int iuser4; 48 | float fuser1; 49 | float fuser2; 50 | float fuser3; 51 | float fuser4; 52 | } weapon_data_t; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/anorms.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | {-0.525731, 0.000000, 0.850651}, 17 | {-0.442863, 0.238856, 0.864188}, 18 | {-0.295242, 0.000000, 0.955423}, 19 | {-0.309017, 0.500000, 0.809017}, 20 | {-0.162460, 0.262866, 0.951056}, 21 | {0.000000, 0.000000, 1.000000}, 22 | {0.000000, 0.850651, 0.525731}, 23 | {-0.147621, 0.716567, 0.681718}, 24 | {0.147621, 0.716567, 0.681718}, 25 | {0.000000, 0.525731, 0.850651}, 26 | {0.309017, 0.500000, 0.809017}, 27 | {0.525731, 0.000000, 0.850651}, 28 | {0.295242, 0.000000, 0.955423}, 29 | {0.442863, 0.238856, 0.864188}, 30 | {0.162460, 0.262866, 0.951056}, 31 | {-0.681718, 0.147621, 0.716567}, 32 | {-0.809017, 0.309017, 0.500000}, 33 | {-0.587785, 0.425325, 0.688191}, 34 | {-0.850651, 0.525731, 0.000000}, 35 | {-0.864188, 0.442863, 0.238856}, 36 | {-0.716567, 0.681718, 0.147621}, 37 | {-0.688191, 0.587785, 0.425325}, 38 | {-0.500000, 0.809017, 0.309017}, 39 | {-0.238856, 0.864188, 0.442863}, 40 | {-0.425325, 0.688191, 0.587785}, 41 | {-0.716567, 0.681718, -0.147621}, 42 | {-0.500000, 0.809017, -0.309017}, 43 | {-0.525731, 0.850651, 0.000000}, 44 | {0.000000, 0.850651, -0.525731}, 45 | {-0.238856, 0.864188, -0.442863}, 46 | {0.000000, 0.955423, -0.295242}, 47 | {-0.262866, 0.951056, -0.162460}, 48 | {0.000000, 1.000000, 0.000000}, 49 | {0.000000, 0.955423, 0.295242}, 50 | {-0.262866, 0.951056, 0.162460}, 51 | {0.238856, 0.864188, 0.442863}, 52 | {0.262866, 0.951056, 0.162460}, 53 | {0.500000, 0.809017, 0.309017}, 54 | {0.238856, 0.864188, -0.442863}, 55 | {0.262866, 0.951056, -0.162460}, 56 | {0.500000, 0.809017, -0.309017}, 57 | {0.850651, 0.525731, 0.000000}, 58 | {0.716567, 0.681718, 0.147621}, 59 | {0.716567, 0.681718, -0.147621}, 60 | {0.525731, 0.850651, 0.000000}, 61 | {0.425325, 0.688191, 0.587785}, 62 | {0.864188, 0.442863, 0.238856}, 63 | {0.688191, 0.587785, 0.425325}, 64 | {0.809017, 0.309017, 0.500000}, 65 | {0.681718, 0.147621, 0.716567}, 66 | {0.587785, 0.425325, 0.688191}, 67 | {0.955423, 0.295242, 0.000000}, 68 | {1.000000, 0.000000, 0.000000}, 69 | {0.951056, 0.162460, 0.262866}, 70 | {0.850651, -0.525731, 0.000000}, 71 | {0.955423, -0.295242, 0.000000}, 72 | {0.864188, -0.442863, 0.238856}, 73 | {0.951056, -0.162460, 0.262866}, 74 | {0.809017, -0.309017, 0.500000}, 75 | {0.681718, -0.147621, 0.716567}, 76 | {0.850651, 0.000000, 0.525731}, 77 | {0.864188, 0.442863, -0.238856}, 78 | {0.809017, 0.309017, -0.500000}, 79 | {0.951056, 0.162460, -0.262866}, 80 | {0.525731, 0.000000, -0.850651}, 81 | {0.681718, 0.147621, -0.716567}, 82 | {0.681718, -0.147621, -0.716567}, 83 | {0.850651, 0.000000, -0.525731}, 84 | {0.809017, -0.309017, -0.500000}, 85 | {0.864188, -0.442863, -0.238856}, 86 | {0.951056, -0.162460, -0.262866}, 87 | {0.147621, 0.716567, -0.681718}, 88 | {0.309017, 0.500000, -0.809017}, 89 | {0.425325, 0.688191, -0.587785}, 90 | {0.442863, 0.238856, -0.864188}, 91 | {0.587785, 0.425325, -0.688191}, 92 | {0.688191, 0.587785, -0.425325}, 93 | {-0.147621, 0.716567, -0.681718}, 94 | {-0.309017, 0.500000, -0.809017}, 95 | {0.000000, 0.525731, -0.850651}, 96 | {-0.525731, 0.000000, -0.850651}, 97 | {-0.442863, 0.238856, -0.864188}, 98 | {-0.295242, 0.000000, -0.955423}, 99 | {-0.162460, 0.262866, -0.951056}, 100 | {0.000000, 0.000000, -1.000000}, 101 | {0.295242, 0.000000, -0.955423}, 102 | {0.162460, 0.262866, -0.951056}, 103 | {-0.442863, -0.238856, -0.864188}, 104 | {-0.309017, -0.500000, -0.809017}, 105 | {-0.162460, -0.262866, -0.951056}, 106 | {0.000000, -0.850651, -0.525731}, 107 | {-0.147621, -0.716567, -0.681718}, 108 | {0.147621, -0.716567, -0.681718}, 109 | {0.000000, -0.525731, -0.850651}, 110 | {0.309017, -0.500000, -0.809017}, 111 | {0.442863, -0.238856, -0.864188}, 112 | {0.162460, -0.262866, -0.951056}, 113 | {0.238856, -0.864188, -0.442863}, 114 | {0.500000, -0.809017, -0.309017}, 115 | {0.425325, -0.688191, -0.587785}, 116 | {0.716567, -0.681718, -0.147621}, 117 | {0.688191, -0.587785, -0.425325}, 118 | {0.587785, -0.425325, -0.688191}, 119 | {0.000000, -0.955423, -0.295242}, 120 | {0.000000, -1.000000, 0.000000}, 121 | {0.262866, -0.951056, -0.162460}, 122 | {0.000000, -0.850651, 0.525731}, 123 | {0.000000, -0.955423, 0.295242}, 124 | {0.238856, -0.864188, 0.442863}, 125 | {0.262866, -0.951056, 0.162460}, 126 | {0.500000, -0.809017, 0.309017}, 127 | {0.716567, -0.681718, 0.147621}, 128 | {0.525731, -0.850651, 0.000000}, 129 | {-0.238856, -0.864188, -0.442863}, 130 | {-0.500000, -0.809017, -0.309017}, 131 | {-0.262866, -0.951056, -0.162460}, 132 | {-0.850651, -0.525731, 0.000000}, 133 | {-0.716567, -0.681718, -0.147621}, 134 | {-0.716567, -0.681718, 0.147621}, 135 | {-0.525731, -0.850651, 0.000000}, 136 | {-0.500000, -0.809017, 0.309017}, 137 | {-0.238856, -0.864188, 0.442863}, 138 | {-0.262866, -0.951056, 0.162460}, 139 | {-0.864188, -0.442863, 0.238856}, 140 | {-0.809017, -0.309017, 0.500000}, 141 | {-0.688191, -0.587785, 0.425325}, 142 | {-0.681718, -0.147621, 0.716567}, 143 | {-0.442863, -0.238856, 0.864188}, 144 | {-0.587785, -0.425325, 0.688191}, 145 | {-0.309017, -0.500000, 0.809017}, 146 | {-0.147621, -0.716567, 0.681718}, 147 | {-0.425325, -0.688191, 0.587785}, 148 | {-0.162460, -0.262866, 0.951056}, 149 | {0.442863, -0.238856, 0.864188}, 150 | {0.162460, -0.262866, 0.951056}, 151 | {0.309017, -0.500000, 0.809017}, 152 | {0.147621, -0.716567, 0.681718}, 153 | {0.000000, -0.525731, 0.850651}, 154 | {0.425325, -0.688191, 0.587785}, 155 | {0.587785, -0.425325, 0.688191}, 156 | {0.688191, -0.587785, 0.425325}, 157 | {-0.955423, 0.295242, 0.000000}, 158 | {-0.951056, 0.162460, 0.262866}, 159 | {-1.000000, 0.000000, 0.000000}, 160 | {-0.850651, 0.000000, 0.525731}, 161 | {-0.955423, -0.295242, 0.000000}, 162 | {-0.951056, -0.162460, 0.262866}, 163 | {-0.864188, 0.442863, -0.238856}, 164 | {-0.951056, 0.162460, -0.262866}, 165 | {-0.809017, 0.309017, -0.500000}, 166 | {-0.864188, -0.442863, -0.238856}, 167 | {-0.951056, -0.162460, -0.262866}, 168 | {-0.809017, -0.309017, -0.500000}, 169 | {-0.681718, 0.147621, -0.716567}, 170 | {-0.681718, -0.147621, -0.716567}, 171 | {-0.850651, 0.000000, -0.525731}, 172 | {-0.688191, 0.587785, -0.425325}, 173 | {-0.587785, 0.425325, -0.688191}, 174 | {-0.425325, 0.688191, -0.587785}, 175 | {-0.425325, -0.688191, -0.587785}, 176 | {-0.587785, -0.425325, -0.688191}, 177 | {-0.688191, -0.587785, -0.425325}, 178 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/archtypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // Word size dependent definitions 3 | // DAL 1/03 4 | // 5 | #ifndef ARCHTYPES_H 6 | #define ARCHTYPES_H 7 | 8 | #ifdef __x86_64__ 9 | #define X64BITS 10 | #endif 11 | 12 | #if defined( _WIN32 ) && (! defined( __MINGW32__ )) 13 | 14 | typedef __int16 int16; 15 | typedef unsigned __int16 uint16; 16 | typedef __int32 int32; 17 | typedef unsigned __int32 uint32; 18 | typedef __int64 int64; 19 | typedef unsigned __int64 uint64; 20 | typedef __int32 intp; // intp is an integer that can accomodate a pointer 21 | typedef unsigned __int32 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) 22 | 23 | #else /* _WIN32 */ 24 | 25 | typedef short int16; 26 | typedef unsigned short uint16; 27 | typedef int int32; 28 | typedef unsigned int uint32; 29 | typedef long long int64; 30 | typedef unsigned long long uint64; 31 | #ifdef X64BITS 32 | typedef long long intp; 33 | typedef unsigned long long uintp; 34 | #else 35 | typedef int intp; 36 | typedef unsigned int uintp; 37 | #endif 38 | 39 | #endif /* else _WIN32 */ 40 | 41 | #endif /* ARCHTYPES_H */ 42 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/custom.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Customization.h 16 | 17 | #ifndef CUSTOM_H 18 | #define CUSTOM_H 19 | #ifdef _WIN32 20 | #ifndef __MINGW32__ 21 | #pragma once 22 | #endif /* not __MINGW32__ */ 23 | #endif 24 | 25 | #include "const.h" 26 | 27 | #define MAX_QPATH 64 // Must match value in quakedefs.h 28 | 29 | ///////////////// 30 | // Customization 31 | // passed to pfnPlayerCustomization 32 | // For automatic downloading. 33 | typedef enum 34 | { 35 | t_sound = 0, 36 | t_skin, 37 | t_model, 38 | t_decal, 39 | t_generic, 40 | t_eventscript, 41 | t_world, // Fake type for world, is really t_model 42 | } resourcetype_t; 43 | 44 | 45 | typedef struct 46 | { 47 | int size; 48 | } _resourceinfo_t; 49 | 50 | typedef struct resourceinfo_s 51 | { 52 | _resourceinfo_t info[ 8 ]; 53 | } resourceinfo_t; 54 | 55 | #define RES_FATALIFMISSING (1<<0) // Disconnect if we can't get this file. 56 | #define RES_WASMISSING (1<<1) // Do we have the file locally, did we get it ok? 57 | #define RES_CUSTOM (1<<2) // Is this resource one that corresponds to another player's customization 58 | // or is it a server startup resource. 59 | #define RES_REQUESTED (1<<3) // Already requested a download of this one 60 | #define RES_PRECACHED (1<<4) // Already precached 61 | 62 | #include "crc.h" 63 | 64 | typedef struct resource_s 65 | { 66 | char szFileName[MAX_QPATH]; // File name to download/precache. 67 | resourcetype_t type; // t_sound, t_skin, t_model, t_decal. 68 | int nIndex; // For t_decals 69 | int nDownloadSize; // Size in Bytes if this must be downloaded. 70 | unsigned char ucFlags; 71 | 72 | // For handling client to client resource propagation 73 | unsigned char rgucMD5_hash[16]; // To determine if we already have it. 74 | unsigned char playernum; // Which player index this resource is associated with, if it's a custom resource. 75 | 76 | unsigned char rguc_reserved[ 32 ]; // For future expansion 77 | struct resource_s *pNext; // Next in chain. 78 | struct resource_s *pPrev; 79 | } resource_t; 80 | 81 | typedef struct customization_s 82 | { 83 | qboolean bInUse; // Is this customization in use; 84 | resource_t resource; // The resource_t for this customization 85 | qboolean bTranslated; // Has the raw data been translated into a useable format? 86 | // (e.g., raw decal .wad make into texture_t *) 87 | int nUserData1; // Customization specific data 88 | int nUserData2; // Customization specific data 89 | void *pInfo; // Buffer that holds the data structure that references the data (e.g., the cachewad_t) 90 | void *pBuffer; // Buffer that holds the data for the customization (the raw .wad data) 91 | struct customization_s *pNext; // Next in chain 92 | } customization_t; 93 | 94 | #define FCUST_FROMHPAK ( 1<<0 ) 95 | #define FCUST_WIPEDATA ( 1<<1 ) 96 | #define FCUST_IGNOREINIT ( 1<<2 ) 97 | 98 | void COM_ClearCustomizationList( struct customization_s *pHead, qboolean bCleanDecals); 99 | qboolean COM_CreateCustomization( struct customization_s *pListHead, struct resource_s *pResource, int playernumber, int flags, 100 | struct customization_s **pCustomization, int *nLumps ); 101 | int COM_SizeofResourceList ( struct resource_s *pList, struct resourceinfo_s *ri ); 102 | 103 | #endif // CUSTOM_H 104 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/customentity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CUSTOMENTITY_H 16 | #define CUSTOMENTITY_H 17 | 18 | // Custom Entities 19 | 20 | // Start/End Entity is encoded as 12 bits of entity index, and 4 bits of attachment (4:12) 21 | #define BEAMENT_ENTITY(x) ((x)&0xFFF) 22 | #define BEAMENT_ATTACHMENT(x) (((x)>>12)&0xF) 23 | 24 | // Beam types, encoded as a byte 25 | enum 26 | { 27 | BEAM_POINTS = 0, 28 | BEAM_ENTPOINT, 29 | BEAM_ENTS, 30 | BEAM_HOSE, 31 | }; 32 | 33 | #define BEAM_FSINE 0x10 34 | #define BEAM_FSOLID 0x20 35 | #define BEAM_FSHADEIN 0x40 36 | #define BEAM_FSHADEOUT 0x80 37 | 38 | #endif //CUSTOMENTITY_H 39 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/edict.h: -------------------------------------------------------------------------------- 1 | //========= Copyright ?1996-2002, Valve LLC, All rights reserved. ============ 2 | // 3 | // Purpose: 4 | // 5 | // $NoKeywords: $ 6 | //============================================================================= 7 | 8 | #if !defined EDICT_H 9 | #define EDICT_H 10 | #ifdef _WIN32 11 | #ifndef __MINGW32__ 12 | #pragma once 13 | #endif /* not __MINGW32__ */ 14 | #endif 15 | #define MAX_ENT_LEAFS 48 16 | 17 | #include "progdefs.h" 18 | 19 | struct edict_s 20 | { 21 | qboolean free; 22 | int serialnumber; 23 | link_t area; // linked to a division node or leaf 24 | 25 | int headnode; // -1 to use normal leaf check 26 | int num_leafs; 27 | short leafnums[MAX_ENT_LEAFS]; 28 | 29 | float freetime; // sv.time when the object was freed 30 | 31 | void* pvPrivateData; // Alloced and freed by engine, used by DLLs 32 | 33 | entvars_t v; // C exported fields from progs 34 | 35 | // other fields from progs come immediately after 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/keydefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/engine/keydefs.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/progdefs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef PROGDEFS_H 16 | #define PROGDEFS_H 17 | #ifdef _WIN32 18 | #ifndef __MINGW32__ 19 | #pragma once 20 | #endif /* not __MINGW32__ */ 21 | #endif 22 | 23 | typedef struct 24 | { 25 | float time; 26 | float frametime; 27 | float force_retouch; 28 | string_t mapname; 29 | string_t startspot; 30 | float deathmatch; 31 | float coop; 32 | float teamplay; 33 | float serverflags; 34 | float found_secrets; 35 | vec3_t v_forward; 36 | vec3_t v_up; 37 | vec3_t v_right; 38 | float trace_allsolid; 39 | float trace_startsolid; 40 | float trace_fraction; 41 | vec3_t trace_endpos; 42 | vec3_t trace_plane_normal; 43 | float trace_plane_dist; 44 | edict_t *trace_ent; 45 | float trace_inopen; 46 | float trace_inwater; 47 | int trace_hitgroup; 48 | int trace_flags; 49 | int msg_entity; 50 | int cdAudioTrack; 51 | int maxClients; 52 | int maxEntities; 53 | const char *pStringBase; 54 | 55 | void *pSaveData; 56 | vec3_t vecLandmarkOffset; 57 | } globalvars_t; 58 | 59 | 60 | typedef struct entvars_s 61 | { 62 | string_t classname; 63 | string_t globalname; 64 | 65 | vec3_t origin; 66 | vec3_t oldorigin; 67 | vec3_t velocity; 68 | vec3_t basevelocity; 69 | vec3_t clbasevelocity; // Base velocity that was passed in to server physics so 70 | // client can predict conveyors correctly. Server zeroes it, so we need to store here, too. 71 | vec3_t movedir; 72 | 73 | vec3_t angles; // Model angles 74 | vec3_t avelocity; // angle velocity (degrees per second) 75 | vec3_t punchangle; // auto-decaying view angle adjustment 76 | vec3_t v_angle; // Viewing angle (player only) 77 | 78 | // For parametric entities 79 | vec3_t endpos; 80 | vec3_t startpos; 81 | float impacttime; 82 | float starttime; 83 | 84 | int fixangle; // 0:nothing, 1:force view angles, 2:add avelocity 85 | float idealpitch; 86 | float pitch_speed; 87 | float ideal_yaw; 88 | float yaw_speed; 89 | 90 | int modelindex; 91 | string_t model; 92 | 93 | int viewmodel; // player's viewmodel 94 | int weaponmodel; // what other players see 95 | 96 | vec3_t absmin; // BB max translated to world coord 97 | vec3_t absmax; // BB max translated to world coord 98 | vec3_t mins; // local BB min 99 | vec3_t maxs; // local BB max 100 | vec3_t size; // maxs - mins 101 | 102 | float ltime; 103 | float nextthink; 104 | 105 | int movetype; 106 | int solid; 107 | 108 | int skin; 109 | int body; // sub-model selection for studiomodels 110 | int effects; 111 | 112 | float gravity; // % of "normal" gravity 113 | float friction; // inverse elasticity of MOVETYPE_BOUNCE 114 | 115 | int light_level; 116 | 117 | int sequence; // animation sequence 118 | int gaitsequence; // movement animation sequence for player (0 for none) 119 | float frame; // % playback position in animation sequences (0..255) 120 | float animtime; // world time when frame was set 121 | float framerate; // animation playback rate (-8x to 8x) 122 | byte controller[4]; // bone controller setting (0..255) 123 | byte blending[2]; // blending amount between sub-sequences (0..255) 124 | 125 | float scale; // sprite rendering scale (0..255) 126 | 127 | int rendermode; 128 | float renderamt; 129 | vec3_t rendercolor; 130 | int renderfx; 131 | 132 | float health; 133 | float frags; 134 | int weapons; // bit mask for available weapons 135 | float takedamage; 136 | 137 | int deadflag; 138 | vec3_t view_ofs; // eye position 139 | 140 | int button; 141 | int impulse; 142 | 143 | edict_t *chain; // Entity pointer when linked into a linked list 144 | edict_t *dmg_inflictor; 145 | edict_t *enemy; 146 | edict_t *aiment; // entity pointer when MOVETYPE_FOLLOW 147 | edict_t *owner; 148 | edict_t *groundentity; 149 | 150 | int spawnflags; 151 | int flags; 152 | 153 | int colormap; // lowbyte topcolor, highbyte bottomcolor 154 | int team; 155 | 156 | float max_health; 157 | float teleport_time; 158 | float armortype; 159 | float armorvalue; 160 | int waterlevel; 161 | int watertype; 162 | 163 | string_t target; 164 | string_t targetname; 165 | string_t netname; 166 | string_t message; 167 | 168 | float dmg_take; 169 | float dmg_save; 170 | float dmg; 171 | float dmgtime; 172 | 173 | string_t noise; 174 | string_t noise1; 175 | string_t noise2; 176 | string_t noise3; 177 | 178 | float speed; 179 | float air_finished; 180 | float pain_finished; 181 | float radsuit_finished; 182 | 183 | edict_t *pContainingEntity; 184 | 185 | int playerclass; 186 | float maxspeed; 187 | 188 | float fov; 189 | int weaponanim; 190 | 191 | int pushmsec; 192 | 193 | int bInDuck; 194 | int flTimeStepSound; 195 | int flSwimTime; 196 | int flDuckTime; 197 | int iStepLeft; 198 | float flFallVelocity; 199 | 200 | int gamestate; 201 | 202 | int oldbuttons; 203 | 204 | int groupinfo; 205 | 206 | // For mods 207 | int iuser1; 208 | int iuser2; 209 | int iuser3; 210 | int iuser4; 211 | float fuser1; 212 | float fuser2; 213 | float fuser3; 214 | float fuser4; 215 | vec3_t vuser1; 216 | vec3_t vuser2; 217 | vec3_t vuser3; 218 | vec3_t vuser4; 219 | edict_t *euser1; 220 | edict_t *euser2; 221 | edict_t *euser3; 222 | edict_t *euser4; 223 | } entvars_t; 224 | 225 | 226 | #endif // PROGDEFS_H 227 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/progs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef PROGS_H 16 | #define PROGS_H 17 | 18 | #include "progdefs.h" 19 | 20 | // 16 simultaneous events, max 21 | #define MAX_EVENT_QUEUE 64 22 | 23 | #define DEFAULT_EVENT_RESENDS 1 24 | 25 | #include "event_flags.h" 26 | 27 | typedef struct event_info_s event_info_t; 28 | 29 | #include "event_args.h" 30 | 31 | struct event_info_s 32 | { 33 | unsigned short index; // 0 implies not in use 34 | 35 | short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event 36 | // parameter signature 37 | short entity_index; // The edict this event is associated with 38 | 39 | float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client ) 40 | 41 | event_args_t args; 42 | 43 | // CLIENT ONLY 44 | int flags; // Reliable or not, etc. 45 | 46 | }; 47 | 48 | typedef struct event_state_s event_state_t; 49 | 50 | struct event_state_s 51 | { 52 | struct event_info_s ei[ MAX_EVENT_QUEUE ]; 53 | }; 54 | 55 | #if !defined( ENTITY_STATEH ) 56 | #include "entity_state.h" 57 | #endif 58 | 59 | #if !defined( EDICT_H ) 60 | #include "edict.h" 61 | #endif 62 | 63 | #define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m))) 64 | #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area) 65 | 66 | //============================================================================ 67 | 68 | extern char *pr_strings; 69 | extern globalvars_t gGlobalVariables; 70 | 71 | //============================================================================ 72 | 73 | edict_t *ED_Alloc (void); 74 | void ED_Free (edict_t *ed); 75 | void ED_LoadFromFile (char *data); 76 | 77 | edict_t *EDICT_NUM(int n); 78 | int NUM_FOR_EDICT(const edict_t *e); 79 | 80 | #define PROG_TO_EDICT(e) ((edict_t *)((byte *)sv.edicts + e)) 81 | 82 | #endif // PROGS_H 83 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/engine/shake.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef SHAKE_H 16 | #define SHAKE_H 17 | 18 | // Screen / View effects 19 | 20 | // screen shake 21 | extern int gmsgShake; 22 | 23 | // This structure is sent over the net to describe a screen shake event 24 | typedef struct 25 | { 26 | unsigned short amplitude; // FIXED 4.12 amount of shake 27 | unsigned short duration; // FIXED 4.12 seconds duration 28 | unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble) 29 | } ScreenShake; 30 | 31 | extern void V_ApplyShake( float *origin, float *angles, float factor ); 32 | extern void V_CalcShake( void ); 33 | extern int V_ScreenShake( const char *pszName, int iSize, void *pbuf ); 34 | extern int V_ScreenFade( const char *pszName, int iSize, void *pbuf ); 35 | 36 | 37 | // Fade in/out 38 | extern int gmsgFade; 39 | 40 | #define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function 41 | #define FFADE_OUT 0x0001 // Fade out (not in) 42 | #define FFADE_MODULATE 0x0002 // Modulate (don't blend) 43 | #define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received 44 | 45 | // This structure is sent over the net to describe a screen fade event 46 | typedef struct 47 | { 48 | unsigned short duration; // FIXED 4.12 seconds duration 49 | unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold) 50 | short fadeFlags; // flags 51 | byte r, g, b, a; // fade to color ( max alpha ) 52 | } ScreenFade; 53 | 54 | #endif // SHAKE_H 55 | 56 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/pm_shared/pm_info.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Physics info string definition 16 | #if !defined( PM_INFOH ) 17 | #define PM_INFOH 18 | #ifdef _WIN32 19 | #ifndef __MINGW32__ 20 | #pragma once 21 | #endif /* not __MINGW32__ */ 22 | #endif 23 | 24 | #define MAX_PHYSINFO_STRING 256 25 | 26 | #endif // PM_INFOH 27 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/pm_shared/pm_movevars.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SwNPC/sdk/pm_shared/pm_movevars.h -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/activity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | #ifndef ACTIVITY_H 17 | #define ACTIVITY_H 18 | 19 | 20 | typedef enum { 21 | ACT_RESET = 0, // Set m_Activity to this invalid value to force a reset to m_IdealActivity 22 | ACT_IDLE = 1, 23 | ACT_GUARD, 24 | ACT_WALK, 25 | ACT_RUN, 26 | ACT_FLY, // Fly (and flap if appropriate) 27 | ACT_SWIM, 28 | ACT_HOP, // vertical jump 29 | ACT_LEAP, // long forward jump 30 | ACT_FALL, 31 | ACT_LAND, 32 | ACT_STRAFE_LEFT, 33 | ACT_STRAFE_RIGHT, 34 | ACT_ROLL_LEFT, // tuck and roll, left 35 | ACT_ROLL_RIGHT, // tuck and roll, right 36 | ACT_TURN_LEFT, // turn quickly left (stationary) 37 | ACT_TURN_RIGHT, // turn quickly right (stationary) 38 | ACT_CROUCH, // the act of crouching down from a standing position 39 | ACT_CROUCHIDLE, // holding body in crouched position (loops) 40 | ACT_STAND, // the act of standing from a crouched position 41 | ACT_USE, 42 | ACT_SIGNAL1, 43 | ACT_SIGNAL2, 44 | ACT_SIGNAL3, 45 | ACT_TWITCH, 46 | ACT_COWER, 47 | ACT_SMALL_FLINCH, 48 | ACT_BIG_FLINCH, 49 | ACT_RANGE_ATTACK1, 50 | ACT_RANGE_ATTACK2, 51 | ACT_MELEE_ATTACK1, 52 | ACT_MELEE_ATTACK2, 53 | ACT_RELOAD, 54 | ACT_ARM, // pull out gun, for instance 55 | ACT_DISARM, // reholster gun 56 | ACT_EAT, // monster chowing on a large food item (loop) 57 | ACT_DIESIMPLE, 58 | ACT_DIEBACKWARD, 59 | ACT_DIEFORWARD, 60 | ACT_DIEVIOLENT, 61 | ACT_BARNACLE_HIT, // barnacle tongue hits a monster 62 | ACT_BARNACLE_PULL, // barnacle is lifting the monster ( loop ) 63 | ACT_BARNACLE_CHOMP, // barnacle latches on to the monster 64 | ACT_BARNACLE_CHEW, // barnacle is holding the monster in its mouth ( loop ) 65 | ACT_SLEEP, 66 | ACT_INSPECT_FLOOR, // for active idles, look at something on or near the floor 67 | ACT_INSPECT_WALL, // for active idles, look at something directly ahead of you ( doesn't HAVE to be a wall or on a wall ) 68 | ACT_IDLE_ANGRY, // alternate idle animation in which the monster is clearly agitated. (loop) 69 | ACT_WALK_HURT, // limp (loop) 70 | ACT_RUN_HURT, // limp (loop) 71 | ACT_HOVER, // Idle while in flight 72 | ACT_GLIDE, // Fly (don't flap) 73 | ACT_FLY_LEFT, // Turn left in flight 74 | ACT_FLY_RIGHT, // Turn right in flight 75 | ACT_DETECT_SCENT, // this means the monster smells a scent carried by the air 76 | ACT_SNIFF, // this is the act of actually sniffing an item in front of the monster 77 | ACT_BITE, // some large monsters can eat small things in one bite. This plays one time, EAT loops. 78 | ACT_THREAT_DISPLAY, // without attacking, monster demonstrates that it is angry. (Yell, stick out chest, etc ) 79 | ACT_FEAR_DISPLAY, // monster just saw something that it is afraid of 80 | ACT_EXCITED, // for some reason, monster is excited. Sees something he really likes to eat, or whatever. 81 | ACT_SPECIAL_ATTACK1, // very monster specific special attacks. 82 | ACT_SPECIAL_ATTACK2, 83 | ACT_COMBAT_IDLE, // agitated idle. 84 | ACT_WALK_SCARED, 85 | ACT_RUN_SCARED, 86 | ACT_VICTORY_DANCE, // killed a player, do a victory dance. 87 | ACT_DIE_HEADSHOT, // die, hit in head. 88 | ACT_DIE_CHESTSHOT, // die, hit in chest 89 | ACT_DIE_GUTSHOT, // die, hit in gut 90 | ACT_DIE_BACKSHOT, // die, hit in back 91 | ACT_FLINCH_HEAD, 92 | ACT_FLINCH_CHEST, 93 | ACT_FLINCH_STOMACH, 94 | ACT_FLINCH_LEFTARM, 95 | ACT_FLINCH_RIGHTARM, 96 | ACT_FLINCH_LEFTLEG, 97 | ACT_FLINCH_RIGHTLEG, 98 | } Activity; 99 | 100 | 101 | typedef struct { 102 | int type; 103 | char *name; 104 | } activity_map_t; 105 | 106 | extern activity_map_t activity_map[]; 107 | 108 | 109 | #endif //ACTIVITY_H 110 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/basemonster.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef BASEMONSTER_H 16 | #define BASEMONSTER_H 17 | 18 | class CBaseMonster : public CBaseToggle 19 | { 20 | public: 21 | Activity m_Activity;// what the monster is doing (animation) 22 | Activity m_IdealActivity;// monster should switch to this activity 23 | int m_LastHitGroup; // the last body region that took damage 24 | int m_bitsDamageType; // what types of damage has monster (player) taken 25 | BYTE m_rgbTimeBasedDamage[CDMG_TIMEBASED]; 26 | MONSTERSTATE m_MonsterState;// monster's current state 27 | MONSTERSTATE m_IdealMonsterState;// monster should change to this state 28 | int m_afConditions; 29 | int m_afMemory; 30 | float m_flNextAttack; // cannot attack again until this time 31 | EHANDLE m_hEnemy; // the entity that the monster is fighting. 32 | EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach 33 | float m_flFieldOfView;// width of monster's field of view ( dot product ) 34 | int m_bloodColor; // color of blood particless 35 | Vector m_HackedGunPos; // HACK until we can query end of gun 36 | Vector m_vecEnemyLKP;// last known position of enemy. (enemy's origin) 37 | 38 | 39 | void KeyValue( KeyValueData *pkvd ); 40 | 41 | void MakeIdealYaw( Vector vecTarget ); 42 | virtual float ChangeYaw ( int speed ); 43 | virtual BOOL HasHumanGibs( void ); 44 | virtual BOOL HasAlienGibs( void ); 45 | virtual void FadeMonster( void ); // Called instead of GibMonster() when gibs are disabled 46 | virtual void GibMonster( void ); 47 | virtual Activity GetDeathActivity ( void ); 48 | Activity GetSmallFlinchActivity( void ); 49 | virtual void BecomeDead( void ); 50 | BOOL ShouldGibMonster( int iGib ); 51 | void CallGibMonster( void ); 52 | virtual BOOL ShouldFadeOnDeath( void ); 53 | BOOL FCheckAITrigger( void );// checks and, if necessary, fires the monster's trigger target. 54 | virtual int IRelationship ( CBaseEntity *pTarget ); 55 | virtual int TakeHealth( float flHealth, int bitsDamageType ); 56 | virtual int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType); 57 | int DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ); 58 | float DamageForce( float damage ); 59 | virtual void Killed( entvars_t *pevAttacker, int iGib ); 60 | virtual void PainSound ( void ) { return; }; 61 | 62 | void RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ); 63 | void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ); 64 | 65 | inline void SetConditions( int iConditions ) { m_afConditions |= iConditions; } 66 | inline void ClearConditions( int iConditions ) { m_afConditions &= ~iConditions; } 67 | inline BOOL HasConditions( int iConditions ) { if ( m_afConditions & iConditions ) return TRUE; return FALSE; } 68 | inline BOOL HasAllConditions( int iConditions ) { if ( (m_afConditions & iConditions) == iConditions ) return TRUE; return FALSE; } 69 | 70 | inline void Remember( int iMemory ) { m_afMemory |= iMemory; } 71 | inline void Forget( int iMemory ) { m_afMemory &= ~iMemory; } 72 | inline BOOL HasMemory( int iMemory ) { if ( m_afMemory & iMemory ) return TRUE; return FALSE; } 73 | inline BOOL HasAllMemories( int iMemory ) { if ( (m_afMemory & iMemory) == iMemory ) return TRUE; return FALSE; } 74 | 75 | // This will stop animation until you call ResetSequenceInfo() at some point in the future 76 | inline void StopAnimation( void ) { pev->framerate = 0; } 77 | 78 | virtual void ReportAIState( void ); 79 | virtual void MonsterInitDead( void ); // Call after animation/pose is set up 80 | void EXPORT CorpseFallThink( void ); 81 | 82 | virtual void Look ( int iDistance );// basic sight function for monsters 83 | virtual CBaseEntity* BestVisibleEnemy ( void );// finds best visible enemy for attack 84 | CBaseEntity *CheckTraceHullAttack( float flDist, int iDamage, int iDmgType ); 85 | virtual BOOL FInViewCone ( CBaseEntity *pEntity );// see if pEntity is in monster's view cone 86 | virtual BOOL FInViewCone ( Vector *pOrigin );// see if given location is in monster's view cone 87 | void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType); 88 | void MakeDamageBloodDecal ( int cCount, float flNoise, TraceResult *ptr, const Vector &vecDir ); 89 | virtual BOOL IsAlive( void ) { return (pev->deadflag != DEAD_DEAD); } 90 | 91 | }; 92 | 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/cdll_dll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // cdll_dll.h 17 | 18 | // this file is included by both the game-dll and the client-dll, 19 | 20 | #ifndef CDLL_DLL_H 21 | #define CDLL_DLL_H 22 | 23 | #define MAX_WEAPONS 32 // ??? 24 | 25 | #define MAX_WEAPON_SLOTS 5 // hud item selection slots 26 | #define MAX_ITEM_TYPES 6 // hud item selection slots 27 | 28 | #define MAX_ITEMS 5 // hard coded item types 29 | 30 | #define HIDEHUD_WEAPONS ( 1<<0 ) 31 | #define HIDEHUD_FLASHLIGHT ( 1<<1 ) 32 | #define HIDEHUD_ALL ( 1<<2 ) 33 | #define HIDEHUD_HEALTH ( 1<<3 ) 34 | 35 | #define MAX_AMMO_TYPES 32 // ??? 36 | #define MAX_AMMO_SLOTS 32 // not really slots 37 | 38 | #define HUD_PRINTNOTIFY 1 39 | #define HUD_PRINTCONSOLE 2 40 | #define HUD_PRINTTALK 3 41 | #define HUD_PRINTCENTER 4 42 | 43 | 44 | #define WEAPON_SUIT 31 45 | 46 | #endif -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/enginecallbacks.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // enginecallbacks.h - wrapper for 5 | 6 | /* 7 | * Copyright (c) 2001-2006 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | #ifndef MM_ENGINECALLBACKS_H 38 | #define MM_ENGINECALLBACKS_H 39 | 40 | // This file is a wrapper around the SDK's enginecallback.h file. We need 41 | // this because we use a different type for the global object g_engfuncs, 42 | // which is still compatible with the enginefuncs_t that the SDK 43 | // uses. 44 | // This is only done for files that belong to Metamod, not other projects 45 | // like plugins that use this file, or others that include it, too. 46 | // Since we don't have a clean seperation of include files right now we 47 | // "hack" our way around that by using a flag METAMOD_CORE which is set 48 | // when compiling Metamod proper. 49 | 50 | #ifdef METAMOD_CORE 51 | # include "meta_eiface.h" // HL_enginefuncs_t 52 | 53 | // Use a #define to bend the enginefuncs_t type to our HL_enginefuncs_t 54 | // type instead as we now use that for the global object g_engfuncs. 55 | # define enginefuncs_t HL_enginefuncs_t 56 | #endif /* METAMOD_CORE */ 57 | 58 | #include "enginecallback.h" // ALERT, etc 59 | 60 | #ifdef METAMOD_CORE 61 | # undef enginefuncs_t 62 | #endif /* METAMOD_CORE */ 63 | 64 | // Also, create some additional macros for engine callback functions, which 65 | // weren't in SDK dlls/enginecallbacks.h but probably should have been. 66 | 67 | #define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) 68 | #define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue) 69 | #define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue) 70 | #define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand) 71 | #define SERVER_PRINT (*g_engfuncs.pfnServerPrint) 72 | #define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue) 73 | #define QUERY_CLIENT_CVAR_VALUE (*g_engfuncs.pfnQueryClientCvarValue) 74 | #define QUERY_CLIENT_CVAR_VALUE2 (*g_engfuncs.pfnQueryClientCvarValue2) 75 | 76 | 77 | #endif /* MM_ENGINECALLBACKS_H */ 78 | 79 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/extdll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef EXTDLL_H 16 | #define EXTDLL_H 17 | 18 | 19 | // 20 | // Global header file for extension DLLs 21 | // 22 | 23 | // Allow "DEBUG" in addition to default "_DEBUG" 24 | #ifdef _DEBUG 25 | #define DEBUG 1 26 | #endif 27 | 28 | // Silence certain warnings 29 | #pragma warning(disable : 4244) // int or float down-conversion 30 | #pragma warning(disable : 4305) // int or float data truncation 31 | #pragma warning(disable : 4201) // nameless struct/union 32 | #pragma warning(disable : 4514) // unreferenced inline function removed 33 | #pragma warning(disable : 4100) // unreferenced formal parameter 34 | 35 | // Prevent tons of unused windows definitions 36 | #ifdef _WIN32 37 | #define WIN32_LEAN_AND_MEAN 38 | #define NOWINRES 39 | #define NOSERVICE 40 | #define NOMCX 41 | #define NOIME 42 | #include "windows.h" 43 | #else // _WIN32 44 | #define FALSE 0 45 | #define TRUE (!FALSE) 46 | typedef unsigned long ULONG; 47 | typedef unsigned char BYTE; 48 | typedef int BOOL; 49 | #define MAX_PATH PATH_MAX 50 | #include 51 | #include 52 | #ifndef min 53 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 54 | #endif 55 | #ifndef max 56 | #define max(a,b) (((a) > (b)) ? (a) : (b)) 57 | #define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) 58 | #endif 59 | #endif //_WIN32 60 | 61 | // Misc C-runtime library headers 62 | #include "stdio.h" 63 | #include "stdlib.h" 64 | #include "math.h" 65 | 66 | // Header file containing definition of globalvars_t and entvars_t 67 | typedef int func_t; // 68 | typedef int string_t; // from engine's pr_comp.h; 69 | typedef float vec_t; // needed before including progdefs.h 70 | 71 | // Vector class 72 | #include "vector.h" 73 | 74 | // Defining it as a (bogus) struct helps enforce type-checking 75 | #define vec3_t Vector 76 | 77 | // Shared engine/DLL constants 78 | #include "const.h" 79 | #include "progdefs.h" 80 | #include "edict.h" 81 | 82 | // Shared header describing protocol between engine and DLLs 83 | #include "eiface.h" 84 | 85 | // Shared header between the client DLL and the game DLLs 86 | #include "cdll_dll.h" 87 | 88 | #endif //EXTDLL_H 89 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/log_meta.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // log_meta.h - functions & macros for logging 5 | 6 | /* 7 | * Copyright (c) 2001-2003 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | #ifndef LOG_META_H 38 | #define LOG_META_H 39 | 40 | #include "enginecallbacks.h" // ALERT, etc 41 | #include "sdk_util.h" // UTIL_VarArgs, etc 42 | 43 | // Debug logging. 44 | // 45 | // This is done as a macro, rather than a function. This way, you can add 46 | // DEBUG statements all over, without worrying about performance 47 | // implications. If the debugging level is set low, all those statements 48 | // will only generate a simple float/int compare each; if we were to use a 49 | // function instead of a macro, it would end up wasting a lot of cpu cycles 50 | // calling/returning from the function every time. With a fair number of 51 | // DEBUG statements, or if they're placed in frequently excuted code, the 52 | // overhead of the wasted function calls could significantly impact server 53 | // performance. 54 | // 55 | // For this reason, we also compare directly to the float value of the 56 | // cvar, rather than calling CVAR_GET_FLOAT() and thus generating a string 57 | // compare for each DEBUG statement. 58 | // 59 | // Called as: 60 | // META_DEBUG(3, ("return code: %d", ret)); 61 | // 62 | // Note the double parens, and the missing parens around "args" in the 63 | // macro itself. Note also the "do..while(0)" loop wrapping the 64 | // statements, so they become a single statement when expanded, necessary 65 | // for times when it might be called as a single-statement result of an 66 | // else (or other flow control). 67 | // 68 | // As suggested by Jussi Kivilinna: Use "if(meta_debug.value < level); else 69 | // DO(something);" style because "meta_debug.value < level" is in most common 70 | // case "false". Check disasm, contitional jumps are predicted not to be 71 | // taken by CPU. 72 | // 73 | // Yes, it's all a bit of a hack. 74 | 75 | #define META_DEBUG(level, args) \ 76 | do { if(meta_debug.value < level) break; else ALERT(at_logged, "[META] (debug:%d) %s\n", level, UTIL_VarArgs args ); } while(0) 77 | 78 | // max buffer size for printed messages 79 | #define MAX_LOGMSG_LEN 1024 80 | 81 | // max buffer size for client messages 82 | #define MAX_CLIENTMSG_LEN 128 83 | 84 | extern cvar_t meta_debug; 85 | 86 | // META_DEV provides debug logging via the cvar "developer" (when set to 1) 87 | // and uses a function call rather than a macro as it's really intended to 88 | // be used only during startup, before meta_debug has been set from reading 89 | // server.cfg. 90 | // NOTE: META_DEV has now been mostly obsoleted in the code. 91 | 92 | void META_CONS(const char *fmt, ...); 93 | void META_DEV(const char *fmt, ...); 94 | void META_INFO(const char *fmt, ...); 95 | void META_WARNING(const char *fmt, ...); 96 | void META_ERROR(const char *fmt, ...); 97 | void META_LOG(const char *fmt, ...); 98 | void META_CLIENT(edict_t *pEntity, const char *fmt, ...); 99 | 100 | void flush_ALERT_buffer(void); 101 | 102 | #endif /* LOG_META_H */ 103 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/mhook.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | #ifdef UNFINISHED 5 | 6 | // mhook.h - class and types to describe hooks and hooklists 7 | 8 | /* 9 | * Copyright (c) 2001-2003 Will Day 10 | * 11 | * This file is part of Metamod. 12 | * 13 | * Metamod is free software; you can redistribute it and/or modify it 14 | * under the terms of the GNU General Public License as published by the 15 | * Free Software Foundation; either version 2 of the License, or (at 16 | * your option) any later version. 17 | * 18 | * Metamod is distributed in the hope that it will be useful, but 19 | * WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | * General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Metamod; if not, write to the Free Software Foundation, 25 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 | * 27 | * In addition, as a special exception, the author gives permission to 28 | * link the code of this program with the Half-Life Game Engine ("HL 29 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 30 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 31 | * respects for all of the code used other than the HL Engine and MODs 32 | * from Valve. If you modify this file, you may extend this exception 33 | * to your version of the file, but you are not obligated to do so. If 34 | * you do not wish to do so, delete this exception statement from your 35 | * version. 36 | * 37 | */ 38 | 39 | #ifndef MHOOK_H 40 | #define MHOOK_H 41 | 42 | #include "plinfo.h" // plid_t, etc 43 | #include "types_meta.h" // mBOOL 44 | #include "osdep.h" // MUTEX_T, etc 45 | 46 | #define MAX_HOOKS 100 47 | 48 | // Particular game events that we detect, though whatever means we can best 49 | // find. 50 | typedef enum { 51 | EV_NONE = 0, // no event here... 52 | // non-log detected 53 | EV_PLAYER_CONNECT, // ie ClientConnect 54 | EV_PLAYER_ENTER, // ie ClientPutInServer 55 | EV_PLAYER_LEAVE, // ie ClientDisconnect (opposite PutInServer) 56 | EV_PLAYER_SPAWN, // deadflag change to DEAD_NO 57 | EV_PLAYER_DEATH, // deadflag change to DEAD_DEAD 58 | EV_PLAYER_CHANGE_NAME, // netname change in ClientUserInfoChanged 59 | // log detected 60 | EV_PLAYER_JOIN_TEAM, // ie "Joe<15><785><>" joined team "CT" 61 | EV_PLAYER_SUICIDE, // ie "Joe<15><785>" committed suicide ... 62 | EV_PLAYER_CHANGE_ROLE, // TFC: ie "Joe<15><785>" changed role to "Pyro" 63 | EV_TEAM_KILL, // ie "Joe<15><785>" killed "Bob<16><342>" ... 64 | EV_WEAPON_KILL, // ie "Joe<15><785>" killed "Sam<17><197>" with "sg552" 65 | EV_TEAM_SCORE, // ie Team "CT" scored "7" with "2" players 66 | } game_event_t; 67 | 68 | // Info corresponding to a player, in particular the info found in the logline. 69 | typedef struct { 70 | char *name; 71 | int userid; 72 | int wonid; 73 | char *team; 74 | } event_player_t; 75 | 76 | // Info for an event, mostly corresponding to info from a logline. 77 | typedef struct { 78 | game_event_t evtype; // specific event, if identified. 79 | char *buf; // copy of the logmsg, with embedded NULLs 80 | event_player_t *player; 81 | char *action; // "triggered" string, or a generic action string 82 | event_player_t *target; 83 | char *with; 84 | } event_args_t; 85 | 86 | // Types for callback functions to be called for requested event/logline. 87 | typedef void (*event_func_t) (game_event_t event, event_args_t *args, 88 | const char *logline); 89 | typedef void (*logmatch_func_t) (const char *pattern, event_args_t *args, 90 | const char *logline); 91 | 92 | // The 4 types of hook requests we accept. 93 | typedef enum { 94 | H_NONE = 0, 95 | H_EVENT, // Specific event, from a short list. 96 | H_TRIGGER, // A given "triggered" string. 97 | H_STRING, // Any substring of logline. 98 | H_REGEX, // A regular expression matching of logline. 99 | } hook_t; 100 | 101 | 102 | // Class for individual hook function, as registered by a plugin. 103 | class MHook { 104 | friend class MHookList; 105 | friend class MFuncQueue; 106 | private: 107 | // data: 108 | int index; 109 | hook_t type; // EVENT, TRIGGER, etc 110 | plid_t plid; 111 | int pl_index; // index of matching plugin 112 | void *pfnHandle; 113 | game_event_t event; // if type is H_EVENT 114 | const char *match; // if type is TRIGGER, STRING, or REGEX 115 | // Copy/Assignment constructors, to satisfy -Weffc++. 116 | // Note however, we declare them private and don't define them, since 117 | // we don't ever want to copy or assign instances of the class. 118 | // (thanks to O'Reilly "C++: The Core Language", page 113) 119 | MHook(const MHook &src); 120 | void operator=(const MHook &src); 121 | // constructors: 122 | MHook(void); 123 | MHook(int idx, plid_t pid, game_event_t evt, event_func_t pfn); 124 | MHook(int idx, plid_t pid, hook_t tp, const char *cp, logmatch_func_t pfn); 125 | // functions: 126 | mBOOL call(event_args_t *args, const char *logline); 127 | mBOOL enqueue(MFuncQueue *mfq, event_args_t *args, const char *logline); 128 | public: 129 | // no public interfaces; everything done from friend MHookList. 130 | }; 131 | 132 | 133 | // Class for list of registered hook functions. 134 | class MHookList { 135 | private: 136 | // data: 137 | MHook *hlist[MAX_HOOKS]; 138 | int size; // set to MAX_HOOKS in constructor 139 | int endlist; 140 | MUTEX_T mx_hlist; 141 | int MXlock(void) { return(MUTEX_LOCK(&mx_hlist)); }; 142 | int MXunlock(void) { return(MUTEX_UNLOCK(&mx_hlist)); }; 143 | public: 144 | // constructor: 145 | MHookList(void); 146 | // functions: 147 | int add(plid_t plid, game_event_t event, event_func_t pfnHandle); 148 | int add(plid_t plid, hook_t type, const char *match, 149 | logmatch_func_t pfnHandle); 150 | mBOOL remove(plid_t plid, int hindex); 151 | int remove_all(plid_t plid); 152 | mBOOL call(event_args_t *args, const char *logline); 153 | mBOOL enqueue(MFuncQueue *mfq, hook_t htype, event_args_t *evargs, 154 | const char *logline); 155 | char *str_htype(hook_t htype); 156 | }; 157 | 158 | #endif /* MHOOK_H */ 159 | 160 | #endif /* UNFINISHED */ 161 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/monsterevent.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef MONSTEREVENT_H 16 | #define MONSTEREVENT_H 17 | 18 | typedef struct 19 | { 20 | int event; 21 | char *options; 22 | } MonsterEvent_t; 23 | 24 | #define EVENT_SPECIFIC 0 25 | #define EVENT_SCRIPTED 1000 26 | #define EVENT_SHARED 2000 27 | #define EVENT_CLIENT 5000 28 | 29 | #define MONSTER_EVENT_BODYDROP_LIGHT 2001 30 | #define MONSTER_EVENT_BODYDROP_HEAVY 2002 31 | 32 | #define MONSTER_EVENT_SWISHSOUND 2010 33 | 34 | #endif // MONSTEREVENT_H 35 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/mreg.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // mreg.h - description of registered items (classes MRegCmd, MRegCmdList) 5 | 6 | /* 7 | * Copyright (c) 2001-2003 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | #ifndef MREG_H 38 | #define MREG_H 39 | 40 | #include "types_meta.h" // mBOOL 41 | 42 | // Number of entries to add to reglists when they need to grow. Typically 43 | // more cvars than commands, so we grow them at different increments. 44 | #define REG_CMD_GROWSIZE 32 45 | #define REG_CVAR_GROWSIZE 64 46 | 47 | // Width required to printf a Reg*List index number, for show() functions. 48 | // This used to correspond to the number of digits in MAX_REG, which was a 49 | // fixed, compile-time limit. However, now that the reg lists are grown 50 | // dynamically, this has less strong correspondance to list sizes. So for 51 | // the moment, it reflects what one might normally expect to be the max 52 | // width needed to print an index number; 4 allows 9999 (which is a damn 53 | // lot, if you ask me). 54 | #define WIDTH_MAX_REG 4 55 | 56 | // Max number of registered user msgs we can manage. 57 | #define MAX_REG_MSGS 256 58 | 59 | // Flags to indicate if given cvar or func is part of a loaded plugin. 60 | typedef enum { 61 | RG_INVALID, 62 | RG_VALID, 63 | } REG_STATUS; 64 | 65 | // Pointer to function registered by AddServerCommand. 66 | typedef void (*REG_CMD_FN) (void); 67 | 68 | 69 | // An individual registered function/command. 70 | class MRegCmd { 71 | friend class MRegCmdList; 72 | private: 73 | // data: 74 | int index; // 1-based 75 | public: 76 | char *name; // space is malloc'd 77 | REG_CMD_FN pfnCmd; // pointer to the function 78 | int plugid; // index id of corresponding plugin 79 | REG_STATUS status; // whether corresponding plugin is loaded 80 | // functions: 81 | void init(int idx); // init values, as not using constructors 82 | mBOOL call(void); // try to call the function 83 | }; 84 | 85 | 86 | // A list of registered commands. 87 | class MRegCmdList { 88 | private: 89 | // data: 90 | MRegCmd *mlist; // malloc'd array of registered commands 91 | int size; // current size of list 92 | int endlist; // index of last used entry 93 | // Private; to satisfy -Weffc++ "has pointer data members but does 94 | // not override" copy/assignment constructor. 95 | void operator=(const MRegCmdList &src); 96 | MRegCmdList(const MRegCmdList &src); 97 | 98 | public: 99 | // constructor: 100 | MRegCmdList(void); 101 | 102 | // functions: 103 | MRegCmd *find(const char *findname); // find by MRegCmd->name 104 | MRegCmd *add(const char *addname); 105 | void disable(int plugin_id); // change status to Invalid 106 | void show(void); // list all funcs to console 107 | void show(int plugin_id); // list given plugin's funcs to console 108 | }; 109 | 110 | 111 | 112 | // An individual registered cvar. 113 | class MRegCvar { 114 | friend class MRegCvarList; 115 | private: 116 | // data: 117 | int index; // 1-based 118 | public: 119 | cvar_t *data; // actual cvar structure, malloc'd 120 | int plugid; // index id of corresponding plugin 121 | REG_STATUS status; // whether corresponding plugin is loaded 122 | // functions: 123 | void init(int idx); // init values, as not using constructors 124 | mBOOL set(cvar_t *src); 125 | }; 126 | 127 | 128 | // A list of registered cvars. 129 | class MRegCvarList { 130 | private: 131 | // data: 132 | MRegCvar *vlist; // malloc'd array of registered cvars 133 | int size; // size of list, ie MAX_REG_CVARS 134 | int endlist; // index of last used entry 135 | // Private; to satisfy -Weffc++ "has pointer data members but does 136 | // not override" copy/assignment constructor. 137 | void operator=(const MRegCvarList &src); 138 | MRegCvarList(const MRegCvarList &src); 139 | 140 | public: 141 | // constructor: 142 | MRegCvarList(void); 143 | 144 | // functions: 145 | MRegCvar *add(const char *addname); 146 | MRegCvar *find(const char *findname); // find by MRegCvar->data.name 147 | void disable(int plugin_id); // change status to Invalid 148 | void show(void); // list all cvars to console 149 | void show(int plugin_id); // list given plugin's cvars to console 150 | }; 151 | 152 | 153 | 154 | // An individual registered user msg, from gamedll. 155 | class MRegMsg { 156 | friend class MRegMsgList; 157 | private: 158 | // data: 159 | int index; // 1-based 160 | public: 161 | const char *name; // name, assumed constant string in gamedll 162 | int msgid; // msgid, assigned by engine 163 | int size; // size, if given by gamedll 164 | }; 165 | 166 | 167 | // A list of registered user msgs. 168 | class MRegMsgList { 169 | private: 170 | // data: 171 | MRegMsg mlist[MAX_REG_MSGS]; // array of registered msgs 172 | int size; // size of list, ie MAX_REG_MSGS 173 | int endlist; // index of last used entry 174 | 175 | public: 176 | // constructor: 177 | MRegMsgList(void); 178 | 179 | // functions: 180 | MRegMsg *add(const char *addname, int addmsgid, int addsize); 181 | MRegMsg *find(const char *findname); 182 | MRegMsg *find(int findmsgid); 183 | void show(void); // list all msgs to console 184 | }; 185 | 186 | #endif /* MREG_H */ 187 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/plinfo.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // plinfo.h - typedefs for plugin info structure 5 | 6 | /* 7 | * Copyright (c) 2001-2003 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | #ifndef PLINFO_H 38 | #define PLINFO_H 39 | 40 | // Flags for plugin to indicate when it can be be loaded/unloaded. 41 | // NOTE: order is crucial, as greater/less comparisons are made. 42 | typedef enum { 43 | PT_NEVER = 0, 44 | PT_STARTUP, // should only be loaded/unloaded at initial hlds execution 45 | PT_CHANGELEVEL, // can be loaded/unloaded between maps 46 | PT_ANYTIME, // can be loaded/unloaded at any time 47 | PT_ANYPAUSE, // can be loaded/unloaded at any time, and can be "paused" during a map 48 | } PLUG_LOADTIME; 49 | 50 | // Flags to indicate why the plugin is being unloaded. 51 | typedef enum { 52 | PNL_NULL = 0, 53 | PNL_INI_DELETED, // was deleted from plugins.ini 54 | PNL_FILE_NEWER, // file on disk is newer than last load 55 | PNL_COMMAND, // requested by server/console command 56 | PNL_CMD_FORCED, // forced by server/console command 57 | PNL_DELAYED, // delayed from previous request; can't tell origin 58 | //only used for 'real_reason' on MPlugin::unload() 59 | PNL_PLUGIN, // requested by plugin function call 60 | PNL_PLG_FORCED, // forced by plugin function call 61 | PNL_RELOAD, // forced unload by reload() 62 | } PL_UNLOAD_REASON; 63 | 64 | // Information plugin provides about itself. 65 | typedef struct { 66 | const char *ifvers; // meta_interface version 67 | const char *name; // full name of plugin 68 | const char *version; // version 69 | const char *date; // date 70 | const char *author; // author name/email 71 | const char *url; // URL 72 | const char *logtag; // log message prefix (unused right now) 73 | PLUG_LOADTIME loadable; // when loadable 74 | PLUG_LOADTIME unloadable; // when unloadable 75 | } plugin_info_t; 76 | extern plugin_info_t Plugin_info; 77 | 78 | // Plugin identifier, passed to all Meta Utility Functions. 79 | typedef plugin_info_t* plid_t; 80 | #define PLID &Plugin_info 81 | 82 | #endif /* PLINFO_H */ 83 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/saverestore.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Implementation in UTIL.CPP 16 | #ifndef SAVERESTORE_H 17 | #define SAVERESTORE_H 18 | 19 | class CBaseEntity; 20 | 21 | class CSaveRestoreBuffer 22 | { 23 | public: 24 | CSaveRestoreBuffer( void ); 25 | CSaveRestoreBuffer( SAVERESTOREDATA *pdata ); 26 | virtual ~CSaveRestoreBuffer( void ); 27 | 28 | int EntityIndex( entvars_t *pevLookup ); 29 | int EntityIndex( edict_t *pentLookup ); 30 | int EntityIndex( EOFFSET eoLookup ); 31 | int EntityIndex( CBaseEntity *pEntity ); 32 | 33 | int EntityFlags( int entityIndex, int flags ) { return EntityFlagsSet( entityIndex, 0 ); } 34 | int EntityFlagsSet( int entityIndex, int flags ); 35 | 36 | edict_t *EntityFromIndex( int entityIndex ); 37 | 38 | unsigned short TokenHash( const char *pszToken ); 39 | 40 | protected: 41 | SAVERESTOREDATA *m_pdata; 42 | void BufferRewind( int size ); 43 | unsigned int HashString( const char *pszToken ); 44 | private: 45 | // effc++ rule 11 46 | void operator=(CSaveRestoreBuffer&); 47 | CSaveRestoreBuffer(const CSaveRestoreBuffer&); 48 | }; 49 | 50 | 51 | class CSave : public CSaveRestoreBuffer 52 | { 53 | public: 54 | CSave( SAVERESTOREDATA *pdata ) : CSaveRestoreBuffer( pdata ) {}; 55 | 56 | void WriteShort( const char *pname, const short *value, int count ); 57 | void WriteInt( const char *pname, const int *value, int count ); // Save an int 58 | void WriteFloat( const char *pname, const float *value, int count ); // Save a float 59 | void WriteTime( const char *pname, const float *value, int count ); // Save a float (timevalue) 60 | void WriteData( const char *pname, int size, const char *pdata ); // Save a binary data block 61 | void WriteString( const char *pname, const char *pstring ); // Save a null-terminated string 62 | void WriteString( const char *pname, const int *stringId, int count ); // Save a null-terminated string (engine string) 63 | void WriteVector( const char *pname, const Vector &value ); // Save a vector 64 | void WriteVector( const char *pname, const float *value, int count ); // Save a vector 65 | void WritePositionVector( const char *pname, const Vector &value ); // Offset for landmark if necessary 66 | void WritePositionVector( const char *pname, const float *value, int count ); // array of pos vectors 67 | void WriteFunction( const char *pname, const int *value, int count ); // Save a function pointer 68 | int WriteEntVars( const char *pname, entvars_t *pev ); // Save entvars_t (entvars_t) 69 | int WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ); 70 | 71 | private: 72 | int DataEmpty( const char *pdata, int size ); 73 | void BufferField( const char *pname, int size, const char *pdata ); 74 | void BufferString( char *pdata, int len ); 75 | void BufferData( const char *pdata, int size ); 76 | void BufferHeader( const char *pname, int size ); 77 | }; 78 | 79 | typedef struct 80 | { 81 | unsigned short size; 82 | unsigned short token; 83 | char *pData; 84 | } HEADER; 85 | 86 | class CRestore : public CSaveRestoreBuffer 87 | { 88 | public: 89 | CRestore( SAVERESTOREDATA *pdata ) : CSaveRestoreBuffer( pdata ), m_global(0), m_precache(TRUE) { } 90 | int ReadEntVars( const char *pname, entvars_t *pev ); // entvars_t 91 | int ReadFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ); 92 | int ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount, int startField, int size, char *pName, void *pData ); 93 | int ReadInt( void ); 94 | short ReadShort( void ); 95 | int ReadNamedInt( const char *pName ); 96 | char *ReadNamedString( const char *pName ); 97 | int Empty( void ) { return (m_pdata == NULL) || ((m_pdata->pCurrentData-m_pdata->pBaseData)>=m_pdata->bufferSize); } 98 | inline void SetGlobalMode( int global ) { m_global = global; } 99 | void PrecacheMode( BOOL mode ) { m_precache = mode; } 100 | 101 | private: 102 | char *BufferPointer( void ); 103 | void BufferReadBytes( char *pOutput, int size ); 104 | void BufferSkipBytes( int bytes ); 105 | int BufferSkipZString( void ); 106 | int BufferCheckZString( const char *string ); 107 | 108 | void BufferReadHeader( HEADER *pheader ); 109 | 110 | int m_global; // Restoring a global entity? 111 | BOOL m_precache; 112 | }; 113 | 114 | #define MAX_ENTITYARRAY 64 115 | 116 | //#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) 117 | 118 | #define IMPLEMENT_SAVERESTORE(derivedClass,baseClass) \ 119 | int derivedClass::Save( CSave &save )\ 120 | {\ 121 | if ( !baseClass::Save(save) )\ 122 | return 0;\ 123 | return save.WriteFields( #derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData) );\ 124 | }\ 125 | int derivedClass::Restore( CRestore &restore )\ 126 | {\ 127 | if ( !baseClass::Restore(restore) )\ 128 | return 0;\ 129 | return restore.ReadFields( #derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData) );\ 130 | } 131 | 132 | 133 | typedef enum { GLOBAL_OFF = 0, GLOBAL_ON = 1, GLOBAL_DEAD = 2 } GLOBALESTATE; 134 | 135 | typedef struct globalentity_s globalentity_t; 136 | 137 | struct globalentity_s 138 | { 139 | char name[64]; 140 | char levelName[32]; 141 | GLOBALESTATE state; 142 | globalentity_t *pNext; 143 | }; 144 | 145 | class CGlobalState 146 | { 147 | public: 148 | CGlobalState(); 149 | void Reset( void ); 150 | void ClearStates( void ); 151 | void EntityAdd( string_t globalname, string_t mapName, GLOBALESTATE state ); 152 | void EntitySetState( string_t globalname, GLOBALESTATE state ); 153 | void EntityUpdate( string_t globalname, string_t mapname ); 154 | const globalentity_t *EntityFromTable( string_t globalname ); 155 | GLOBALESTATE EntityGetState( string_t globalname ); 156 | int EntityInTable( string_t globalname ) { return (Find( globalname ) != NULL) ? 1 : 0; } 157 | int Save( CSave &save ); 158 | int Restore( CRestore &restore ); 159 | static TYPEDESCRIPTION m_SaveData[]; 160 | 161 | //#ifdef _DEBUG 162 | void DumpGlobals( void ); 163 | //#endif 164 | 165 | private: 166 | globalentity_t *Find( string_t globalname ); 167 | globalentity_t *m_pList; 168 | int m_listCount; 169 | // effc++ rule 11 170 | void operator=(CGlobalState&); 171 | CGlobalState(const CGlobalState&); 172 | }; 173 | 174 | extern CGlobalState gGlobalState; 175 | 176 | #endif //SAVERESTORE_H 177 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/sdk_util.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // sdk_util.h - wrapper & extension of util.h from HL SDK 5 | 6 | /* 7 | * Copyright (c) 2001-2003 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | // Wrap util.h from SDK with ifndef/endif, to avoid problems from multiple 38 | // inclusions. Dunno why Valve didn't do that in util.h themselves.. 39 | 40 | #ifndef SDK_UTIL_H 41 | #define SDK_UTIL_H 42 | 43 | // We're not including the DBG_EntOfVars and DBG_AssertFunction routines 44 | // mentioned in the SDK util.h, so we're going to unset DEBUG here so that 45 | // we don't get "unresolved symbol" errors. 46 | #ifdef DEBUG 47 | #undef DEBUG 48 | #endif /* DEBUG */ 49 | 50 | // Inlcude local enginecallbacks wrapper *first* so that the g_engfuncs 51 | // type is correct and the header protection is already 52 | // defined. 53 | #include "enginecallbacks.h" 54 | 55 | #include "util.h" 56 | 57 | 58 | 59 | // Add overloaded ENTINDEX() version for const edict_t pointer. 60 | // The pfnIndexOfEdict() function takes a const edict_t pointer 61 | // as parameter anyway, so there is no reason why ENTINDEX() 62 | // shouldn't. 63 | inline int ENTINDEX(const edict_t *pEdict) { 64 | return (*g_engfuncs.pfnIndexOfEdict)(pEdict); 65 | } 66 | 67 | 68 | // Also, create some nice inlines for engine callback combos. 69 | 70 | // Get a setinfo value from a player entity. 71 | inline char *ENTITY_KEYVALUE(edict_t *entity, char *key) { 72 | char *ifbuf=GET_INFOKEYBUFFER(entity); 73 | return(INFOKEY_VALUE(ifbuf, key)); 74 | } 75 | 76 | // Set a setinfo value for a player entity. 77 | inline void ENTITY_SET_KEYVALUE(edict_t *entity, char *key, char *value) { 78 | char *ifbuf=GET_INFOKEYBUFFER(entity); 79 | SET_CLIENT_KEYVALUE(ENTINDEX(entity), ifbuf, key, value); 80 | } 81 | 82 | // Get a "serverinfo" value. 83 | inline char *SERVERINFO(char *key) { 84 | edict_t *server=INDEXENT(0); 85 | return(ENTITY_KEYVALUE(server, key)); 86 | } 87 | 88 | // Set a "serverinfo" value. 89 | inline void SET_SERVERINFO(char *key, char *value) { 90 | edict_t *server=INDEXENT(0); 91 | char *ifbuf=GET_INFOKEYBUFFER(server); 92 | SET_SERVER_KEYVALUE(ifbuf, key, value); 93 | } 94 | 95 | // Get a "localinfo" value. 96 | inline char *LOCALINFO(char *key) { 97 | edict_t *server=NULL; 98 | return(ENTITY_KEYVALUE(server, key)); 99 | } 100 | 101 | // Set a "localinfo" value. 102 | inline void SET_LOCALINFO(char *key, char *value) { 103 | edict_t *server=NULL; 104 | char *ifbuf=GET_INFOKEYBUFFER(server); 105 | SET_SERVER_KEYVALUE(ifbuf, key, value); 106 | } 107 | 108 | short FixedSigned16(float value, float scale); 109 | unsigned short FixedUnsigned16(float value, float scale); 110 | 111 | // Our slightly modified version, using an edict_t pointer instead of a 112 | // CBaseEntity pointer. 113 | void META_UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, const char *pMessage); 114 | 115 | #endif /* SDK_UTIL_H */ 116 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/sdk/sdk/types_meta.h: -------------------------------------------------------------------------------- 1 | // vi: set ts=4 sw=4 : 2 | // vim: set tw=75 : 3 | 4 | // types_meta.h - common internal type, etc definitions 5 | 6 | /* 7 | * Copyright (c) 2001-2003 Will Day 8 | * 9 | * This file is part of Metamod. 10 | * 11 | * Metamod is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU General Public License as published by the 13 | * Free Software Foundation; either version 2 of the License, or (at 14 | * your option) any later version. 15 | * 16 | * Metamod is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Metamod; if not, write to the Free Software Foundation, 23 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | * 25 | * In addition, as a special exception, the author gives permission to 26 | * link the code of this program with the Half-Life Game Engine ("HL 27 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 28 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 29 | * respects for all of the code used other than the HL Engine and MODs 30 | * from Valve. If you modify this file, you may extend this exception 31 | * to your version of the file, but you are not obligated to do so. If 32 | * you do not wish to do so, delete this exception statement from your 33 | * version. 34 | * 35 | */ 36 | 37 | #ifndef TYPES_META_H 38 | #define TYPES_META_H 39 | 40 | // Our own boolean type, for stricter type matching. 41 | typedef enum mBOOL { 42 | mFALSE = 0, 43 | mTRUE, 44 | } mBOOL; 45 | 46 | // Like C's errno, for our various functions; describes causes of failure 47 | // or mFALSE returns. 48 | typedef enum { 49 | ME_NOERROR = 0, 50 | ME_FORMAT, // invalid format 51 | ME_COMMENT, // ignored comment 52 | ME_BLANK, // ignored blank (empty) line 53 | ME_ALREADY, // request had already been done 54 | ME_DELAYED, // request is delayed 55 | ME_NOTALLOWED, // request not allowed 56 | ME_SKIPPED, // request is being skipped for whatever reason 57 | ME_BADREQ, // invalid request for this 58 | ME_ARGUMENT, // invalid arguments 59 | ME_NULLRESULT, // resulting data was empty or null 60 | ME_MAXREACHED, // reached max/limit 61 | ME_NOTUNIQ, // not unique (ambigious match) 62 | ME_NOTFOUND, // in find operation, match not found 63 | ME_NOFILE, // file empty or missing 64 | ME_NOMEM, // malloc failed 65 | ME_BADMEMPTR, // invalid memory address 66 | ME_OSNOTSUP, // OS doesn't support this operation 67 | ME_DLOPEN, // failed to open shared lib/dll 68 | ME_DLMISSING, // symbol missing in lib/dll 69 | ME_DLERROR, // some other error encountered calling functions from dll 70 | ME_IFVERSION, // incompatible interface version 71 | ME_UNLOAD_UNLOADER, // tried to unload unloader 72 | ME_UNLOAD_SELF, // tried to unload self 73 | } META_ERRNO; 74 | extern META_ERRNO meta_errno; 75 | 76 | #define RETURN_ERRNO(retval, errval) \ 77 | do { meta_errno=errval; return(retval); } while(0) 78 | 79 | #define RETURN_LOGERR_ERRNO(errargs, retval, errval) \ 80 | do { META_ERROR errargs ; meta_errno=errval; return(retval); } while(0) 81 | 82 | #endif /* TYPES_META_H */ 83 | -------------------------------------------------------------------------------- /Project SyPB/SwNPC/source/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "core.h" 3 | 4 | bool g_swnpcRun = false; 5 | bool g_changeWaypoint = false; 6 | int g_numWaypoints = -1; 7 | 8 | edict_t *g_hostEntity = null; 9 | 10 | int g_callAddNPC = -1; 11 | int g_callRemoveNPC = -1; 12 | 13 | int g_callThink_Pre = -1; 14 | int g_callTakeDamage_Pre = -1; 15 | int g_callKill_Pre = -1; 16 | int g_callPlaySound_Pre = -1; 17 | 18 | int g_callThink_Post = -1; 19 | int g_callTakeDamage_Post = -1; 20 | int g_callKill_Post = -1; 21 | 22 | int g_TDP_damageValue = -1; 23 | bool g_TDP_cvOn = false; 24 | 25 | int gcTextures = 0; 26 | bool fTextureTypeInit = FALSE; 27 | char grgszTextureName[MAX_TEXTURES][MAX_TEXTURENAME_LENGHT]; 28 | char grgchTextureType[MAX_TEXTURES]; 29 | 30 | int g_gameMode = -1; 31 | 32 | int g_sModelIndexBloodDrop = -1; 33 | int g_sModelIndexBloodSpray = -1; 34 | int g_bloodIndex[12]; 35 | 36 | int g_modelIndexLaser = 0; 37 | int g_modelIndexArrow = 0; 38 | 39 | int apiBuffer; 40 | 41 | void OnPluginsLoaded() 42 | { 43 | AllReLoad(); 44 | 45 | g_modelIndexLaser = PRECACHE_MODEL("sprites/laserbeam.spr"); 46 | g_modelIndexArrow = PRECACHE_MODEL("sprites/arrow1.spr"); 47 | 48 | g_sModelIndexBloodSpray = PRECACHE_MODEL("sprites/bloodspray.spr"); 49 | g_sModelIndexBloodDrop = PRECACHE_MODEL("sprites/blood.spr"); 50 | 51 | g_bloodIndex[0] = DECAL_INDEX("{blood1"); 52 | g_bloodIndex[1] = DECAL_INDEX("{blood2"); 53 | g_bloodIndex[2] = DECAL_INDEX("{blood3"); 54 | g_bloodIndex[3] = DECAL_INDEX("{blood4"); 55 | g_bloodIndex[4] = DECAL_INDEX("{blood5"); 56 | g_bloodIndex[5] = DECAL_INDEX("{blood6"); 57 | g_bloodIndex[6] = DECAL_INDEX("{yblood1"); 58 | g_bloodIndex[7] = DECAL_INDEX("{yblood2"); 59 | g_bloodIndex[8] = DECAL_INDEX("{yblood3"); 60 | g_bloodIndex[9] = DECAL_INDEX("{yblood4"); 61 | g_bloodIndex[10] = DECAL_INDEX("{yblood5"); 62 | g_bloodIndex[11] = DECAL_INDEX("{yblood6"); 63 | 64 | SyPBDataLoad(); 65 | 66 | if (g_swnpcRun) 67 | { 68 | // Add new SwNPC / Remove SwNPC 69 | g_callAddNPC = MF_RegisterForward("SwNPC_Add", ET_IGNORE, FP_CELL, FP_DONE); 70 | g_callRemoveNPC = MF_RegisterForward("SwNPC_Remove", ET_IGNORE, FP_CELL, FP_DONE); 71 | 72 | // SwNPC_Think_Pre (npcId) 73 | g_callThink_Pre = MF_RegisterForward("SwNPC_Think_Pre", ET_CONTINUE, FP_CELL, FP_DONE); 74 | // SwNPC_TakeDamage_Pre (victimId, attackId, damage) 75 | g_callTakeDamage_Pre = MF_RegisterForward("SwNPC_TakeDamage_Pre", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL, FP_DONE); 76 | // SwNPC_Kill_Pre (victimId, killerId) 77 | g_callKill_Pre = MF_RegisterForward("SwNPC_Kill_Pre", ET_CONTINUE, FP_CELL, FP_CELL, FP_DONE); 78 | // SwNPC_PlaySound (npcId, soundClass, soundChannel) 79 | g_callPlaySound_Pre = MF_RegisterForward("SwNPC_PlaySound", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL, FP_DONE); 80 | 81 | 82 | // SwNPC_Think_Post (npcId) 83 | g_callThink_Post = MF_RegisterForward("SwNPC_Think_Post", ET_IGNORE, FP_CELL, FP_DONE); 84 | // SwNPC_TakeDamage_Post (victimId, attackId, damage) 85 | g_callTakeDamage_Post = MF_RegisterForward("SwNPC_TakeDamage_Post", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_DONE); 86 | // SwNPC_Kill_Post (victimId, killerId) 87 | g_callKill_Post = MF_RegisterForward("SwNPC_Kill_Post", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE); 88 | } 89 | else 90 | LogToFile("[Error] SwNPC CANNOT RUN"); 91 | } 92 | 93 | void OnAmxxAttach() 94 | { 95 | MF_AddNatives(swnpc_natives); 96 | } 97 | 98 | void AllReLoad(void) 99 | { 100 | // SwNPC Reset 101 | g_swnpcRun = false; 102 | g_numWaypoints = -1; 103 | 104 | g_callAddNPC = -1; 105 | g_callRemoveNPC = -1; 106 | 107 | g_callThink_Pre = -1; 108 | g_callTakeDamage_Pre = -1; 109 | g_callKill_Pre = -1; 110 | g_callPlaySound_Pre = -1; 111 | 112 | g_callThink_Post = -1; 113 | g_callTakeDamage_Post = -1; 114 | g_callKill_Post = -1; 115 | 116 | g_gameMode = -1; 117 | 118 | // Blood Reset 119 | g_sModelIndexBloodDrop = -1; 120 | g_sModelIndexBloodSpray = -1; 121 | for (int i = 0; i < 12; i++) 122 | g_bloodIndex[i] = -1; 123 | 124 | g_npcManager->RemoveAll(); 125 | } 126 | 127 | void FN_DispatchThink(edict_t *pent) 128 | { 129 | if (g_npcManager->IsSwNPC(pent) != null) 130 | g_npcManager->IsSwNPC(pent)->Think(); 131 | 132 | RETURN_META(MRES_IGNORED); 133 | } 134 | 135 | BOOL FN_ClientConnect_Post(edict_t *ent, const char *name, const char *addr, char rejectReason[128]) 136 | { 137 | if (strcmp(addr, "loopback") == 0) 138 | SyPB_GetHostEntity(); 139 | 140 | RETURN_META_VALUE(MRES_IGNORED, 0); 141 | } 142 | 143 | void FN_StartFrame(void) 144 | { 145 | // Pro P.45 - HLDS Fixed 146 | if (g_swnpcRun) 147 | { 148 | if (g_changeWaypoint) 149 | { 150 | GetEntityWaypointPoint(null); 151 | 152 | if (!g_changeWaypoint) 153 | g_waypoint->RemoveWaypointData(); 154 | } 155 | else if (g_numWaypoints == -1) 156 | { 157 | GetWaypointData(); 158 | if (g_numWaypoints <= 0) 159 | g_swnpcRun = false; 160 | } 161 | } 162 | 163 | apiBuffer = 0; 164 | 165 | g_npcManager->Think(); 166 | 167 | RETURN_META(MRES_IGNORED); 168 | } 169 | 170 | void FN_RemoveEntity(edict_t *c) 171 | { 172 | NPC *SwNPC = g_npcManager->IsSwNPC(c); 173 | if (SwNPC != null) 174 | { 175 | if (SwNPC->m_needRemove == false) 176 | RETURN_META(MRES_SUPERCEDE); 177 | } 178 | 179 | RETURN_META(MRES_IGNORED); 180 | } 181 | 182 | const char *GetModName(void) 183 | { 184 | static char modName[256]; 185 | 186 | GET_GAME_DIR(modName); // ask the engine for the MOD directory path 187 | int length = strlen(modName); // get the length of the returned string 188 | 189 | // format the returned string to get the last directory name 190 | int stop = length - 1; 191 | while ((modName[stop] == '\\' || modName[stop] == '/') && stop > 0) 192 | stop--; // shift back any trailing separator 193 | 194 | int start = stop; 195 | while (modName[start] != '\\' && modName[start] != '/' && start > 0) 196 | start--; // shift back to the start of the last subdirectory name 197 | 198 | if (modName[start] == '\\' || modName[start] == '/') 199 | start++; // if we reached a separator, step over it 200 | 201 | // now copy the formatted string back onto itself character per character 202 | for (length = start; length <= stop; length++) 203 | modName[length - start] = modName[length]; 204 | 205 | modName[length - start] = 0; // terminate the string 206 | 207 | return &modName[0]; 208 | } 209 | 210 | void ErrorWindows(const char *text) 211 | { 212 | const int button = ::MessageBox(null, text, "SwNPC Error", MB_YESNO | MB_TOPMOST | MB_ICONINFORMATION); 213 | if (button == IDYES) 214 | exit(1); 215 | } -------------------------------------------------------------------------------- /Project SyPB/SwNPC/source/main.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAIN_H 3 | #define MAIN_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "amxxmodule.h" 10 | #include <../../version.h> 11 | #include "extdll.h" 12 | 13 | // Error Log 14 | int LogToFile(const char *szLogText, ...); 15 | void ErrorWindows(const char *text); 16 | 17 | extern const char *GetModName(void); 18 | 19 | #define PTR_TO_INT(in) *(int *) (in) 20 | 21 | enum LineType 22 | { 23 | LINE_SIMPLE, 24 | LINE_ARROW 25 | }; 26 | 27 | class Color 28 | { 29 | // 30 | // Group: Red, green, blue and alpha (controls transparency (0 - transparent, 255 - opaque)) color components (0 - 255). 31 | // 32 | public: 33 | int red, green, blue, alpha; 34 | 35 | // 36 | // Group: (Con/De)structors. 37 | // 38 | public: 39 | inline Color(int color = 0) : red(color), green(color), blue(color), alpha(color) 40 | { 41 | 42 | } 43 | 44 | inline Color(int inputRed, int inputGreen, int inputBlue, int inputAlpha = 0) : red(inputRed), green(inputGreen), blue(inputBlue), alpha(inputAlpha) 45 | { 46 | } 47 | 48 | inline Color(const Color &right) : red(right.red), green(right.green), blue(right.blue), alpha(right.alpha) 49 | { 50 | } 51 | 52 | // 53 | // Group: Operators. 54 | // 55 | public: 56 | // equality 57 | inline bool operator == (const Color &right) const 58 | { 59 | return red == right.red && green == right.green && blue == right.blue && alpha == right.alpha; 60 | } 61 | 62 | inline bool operator != (const Color &right) const 63 | { 64 | return !operator == (right); 65 | } 66 | 67 | // array access 68 | inline int &operator [] (int colourIndex) 69 | { 70 | return (&red)[colourIndex]; 71 | } 72 | 73 | inline const int &operator [] (int colourIndex) const 74 | { 75 | return (&red)[colourIndex]; 76 | } 77 | 78 | inline const Color operator / (int scaler) const 79 | { 80 | return Color(red / scaler, green / scaler, blue / scaler, alpha / scaler); 81 | } 82 | }; 83 | 84 | template class Singleton 85 | { 86 | protected: 87 | inline Singleton(void) 88 | { 89 | } 90 | 91 | virtual inline ~Singleton(void) 92 | { 93 | } 94 | 95 | 96 | public: 97 | static inline T &GetReference(void) 98 | { 99 | static T reference; 100 | 101 | return reference; 102 | } 103 | 104 | static inline T *GetObjectPtr(void) 105 | { 106 | return &GetReference(); 107 | } 108 | }; 109 | 110 | #endif // MAIN_H -------------------------------------------------------------------------------- /Project SyPB/SwNPC/source/swnpc.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | #include <../../version.h> 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION SWNPC_VERSION_DWORD 8 | PRODUCTVERSION SWNPC_VERSION_DWORD 9 | FILEOS 0x40004 10 | FILETYPE 0x2 11 | { 12 | BLOCK "StringFileInfo" 13 | { 14 | BLOCK "040904E4" 15 | { 16 | VALUE "CompanyName", PRODUCT_AUTHOR "\0" 17 | VALUE "FileDescription", SWNPC_DESCRIPTION "\0" 18 | VALUE "FileVersion", SWNPC_VERSION "\0" 19 | VALUE "OriginalFilename", "SwNPC_amxx.dll" "\0" 20 | VALUE "LegalCopyright", PRODUCT_AUTHOR "\0" 21 | VALUE "LegalTrademarks", PRODUCT_AUTHOR "\0" 22 | VALUE "ProductName", SWNPC_NAME "\0" 23 | VALUE "ProductVersion", SWNPC_VERSION "\0" 24 | } 25 | } 26 | #ifndef NOLANGINFO 27 | BLOCK "VarFileInfo" 28 | { 29 | VALUE "Translation", 0x400, 1252 30 | } 31 | #endif 32 | } -------------------------------------------------------------------------------- /Project SyPB/SwNPC/source/sypbload.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "core.h" 3 | 4 | typedef void(*_SyPB_GetHostEntity) (edict_t **); 5 | _SyPB_GetHostEntity SwNPCAPI_GetHostEntity; 6 | 7 | typedef float(*_SyPBSupportVersion)(void); 8 | _SyPBSupportVersion SwNPCAPI_SyPBSupportVersion; 9 | 10 | typedef void(*_SwNPCBuild)(float, int, int, int, int); 11 | _SwNPCBuild SwNPCAPI_SwNPCBuild; 12 | 13 | typedef void(*_SwNPCLogFile) (char *); 14 | _SwNPCLogFile SwNPCAPI_SwNPCLogFile; 15 | 16 | typedef int(*_SyPBGetWaypointData) (Vector **, float **, int32 **, int16 ***, uint16 ***, int32 ***, Vector ***); 17 | _SyPBGetWaypointData SwNPCAPI_SyPBGetWaypointData; 18 | 19 | typedef int(*_SyPBSetEntityAction) (int, int, int); 20 | _SyPBSetEntityAction SwNPCAPI_SyPBSetEntityAction; 21 | 22 | typedef int(*_SyPBGetEntityWaypointPoint) (edict_t *, bool *); 23 | _SyPBGetEntityWaypointPoint SwNPCAPI_SyPBGetEntityWaypointPoint; 24 | 25 | typedef void(*_SyPBLoadEntityWaypointPoint) (edict_t *, edict_t *, bool *); 26 | _SyPBLoadEntityWaypointPoint SwNPCAPI_SyPBLoadEntityWaypointPoint; 27 | 28 | typedef void(*_SyPBSetNPCNewWaypointPoint) (edict_t*, int, bool *); 29 | _SyPBSetNPCNewWaypointPoint SwNPCAPI_SyPBSetNPCNewWaypointPoint; 30 | 31 | void SyPBDataLoad(void) 32 | { 33 | const HMODULE dll = GetModuleHandle("sypb.dll"); 34 | 35 | if (!dll) 36 | { 37 | ErrorWindows("We cannot find sypb.dll, swnpc.dll cannot run" 38 | "\n\nExit the Game?"); 39 | return; 40 | } 41 | 42 | SwNPCAPI_SyPBSupportVersion = (_SyPBSupportVersion)GetProcAddress(dll, "SwNPC_SyPBSupportVersion"); 43 | if (!SwNPCAPI_SyPBSupportVersion) 44 | { 45 | ErrorWindows("Loading Fail, Pls Try upgrade your SyPB Version" 46 | "\n\nExit the Game?"); 47 | return; 48 | } 49 | 50 | SwNPCAPI_GetHostEntity = (_SyPB_GetHostEntity)GetProcAddress(dll, "SwNPC_GetHostEntity"); 51 | if (!SwNPCAPI_GetHostEntity) 52 | { 53 | ErrorWindows("Loading Fail, Pls Try upgrade your SyPB Version" 54 | "\n\nExit the Game?"); 55 | return; 56 | } 57 | 58 | SwNPCAPI_SwNPCBuild = (_SwNPCBuild)GetProcAddress(dll, "SwNPC_CheckBuild"); 59 | if (!SwNPCAPI_SwNPCBuild) 60 | { 61 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 62 | return; 63 | } 64 | SwNPCAPI_SwNPCBuild(float(SWNPC_VERSION_F), SWNPC_VERSION_DWORD); 65 | 66 | SwNPCAPI_SwNPCLogFile = (_SwNPCLogFile)GetProcAddress(dll, "SwNPC_AddLog"); 67 | if (!SwNPCAPI_SwNPCLogFile) 68 | { 69 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 70 | return; 71 | } 72 | 73 | const float sypbSupportVersion = SwNPCAPI_SyPBSupportVersion(); 74 | if (sypbSupportVersion != float(SWNPC_VERSION_F)) 75 | { 76 | if (sypbSupportVersion < float(SWNPC_VERSION_F)) 77 | LogToFile("Pls upgarde you SyPB Version"); 78 | else 79 | LogToFile("Pls upgarde you SwNPC Version"); 80 | 81 | LogToFile("SwNPC Version: %.2f | SyPB Support SwNPC Version: %.2f", 82 | float(SWNPC_VERSION_F), sypbSupportVersion); 83 | return; 84 | } 85 | 86 | SwNPCAPI_SyPBGetWaypointData = (_SyPBGetWaypointData)GetProcAddress(dll, "SwNPC_GetWaypointData"); 87 | if (!SwNPCAPI_SyPBGetWaypointData) 88 | { 89 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 90 | return; 91 | } 92 | 93 | SwNPCAPI_SyPBSetEntityAction = (_SyPBSetEntityAction)GetProcAddress(dll, "Amxx_SetEntityAction"); 94 | if (!SwNPCAPI_SyPBSetEntityAction) 95 | { 96 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 97 | return; 98 | } 99 | 100 | SwNPCAPI_SyPBGetEntityWaypointPoint = (_SyPBGetEntityWaypointPoint)GetProcAddress(dll, "SwNPC_GetEntityWaypointIndex"); 101 | if (!SwNPCAPI_SyPBGetEntityWaypointPoint) 102 | { 103 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 104 | return; 105 | } 106 | 107 | SwNPCAPI_SyPBLoadEntityWaypointPoint = (_SyPBLoadEntityWaypointPoint)GetProcAddress(dll, "SwNPC_LoadEntityWaypointIndex"); 108 | if (!SwNPCAPI_SyPBLoadEntityWaypointPoint) 109 | { 110 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 111 | return; 112 | } 113 | 114 | SwNPCAPI_SyPBSetNPCNewWaypointPoint = (_SyPBSetNPCNewWaypointPoint)GetProcAddress(dll, "SwNPCAPI_SetNPCNewWaypointPoint"); 115 | if (!SwNPCAPI_SyPBSetNPCNewWaypointPoint) 116 | { 117 | LogToFile("Loading Fail, Pls Try upgrade your SyPB Version"); 118 | return; 119 | } 120 | 121 | g_swnpcRun = true; 122 | } 123 | 124 | void SyPB_GetHostEntity(void) 125 | { 126 | if (!g_swnpcRun) 127 | return; 128 | 129 | SwNPCAPI_GetHostEntity(&g_hostEntity); 130 | } 131 | 132 | void GetWaypointData(void) 133 | { 134 | Vector *origin; 135 | float *radius; 136 | int32 *flags; 137 | int16 **index; 138 | uint16 **cnFlags; 139 | int32 **cnDistance; 140 | Vector **cnVelocity; 141 | 142 | g_numWaypoints = SwNPCAPI_SyPBGetWaypointData(&origin, &radius, &flags, &index, &cnFlags, &cnDistance, &cnVelocity); 143 | g_waypoint->LoadWaypointData(origin, flags, radius, index, cnFlags, cnDistance, cnVelocity); 144 | } 145 | 146 | void SetEntityAction(int index, int team, int action) 147 | { 148 | SwNPCAPI_SyPBSetEntityAction(index, team, action); 149 | } 150 | 151 | int GetEntityWaypointPoint(edict_t *entity) 152 | { 153 | const int wpId = SwNPCAPI_SyPBGetEntityWaypointPoint(entity, &g_changeWaypoint); 154 | 155 | return wpId; 156 | } 157 | 158 | void LoadEntityWaypointPoint(edict_t *getEntity, edict_t *targetEntity) 159 | { 160 | SwNPCAPI_SyPBLoadEntityWaypointPoint(getEntity, targetEntity, &g_changeWaypoint); 161 | } 162 | 163 | void SetNPCNewWaypointPoint(edict_t* entity, int waypointPoint) 164 | { 165 | SwNPCAPI_SyPBSetNPCNewWaypointPoint(entity, waypointPoint, &g_changeWaypoint); 166 | } 167 | 168 | int LogToFile(const char* szLogText, ...) 169 | { 170 | va_list vArgptr; 171 | char szText[1024]; 172 | 173 | va_start(vArgptr, szLogText); 174 | vsprintf(szText, szLogText, vArgptr); 175 | va_end(vArgptr); 176 | 177 | if (SwNPCAPI_SwNPCLogFile) 178 | SwNPCAPI_SwNPCLogFile(szText); 179 | 180 | return 1; 181 | } -------------------------------------------------------------------------------- /Project SyPB/SwNPC/source/waypoint.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "core.h" 3 | 4 | Waypoint::Waypoint(void) 5 | { 6 | for (int i = 0; i < Const_MaxWaypoints; i++) 7 | { 8 | g_waypointPointFlag[i] = -1; 9 | g_waypointPointRadius[i] = -1.0f; 10 | g_waypointPointOrigin[i] = nullvec; 11 | } 12 | 13 | m_pathMatrix = null; 14 | m_distMatrix = null; 15 | } 16 | 17 | void Waypoint::RemoveWaypointData(void) 18 | { 19 | g_numWaypoints = -1; 20 | 21 | for (int i = 0; i < Const_MaxWaypoints; i++) 22 | { 23 | g_waypointPointFlag[i] = -1; 24 | g_waypointPointRadius[i] = -1.0f; 25 | g_waypointPointOrigin[i] = nullvec; 26 | 27 | for (int j = 0; j < Const_MaxPathIndex; j++) 28 | { 29 | g_wpConnectionIndex[i][j] = -1; 30 | g_wpConnectionFlags[i][j] = 0; 31 | g_wpConnectionDistance[i][j] = -1.0f; 32 | g_wpConnectionVelocity[i][j] = nullvec; 33 | } 34 | } 35 | 36 | if (m_pathMatrix != null) 37 | delete[] m_pathMatrix; 38 | 39 | if (m_distMatrix != null) 40 | delete[] m_distMatrix; 41 | 42 | m_pathMatrix = null; 43 | m_distMatrix = null; 44 | } 45 | 46 | void Waypoint::LoadWaypointData(Vector *origin, int32 *flags, float *radius, int16 **cnIndex, uint16 **cnFlags, int32 **cnDistance, Vector **cnVelocity) 47 | { 48 | int i, j, k; 49 | 50 | for (i = 0; i < Const_MaxWaypoints; i++) 51 | { 52 | g_waypointPointOrigin[i] = origin[i]; 53 | g_waypointPointFlag[i] = flags[i]; 54 | g_waypointPointRadius[i] = radius[i]; 55 | 56 | for (j = 0; j < Const_MaxPathIndex; j++) 57 | { 58 | g_wpConnectionIndex[i][j] = cnIndex[i][j]; 59 | g_wpConnectionFlags[i][j] = cnFlags[i][j]; 60 | g_wpConnectionDistance[i][j] = cnDistance[i][j]; 61 | g_wpConnectionVelocity[i][j] = cnVelocity[i][j]; 62 | } 63 | } 64 | 65 | if (m_distMatrix != null) 66 | delete[](m_distMatrix); 67 | 68 | if (m_pathMatrix != null) 69 | delete[] m_pathMatrix; 70 | 71 | m_distMatrix = null; 72 | m_pathMatrix = null; 73 | 74 | m_distMatrix = new int[g_numWaypoints * g_numWaypoints]; 75 | m_pathMatrix = new int[g_numWaypoints * g_numWaypoints]; 76 | 77 | if (m_distMatrix == null || m_pathMatrix == null) 78 | return; 79 | 80 | for (i = 0; i < g_numWaypoints; i++) 81 | { 82 | for (j = 0; j < g_numWaypoints; j++) 83 | { 84 | *(m_distMatrix + i * g_numWaypoints + j) = 999999; 85 | *(m_pathMatrix + i * g_numWaypoints + j) = -1; 86 | } 87 | } 88 | 89 | for (i = 0; i < g_numWaypoints; i++) 90 | { 91 | for (j = 0; j < Const_MaxPathIndex; j++) 92 | { 93 | if (g_wpConnectionIndex[i][j] >= 0 && g_wpConnectionIndex[i][j] < g_numWaypoints) 94 | { 95 | if (g_waypointPointFlag[i] & WAYPOINT_CROUCH || 96 | g_waypointPointFlag[g_wpConnectionIndex[i][j]] & WAYPOINT_CROUCH) 97 | *(m_distMatrix + (i * g_numWaypoints) + g_wpConnectionIndex[i][j]) = (g_wpConnectionDistance[i][j] * 50); 98 | else 99 | *(m_distMatrix + (i * g_numWaypoints) + g_wpConnectionIndex[i][j]) = g_wpConnectionDistance[i][j]; 100 | 101 | *(m_pathMatrix + (i * g_numWaypoints) + g_wpConnectionIndex[i][j]) = g_wpConnectionIndex[i][j]; 102 | } 103 | } 104 | } 105 | 106 | for (i = 0; i < g_numWaypoints; i++) 107 | *(m_distMatrix + (i * g_numWaypoints) + i) = 0; 108 | 109 | for (k = 0; k < g_numWaypoints; k++) 110 | { 111 | for (i = 0; i < g_numWaypoints; i++) 112 | { 113 | for (j = 0; j < g_numWaypoints; j++) 114 | { 115 | if (*(m_distMatrix + (i * g_numWaypoints) + k) + *(m_distMatrix + (k * g_numWaypoints) + j) < (*(m_distMatrix + (i * g_numWaypoints) + j))) 116 | { 117 | *(m_distMatrix + (i * g_numWaypoints) + j) = *(m_distMatrix + (i * g_numWaypoints) + k) + *(m_distMatrix + (k * g_numWaypoints) + j); 118 | *(m_pathMatrix + (i * g_numWaypoints) + j) = *(m_pathMatrix + (i * g_numWaypoints) + k); 119 | } 120 | } 121 | } 122 | } 123 | } 124 | 125 | int Waypoint::FindNearest(Vector origin, float distance) 126 | { 127 | int index = -1; 128 | for (int i = 0; i < g_numWaypoints; i++) 129 | { 130 | float thisDistance = GetDistance(origin, g_waypointPointOrigin[i]); 131 | if (thisDistance > distance) 132 | continue; 133 | 134 | index = i; 135 | distance = thisDistance; 136 | } 137 | 138 | return index; 139 | } 140 | 141 | int Waypoint::GetEntityWpIndex(edict_t *entity) 142 | { 143 | const int wpIndex = GetEntityWaypointPoint(entity); 144 | if (wpIndex >= 0 && wpIndex < g_numWaypoints) 145 | return wpIndex; 146 | 147 | return FindNearest(GetEntityOrigin(entity)); 148 | } 149 | 150 | int Waypoint::GetEntityWpIndex(int id) 151 | { 152 | return GetEntityWpIndex(INDEXENT(id)); 153 | } 154 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/SyPB API.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | 16.0 15 | {4A2FF1C1-2B73-4CE3-A3E1-5FC2C43CB876} 16 | SyPBAPI 17 | 10.0 18 | 2.SyPB API 19 | 20 | 21 | 22 | DynamicLibrary 23 | true 24 | v143 25 | 26 | 27 | false 28 | 29 | 30 | DynamicLibrary 31 | false 32 | v143 33 | false 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\Project_OutPut_Release\ 51 | ..\Project_OutPut_Release\SyPB_API\inf\ 52 | sypb_amxx 53 | 54 | 55 | ..\Project_OutPut_Debug\ 56 | ..\Project_OutPut_Debug\SyPB_API\inf\ 57 | false 58 | sypb_amxx 59 | 60 | 61 | 62 | Level4 63 | Disabled 64 | 65 | 66 | Default 67 | .\sdk;.\sdk\hlsdk;.\sdk\metamod;%(AdditionalIncludeDirectories) 68 | ProgramDatabase 69 | 70 | _WINDLL;%(PreprocessorDefinitions) 71 | Default 72 | Default 73 | Default 74 | MultiThreadedDLL 75 | 76 | 77 | Console 78 | $(OutDir)$(TargetFileName) 79 | $(OutDir)SyPB_API\$(TargetName).pdb 80 | $(OutDir)SyPB_API\$(TargetName).pgd 81 | $(OutDir)SyPB_API\$(TargetName).lib 82 | true 83 | true 84 | true 85 | 86 | 87 | $(OutDir)SyPB_API\$(TargetName).xml 88 | 89 | 90 | 91 | 92 | Level3 93 | Disabled 94 | true 95 | true 96 | 97 | 98 | false 99 | .\sdk;.\sdk\hlsdk;.\sdk\metamod;%(AdditionalIncludeDirectories) 100 | true 101 | 102 | 103 | Console 104 | true 105 | true 106 | $(OutDir)$(TargetFileName) 107 | %(DelayLoadDLLs) 108 | Default 109 | false 110 | 111 | $(OutDir)SyPB_API\$(TargetName).pdb 112 | $(OutDir)SyPB_API\$(TargetName).pgd 113 | $(OutDir)SyPB_API\$(TargetName).lib 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/SyPB API.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {ef89abe2-365a-43b5-a09a-48c1b4fd3fc9} 6 | 7 | 8 | 9 | 10 | sdk 11 | 12 | 13 | 14 | 15 | 16 | 17 | sdk 18 | 19 | 20 | sdk 21 | 22 | 23 | sdk 24 | 25 | 26 | sdk 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/SyPB API.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/hlsdk/extdll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999-2005, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * This source code contains proprietary and confidential information of 10 | * Valve LLC and its suppliers. Access to this code is restricted to 11 | * persons who have executed a written SDK license with Valve. Any access, 12 | * use or distribution of this code by or to any unlicensed person is illegal. 13 | * 14 | ****/ 15 | 16 | #ifndef EXTDLL_H 17 | #define EXTDLL_H 18 | 19 | #ifdef DLL_DEBUG 20 | #define DEBUG 1 21 | #endif 22 | 23 | #ifdef _WIN32 24 | #pragma warning (disable : 4244) // int or float down-conversion 25 | #pragma warning (disable : 4305) // int or float data truncation 26 | #pragma warning (disable : 4201) // nameless struct/union 27 | #pragma warning (disable : 4514) // unreferenced inline function removed 28 | #pragma warning (disable : 4100) // unreferenced formal parameter 29 | #pragma warning (disable : 4715) // not all control paths return a value 30 | #pragma warning (disable : 4996) // function was declared deprecated 31 | #pragma warning (disable : 4702) // unreachable code 32 | 33 | 34 | /* (dz): disable deprecation warnings concerning unsafe CRT functions */ 35 | #if !defined _CRT_SECURE_NO_DEPRECATE 36 | #define _CRT_SECURE_NO_DEPRECATE 37 | #endif 38 | #endif 39 | 40 | #ifdef _WIN32 41 | #define WIN32_LEAN_AND_MEAN 42 | #define NOWINRES 43 | #define NOSERVICE 44 | #define NOMCX 45 | #define NOIME 46 | #include "windows.h" 47 | #else // _WIN32 48 | #define FALSE 0 49 | #define TRUE (!FALSE) 50 | typedef unsigned long ULONG; 51 | typedef unsigned char BYTE; 52 | typedef int BOOL; 53 | 54 | #define MAX_PATH PATH_MAX 55 | #include 56 | #include 57 | #ifndef min 58 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 59 | #endif 60 | #ifndef max 61 | #define max(a,b) (((a) > (b)) ? (a) : (b)) 62 | #define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) 63 | #endif 64 | #endif //_WIN32 65 | 66 | #include "stdio.h" 67 | #include "stdlib.h" 68 | #include "math.h" 69 | 70 | #include 71 | 72 | typedef int func_t; // 73 | typedef int string_t; // from engine's pr_comp.h; 74 | typedef float vec_t; // needed before including progdefs.h 75 | 76 | #include "vector.h" 77 | 78 | #define vec3_t Vector 79 | 80 | #include "const.h" 81 | #include "progdefs.h" 82 | 83 | #define MAX_ENT_LEAFS 48 84 | 85 | struct edict_s 86 | { 87 | qboolean free; 88 | int serialnumber; 89 | link_t area; // linked to a division node or leaf 90 | int headnode; // -1 to use normal leaf check 91 | int num_leafs; 92 | short leafnums[MAX_ENT_LEAFS]; 93 | float freetime; // sv.time when the object was freed 94 | void *pvPrivateData; // Alloced and freed by engine, used by DLLs 95 | entvars_t v; // C exported fields from progs 96 | }; 97 | 98 | #include "eiface.h" 99 | 100 | #define MAX_WEAPON_SLOTS 5 // hud item selection slots 101 | #define MAX_ITEM_TYPES 6 // hud item selection slots 102 | 103 | #define MAX_ITEMS 5 // hard coded item types 104 | 105 | #define HIDEHUD_WEAPONS ( 1 << 0 ) 106 | #define HIDEHUD_FLASHLIGHT ( 1 << 1 ) 107 | #define HIDEHUD_ALL ( 1 << 2 ) 108 | #define HIDEHUD_HEALTH ( 1 << 3 ) 109 | 110 | #define MAX_AMMO_TYPES 32 // ??? 111 | #define MAX_AMMO_SLOTS 32 // not really slots 112 | 113 | #define HUD_PRINTNOTIFY 1 114 | #define HUD_PRINTCONSOLE 2 115 | #define HUD_PRINTTALK 3 116 | #define HUD_PRINTCENTER 4 117 | 118 | #define WEAPON_SUIT 31 119 | #define __USE_GNU 1 120 | 121 | #endif //EXTDLL_H 122 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/hlsdk/progdefs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999-2005, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * This source code contains proprietary and confidential information of 10 | * Valve LLC and its suppliers. Access to this code is restricted to 11 | * persons who have executed a written SDK license with Valve. Any access, 12 | * use or distribution of this code by or to any unlicensed person is illegal. 13 | * 14 | ****/ 15 | #ifndef PROGDEFS_H 16 | #define PROGDEFS_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | float time; 24 | float frametime; 25 | float force_retouch; 26 | string_t mapname; 27 | string_t startspot; 28 | float deathmatch; 29 | float coop; 30 | float teamplay; 31 | float serverflags; 32 | float found_secrets; 33 | vec3_t v_forward; 34 | vec3_t v_up; 35 | vec3_t v_right; 36 | float trace_allsolid; 37 | float trace_startsolid; 38 | float trace_fraction; 39 | vec3_t trace_endpos; 40 | vec3_t trace_plane_normal; 41 | float trace_plane_dist; 42 | edict_t *trace_ent; 43 | float trace_inopen; 44 | float trace_inwater; 45 | int trace_hitgroup; 46 | int trace_flags; 47 | int msg_entity; 48 | int cdAudioTrack; 49 | int maxClients; 50 | int maxEntities; 51 | const char *pStringBase; 52 | void *pSaveData; 53 | vec3_t vecLandmarkOffset; 54 | } globalvars_t; 55 | 56 | 57 | typedef struct entvars_s 58 | { 59 | string_t classname; 60 | string_t globalname; 61 | 62 | vec3_t origin; 63 | vec3_t oldorigin; 64 | vec3_t velocity; 65 | vec3_t basevelocity; 66 | vec3_t clbasevelocity; // Base velocity that was passed in to server physics so 67 | // client can predict conveyors correctly. Server zeroes it, so we need to store here, too. 68 | vec3_t movedir; 69 | 70 | vec3_t angles; // Model angles 71 | vec3_t avelocity; // angle velocity (degrees per second) 72 | vec3_t punchangle; // auto-decaying view angle adjustment 73 | vec3_t v_angle; // Viewing angle (player only) 74 | 75 | // For parametric entities 76 | vec3_t endpos; 77 | vec3_t startpos; 78 | float impacttime; 79 | float starttime; 80 | 81 | int fixangle; // 0:nothing, 1:force view angles, 2:add avelocity 82 | float idealpitch; 83 | float pitch_speed; 84 | float ideal_yaw; 85 | float yaw_speed; 86 | 87 | int modelindex; 88 | string_t model; 89 | 90 | int viewmodel; // player's viewmodel 91 | int weaponmodel; // what other players see 92 | 93 | vec3_t absmin; // BB max translated to world coord 94 | vec3_t absmax; // BB max translated to world coord 95 | vec3_t mins; // local BB min 96 | vec3_t maxs; // local BB max 97 | vec3_t size; // maxs - mins 98 | 99 | float ltime; 100 | float nextthink; 101 | 102 | int movetype; 103 | int solid; 104 | 105 | int skin; 106 | int body; // sub-model selection for studiomodels 107 | int effects; 108 | 109 | float gravity; // % of "normal" gravity 110 | float friction; // inverse elasticity of MOVETYPE_BOUNCE 111 | 112 | int light_level; 113 | 114 | int sequence; // animation sequence 115 | int gaitsequence; // movement animation sequence for player (0 for none) 116 | float frame; // % playback position in animation sequences (0..255) 117 | float animtime; // world time when frame was set 118 | float framerate; // animation playback rate (-8x to 8x) 119 | byte controller[4]; // bone controller setting (0..255) 120 | byte blending[2]; // blending amount between sub-sequences (0..255) 121 | 122 | float scale; // sprite rendering scale (0..255) 123 | 124 | int rendermode; 125 | float renderamt; 126 | vec3_t rendercolor; 127 | int renderfx; 128 | 129 | float health; 130 | float frags; 131 | int weapons; // bit mask for available weapons 132 | float takedamage; 133 | 134 | int deadflag; 135 | vec3_t view_ofs; // eye position 136 | 137 | int button; 138 | int impulse; 139 | 140 | edict_t *chain; // Entity pointer when linked into a linked list 141 | edict_t *dmg_inflictor; 142 | edict_t *enemy; 143 | edict_t *aiment; // entity pointer when MOVETYPE_FOLLOW 144 | edict_t *owner; 145 | edict_t *groundentity; 146 | 147 | int spawnflags; 148 | int flags; 149 | 150 | int colormap; // lowbyte topcolor, highbyte bottomcolor 151 | int team; 152 | 153 | float max_health; 154 | float teleport_time; 155 | float armortype; 156 | float armorvalue; 157 | int waterlevel; 158 | int watertype; 159 | 160 | string_t target; 161 | string_t targetname; 162 | string_t netname; 163 | string_t message; 164 | 165 | float dmg_take; 166 | float dmg_save; 167 | float dmg; 168 | float dmgtime; 169 | 170 | string_t noise; 171 | string_t noise1; 172 | string_t noise2; 173 | string_t noise3; 174 | 175 | float speed; 176 | float air_finished; 177 | float pain_finished; 178 | float radsuit_finished; 179 | 180 | edict_t *pContainingEntity; 181 | 182 | int playerclass; 183 | float maxspeed; 184 | 185 | float fov; 186 | int weaponanim; 187 | 188 | int pushmsec; 189 | 190 | int bInDuck; 191 | int flTimeStepSound; 192 | int flSwimTime; 193 | int flDuckTime; 194 | int iStepLeft; 195 | float flFallVelocity; 196 | 197 | int gamestate; 198 | 199 | int oldbuttons; 200 | 201 | int groupinfo; 202 | 203 | // For mods 204 | int iuser1; 205 | int iuser2; 206 | int iuser3; 207 | int iuser4; 208 | float fuser1; 209 | float fuser2; 210 | float fuser3; 211 | float fuser4; 212 | vec3_t vuser1; 213 | vec3_t vuser2; 214 | vec3_t vuser3; 215 | vec3_t vuser4; 216 | edict_t *euser1; 217 | edict_t *euser2; 218 | edict_t *euser3; 219 | edict_t *euser4; 220 | } entvars_t; 221 | 222 | #endif 223 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/hlsdk/vector.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999-2005, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * This source code contains proprietary and confidential information of 10 | * Valve LLC and its suppliers. Access to this code is restricted to 11 | * persons who have executed a written SDK license with Valve. Any access, 12 | * use or distribution of this code by or to any unlicensed person is illegal. 13 | * 14 | ****/ 15 | #ifndef VECTOR_H 16 | #define VECTOR_H 17 | 18 | // 2DVector - used for many pathfinding and many other 19 | // operations that are treated as planar rather than 3d. 20 | class Vector2D 21 | { 22 | public: 23 | inline Vector2D (void) 24 | { 25 | } 26 | inline Vector2D (float X, float Y) 27 | { 28 | x = X; 29 | y = Y; 30 | } 31 | inline Vector2D operator+ (const Vector2D & v) const 32 | { 33 | return Vector2D (x + v.x, y + v.y); 34 | } 35 | inline Vector2D operator- (const Vector2D & v) const 36 | { 37 | return Vector2D (x - v.x, y - v.y); 38 | } 39 | inline Vector2D operator* (float fl) const 40 | { 41 | return Vector2D (x * fl, y * fl); 42 | } 43 | inline Vector2D operator/ (float fl) const 44 | { 45 | return Vector2D (x / fl, y / fl); 46 | } 47 | inline int operator== (const Vector2D & v) const 48 | { 49 | return x == v.x && y == v.y; 50 | } 51 | 52 | inline float Length (void) const 53 | { 54 | return sqrtf (x * x + y * y); 55 | } 56 | 57 | inline Vector2D Normalize (void) const 58 | { 59 | Vector2D vec2; 60 | 61 | float flLen = Length (); 62 | if (flLen == 0) 63 | { 64 | return Vector2D (0, 0); 65 | } 66 | else 67 | { 68 | flLen = 1 / flLen; 69 | return Vector2D (x * flLen, y * flLen); 70 | } 71 | } 72 | vec_t x, y; 73 | }; 74 | 75 | inline float DotProduct (const Vector2D & a, const Vector2D & b) 76 | { 77 | return (a.x * b.x + a.y * b.y); 78 | } 79 | inline Vector2D operator* (float fl, const Vector2D & v) 80 | { 81 | return v * fl; 82 | } 83 | 84 | // 3D Vector 85 | class Vector // same data-layout as engine's vec3_t, 86 | { // which is a vec_t[3] 87 | public: 88 | // Construction/destruction 89 | inline Vector (void) 90 | { 91 | } 92 | inline Vector (float X, float Y, float Z) 93 | { 94 | x = X; 95 | y = Y; 96 | z = Z; 97 | } 98 | inline Vector (const Vector & v) 99 | { 100 | x = v.x; 101 | y = v.y; 102 | z = v.z; 103 | } 104 | inline Vector (float rgfl[3]) 105 | { 106 | x = rgfl[0]; 107 | y = rgfl[1]; 108 | z = rgfl[2]; 109 | } 110 | 111 | // Operators 112 | inline Vector operator- (void) const 113 | { 114 | return Vector (-x, -y, -z); 115 | } 116 | inline int operator== (const Vector & v) const 117 | { 118 | return x == v.x && y == v.y && z == v.z; 119 | } 120 | inline int operator!= (const Vector & v) const 121 | { 122 | return !(*this == v); 123 | } 124 | inline Vector operator+ (const Vector & v) const 125 | { 126 | return Vector (x + v.x, y + v.y, z + v.z); 127 | } 128 | inline Vector operator- (const Vector & v) const 129 | { 130 | return Vector (x - v.x, y - v.y, z - v.z); 131 | } 132 | inline Vector operator* (float fl) const 133 | { 134 | return Vector (x * fl, y * fl, z * fl); 135 | } 136 | inline Vector operator/ (float fl) const 137 | { 138 | return Vector (x / fl, y / fl, z / fl); 139 | } 140 | 141 | // Methods 142 | inline void CopyToArray (float * rgfl) const 143 | { 144 | rgfl[0] = x, rgfl[1] = y, rgfl[2] = z; 145 | } 146 | inline float Length (void) const 147 | { 148 | return sqrtf (x * x + y * y + z * z); 149 | } 150 | operator float * () 151 | { 152 | return &x; 153 | } // Vectors will now automatically convert to float * when needed 154 | operator const float * () const 155 | { 156 | return &x; 157 | } // Vectors will now automatically convert to float *when needed 158 | 159 | 160 | inline Vector Normalize (void) const 161 | { 162 | float flLen = Length (); 163 | 164 | if (flLen == 0) 165 | return Vector (0, 0, 1); // ???? 166 | 167 | flLen = 1 / flLen; 168 | return Vector (x *flLen, y *flLen, z *flLen); 169 | } 170 | 171 | inline Vector IgnoreZComponent (void) const 172 | { 173 | return Vector (x, y, 0); 174 | } 175 | 176 | inline Vector2D Make2D (void) const 177 | { 178 | Vector2D Vec2; 179 | 180 | Vec2.x = x; 181 | Vec2.y = y; 182 | 183 | return Vec2; 184 | } 185 | inline float Length2D (void) const 186 | { 187 | return sqrtf (x * x + y * y); 188 | } 189 | 190 | // Members 191 | vec_t x, y, z; 192 | }; 193 | inline Vector operator* (float fl, const Vector & v) 194 | { 195 | return v * fl; 196 | } 197 | inline float DotProduct (const Vector & a, const Vector & b) 198 | { 199 | return (a.x * b.x + a.y * b.y + a.z * b.z); 200 | } 201 | inline Vector CrossProduct (const Vector & a, const Vector & b) 202 | { 203 | return Vector (a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); 204 | } 205 | 206 | #endif 207 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/metamod/dllapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2006 Will Day 3 | * 4 | * This file is part of Metamod. 5 | * 6 | * Metamod is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the 8 | * Free Software Foundation; either version 2 of the License, or (at 9 | * your option) any later version. 10 | * 11 | * Metamod is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with Metamod; if not, write to the Free Software Foundation, 18 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * In addition, as a special exception, the author gives permission to 21 | * link the code of this program with the Half-Life Game Engine ("HL 22 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 23 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 24 | * respects for all of the code used other than the HL Engine and MODs 25 | * from Valve. If you modify this file, you may extend this exception 26 | * to your version of the file, but you are not obligated to do so. If 27 | * you do not wish to do so, delete this exception statement from your 28 | * version. 29 | * 30 | */ 31 | 32 | // Simplified version by Wei Mingzhi 33 | 34 | #ifndef DLLAPI_H 35 | #define DLLAPI_H 36 | 37 | #undef DLLEXPORT 38 | #ifdef _WIN32 39 | #define DLLEXPORT __declspec(dllexport) 40 | #elif defined(linux) 41 | #define DLLEXPORT /* */ 42 | #define WINAPI /* */ 43 | #endif /* linux */ 44 | 45 | #define C_DLLEXPORT extern "C" DLLEXPORT 46 | 47 | typedef int (*GETENTITYAPI_FN) (DLL_FUNCTIONS *pFunctionTable, int interfaceVersion); 48 | typedef int (*GETENTITYAPI2_FN) (DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 49 | typedef int (*GETNEWDLLFUNCTIONS_FN) (NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 50 | typedef int (*GET_ENGINE_FUNCTIONS_FN) (enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion); 51 | 52 | export int GetEntityAPI (DLL_FUNCTIONS *pFunctionTable, int interfaceVersion); 53 | export int GetEntityAPI2 (DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 54 | export int GetNewDLLFunctions (NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion); 55 | 56 | #endif /* DLLAPI_H */ 57 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/metamod/mutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2006 Will Day 3 | * See the file "dllapi.h" in this folder for full information 4 | */ 5 | 6 | // Simplified version by Wei Mingzhi 7 | 8 | #ifndef MUTIL_H 9 | #define MUTIL_H 10 | 11 | #include "plinfo.h" 12 | #include "sdk_util.h" 13 | 14 | // max buffer size for printed messages 15 | #define MAX_LOGMSG_LEN 1024 16 | 17 | // for getgameinfo: 18 | typedef enum 19 | { 20 | GINFO_NAME = 0, 21 | GINFO_DESC, 22 | GINFO_GAMEDIR, 23 | GINFO_DLL_FULLPATH, 24 | GINFO_DLL_FILENAME, 25 | GINFO_REALDLL_FULLPATH, 26 | } ginfo_t; 27 | 28 | // Meta Utility Function table type. 29 | typedef struct meta_util_funcs_s 30 | { 31 | void (*pfnLogConsole) (plid_t plid, const char *fmt, ...); 32 | void (*pfnLogMessage) (plid_t plid, const char *fmt, ...); 33 | void (*pfnLogError) (plid_t plid, const char *fmt, ...); 34 | void (*pfnLogDeveloper) (plid_t plid, const char *fmt, ...); 35 | void (*pfnCenterSay) (plid_t plid, const char *fmt, ...); 36 | void (*pfnCenterSayParms) (plid_t plid, hudtextparms_t tparms, const char *fmt, ...); 37 | void (*pfnCenterSayVarargs) (plid_t plid, hudtextparms_t tparms, const char *fmt, va_list ap); 38 | qboolean (*pfnCallGameEntity) (plid_t plid, const char *entStr, entvars_t *pev); 39 | int (*pfnGetUserMsgID) (plid_t plid, const char *msgname, int *size); 40 | const char *(*pfnGetUserMsgName) (plid_t plid, int msgid, int *size); 41 | const char *(*pfnGetPluginPath) (plid_t plid); 42 | const char *(*pfnGetGameInfo) (plid_t plid, ginfo_t tag); 43 | int (*pfnLoadPlugin) (plid_t plid, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle); 44 | int (*pfnUnloadPlugin) (plid_t plid, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason); 45 | int (*pfnUnloadPluginByHandle) (plid_t plid, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason); 46 | const char *(*pfnIsQueryingClientCvar) (plid_t plid, const edict_t *player); 47 | int (*pfnMakeRequestID) (plid_t plid); 48 | void (*pfnGetHookTables) (plid_t plid, enginefuncs_t **peng, DLL_FUNCTIONS **pdll, NEW_DLL_FUNCTIONS **pnewdll); 49 | } mutil_funcs_t; 50 | 51 | #endif /* MUTIL_H */ -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/metamod/plinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2006 Will Day 3 | * See the file "dllapi.h" in this folder for full information 4 | */ 5 | 6 | // Simplified version by Wei Mingzhi 7 | 8 | #ifndef PLINFO_H 9 | #define PLINFO_H 10 | 11 | typedef enum 12 | { 13 | PT_NEVER = 0, 14 | PT_STARTUP, 15 | PT_CHANGELEVEL, 16 | PT_ANYTIME, 17 | PT_ANYPAUSE, 18 | } PLUG_LOADTIME; 19 | 20 | 21 | typedef struct 22 | { 23 | char *ifvers; 24 | char *name; 25 | char *version; 26 | char *date; 27 | char *author; 28 | char *url; 29 | char *logtag; 30 | PLUG_LOADTIME loadable; 31 | PLUG_LOADTIME unloadable; 32 | } plugin_info_t; 33 | extern plugin_info_t Plugin_info; 34 | 35 | typedef plugin_info_t *plid_t; 36 | 37 | #define PLID &Plugin_info 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/sdk/metamod/sdk_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2006 Will Day 3 | * See the file "dllapi.h" in this folder for full information 4 | */ 5 | 6 | // Simplified version by Wei Mingzhi 7 | 8 | #ifndef SDK_UTIL_H 9 | #define SDK_UTIL_H 10 | 11 | #ifdef DEBUG 12 | #undef DEBUG 13 | #endif 14 | 15 | #include 16 | 17 | #define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) 18 | #define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue) 19 | #define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue) 20 | #define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand) 21 | #define SERVER_PRINT (*g_engfuncs.pfnServerPrint) 22 | #define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue) 23 | 24 | inline char *ENTITY_KEYVALUE (edict_t *entity, char *key) 25 | { 26 | char *ifbuf = GET_INFOKEYBUFFER (entity); 27 | 28 | return (INFOKEY_VALUE (ifbuf, key)); 29 | } 30 | 31 | inline void ENTITY_SET_KEYVALUE (edict_t *entity, char *key, char *value) 32 | { 33 | char *ifbuf = GET_INFOKEYBUFFER (entity); 34 | 35 | SET_CLIENT_KEYVALUE (ENTINDEX (entity), ifbuf, key, value); 36 | } 37 | 38 | inline char *SERVERINFO (char *key) 39 | { 40 | edict_t *server = INDEXENT (0); 41 | 42 | return (ENTITY_KEYVALUE (server, key)); 43 | } 44 | 45 | inline void SET_SERVERINFO (char *key, char *value) 46 | { 47 | edict_t *server = INDEXENT (0); 48 | char *ifbuf = GET_INFOKEYBUFFER (server); 49 | 50 | SET_SERVER_KEYVALUE (ifbuf, key, value); 51 | } 52 | 53 | inline char *LOCALINFO (char *key) 54 | { 55 | edict_t *server = NULL; 56 | 57 | return (ENTITY_KEYVALUE (server, key)); 58 | } 59 | 60 | inline void SET_LOCALINFO (char *key, char *value) 61 | { 62 | edict_t *server = NULL; 63 | char *ifbuf = GET_INFOKEYBUFFER (server); 64 | 65 | SET_SERVER_KEYVALUE (ifbuf, key, value); 66 | } 67 | 68 | short FixedSigned16 (float value, float scale); 69 | unsigned short FixedUnsigned16 (float value, float scale); 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/source/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "extdll.h" 3 | 4 | #include <../../version.h> 5 | 6 | 7 | // AMXX API 8 | void OnPluginsLoaded() 9 | { 10 | SyPBDataLoad(); 11 | } 12 | 13 | void OnAmxxAttach() 14 | { 15 | MF_AddNatives( sypb_natives ); 16 | 17 | } 18 | void OnAmxxDetach() 19 | { 20 | 21 | } 22 | 23 | void ErrorWindows(const char *text) 24 | { 25 | const int button = ::MessageBox(NULL, text, "SyPB API Error", MB_YESNO | MB_TOPMOST | MB_ICONINFORMATION); 26 | if (button == IDYES) 27 | exit(1); 28 | } -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/source/main.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAIN_H 3 | #define MAIN_H 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "amxxmodule.h" 10 | 11 | // API calling 12 | extern AMX_NATIVE_INFO sypb_natives[]; 13 | 14 | void SyPBDataLoad(void); 15 | 16 | void ErrorWindows(const char *text); 17 | 18 | // Error Log 19 | int LogToFile(const char *szLogText, ...); 20 | 21 | #endif // MAIN_H -------------------------------------------------------------------------------- /Project SyPB/SyPB_API/source/sypb_api.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | #include <../../version.h> 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION SYPBAPI_VERSION_DWORD 8 | PRODUCTVERSION SYPBAPI_VERSION_DWORD 9 | FILEOS 0x40004 10 | FILETYPE 0x2 11 | { 12 | BLOCK "StringFileInfo" 13 | { 14 | BLOCK "040904E4" 15 | { 16 | VALUE "CompanyName", PRODUCT_AUTHOR "\0" 17 | VALUE "FileDescription", SYPBAPI_DESCRIPTION "\0" 18 | VALUE "FileVersion", SYPBAPI_VERSION "\0" 19 | VALUE "OriginalFilename", "sypb_amxx.dll" "\0" 20 | VALUE "LegalCopyright", PRODUCT_AUTHOR "\0" 21 | VALUE "LegalTrademarks", PRODUCT_AUTHOR "\0" 22 | VALUE "ProductName", SYPBAPI_NAME "\0" 23 | VALUE "ProductVersion", SYPBAPI_VERSION "\0" 24 | } 25 | } 26 | #ifndef NOLANGINFO 27 | BLOCK "VarFileInfo" 28 | { 29 | VALUE "Translation", 0x400, 1252 30 | } 31 | #endif 32 | } -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/SyPB Bot.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source 6 | 7 | 8 | Source 9 | 10 | 11 | Source 12 | 13 | 14 | Source 15 | 16 | 17 | Source 18 | 19 | 20 | Source 21 | 22 | 23 | Source 24 | 25 | 26 | Source 27 | 28 | 29 | Source 30 | 31 | 32 | Source 33 | 34 | 35 | Source 36 | 37 | 38 | Source 39 | 40 | 41 | 42 | 43 | Include 44 | 45 | 46 | Include 47 | 48 | 49 | Include 50 | 51 | 52 | Include 53 | 54 | 55 | Include 56 | 57 | 58 | Include 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {b678dca9-2032-4755-bea2-f0a503a80ed5} 67 | 68 | 69 | {a0378ad2-c214-4b6e-817e-5399c8134945} 70 | 71 | 72 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/SyPB Bot.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WindowsLocalDebugger 5 | 6 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/include/globals.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2003-2023, by HsK-Dev Blog 3 | // https://ccnhsk-dev.blogspot.com/ 4 | // 5 | // And Thank About Yet Another POD-Bot Development Team. 6 | // Copyright (c) 2003-2009, by Yet Another POD-Bot Development Team. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a 9 | // copy of this software and associated documentation files (the "Software"), 10 | // to deal in the Software without restriction, including without limitation 11 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 | // and/or sell copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // $Id:$ 27 | // 28 | 29 | #ifndef GLOBALS_INCLUDED 30 | #define GLOBALS_INCLUDED 31 | 32 | extern uint16 g_sypbbV16[4]; 33 | 34 | // SyPB Pro P.31 - AMXX API 35 | extern float API_Version; 36 | extern float amxxDLL_Version; 37 | extern uint16 amxxDLL_bV16[4]; 38 | // **** 39 | 40 | // SyPB Pro P.42 - SwNPC 41 | extern float SwNPC_Version; 42 | extern uint16 SwNPC_Build[4]; 43 | // **** 44 | 45 | extern bool g_bombPlanted; 46 | extern bool g_bombSayString; 47 | extern bool g_roundEnded; 48 | extern bool g_waypointOn; 49 | extern bool g_waypointsChanged; 50 | extern bool g_botsCanPause; 51 | extern bool g_editNoclip; 52 | extern bool g_isMetamod; 53 | extern bool g_isFakeCommand; 54 | extern bool g_leaderChoosen[2]; 55 | 56 | extern bool g_sgdWaypoint; 57 | extern bool g_sautoWaypoint; 58 | extern int g_sautoRadius; 59 | 60 | extern float g_debugUpdateTime; 61 | extern float g_autoPathDistance; 62 | extern float g_timeBombPlanted; 63 | extern float g_timeNextBombUpdate; 64 | extern float g_lastChatTime; 65 | extern float g_timeRoundEnd; 66 | extern float g_timeRoundMid; 67 | extern float g_timeNextBombUpdate; 68 | extern float g_timeRoundStart; 69 | extern float g_lastRadioTime[2]; 70 | 71 | extern int g_maxClients; 72 | extern float g_secondTime; 73 | extern float g_gameStartTime; 74 | 75 | extern int g_mapType; 76 | extern int g_numWaypoints; 77 | extern int g_gameVersion; 78 | extern int g_fakeArgc; 79 | extern unsigned short g_killHistory; 80 | 81 | extern int g_gameMode; 82 | extern int g_debugMode; 83 | extern bool g_botActionStop; 84 | extern bool g_ignoreEnemies; 85 | 86 | extern int g_normalWeaponPrefs[Const_NumWeapons]; 87 | extern int g_rusherWeaponPrefs[Const_NumWeapons]; 88 | extern int g_carefulWeaponPrefs[Const_NumWeapons]; 89 | extern int g_grenadeBuyPrecent[Const_NumWeapons - 23]; 90 | extern int g_grenadeBuyMoney[Const_NumWeapons - 23]; 91 | extern int g_radioSelect[32]; 92 | extern int g_lastRadio[2]; 93 | extern int g_storeAddbotVars[4]; 94 | extern int *g_weaponPrefs[]; 95 | 96 | extern int g_modelIndexLaser; 97 | extern int g_modelIndexArrow; 98 | extern char g_fakeArgv[256]; 99 | 100 | // SyPB Pro P.42 - Entity Action 101 | extern float g_checkEntityDataTime; 102 | extern int g_entityId[entityNum]; 103 | extern int g_entityTeam[entityNum]; 104 | extern int g_entityAction[entityNum]; 105 | extern int g_entityWpIndex[entityNum]; 106 | extern Vector g_entityGetWpOrigin[entityNum]; 107 | extern float g_entityGetWpTime[entityNum]; 108 | extern edict_t *g_hostages[Const_MaxHostages]; 109 | extern int g_hostagesWpIndex[Const_MaxHostages]; 110 | 111 | extern Array > g_chatFactory; 112 | extern Array g_botNames; 113 | extern Array g_replyFactory; 114 | 115 | extern FireDelay g_fireDelay[Const_NumWeapons + 1]; 116 | extern WeaponSelect g_weaponSelect[Const_NumWeapons + 1]; 117 | extern WeaponProperty g_weaponDefs[Const_MaxWeapons + 1]; 118 | 119 | extern Client_old g_clients[32]; 120 | extern MenuText g_menus[26]; 121 | extern SkillDef g_skillTab[6]; 122 | extern Task g_taskFilters[]; 123 | 124 | extern edict_t *g_hostEntity; 125 | extern edict_t *g_worldEdict; 126 | extern Library *g_gameLib; 127 | 128 | extern DLL_FUNCTIONS g_functionTable; 129 | extern EntityAPI_t g_entityAPI; 130 | extern FuncPointers_t g_funcPointers; 131 | extern NewEntityAPI_t g_getNewEntityAPI; 132 | extern BlendAPI_t g_serverBlendingAPI; 133 | 134 | #endif // GLOBALS_INCLUDED 135 | -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/include/platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2003-2023, by HsK-Dev Blog 3 | // https://ccnhsk-dev.blogspot.com/ 4 | // 5 | // And Thank About Yet Another POD-Bot Development Team. 6 | // Copyright (c) 2003-2009, by Yet Another POD-Bot Development Team. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a 9 | // copy of this software and associated documentation files (the "Software"), 10 | // to deal in the Software without restriction, including without limitation 11 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 12 | // and/or sell copies of the Software, and to permit persons to whom the 13 | // Software is furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // $Id$ 27 | // 28 | 29 | #ifndef PLATFORM_INCLUDED 30 | #define PLATFORM_INCLUDED 31 | 32 | // detects the build platform 33 | #if defined (__linux__) || defined (__debian__) || defined (__linux) 34 | #define PLATFORM_LINUX32 1 35 | #elif defined (__x86_64__) || defined (__amd64__) 36 | #define PLATFORM_LINUX64 1 37 | #elif defined (_WIN32) 38 | #define PLATFORM_WIN32 1 39 | #endif 40 | 41 | // detects the compiler 42 | #if defined (_MSC_VER) 43 | #define COMPILER_VISUALC _MSC_VER 44 | #elif defined (__BORLANDC__) 45 | #define COMPILER_BORLAND __BORLANDC__ 46 | #elif defined (__MINGW32__) 47 | #define COMPILER_MINGW32 __MINGW32__ 48 | #endif 49 | 50 | // configure export macros 51 | #if defined (COMPILER_VISUALC) || defined (COMPILER_MINGW32) 52 | #define export extern "C" __declspec (dllexport) 53 | #elif defined (PLATFORM_LINUX32) || defined (PLATFORM_LINUX64) || defined (COMPILER_BORLAND) 54 | #define export extern "C" 55 | #else 56 | #error "Can't configure export macros. Compiler unrecognized." 57 | #endif 58 | 59 | #ifdef PLATFORM_WIN32 60 | #include 61 | #pragma comment(lib, "Urlmon.lib") 62 | #endif 63 | 64 | 65 | // operating system specific macros, functions and typedefs 66 | #ifdef PLATFORM_WIN32 67 | 68 | #include 69 | 70 | #define DLL_ENTRYPOINT int STDCALL DllMain (void *, unsigned long dwReason, void *) 71 | #define DLL_DETACHING (dwReason == 0) 72 | #define DLL_RETENTRY return 1 73 | 74 | #define stricmp _stricmp 75 | 76 | #if defined (COMPILER_VISUALC) 77 | #define DLL_GIVEFNPTRSTODLL extern "C" void STDCALL 78 | #elif defined (COMPILER_MINGW32) 79 | #define DLL_GIVEFNPTRSTODLL export void STDCALL 80 | #endif 81 | 82 | // specify export parameter 83 | #if defined (COMPILER_VISUALC) && (COMPILER_VISUALC > 1000) 84 | #pragma comment (linker, "/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1") 85 | #pragma comment (linker, "/SECTION:.data,RW") 86 | #endif 87 | 88 | typedef int ( *EntityAPI_t) (DLL_FUNCTIONS *, int); 89 | typedef int ( *NewEntityAPI_t) (NEW_DLL_FUNCTIONS *, int *); 90 | typedef int ( *BlendAPI_t) (int, void **, void *, float (*)[3][4], float (*)[128][3][4]); 91 | typedef void (__stdcall *FuncPointers_t) (enginefuncs_t *, globalvars_t *); 92 | typedef void (*EntityPtr_t) (entvars_t *); 93 | 94 | #elif defined (PLATFORM_LINUX32) || defined (PLATFORM_LINUX64) 95 | 96 | #include 97 | #include 98 | #include 99 | #include 100 | 101 | #define DLL_ENTRYPOINT void _fini (void) 102 | #define DLL_DETACHING TRUE 103 | #define DLL_RETENTRY return 104 | #define DLL_GIVEFNPTRSTODLL extern "C" void 105 | 106 | #define stricmp strcasecmp 107 | 108 | inline uint32 _lrotl (uint32 x, int r) { return (x << r) | (x >> (sizeof (x) * 8 - r));} 109 | 110 | typedef int (*EntityAPI_t) (DLL_FUNCTIONS *, int); 111 | typedef int (*NewEntityAPI_t) (NEW_DLL_FUNCTIONS *, int *); 112 | typedef int (*BlendAPI_t) (int, void **, void *, float (*)[3][4], float (*)[128][3][4]); 113 | typedef void (*FuncPointers_t) (enginefuncs_t *, globalvars_t *); 114 | typedef void (*EntityPtr_t) (entvars_t *); 115 | 116 | #else 117 | #error "Platform unrecognized." 118 | #endif 119 | 120 | // library wrapper 121 | class Library 122 | { 123 | private: 124 | #ifdef PLATFORM_WIN32 125 | HMODULE m_ptr; 126 | #else 127 | void* m_ptr; 128 | #endif 129 | 130 | public: 131 | 132 | Library (const char *fileName) 133 | { 134 | if (fileName == null) 135 | return; 136 | 137 | #ifdef PLATFORM_WIN32 138 | m_ptr = LoadLibraryA (fileName); 139 | #else 140 | m_ptr = dlopen (fileName, RTLD_NOW); 141 | #endif 142 | } 143 | 144 | ~Library (void) 145 | { 146 | if (!IsLoaded ()) 147 | return; 148 | 149 | #ifdef PLATFORM_WIN32 150 | FreeLibrary (m_ptr); 151 | #else 152 | dlclose (m_ptr); 153 | #endif 154 | } 155 | 156 | public: 157 | void *GetFunctionAddr (const char *functionName) 158 | { 159 | if (!IsLoaded ()) 160 | return null; 161 | 162 | #ifdef PLATFORM_WIN32 163 | return GetProcAddress (m_ptr, functionName); 164 | #else 165 | return dlsym (m_ptr, functionName); 166 | #endif 167 | } 168 | 169 | inline bool IsLoaded (void) const 170 | { 171 | return m_ptr != null; 172 | } 173 | }; 174 | 175 | #endif -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/include/sypb.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CCNHsK-Dev/SyPB/8a9613572f36f060ad2b08076640a02ac434c640/Project SyPB/SyPB_BOT/include/sypb.aps -------------------------------------------------------------------------------- /Project SyPB/SyPB_BOT/include/sypb.rc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include <../../version.h> 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION SYPB_VERSION_DWORD 7 | PRODUCTVERSION SYPB_VERSION_DWORD 8 | FILEOS 0x40004 9 | FILETYPE 0x2 10 | { 11 | BLOCK "StringFileInfo" 12 | { 13 | BLOCK "040904E4" 14 | { 15 | VALUE "CompanyName", PRODUCT_AUTHOR "\0" 16 | VALUE "FileDescription", SYPB_DESCRIPTION "\0" 17 | VALUE "FileVersion", SYPB_VERSION "\0" 18 | VALUE "OriginalFilename", "sypb.dll" "\0" 19 | VALUE "LegalCopyright", PRODUCT_AUTHOR "\0" 20 | VALUE "LegalTrademarks", PRODUCT_AUTHOR "\0" 21 | VALUE "ProductName", SYPB_NAME "\0" 22 | VALUE "ProductVersion", SYPB_VERSION "\0" 23 | } 24 | } 25 | #ifndef NOLANGINFO 26 | BLOCK "VarFileInfo" 27 | { 28 | VALUE "Translation", 0x400, 1252 29 | } 30 | #endif 31 | } -------------------------------------------------------------------------------- /Project SyPB/version.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RESOURCE_INCLUDED 3 | #define RESOURCE_INCLUDED 4 | 5 | #define PRODUCT_AUTHOR "HsK Dev-Blog @ CCN" 6 | #define PRODUCT_URL "http://ccnhsk-dev.blogspot.com/" 7 | #define PRODUCT_EMAIL "ccndevblog@outlook.com" 8 | 9 | // SyPB ------------------------- 10 | #define SYPB_NAME "SyPB" 11 | #define SYPB_VERSION "Beta 1.50" 12 | #define SYPB_VERSION_F 1.50 13 | #define SYPB_VERSION_DWORD 1,50,20240506,822 // yyyy/mm/dd 14 | 15 | #define SWNPC_NAME "SwNPC" 16 | #define SWNPC_VERSION "Beta 1.50" 17 | #define SWNPC_VERSION_F 1.50 18 | #define SWNPC_VERSION_DWORD 1,50,20230506,151 // yyyy/mm/dd 19 | 20 | #define SYPBAPI_NAME "SyPB AMXX API" 21 | #define SYPBAPI_VERSION "Beta 1.50" 22 | #define SYPBAPI_VERSION_F 1.50 23 | #define SYPBAPI_VERSION_DWORD 1,50,20230528,55 // yyyy/mm/dd 24 | 25 | #define SYPB_DESCRIPTION SYPB_NAME " " SYPB_VERSION " (API: " SYPBAPI_VERSION " | SwNPC: " SWNPC_VERSION ")" 26 | #define SWNPC_DESCRIPTION SWNPC_NAME " " SWNPC_VERSION 27 | #define SYPBAPI_DESCRIPTION SYPBAPI_NAME " " SYPBAPI_VERSION 28 | 29 | // SyPB Support Game Mode 30 | enum GameMode 31 | { 32 | MODE_BASE = 0, 33 | MODE_DM = 1, 34 | MODE_ZP = 2, 35 | MODE_NOTEAM = 3, 36 | MODE_ZH = 4, 37 | MODE_NONE 38 | }; 39 | 40 | // SyPB Debug Mode 41 | enum DebugMode 42 | { 43 | DEBUG_NONE = 0, 44 | DEBUG_PLAYER = 1, 45 | DEBUG_SWNPC = 2, 46 | DEBUG_ALL 47 | }; 48 | 49 | // SyPB Waypoint Flag 50 | enum WaypointFlag 51 | { 52 | WAYPOINT_LIFT = (1 << 1), // wait for lift to be down before approaching this waypoint 53 | WAYPOINT_CROUCH = (1 << 2), // must crouch to reach this waypoint 54 | WAYPOINT_CROSSING = (1 << 3), // a target waypoint 55 | WAYPOINT_GOAL = (1 << 4), // mission goal point (bomb, hostage etc.) 56 | WAYPOINT_LADDER = (1 << 5), // waypoint is on ladder 57 | WAYPOINT_RESCUE = (1 << 6), // waypoint is a hostage rescue point 58 | WAYPOINT_CAMP = (1 << 7), // waypoint is a camping point 59 | WAYPOINT_NOHOSTAGE = (1 << 8), // only use this waypoint if no hostage 60 | WAYPOINT_DJUMP = (1 << 9), // bot help's another bot (requster) to get somewhere (using djump) 61 | WAYPOINT_ZMHMCAMP = (1 << 10), // Zombie Mod Human Camp for SyPB 62 | WAYPOINT_SNIPER = (1 << 28), // it's a specific sniper point 63 | WAYPOINT_TERRORIST = (1 << 29), // it's a specific terrorist point 64 | WAYPOINT_COUNTER = (1 << 30) // it's a specific ct point 65 | }; 66 | 67 | enum PathFlag 68 | { 69 | PATHFLAG_JUMP = (1 << 0), // must jump for this connection 70 | PATHFLAG_DOUBLE = (1 << 1) // must use friend for this connection 71 | }; 72 | 73 | #endif // RESOURCE_INCLUDED 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SyPB 2 | Counter-Strike 1.6 Bot, Based on YaPB2.7.2 3 | 4 | SyPB - Lastly Version: Beta 1.49 (Build: 1.49.50770.745) 5 | - Counter-Strike 1.6 Bot 6 | 7 | SwNPC - Lastly Version: Beta 1.48 (Build: 1.48.50576.121) 8 | - Counter-Strike 1.6 NPC System 9 | - Use SyPB Waypoint, Need SyPB 10 | 11 | SyPB AMXX API - Lastly Version: 1.48 (Build: 1.48.50576.49) 12 | - SyPB AMXX API 13 | 14 | ! Windows Only ! 15 | 16 | Download or more pls visit: http://ccnhsk-dev.blogspot.hk/ 17 | --------------------------------------------------------------------------------