PDA

View Full Version : 008 Crypt Lord [80] v1.0.9



ZERO
12-13-2010, 09:36 PM
Crypt Lord
Required Level: 80
Levels per ability: 5
Allowed per Team: 2
Item Restrictions: NONE
6902Impale: Shake and push the enemy, 10-33% chance
6903Spiked Carapace: Get 110-200 armor on spawn, 20-40% chance to deal 10-20% mirror damage
6905Carrion Beetles: You have a 20-33% chance of your beetles attacking the enemy for 5-15 extra damage
6906Locust Swarm: A Swarm of Locusts steals 25HP and 10-30 armor from one random enemy




http://www.ibisgaming.com/wcs_stats/player.php?id=11870



1.0.0

Initial Release


1.0.1

Fixed Spiked Carapace to give you Kevlar and a helmet first before giving you extra armor to prevent you from buying said armor automatically and having your armor reduced back to 100.


1.0.2

Fixed ultimate so that you actually get the health and armor that you stole, you can not exceed 125health/armor


1.0.3

Limited to 2 per team


1.0.4

Changed max health you can gain from ultimate from 125 to 150


1.0.5

Updated descriptions


1.0.6

Fixed invalid array size for beetles that prevented the ability from working on some levels.


1.0.7

Confirmed CODE is 100% same as 1.0.6


1.0.8

Initial Release of reprogrammed version


1.0.9

Max health gain is now actually limited to 400hp

ZERO
12-15-2010, 04:36 PM
1.0.1

Fixed Spiked Carapace to give you Kevlar and a helmet first before giving you extra armor to prevent you from buying said armor automatically and having your armor reduced back to 100.

ZERO
12-16-2010, 04:55 PM
1.0.2

Fixed ultimate so that you actually get the health and armor that you stole, you can not exceed 125health/armor.

ZERO
12-21-2010, 05:52 PM
1.0.3


Limited to 2 per team

CYBER
12-21-2010, 10:33 PM
Crypt Lord
Required Level: 80
Levels per ability: 5
Allowed per Team: 2

Impale: Shake and push the enemy, 10-33% chance
Spiked Carapace: Get 110-200 armor on spawn, 20-40% chance to deal 10-20% mirror damage
Carrion Beetles: You have a 20-33% chance of your beetles attacking the enemy for 5-15 extra damage
Locust Swarm: A Swarm of Locusts steals 25HP and 10-30 armor from one random enemy



1.0.0

Initial Release


1.0.1

Fixed Spiked Carapace to give you Kevlar and a helmet first before giving you extra armor to prevent you from buying said armor automatically and having your armor reduced back to 100.


1.0.2

Fixed ultimate so that you actually get the health and armor that you stole, you can not exceed 125health/armor

1.0.3

Limited to 2 per team





when u hit someone with the locust, it displays it "damage given with locus 25" or smthn like that.
is there a chance that it can tell u the name of the player who got hit by that locust? for strategical reasons?


also, updating the locust skill, does it reduce the time to wait? or increase damage? bcos i upgraded it a few times and its still the same? or am i missing msnth?

DJ_MikeyRevile
12-21-2010, 11:11 PM
when u hit someone with the locust, it displays it "damage given with locus 25" or smthn like that.
is there a chance that it can tell u the name of the player who got hit by that locust? for strategical reasons?


also, updating the locust skill, does it reduce the time to wait? or increase damage? bcos i upgraded it a few times and its still the same? or am i missing msnth?

that is dumb. seriously... if you really want to know what race someone is type playerinfo "a dominate part of there name" otherwise it would be unfair to the crypt lords.


edit: that dmg shows up in your console after you die anyways.... if you wanted to be "strategic" use that info the next round. i see you only wanting this "feature" added so that you can joke about it at that moment it happens.

acolyte_to_jippity
12-21-2010, 11:11 PM
when u hit someone with the locust, it displays it "damage given with locus 25" or smthn like that.
is there a chance that it can tell u the name of the player who got hit by that locust? for strategical reasons?


also, updating the locust skill, does it reduce the time to wait? or increase damage? bcos i upgraded it a few times and its still the same? or am i missing msnth?

increases armor damage i believe

ZERO
12-21-2010, 11:36 PM
Yea as stated you get more armor also note that is the amount you steal so you will also restore that amount of armor.

taz1stP
12-21-2010, 11:46 PM
i they are taking armor and hp then shouldnt it just take one at a time instead of both.

ZERO
12-22-2010, 12:43 AM
It works exactly like it did before and it does take both.

CYBER
12-22-2010, 11:19 AM
that is dumb. seriously... if you really want to know what race someone is type playerinfo "a dominate part of there name" otherwise it would be unfair to the crypt lords.


edit: that dmg shows up in your console after you die anyways.... if you wanted to be "strategic" use that info the next round. i see you only wanting this "feature" added so that you can joke about it at that moment it happens.

i dont know what u think i meant, but what i meant is that, say am a crypt lord, and i locust one of the 3 ennemies am up against, i would personally want to know who i hit, and if i hit the same person twice...
yes, for u it might be "just a feature", but i was just suggesting it for the heck of it.
i have no problem with the damage it takes or the timing, i only asked if it changes bcos after maxing out my locust, i still dnt see any upgrade in its power , or countdown. that is all.

Masskid
12-22-2010, 12:16 PM
I always thought crypt lord could get up to a maximum of 150 life O.o was i wrong?

ZERO
12-22-2010, 02:58 PM
What I can say if this helps you is it will always hit the closest target.

CYBER
12-22-2010, 07:51 PM
What I can say if this helps you is it will always hit the closest target.

makes sense to me :)

Masskid
12-28-2010, 10:15 AM
Is it just me or is impale not pushing anyone? i really don't know :\

acolyte_to_jippity
12-28-2010, 01:08 PM
Is it just me or is impale not pushing anyone? i really don't know :\

it makes their screen shake

Blackmage
12-28-2010, 02:28 PM
I think he's commenting on the "Shake and push". Was Crypt lord the one that used to pop people in the air?

acolyte_to_jippity
12-28-2010, 02:29 PM
I think he's commenting on the "Shake and push". Was Crypt lord the one that used to pop people in the air?

you're thinking jack

Blackmage
12-28-2010, 03:42 PM
That's right. I think the "and push" was just part of the badly worded original ability, Mass.

acolyte_to_jippity
12-30-2010, 08:28 PM
problem:

you fixed the scroll deleteing crypt lord's extra armor, but if you have an ankh, you'll come back next round w/ only 100 armor (instead of 125 like you're supposed to have)

ZERO
12-31-2010, 02:08 PM
I do not think there will be a way to fix that b/c of the way it works. Any race that has extra armor should have this glitch.

CYBER
12-31-2010, 05:38 PM
can someone please explain to me what happens when u level up the crypt lord's locust???

so far the cooldown is the same 20 secs
hp sucking is still 25
armor sucking still 25
max hp is 125?????
max armor (125? i believe so)


many ppl tell me its supposed to get u up to 175 hp? or smthn? but i have tested it , and camped like 15 times when in hostage room while using this ultimate, and after the 125/125 hp/armor , u still inflict damage, but cant increase anything of urs... or does?...confused as fuck how the locust upgrades. and yes i have crypt lord maxed out now.

acolyte_to_jippity
12-31-2010, 06:08 PM
can someone please explain to me what happens when u level up the crypt lord's locust???

so far the cooldown is the same 20 secs
hp sucking is still 25
armor sucking still 25
max hp is 125?????
max armor (125? i believe so)


many ppl tell me its supposed to get u up to 175 hp? or smthn? but i have tested it , and camped like 15 times when in hostage room while using this ultimate, and after the 125/125 hp/armor , u still inflict damage, but cant increase anything of urs... or does?...confused as fuck how the locust upgrades. and yes i have crypt lord maxed out now.

you take more armor

ZERO
01-04-2011, 06:45 PM
1.0.4


Changed max health you can gain from ultimate from 125 to 150

ZERO
01-08-2011, 04:11 AM
1.0.5


Updated descriptions

ZERO
01-20-2011, 10:10 PM
1.0.6

Fixed invalid array size for beetles that prevented the ability from working on some levels.

Sword of Gideon
06-20-2011, 05:49 PM
I've noticed that the locust don't necessarily attack the closest person, but rather select a specific person.

So in say a 8player vs 8player game, I have been hit at the begginning of every single round from the locust.

When this happens, I tend to change to human and start with 150 health and I'll get hit for 50 most of the time, so that's okay. But it happens, alot!
I think it would be worth investigating, because it's rather unfair to be hit for that kind of damage every single round for a map when you don't know what to do about it.

maynard
06-20-2011, 05:53 PM
you should really read through the past info on these races and things that have been complained about already... this is a well known issue, not new in the slightest.

Sword of Gideon
06-20-2011, 08:34 PM
I read through the entire thread. Is there more somewhere else? Cause nowhere in this thread does it talk about the locust attack the same person.

Masskid
06-22-2011, 12:40 PM
I've noticed that the locust don't necessarily attack the closest person, but rather select a specific person.

So in say a 8player vs 8player game, I have been hit at the begginning of every single round from the locust.

When this happens, I tend to change to human and start with 150 health and I'll get hit for 50 most of the time, so that's okay. But it happens, alot!
I think it would be worth investigating, because it's rather unfair to be hit for that kind of damage every single round for a map when you don't know what to do about it.

solution = buy a necklace... done now lets move on

Sword of Gideon
06-23-2011, 05:06 PM
The point to even having discussion is to find out what's broken so that it can be fixed.

The crypt lord locust attack is supposed to key on the nearest enemy. It isn't doing that. It's attacking the same person over and over. That's a great example of broken. Chances are that this isn't well known. Now because I brought it up, it can be fixed.

Or perhaps not... I don't see a lot of interest in fixing anything really. I see a lot of talk of upcoming changes. But it's always been my experience that this will only lead to more things being broken. Meanwhile, the things I do bring up are dismissed. So probably nothing will happen. But that doesn't change the fact that it's still broken.

acolyte_to_jippity
06-23-2011, 05:44 PM
the targeting problem is known on the war3 forums. also, it' not game-breaking, so it's somewhat lower priority.

maynard
06-23-2011, 06:01 PM
my telling you 2 read up on everything wasn't related 2 just this thread, it was everything in general with this mod. every single thing you've brought up has already been brought up at 1 point or another.

great 2 see you have an interest in the server and want it 2 be better, but all the basic things you've noticed in like a few days, well the people who have been playing here for years are obviously going 2 already be well aware of.

you can always hit me up on steam if you want a second opinion on something before you post about it, or just in general.

Blackmage
10-02-2011, 10:42 PM
The Periapt of Health does not stack with this race's max health (it keeps the max at 150). Is this intentional or not?

ZERO
03-19-2012, 11:38 PM
1.0.7

Confirmed CODE is 100% same as 1.0.6

>>>Shots<<<
08-14-2012, 11:26 AM
Not sure if this is intended, but you can gain more than 150 hp of health (e.g. 170 hp) with ultimate if you minorly injure yourself (fall from low height) so that your health is between 125-150 then use the ultimate.

ZERO
10-20-2014, 11:44 PM
Reprogramming started.

ZERO
10-21-2014, 01:29 AM
Race is ready for FINAL RELEASE TESTING all abilities should work as before no major changes. Some feed back messages have been changed. If the target for the ult has immunity you need to press the ult again to find a target that does not have immunity. If all targets have immunity then you logically can keep pressing all day with no results.

Just like in the current version you will always steal 25hp and X armor even if the person you steal from have less than those values. Thus there have been no balance changes to this race. You should see that the race works virtually identical to the one on the live server.

ZERO
10-21-2014, 01:38 AM
Example of how the code has changed:

Original global var deceleration:

new thisRaceID;

new SKILL_IMPALE,SKILL_SPIKE,SKILL_BEETLES,ULT_LOCUST;

//Increase length from 5 to 6

//skill 1
//Impale
new Float:ImpaleChanceArr[]={0.0,0.1,0.16,0.22,0.26,0.33};

//skill 2
//Spiked Carapace
//new Float:SpikeDamageRecieve[]={1.0,0.95,0.9,0.85,0.8,0.75};
//new Float:SpikeArmorGainArr[]={0.0,0.0,0.0,0.0,0.0,0.0};
new Float:SpikeChanceArr[]={0.0,0.2,0.25,0.3,0.35,0.4};
new Float:SpikeReturnDmgArr[]={0.0,0.1,0.13,0.15,0.17,0.2};
new ArmorArr[]={0,110,130,160,180,200};

//skill 3
//Carrion Beetles
new BeetleDamageArr[]={0,5,7,9,12,15};
new Float:BeetleChanceArr[]={0.0,0.2,0.25,0.28,0.3,0.33};

//ultimate
//Locust Swarm
new Handle:ultCooldownCvar;
new Handle:ultRangeCvar;
new const LocustDamage=25;
new const LocustMaxHealth=150;
new RemoveArmorArr[]={0,10,15,20,25,30};

new String:ultimateSound[]="war3source/locustswarmloop.wav";

New decelerations:

new thisRaceID;

new SKILL_ONE, SKILL_TWO, SKILL_THREE, ULT;

const RaceLevels = 5;

//Impale
new skill_level_one[MAXPLAYERSCUSTOM+1];

public Float:ImpaleChance(currentLevel)
{
return AbilityValue(0.1, 0.33, RaceLevels, currentLevel);
}

//Spiked Carapace
new skill_level_two[MAXPLAYERSCUSTOM+1];

public ArmorAmt(currentLevel)
{
return RoundFloat(AbilityValue(110.0, 200.0, RaceLevels, currentLevel));
}

public Float:SpikeChance(currentLevel)
{
return AbilityValue(0.2, 0.4, RaceLevels, currentLevel);
}

public Float:SpikePercent(currentLevel)
{
return AbilityValue(0.1, 0.2, RaceLevels, currentLevel);
}

//Carrion Beetles
new skill_level_three[MAXPLAYERSCUSTOM+1];

public Float:BeetlesChance(currentLevel)
{
return AbilityValue(0.2, 0.33, RaceLevels, currentLevel);
}

public BeetlesDmg(currentLevel)
{
return RoundFloat(AbilityValue(5.0, 15.0, RaceLevels, currentLevel));
}

//Locust Swarm
new skill_level_ult[MAXPLAYERSCUSTOM+1];

public ArmorSteal(currentLevel)
{
return RoundFloat(AbilityValue(10.0, 30.0, RaceLevels, currentLevel));
}

new String:ultimateSound[]="war3source/locustswarmloop.wav";

You can see here how the new methodology allows for easier customization of the ability values and simple adjustment to the races total levels. This makes it so that the race can have abilities and level requirements easily changed in a few seconds. It also reduces memory usage by lowering the number of global arrays required. Instead the resultant values are calculated on demand which does take more cpu but we are talking about basic math here. Likewise the memory savings are not really all that great anyways but this does fully prevent indexing errors by making them literally impossible due to the reduced reliance of arrays. Lastly the ability names have been standardized as to reduce development time.

ZERO
10-21-2014, 01:47 AM
The addition of this method rids the need for War3_GetSkillLevel() API calls and increases performance for faster lockup of a users current skill when needed in other parts of the program:


//Better tracking of current level for increased performance!
public OnSkillLevelChanged(client,race,skill,newskillleve l)
{
if(race==thisRaceID)
{
if(skill==SKILL_ONE) //1
{
skill_level_one[client]=newskilllevel;
}
else if(skill==SKILL_TWO) //2
{
skill_level_two[client]=newskilllevel;
}
else if(skill==SKILL_THREE) //3
{
skill_level_three[client]=newskilllevel;
}
else if(skill==ULT) //4
{
skill_level_ult[client]=newskilllevel;
}
}
}

ZERO
10-21-2014, 01:57 AM
There is also another global var added to this race which has its own section under all the other decelerations:

//TIMERS
new Handle:SpawnTimer[MAXPLAYERS+1];

This is for dealing with timers which require tracking to prevent errors or to ensure they get killed on demand. This is part of the timer handling system that does not exist in any of the races that I have not coded. The other parts of the system are explained below:


public OnPluginStart()
{
//Safe way to stop timers at end of round
HookEvent("round_end",RoundEnd);
}

public OnMapStart()
{
OnMapStart_UltBlockSound();

War3_PrecacheSound(ultimateSound);

//Reset Arrays
Array_Fill(SpawnTimer, MAXPLAYERS+1, INVALID_HANDLE);
}

public RoundEnd(Handle:event,const String:name[],bool:dontBroadcast)
{
//CLEAR TIMERS
LoopClearTimers();
}

public OnClientDisconnect(client)
{
ClearTimers(client);
}

//CLEAR TIMERS
ClearTimers(client)
{
CleanTimerCell(SpawnTimer, client);
}

In the above section of the Crypt Lord we see that firstly the method order follows a logical process to make it easy to read and reference. We can also see that there is a lot of automated handling to ensure that timers are tracked and destroyed correctly when needed. This is very important to prevent crashes. This is also all the code needed to ensure that a timer which must end when the round stops or the client spawns, dies ect does so without creating errors.

ZERO
10-21-2014, 01:58 AM
So here is the Original:

/**
* File: War3Source_CryptLord.sp
* Description: The Crypt Lord race for War3Source.
* Author(s): Anthony Iacono & Ownage | Ownz
*/

#pragma semicolon 1

#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include <sdktools>
#include <sdktools_functions>
#include <sdktools_tempents>
#include <sdktools_tempents_stocks>
#include <smlib>

new thisRaceID;

new SKILL_IMPALE,SKILL_SPIKE,SKILL_BEETLES,ULT_LOCUST;

//Increase length from 5 to 6

//skill 1
//Impale
new Float:ImpaleChanceArr[]={0.0,0.1,0.16,0.22,0.26,0.33};

//skill 2
//Spiked Carapace
//new Float:SpikeDamageRecieve[]={1.0,0.95,0.9,0.85,0.8,0.75};
//new Float:SpikeArmorGainArr[]={0.0,0.0,0.0,0.0,0.0,0.0};
new Float:SpikeChanceArr[]={0.0,0.2,0.25,0.3,0.35,0.4};
new Float:SpikeReturnDmgArr[]={0.0,0.1,0.13,0.15,0.17,0.2};
new ArmorArr[]={0,110,130,160,180,200};

//skill 3
//Carrion Beetles
new BeetleDamageArr[]={0,5,7,9,12,15};
new Float:BeetleChanceArr[]={0.0,0.2,0.25,0.28,0.3,0.33};

//ultimate
//Locust Swarm
new Handle:ultCooldownCvar;
new Handle:ultRangeCvar;
new const LocustDamage=25;
new const LocustMaxHealth=150;
new RemoveArmorArr[]={0,10,15,20,25,30};

new String:ultimateSound[]="war3source/locustswarmloop.wav";


public Plugin:myinfo =
{
name = "War3Source Race - Crypt LordZ",
author = "PimpinJuice & Ownz -ZERO <ibis>",
description = "The Crypt Lord race for War3Source.",
version = "2.0.0.5",
url = "http://Www.OwnageClan.Com"
};

public OnPluginStart()
{

ultCooldownCvar=CreateConVar("war3_crypt_locust_cooldown","20","Cooldown between ultimate usage");
ultRangeCvar=CreateConVar("war3_crypt_locust_range","800","Range of locust ultimate");

LoadTranslations("w3s.race.crypt.phrases");
}

public OnWar3LoadRaceOrItemOrdered(num)
{
if(num==80)
{


//Update levels from 4 to 5
thisRaceID=War3_CreateNewRaceT("crypt");
SKILL_IMPALE=War3_AddRaceSkill(thisRaceID,"Impale","Shake and push the enemy, 10-33% chance",false,5);
SKILL_SPIKE=War3_AddRaceSkill(thisRaceID,War3_GetG ame()==Game_CS?"SpikedCarapaceCS":"SpikedCarapaceTF","Get 110-200 armor on spawn, 20-40% chance to deal 10-20% mirror damage",false,5);
SKILL_BEETLES=War3_AddRaceSkill(thisRaceID,"CarrionBeetles","20-33% chance of your beetles attacking the enemy for 5-15 extra damage",false,5);
ULT_LOCUST=War3_AddRaceSkill(thisRaceID,"LocustSwarm","steals 25HP and 10-30 armor from one random enemy",true,5);
War3_CreateRaceEnd(thisRaceID);
}

}

public OnMapStart()
{

War3_PrecacheSound(ultimateSound);
}

public OnWar3PlayerAuthed(client)
{

}

public OnRaceChanged(client,oldrace,newrace)
{
if(oldrace==thisRaceID)
{
}
}

public OnWar3EventSpawn( client )
{
new race = War3_GetRace( client );
if( race == thisRaceID )
{
new skilllevel_spike = War3_GetSkillLevel( client, thisRaceID, SKILL_SPIKE );
if( skilllevel_spike > 0)
{
GivePlayerItem(client, "item_assaultsuit");
War3_SetCSArmor(client,ArmorArr[skilllevel_spike]);
}
}
}


public OnUltimateCommand(client,race,bool:pressed)
{

if(race==thisRaceID && pressed && ValidPlayer(client,true) )
{
new ult_level=War3_GetSkillLevel(client,race,ULT_LOCUS T);
if(ult_level>0)
{

if(!Silenced(client)&&War3_SkillNotInCooldown(client,thisRaceID,ULT_LOCU ST,true))
{
new Float:posVec[3];
GetClientAbsOrigin(client,posVec);
new Float:otherVec[3];
new Float:bestTargetDistance=999999.0;
new team = GetClientTeam(client);
new bestTarget=0;

new Float:ultmaxdistance=GetConVarFloat(ultRangeCvar);
for(new i=1;i<=MaxClients;i++)
{
if(ValidPlayer(i,true)&&GetClientTeam(i)!=team&&!W3HasImmunity(i,Immunity_Ultimates))
{
GetClientAbsOrigin(i,otherVec);
new Float:dist=GetVectorDistance(posVec,otherVec);
if(dist<bestTargetDistance&&dist<ultmaxdistance)
{
bestTarget=i;
bestTargetDistance=GetVectorDistance(posVec,otherV ec);

}
}
}
if(bestTarget==0)
{
PrintHintText(client,"%T","No Target Found within {amount} feet",client,ultmaxdistance/10);
}
else
{
//Locous Attack
//new damage=RoundFloat(float(War3_GetMaxHP(bestTarget)) *LocustDamagePercent[ult_level]);

new damage=LocustDamage;
if(damage>0)
{
//Damage Player
if(War3_DealDamage(bestTarget,damage,client,DMG_BU LLET,"locust")) //default magic
{
W3PrintSkillDmgHintConsole(bestTarget,client,War3_ GetWar3DamageDealt(),ULT_LOCUST);
W3FlashScreen(bestTarget,RGBA_COLOR_RED);

EmitSoundToAll(ultimateSound,client);
War3_CooldownMGR(client,GetConVarFloat(ultCooldown Cvar),thisRaceID,ULT_LOCUST,false,_);

//Armor Remove Part
if(War3_GetGame()==Game_CS)
{
new armor=War3_GetCSArmor(bestTarget);
new armor_subtract=RemoveArmorArr[ult_level];
new armor_new=armor-armor_subtract;
if(armor_new < 0)
{
armor_new=0;
}

War3_SetCSArmor(bestTarget,armor_new);


//Give armor and health to client

//Health
new old_health=GetClientHealth(client);
new max_health=LocustMaxHealth;
if(old_health<max_health)
{
SetEntityHealth(client,old_health+LocustDamage);
}

new givearmor=War3_GetCSArmor(client);
new givearmor_add=RemoveArmorArr[ult_level];
new givearmor_new=givearmor+givearmor_add;

War3_SetCSArmor(client,givearmor_new);

}

}
}
}
}
}
else
{
PrintHintText(client,"%T","Level Your Ultimate First",client);
}
}
}


//Removes damge as part of Spike ability, DISABLED
/*
public OnW3TakeDmgBullet(victim,attacker,Float:damage){
if(ValidPlayer(victim,true)&&ValidPlayer(attacker,true)&&GetClientTeam(victim)!=GetClientTeam(attacker))
{
if(War3_GetRace(victim)==thisRaceID)
{
new skill_level=War3_GetSkillLevel(victim,thisRaceID,S KILL_SPIKE);
if(skill_level>0&&!Hexed(victim,false))
{
War3_DamageModPercent(SpikeDamageRecieve[skill_level]);
}
}
}
}
*/

public OnWar3EventPostHurt(victim,attacker,damage)
{

if(W3GetDamageIsBullet()&&ValidPlayer(victim,true)&&ValidPlayer(attacker,true)&&GetClientTeam(victim)!=GetClientTeam(attacker))
{

if(War3_GetRace(victim)==thisRaceID)
{
//Spike Ability
new skill_level=War3_GetSkillLevel(victim,thisRaceID,S KILL_SPIKE);
if(skill_level>0&&!Hexed(victim,false))
{
if(!W3HasImmunity(attacker,Immunity_Skills)){

//Gives armor when attacked!? DISABLED
/*
if(War3_GetGame()==Game_CS)
{
new armor=War3_GetCSArmor(victim);
new armor_add=RoundFloat(damage*SpikeArmorGainArr[skill_level]);
if(armor_add>20) armor_add=20;
War3_SetCSArmor(victim,armor+armor_add);


}
*/


//Deal Damage back to attacker
if(Math_GetRandomFloat( 0.00, 1.00 ) <= SpikeChanceArr[skill_level])
{
new returndmg=RoundFloat(FloatMul(SpikeReturnDmgArr[skill_level],float(damage)));
War3_DealDamage(attacker,returndmg,victim,_,"spiked_carapace",W3DMGORIGIN_SKILL,W3DMGTYPE_PHYSICAL);
PrintToConsole(victim,"%T","Returned {amount} damage to {player}",victim,War3_GetWar3DamageDealt(),attacker);
PrintToConsole(attacker,"%T","Received {amount} damage from Spiked Carapace from {player}",attacker,War3_GetWar3DamageDealt(),victim);
}
}
}


//Impale Ability (when being attacked!?)
//skill_level = War3_GetSkillLevel(attacker,thisRaceID,SKILL_IMPAL E);
//if(skill_level>0&&!Hexed(victim,false)&&Math_GetRandomFloat(0.0,1.0)<=ImpaleChanceArr[skill_level])
//{
//if(W3HasImmunity(attacker,Immunity_Skills))
//{
//PrintHintText(attacker,"%T","Blocked Impale",attacker);
//PrintHintText(victim,"%T","Enemy Blocked Impale",victim);
//}
//else
//{
//War3_ShakeScreen(attacker,2.0,50.0,40.0);
//PrintHintText(victim,"%T","Impaled enemy",victim);
//PrintHintText(attacker,"%T","You got impaled by enemy",attacker);
//W3FlashScreen(attacker,{0,0,128,80});
//}
//}
}
if(War3_GetRace(attacker)==thisRaceID)
{
//Beetles ability
new skill_level = War3_GetSkillLevel(attacker,thisRaceID,SKILL_BEETL ES);
if(!Hexed(attacker,false)&&Math_GetRandomFloat(0.0,1.0)<=BeetleChanceArr[skill_level])
{
if(W3HasImmunity(victim,Immunity_Skills))
{
PrintHintText(victim,"%T","You blocked beetles attack",victim);
PrintHintText(attacker,"%T","Beetles attack was blocked",attacker);
}
else
{

War3_DealDamage(victim,BeetleDamageArr[skill_level],attacker,DMG_BULLET,"beetles");
W3PrintSkillDmgHintConsole(victim,attacker,War3_Ge tWar3DamageDealt(),SKILL_BEETLES);
W3FlashScreen(victim,RGBA_COLOR_RED);

}
}

//Impale ability
skill_level = War3_GetSkillLevel(attacker,thisRaceID,SKILL_IMPAL E);
if(skill_level>0&&!Hexed(attacker,false)&&Math_GetRandomFloat(0.0,1.0)<=ImpaleChanceArr[skill_level]) //spike always activates except chancemod reduction
{
if(W3HasImmunity(attacker,Immunity_Skills)){
PrintHintText(victim,"%T","Blocked Impale",victim);
PrintHintText(attacker,"%T","Enemy Blocked Impale",attacker);
}
else
{
War3_ShakeScreen(victim,2.0,50.0,40.0);
PrintHintText(victim,"%T","You got impaled by enemy",victim);
PrintHintText(attacker,"%T","Impaled enemy",attacker);
W3FlashScreen(victim,{0,0,128,80});
}
}
}
}
}

ZERO
10-21-2014, 02:07 AM
Here is the reprogrammed:
8859
Please note that in this reprogrammed version not 100% of the code is all mine. You can clearly see some lines where I have copy&pasted from the original as no changes to those parts of the code were needed. In some cases the same variable names were used as to make referencing to the original to ensure consistency in the effective operation of the program was maintained. Note that my name being listed as the only author is for internal use and is not intended to imply that all of the code contained within the program is 100% my original work.

For those of you that are interested I think you will be able to see by comparing the two versions how I have "optimized" the original plugin. Made it easier to read and modify as well as unify its code base so that it can be easily updated. You will also see many areas that get replaced with methods that did not exist in the original. Many of these methods are from the stock functions which are used by all the reprogrammed races. By ensuring 100% code consistency via those methods it is easy to make changes to all the races from 1 place when a universal error is found or when a new feature needs to be implemented.

CYBER
10-22-2014, 09:09 AM
im guessing "AbilityValue()" is a custom function from zerostocks that allows you to interpolate a % chance based on the min/max proc chances, the total race levels and current level?

yeah, i see a lot of optimizations under the assumptions that leveling the powers is more linear with your design as opposed to a more complex custom progression of levels.


keep posting those race codes zero, they were a good fun read to see the gears in motion for this race! (even though i tihnk crypt lord seems to be one of the easiest races to code compared to some other ones:S)

ZERO
10-22-2014, 12:33 PM
It is which also makes it easier to read for beginners. As far as the scaling goes it was always linear for all the races anyways.

ZERO
10-27-2014, 08:41 PM
1.0.8


Initial Release of reprogrammed version

ZERO
12-03-2014, 12:41 AM
1.0.9
Max health gain is now actually limited to 400hp

Masskid
01-09-2015, 10:52 PM
[Killer Info] (>'-')>Faded<('-'<) killed you with spiked_carapace at a distance of 17.2 meters and has -186 health and 10 Armor left


Crypt lord to op, plox nerf, bitch be killing with negative health

ZERO
01-13-2015, 12:08 AM
what!?