Author Topic: [Whacky, Knife Race, Finished] Stealth Assassin  (Read 5799 times)

[Oddity]TeacherCreature

  • Moderator
  • Sr. Member
  • *****
  • Posts: 467
    • View Profile
[Whacky, Knife Race, Finished] Stealth Assassin
« on: November 06, 2010, 09:41:22 AM »
Also know as NightHound in HoN
Stealth Assassin

Scurrilous rumors of unnatural parentage have haunted this proud, leonine warrior his entire life. He long served in the Beast Horde as a shadowy scout and assassin before taking on a comparable role in the new Legion. Wherever he came from, Night Hound is a welcome ally and a deadly foe.

Skills:
Smoke Screen (Ability)-Smoke silences and slows the enemies
Back Stab-Damage boost if you attack from behind
Perma Invis-Invis if ducking
Blink Strike (Ultimate)-Get behind a random enemy


The attached files are:
the main source for the race but it calls upon sounds
and the sounds which I have included in a zip, open the contents of the zip file and copy it right onto your root directory.
This race talks alot :)

ToDo:
Convert Back stab from random percent daamge to true daamge when behind
« Last Edit: April 05, 2011, 07:14:01 AM by [Oddity]TeacherCreature »

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #1 on: November 06, 2010, 11:18:21 AM »
its night hound in HON stealth assasin in DOTA, take ur pick

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #2 on: November 06, 2010, 11:59:09 AM »
This is also a race on my todo list. With the difference that I actually got the code for backstab extra damage and a smoke screen wich gives evasion in a AoE and has a nice effect...

[Oddity]TeacherCreature

  • Moderator
  • Sr. Member
  • *****
  • Posts: 467
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #3 on: November 06, 2010, 01:47:19 PM »
ouch my smoke screen has smoke effect and slows silences victim isntead of evade

back stab code is easy enough to get but i am adding races at a rate of 5 or 6 per week which with my time schedule doesnt permit a ton of coding time... perhaps you would like to use mine as starters and update it - then you can add authorship i dotn care about that and we will ahve a nice hybrid
and I ahve provided all the sounds already

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #4 on: November 06, 2010, 10:17:24 PM »
Doesn't work on TF2 since TF2 has no weapon_fire event.

Quote
L 11/07/2010 - 05:13:44: [SM] Native "HookEvent" reported: Game event "weapon_fire" does not exist
L 11/07/2010 - 05:13:44: [SM] Displaying call stack trace for plugin "War3Source_049_StealthAssassin.smx":
L 11/07/2010 - 05:13:44: [SM]  
  •  Line 56, War3Source_049_StealthAssassin.sp::OnPluginStart()
There's no real way around this. CalcAttackIsCritical can act as a substitute but is not fired on nocrit servers.

[Oddity]TeacherCreature

  • Moderator
  • Sr. Member
  • *****
  • Posts: 467
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #5 on: November 06, 2010, 10:58:28 PM »
TF2 doesnt have an event for attack or weapon fire? that is nuts

but if u remove that whole block u would be ok since the weapon fire is really jsut to remove invisible since in the past the knfie was invisible too

now that the knfie can be seen that sint even necessary
« Last Edit: November 06, 2010, 11:00:11 PM by [Oddity]TeacherCreature »

Crazy-acm

  • Newbie
  • *
  • Posts: 39
  • STEAMWorld admin
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #6 on: March 18, 2011, 03:11:24 AM »
using 1.2.0.7, compile error:
War3Source_StealthAssassin.sp(57) : warning 204: symbol is a value that is never used: "ultCooldownCvar"

nvn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #7 on: March 18, 2011, 05:33:49 AM »
Btw smoke cloud is flying away, is it like u whant it to be?


hitmany

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #8 on: June 13, 2011, 04:46:19 AM »
where is source file?

loversama

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #9 on: July 23, 2013, 01:51:41 AM »
I'd also like to see the source file ^____^

thanks in advance.

joshtrav

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #10 on: July 23, 2013, 05:15:31 PM »
Won't be perfect... Just for reference in the future: http://godtony.mooo.com/lysis/

I would suggest using it on all compiled races.  Folks are known for putting up admin back doors in their addons/races.  I have heard TC was one of them (never saw any proof).  I know for certain that Holliday from the ES side was known for putting in back doors in his admin plugin for self admin/rcon, etc.

Code: [Select]
public PlVers:__version =
{
version = 5,
filevers = "1.3.4-dev",
date = "03/24/2011",
time = "09:35:47"
};
new Float:NULL_VECTOR[3];
new String:NULL_STRING[4];
public Extension:__ext_core =
{
name = "Core",
file = "core",
autoload = 0,
required = 0,
};
new MaxClients;
public Extension:__ext_sdktools =
{
name = "SDKTools",
file = "sdktools.ext",
autoload = 1,
required = 1,
};
new String:CTagCode[6][16];
new bool:CSkipList[65];
new bool:CTagReqSayText2[6];
new bool:CEventIsHooked;
new String:CTag[6][0];
new bool:CProfile_Colors[6] =
{
1, 1, 0, 0, 0, 0
};
new CProfile_TeamIndex[6] =
{
-1, ...
};
new bool:CProfile_SayText2;
new String:interfaceVersion[8] = "1.1.8";
new MaxBuffLoopLimit = 774975025;
new String:zzname[32] = "sdkhooks";
public Extension:__ext_sdkhooks =
{
name = "sdkhooks",
file = "sdkhooks.ext",
autoload = 1,
required = 1,
};
public Plugin:myinfo =
{
name = "War3Source Race - Stealth Assassin",
description = "The stealth assassin race for War3Source.",
author = "TeacherCreature",
version = "1.0.7.6",
url = "http://war3source.com"
};
new thisRaceID;
new g_offsCollisionGroup;
new smokesprite;
new bool:bSmoking[66];
new Float:StabChance[7] =
{
0, 1045220557, 1048576000, 1050253722, 1051931443, 1053609165, 1055286886
};
new BackstabDmg[7] =
{
0, 15, 20, 25, 30, 35, 40
};
new bool:bDucking[66];
new InvisTimer[7] =
{
50, 25, 23, 21, 19, 17, 15
};
new DuckTime[66];
new Float:BlinkstrikeCD[7] =
{
0, 1108082688, 1106247680, 1103626240, 1101004800, 1097859072, 1092616192
};
new String:UltimateSound[36] = "war3source/stealth/ability_02_1.mp3";
new Float:pOsition[3];
new String:Spawn1Sound[32] = "war3source/stealth/attack_1.mp3";
new String:Spawn2Sound[32] = "war3source/stealth/attack_2.mp3";
new String:Spawn3Sound[32] = "war3source/stealth/attack_3.mp3";
new String:AlertSound[36] = "war3source/stealth/taunt_prior.mp3";
new String:TauntSound[36] = "war3source/stealth/taunt_after.mp3";
new String:SmokeSound[36] = "war3source/stealth/ability_01.mp3";
new SKILL_SMOKE;
new SKILL_INVIS;
new SKILL_STAB;
new ULT_ASSASSINATION;
public __ext_core_SetNTVOptional()
{
MarkNativeAsOptional("GetFeatureStatus");
MarkNativeAsOptional("RequireFeature");
MarkNativeAsOptional("AddCommandListener");
MarkNativeAsOptional("RemoveCommandListener");
VerifyCoreVersion();
return 0;
}

Float:operator+(Float:,_:)(Float:oper1, oper2)
{
return oper1 + float(oper2);
}

Float:operator-(Float:,_:)(Float:oper1, oper2)
{
return oper1 - float(oper2);
}

bool:operator<(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) < 0;
}

bool:operator<=(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) <= 0;
}

bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive)
{
return strcmp(str1, str2, caseSensitive) == 0;
}

EmitSoundToAll(String:sample[], entity, channel, level, flags, Float:volume, pitch, speakerentity, Float:origin[3], Float:dir[3], bool:updatePos, Float:soundtime)
{
new clients[MaxClients];
new total;
new i = 1;
while (i <= MaxClients)
{
if (IsClientInGame(i))
{
total++;
clients[total] = i;
i++;
}
i++;
}
if (!total)
{
return 0;
}
EmitSound(clients, total, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
return 0;
}

AddFileToDownloadsTable(String:filename[])
{
static table = -1;
if (table == -1)
{
table = FindStringTable("downloadables");
}
new bool:save = LockStringTables(false);
AddToStringTable(table, filename, "", -1);
LockStringTables(save);
return 0;
}

TE_SetupSmoke(Float:pos[3], Model, Float:Scale, FrameRate)
{
TE_Start("Smoke");
TE_WriteVector("m_vecOrigin", pos);
TE_WriteNum("m_nModelIndex", Model);
TE_WriteFloat("m_fScale", Scale);
TE_WriteNum("m_nFrameRate", FrameRate);
return 0;
}

CSetupProfile()
{
decl String:szGameName[32];
GetGameFolderName(szGameName, 30);
if (StrEqual(szGameName, "cstrike", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[2] = 0;
CProfile_TeamIndex[3] = 2;
CProfile_TeamIndex[4] = 3;
CProfile_SayText2 = 1;
}
else
{
if (StrEqual(szGameName, "tf", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[2] = 0;
CProfile_TeamIndex[3] = 2;
CProfile_TeamIndex[4] = 3;
CProfile_SayText2 = 1;
}
if (StrEqual(szGameName, "left4dead", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[2] = 0;
CProfile_TeamIndex[3] = 3;
CProfile_TeamIndex[4] = 2;
CProfile_SayText2 = 1;
}
if (StrEqual(szGameName, "hl2mp", false))
{
if (GetConVarBool(FindConVar("mp_teamplay")))
{
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[3] = 3;
CProfile_TeamIndex[4] = 2;
CProfile_SayText2 = 1;
}
else
{
CProfile_SayText2 = 0;
CProfile_Colors[5] = 1;
}
}
if (StrEqual(szGameName, "dod", false))
{
CProfile_Colors[5] = 1;
CProfile_SayText2 = 0;
}
if (GetUserMessageId("SayText2") == -1)
{
CProfile_SayText2 = 0;
}
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_TeamIndex[3] = 2;
CProfile_TeamIndex[4] = 3;
CProfile_SayText2 = 1;
}
return 0;
}

public Action:CEvent_MapStart(Handle:event, String:name[], bool:dontBroadcast)
{
CSetupProfile();
new i = 1;
while (i <= MaxClients)
{
CTagCode[i] = 0;
i++;
}
return Action:0;
}

public War3InterfaceExec()
{
LoadTranslations("w3s._common.phrases");
return 0;
}

public zzOnPluginEnd()
{
new String:name[64];
new Handle:plugin = GetMyHandle();
GetPluginFilename(plugin, name, 64);
PrintToServer("[War3Source] OnPluginEnd %s", name);
return 0;
}

bool:ValidPlayer(client, bool:check_alive)
{
if (client > 0)
{
if (check_alive)
{
return false;
}
return true;
}
return false;
}

bool:Stunned(client)
{
return W3GetBuffHasTrue(client, W3Buff:18);
}

/* ERROR! Unable to cast object of type 'Lysis.LDebugBreak' to type 'Lysis.LConstant'. */
 function "Silenced" (number 15)

/* ERROR! Unable to cast object of type 'Lysis.LDebugBreak' to type 'Lysis.LConstant'. */
 function "Hexed" (number 16)

public War3FailedSignal(String:str[])
{
W3LogError(str);
SetFailState(str);
return 0;
}

public CheckWar3Compatability(String:w3mainInterfVersion[])
{
if (!StrEqual(interfaceVersion, w3mainInterfVersion, true))
{
W3LogError("FATAL ERROR, PLUGIN COMPILED INTERFACE VERSION (%s) IS DIFFERENT FROM WAR3SOURCE BASE VERSION (%s). Please Compile With Latest Version!!!", interfaceVersion, w3mainInterfVersion);
SetFailState("FATAL ERROR, PLUGIN COMPILED INTERFACE VERSION (%s) IS DIFFERENT FROM WAR3SOURCE BASE VERSION (%s). Please Compile With Latest Version!!!", interfaceVersion, w3mainInterfVersion);
}
return 0;
}

bool:IS_PLAYER(x)
{
if (x > 0)
{
return true;
}
return false;
}

bool:War3_PrecacheSound(String:sound[])
{
new String:longsound[512];
Format(longsound, 512, "sound/%s", sound);
AddFileToDownloadsTable(longsound);
if (PrecacheSound(sound, true))
{
return true;
}
PrintToServer("Fail War3_PrecacheSound %s", longsound);
return false;
}

bool:W3HasImmunity(client, War3Immunity:immunityindex)
{
if (immunityindex == War3Immunity:5)
{
return W3GetBuffHasTrue(client, W3Buff:15);
}
if (immunityindex == War3Immunity:1)
{
return W3GetBuffHasTrue(client, W3Buff:16);
}
return false;
}

public OnPluginStart()
{
g_offsCollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
CreateTimer(0.1, CalcVis, any:0, 1);
CreateTimer(0.1, Smoker, any:0, 1);
return 0;
}

public Action:Smoker(Handle:timer, userid)
{
new x;
while (x < MaxClients)
{
if (ValidPlayer(x, true))
{
new smoke_level = War3_GetSkillLevel(x, thisRaceID, SKILL_SMOKE);
if (smoke_level > 0)
{
new players;
new targets[66];
new i = 1;
while (i <= MaxClients)
{
if (ValidPlayer(i, true))
{
targets[players] = i;
players++;
i++;
}
i++;
}
new Float:SavePos[3] = 0;
new Float:EffPos[3] = 0;
GetClientAbsOrigin(x, SavePos);
GetClientAbsOrigin(x, EffPos);
EffPos[0] = EffPos[0][100];
TE_SetupSmoke(EffPos, smokesprite, 1000, 1);
TE_Send(targets, players, 0);
EffPos[0] = EffPos[0] - 100;
var5 = var5[100];
TE_SetupSmoke(EffPos, smokesprite, 1000, 1);
TE_Send(targets, players, 0);
EffPos[1] -= 100;
EffPos[0] = EffPos[0] - 100;
TE_SetupSmoke(EffPos, smokesprite, 1000, 1);
TE_Send(targets, players, 0);
EffPos[1] -= 100;
EffPos[0] = EffPos[0][100];
TE_SetupSmoke(EffPos, smokesprite, 1000, 1);
TE_Send(targets, players, 0);
new y;
while (y < MaxClients)
{
if (ValidPlayer(y, true))
{
new Float:targpos[3] = 0;
GetClientAbsOrigin(y, targpos);
if (GetVectorDistance(SavePos, targpos, false) < 1132068864)
{
War3_SetBuff(y, W3Buff:13, thisRaceID, any:1061997773);
War3_SetBuff(y, W3Buff:17, thisRaceID, any:1061997773);
War3_SetBuff(y, W3Buff:21, thisRaceID, any:1);
CreateTimer(1, norm, y, 0);
y++;
}
y++;
}
y++;
}
x++;
}
x++;
}
x++;
}
return Action:0;
}

public Action:norm(Handle:timer, client)
{
if (ValidPlayer(client, false))
{
War3_SetBuff(client, W3Buff:13, thisRaceID, any:1065353216);
War3_SetBuff(client, W3Buff:17, thisRaceID, any:1065353216);
War3_SetBuff(client, W3Buff:21, thisRaceID, any:0);
}
return Action:0;
}

public Action:CalcVis(Handle:timer, userid)
{
new i;
while (i < MaxClients)
{
if (ValidPlayer(i, false))
{
new invis_level = War3_GetSkillLevel(i, thisRaceID, SKILL_INVIS);
if (0 < invis_level)
{
if (bDucking[i][0][0])
{
DuckTime[i]++;
if (InvisTimer[invis_level][0][0] <= DuckTime[i][0][0])
{
War3_SetBuff(i, W3Buff:5, thisRaceID, any:0);
i++;
}
else
{
War3_SetBuff(i, W3Buff:5, thisRaceID, any:1065353216);
i++;
}
i++;
}
else
{
DuckTime[i] = 0;
War3_SetBuff(i, W3Buff:5, thisRaceID, any:1065353216);
i++;
}
i++;
}
else
{
War3_SetBuff(i, W3Buff:5, thisRaceID, any:1065353216);
i++;
}
i++;
}
i++;
}
return Action:0;
}

public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (ValidPlayer(client, false))
{
if (buttons & 4)
{
var2 = 1;
}
else
{
var2 = 0;
}
bDucking[client] = var2;
}
return Action:0;
}

public OnWar3LoadRaceOrItemOrdered(num)
{
if (num == 49)
{
thisRaceID = War3_CreateNewRace("Stealth Assassin", "stealth");
SKILL_SMOKE = War3_AddRaceSkill(thisRaceID, "Smoke Screen(ability)", "Smoke silences and slows enemies", false, 6);
SKILL_STAB = War3_AddRaceSkill(thisRaceID, "Back Stab(attack)", "Damage Boost if you attack from behind", false, 6);
SKILL_INVIS = War3_AddRaceSkill(thisRaceID, "Perma Invis(crouch)", "Invis if ducking", false, 6);
ULT_ASSASSINATION = War3_AddRaceSkill(thisRaceID, "Blink Strike", "Get behind a random enemy", true, 6);
War3_CreateRaceEnd(thisRaceID);
}
return 0;
}

public OnMapStart()
{
War3_PrecacheSound(UltimateSound);
War3_PrecacheSound(Spawn1Sound);
War3_PrecacheSound(Spawn2Sound);
War3_PrecacheSound(Spawn3Sound);
War3_PrecacheSound(TauntSound);
War3_PrecacheSound(AlertSound);
War3_PrecacheSound(SmokeSound);
smokesprite = PrecacheModel("sprites/smoke.vmt", false);
return 0;
}

public OnAbilityCommand(client, ability, bool:pressed)
{
if (thisRaceID == War3_GetRace(client))
{
if (!Silenced(client, 1))
{
new smoke_level = War3_GetSkillLevel(client, thisRaceID, SKILL_SMOKE);
if (0 < smoke_level)
{
if (War3_SkillNotInCooldown(client, thisRaceID, SKILL_SMOKE, true))
{
War3_CooldownMGR(client, 10, thisRaceID, SKILL_SMOKE, true, true, true, "Smoke Screen");
bSmoking[client] = 1;
EmitSoundToAll(SmokeSound, client, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
CreateTimer(5, nosmoke, client, 0);
}
}
else
{
PrintHintText(client, "Level Smoke Screen first");
}
}
PrintHintText(client, "Silenced");
}
return 0;
}

public Action:nosmoke(Handle:timer, client)
{
if (ValidPlayer(client, false))
{
bSmoking[client] = 0;
}
return Action:0;
}

public OnWar3EventDeath(victim, attacker)
{
if (thisRaceID == War3_GetRace(attacker))
{
EmitSoundToAll(TauntSound, attacker, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
}
return 0;
}

public OnW3TakeDmgBullet(victim, attacker, Float:damage)
{
if (IS_PLAYER(victim))
{
new vteam = GetClientTeam(victim);
new ateam = GetClientTeam(attacker);
if (ateam != vteam)
{
new race_attacker = War3_GetRace(attacker);
if (thisRaceID == race_attacker)
{
new skill_level = War3_GetSkillLevel(attacker, thisRaceID, SKILL_STAB);
if (0 < skill_level)
{
if (!Hexed(attacker, 1))
{
if (GetRandomFloat(0, 1) <= StabChance[skill_level][0][0])
{
War3_DealDamage(victim, BackstabDmg[skill_level][0][0], attacker, 0, "BackStab", War3DamageOrigin:1, War3DamageType:1, true, false);
}
}
}
}
}
}
return 0;
}

public OnUltimateCommand(client, race, bool:pressed)
{
if (thisRaceID == race)
{
if (!Silenced(client, 1))
{
new ult_level = War3_GetSkillLevel(client, thisRaceID, ULT_ASSASSINATION);
if (0 < ult_level)
{
if (War3_SkillNotInCooldown(client, thisRaceID, ULT_ASSASSINATION, true))
{
new Float:posVec[3] = 0;
GetClientAbsOrigin(client, posVec);
new Float:otherVec[3] = 0;
new Float:bestTargetDistance = 1000;
new team = GetClientTeam(client);
new bestTarget;
new i = 1;
while (i <= MaxClients)
{
if (ValidPlayer(i, true))
{
GetClientAbsOrigin(i, otherVec);
new Float:dist = GetVectorDistance(posVec, otherVec, false);
if (dist < bestTargetDistance)
{
bestTarget = i;
bestTargetDistance = GetVectorDistance(posVec, otherVec, false);
i++;
}
i++;
}
i++;
}
if (0 < bestTarget)
{
War3_CachedPosition(bestTarget, pOsition);
TeleportEntity(client, pOsition, NULL_VECTOR, NULL_VECTOR);
SetEntData(bestTarget, g_offsCollisionGroup, any:2, 4, true);
SetEntData(client, g_offsCollisionGroup, any:2, 4, true);
CreateTimer(2, normal, client, 0);
SetEntData(bestTarget, g_offsCollisionGroup, any:2, 4, true);
CreateTimer(2, normal, bestTarget, 0);
EmitSoundToAll(AlertSound, bestTarget, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
EmitSoundToAll(UltimateSound, client, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
War3_CooldownMGR(client, BlinkstrikeCD[ult_level][0][0], thisRaceID, ULT_ASSASSINATION, true, true, true, "Assasination");
}
else
{
PrintHintText(client, "No Target Found Within Range");
}
}
}
else
{
PrintHintText(client, "Level Your Ultimate First");
}
}
PrintHintText(client, "SILENCED");
}
return 0;
}

public Action:normal(Handle:timer, client)
{
if (ValidPlayer(client, true))
{
new Float:end_dist = 40;
new Float:end_pos[3] = 0;
GetClientAbsOrigin(client, end_pos);
new i = 1;
while (i <= MaxClients)
{
if (ValidPlayer(i, true))
{
new Float:pos[3] = 0;
GetClientAbsOrigin(i, pos);
new Float:dist = GetVectorDistance(end_pos, pos, false);
if (dist <= end_dist)
{
CreateTimer(0.5, normal, client, 0);
}
SetEntData(client, g_offsCollisionGroup, any:5, 4, true);
i++;
}
i++;
}
}
return Action:0;
}

public OnRaceSelected(client, newrace)
{
if (thisRaceID != newrace)
{
War3_SetBuff(client, W3Buff:9, thisRaceID, any:0);
War3_WeaponRestrictTo(client, thisRaceID, "", 1);
War3_SetBuff(client, W3Buff:5, thisRaceID, any:1065353216);
}
if (thisRaceID == newrace)
{
War3_WeaponRestrictTo(client, thisRaceID, "weapon_knife", 1);
War3_SetBuff(client, W3Buff:9, thisRaceID, any:1);
if (ValidPlayer(client, true))
{
CreateTimer(0.1, Equip, client, 0);
}
}
return 0;
}

public Action:Equip(Handle:t, client)
{
if (ValidPlayer(client, true))
{
GivePlayerItem(client, "weapon_knife", 0);
}
return Action:0;
}

public OnWar3EventSpawn(client)
{
War3_SetBuff(client, W3Buff:13, thisRaceID, any:1065353216);
War3_SetBuff(client, W3Buff:17, thisRaceID, any:1065353216);
War3_SetBuff(client, W3Buff:21, thisRaceID, any:0);
new race = War3_GetRace(client);
if (thisRaceID == race)
{
DuckTime[client] = 0;
bSmoking[client] = 0;
new DICE = GetRandomInt(1, 3);
if (DICE == 1)
{
EmitSoundToAll(Spawn1Sound, client, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
}
if (DICE == 2)
{
EmitSoundToAll(Spawn2Sound, client, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
}
if (DICE == 3)
{
EmitSoundToAll(Spawn3Sound, client, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
}
if (0 < GetPlayerWeaponSlot(client, 2))
{
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 2));
}
CreateTimer(0.1, Equip, client, 0);
}
return 0;
}
« Last Edit: July 23, 2013, 05:17:36 PM by joshtrav »


Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #11 on: July 23, 2013, 05:43:56 PM »
The race itself isn't complex at all, you could just piece it together from other races if you really want it.

mentaldepth

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Email
Re: [Whacky, Knife Race, Finished] Stealth Assassin
« Reply #12 on: August 31, 2013, 08:35:53 AM »
Does this work on csgo? I tried to load it couldn't see it in the list of races.