Advertisement
Guest User

Pit Drone code, added to Source Files > dlls

a guest
Oct 10th, 2019
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.01 KB | None | 0 0
  1. #include "extdll.h"
  2. #include "util.h"
  3. #include "cbase.h"
  4. #include "monsters.h"
  5. #include "schedule.h"
  6. #include "decals.h"
  7.  
  8. //=========================
  9. //--Monster's Anim Events--
  10. //=========================
  11. #define PDRONE_FIRE_SPIKE 1
  12. #define PDRONE_MELEE_LEFT 3
  13. #define PDRONE_MELEE_RIGHT 8
  14. #define PDRONE_MELEE_BOTH 6
  15.  
  16. //=========================
  17. //--Monster's Extra Defs---
  18. //=========================
  19.  
  20. //-Body Groups
  21. #define BODYGROUP_BODY              1
  22. #define BODYGROUP_SPIKES            2
  23.  
  24. //-Spike Groups
  25. #define BODY_NO_SPIKES              0
  26. #define BODY_SIX_SPIKES             1
  27. #define BODY_FIVE_SPIKES            2
  28. #define BODY_FOUR_SPIKES            3
  29. #define BODY_THREE_SPIKES           4
  30. #define BODY_TWO_SPIKES             5
  31. #define BODY_ONE_SPIKES             6
  32.  
  33. class CPitDrone : public CBaseMonster
  34. {
  35. public:
  36.     void Spawn(void);
  37.     void Precache(void);
  38.     int iSpikes;
  39.     int Classify(void);
  40.     void SetYawSpeed(void);
  41. };
  42.  
  43. LINK_ENTITY_TO_CLASS(monster_pitdrone, CPitDrone);
  44.  
  45. void CPitDrone::Spawn()
  46. {
  47.     Precache(); // So the model loads
  48.  
  49.     SET_MODEL(ENT(pev), "models/npcs/pit_drone.mdl"); // So you can see him
  50.  
  51.     UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX); // Let's make his size human. If you're smart enough (or have lots of patience) you can get replace the VEC_ stuff with "Vector( x, y, z)".
  52.  
  53.     pev->solid = SOLID_SLIDEBOX; // They see me slidin', they hating. This actually tells the engine for it to be Solid. Snakes can GTHO.
  54.     pev->movetype = MOVETYPE_STEP; // 'cause monsters walk - they don't drive (Nightmares will follow)
  55.     m_bloodColor = BLOOD_COLOR_GREEN; // Green blood - just like this comment. Freaked out much? (The blood's actually yellow, though)
  56.     pev->health = 100; // Health - let's keep it as an integer, as opposed to a changeable variable for now.
  57.     pev->view_ofs = Vector(0, 0, 20); // Eyes' offset (He sees you doing stuff you shouldn't)
  58.     m_flFieldOfView = 0.5; // How far he can see.
  59.     m_MonsterState = MONSTERSTATE_NONE; // Afet he spawns, make him sit there like an idiot, doing nothing.
  60.  
  61.     MonsterInit(); // Starts the monsters AI
  62.  
  63.     iSpikes = 6; // Default, he's fully loaded with spikes. AGAIN, NO PUNS YOU SICKOS!
  64. }
  65.  
  66. void CPitDrone::Precache()
  67. {
  68.     PRECACHE_MODEL("models/pit_drone_spike.mdl"); //Loads the model for the spike
  69.     PRECACHE_MODEL("models/npcs/pit_drone.mdl"); //Loads the NPC model in the game
  70.  
  71.                                                  // Bunch of pretty self-explanatory sounds
  72.     PRECACHE_SOUND("pitdrone/pit_drone_melee_attack1.wav");
  73.     PRECACHE_SOUND("pitdrone/pit_drone_melee_attack2.wav");
  74.     PRECACHE_SOUND("pitdrone/pit_drone_attack_spike1.wav");
  75.     PRECACHE_SOUND("pitdrone/pit_drone_eat.wav");
  76.     PRECACHE_SOUND("pitdrone/pit_drone_die1.wav");
  77.     PRECACHE_SOUND("pitdrone/pit_drone_die2.wav");
  78.     PRECACHE_SOUND("pitdrone/pit_drone_die3.wav");
  79.     PRECACHE_SOUND("pitdrone/pit_drone_hunt3.wav");
  80. }
  81.  
  82. //Set monster faction
  83. int CPitDrone::Classify(void)
  84. {
  85.     return CLASS_ALIEN_MONSTER;
  86. }
  87.  
  88. //Turning Speed
  89. void CPitDrone::SetYawSpeed(void) {
  90.     pev->yaw_speed = 90;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement