Quote:
Originally Posted by Demisis_P2P
Shotgun guy should probably just charge, unless he's the last NPC alive.
|
I actually have variables for how far away a projectile baddy will try to stay. This could be easily manipulated during the script's runtime.
If anyone's interested, here's a list of the current variables that affect the behavior of the baddy.
PHP Code:
//NPC created by Blonk
join("bl0nkt-smartbaddies");
function onCreated() {
showCharacter();
x-=0.5;
this.headimg = "head368.png";
this.bodyimg = "body14.png";
this.shieldimg = "shield2.png";
this.nick = "Rifle Roger";
//Serverside vars ---------------------------------------------------------------------------------------------------------------------------------
this.baddyAlliance = "Red Gang"; //Checks for guild affiliations to not attack (SERVERSIDE for resetting fights if room is filled only with affiliations)
this.baddyHp = 400; //Start HP
this.baddyRespawnSecs = 60; // Time for baddy to respawn
}
//#CLIENTSIDE
function onCreated() {
//Basic baddy stuff ---------------------------------------------------------------------------------------------------------------------------------
this.baddyAlliance = "Red Gang"; //Checks for guild affiliations to not attack (CLIENTSIDE is to prevent combat)
this.baddyMustDie2Continue = true; //Does the baddy have to die to continue into any rooms? (true/false)
this.baddyCanAlert = false; //The baddy alerts all other baddies when entering combat (true/false)
this.baddyDeathMessages = {"DRATS", "HNNGGG!"}; //Random selection of messages the baddy says upon death
this.baddyAlertMessages = {"I see you!", "Ha!", "Thought you could sneak by me?"}; //Random selection of messages the baddy says upon contact
this.baddyMode = "projectile"; //-- "projectile" or "melee"
this.baddySpeed = 0.5; //Baddy run speed
this.baddyRadius = 14; //Distance it takes for baddy to see you
this.baddyReflexTime = 2; //Increase to make the baddy react to movements slower (MUST BE AN INTEGER)
this.baddyMaxHp = 400; //Maximum HP
this.baddyDefaultDir = 2; // 0 = up, 1 = left, 2 = down, 3 = right
this.baddyIdleGani = "amsel_assaultrifle-idle";
this.baddyWalkGani = "amsel_assaultrifle-walk";
this.baddyDefaultGani = "amsel_assaultrifle-idle"; //The gani shown before combat
//Baddy melee control ---------------------------------------------------------------------------------------------------------------------------------
this.baddyMeleeSpeed = 0.78; //How fast their melee hits
this.baddyMeleeFreeze = 0.3; //Freeze time of melee
this.baddyMeleeDamage = 5; //Amount of melee damage done
this.baddyMeleeAni = "era_knife_stab1";
//Baddy projectile control ----------------------------------------------------------------------------------------------------------------------------------
this.baddyBulletCountPerShot = 1; //How many bullets are fired per shot (typically shotguns)
this.baddyMaxProjectileDist = 12; //Distance the baddy tries to stay at when shooting at a player
this.baddyProjectileSpeed = 0.12; //Speed of their projectile weapon
this.baddyProjectileFreeze = 0.1; //Freeze of projectile weapon
this.baddyProjectileDamage = 25; //Projectile damage
this.baddyProjectileSpread = 0.2; //Projectile weapon's spread
this.baddyProjectileXModifier = {-0.5, -1.6, 0.5, 2.4}; //Sets the projectile's X offset {up, left, down, right}
this.baddyProjectileYModifier = {-0.12, -0.34, 0.12, -0.4}; //Sets the projectile's Y offset {up, left, down, right}
this.baddyProjectileAni = "amsel_assaultrifle-fire";
}