Ok few things for the race, the ultimate does not have a duration level 1 and level 4 last same amount of time... It is a glitch with flashscreen effect u can use original sourcemod screen or use an overlay. also ultimate should respect ultimate immunity and i dont see a check for that anywhere
The slow down and ultiamte have effects that only work in TF2 and not CS why not choose game shared sprites.
i can share a version buti dont have a decay buff i use a dif version or hint engine for that matter so i can share my version but it would be different.
I tried to hint out most of the shit i took out so u can readd it......
ALSO i meant share the code not the model i cna post that but the code wont work for most of ur users and i hate to mess tehir heads up or cause them to crash
I also made skilsl go to level 8 for u guys rather than 4... on my server ucan level ar ace to level 9999 if u choose to but i know many of urs cant go past capso this raises a cap in my opinion.. I didnt add to author i dont think i deserve to so feel free to edit.
-ps not respecting ulti immunity is a nono for package and i thought by interface compliant it meant for both games.. IT SHOULD!! anyway this is not negative ti is a chacne to improve.... the only reason thsi wasnt cs compatible really was some bs sprite choices... just choose sprites on both and get rid of the particle shit and eitehr use particle system form level addon or use other effects like i used bubble effect here.... It gives similiar effect i would think and it makes it work for everyone
#pragma semicolon 1 ///WE RECOMMEND THE SEMICOLON
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include "W3SIncs/War3Source_Effects"
new thisRaceID;
public Plugin:myinfo =
{
name = "Race - Dark Elf",
author = "Smilax & Glider helped a lot :D",
description = "The Dark Elf race for War3Source.",
version = "1.0.0.0",
url = "http://cgaclan.com/"
};
new SKILL_FADE,SKILL_SLOWFALL,SKILL_TRIBUNAL,ULTIMATE_DARKORB;
new bool:bDecay[66];
new Float:FadeChance[9]={0.0,0.05,0.07, 0.09, 0.11, 0.13, 0.15, 0.17, 0.2}; //done
new Float:SlowfallGravity[9]={1.0, 0.75, 0.70, 0.65, 0.60, 0.55, 0.5, 0.45, 0.4}; //probably too much overhead lololol oh god
new Float:TribunalDecay[9]={0.0,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8}; //simple
new TCDecay[9]={0,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8};
new Float:TribunalSpeed[9]={1.0, 1.3, 1.38, 1.45, 1.52, 1.59, 1.66, 1.73, 1.8}; //simple
new Float:TribunalDuration=3.5;
new Float:TribunalCooldownTime=15.0;
new Float:DarkorbDistance=1000.0;
new Float:DarkorbDuration[9]={0.0,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2};
new Float:DarkorbCooldownTime=10.0;
new Float:darkvec[3]={0.0,0.0,0.0};
new Float:prevdarkvec[3]={0.0,0.0,0.0};
new Float:victimvec[3]={0.0,0.0,0.0};
// Sounds
new String:tribunal[]="war3source/darkelf/tribunal.mp3";
new String:darkorb[]="war3source/darkelf/darkorb.mp3";
//effects
new g_ef_muzzleflashX, g_ef_animglow;
public OnWar3PluginReady(){
thisRaceID=War3_CreateNewRace("[Beta]DarkElf","darkelf");
SKILL_FADE=War3_AddRaceSkill(thisRaceID,"Fade(auto-cast)","You fade out of site on hit",false,8);
SKILL_SLOWFALL=War3_AddRaceSkill(thisRaceID,"SlowFall(passive)","You fall a lot slower",false,8);
SKILL_TRIBUNAL=War3_AddRaceSkill(thisRaceID,"Tribunal(+ability)","At the cost of life, you speed up",false,8);
ULTIMATE_DARKORB=War3_AddRaceSkill(thisRaceID,"DarkOrb","Blind a player",true,8);
War3_CreateRaceEnd(thisRaceID);
}
public OnPluginStart()
{
CreateTimer(0.1,SlowfallTimer,_,TIMER_REPEAT);
CreateTimer(1.0,Decayer,_,TIMER_REPEAT);
}
new FallSprite,GhostSprite;
public OnMapStart()
{
g_ef_animglow = PrecacheModel ("materials/sprites/animglow01.vmt");
g_ef_muzzleflashX = PrecacheModel ("materials/effects/muzzleflashX.vmt");
FallSprite=PrecacheModel("materials/effects/blueflare1.vmt");
GhostSprite=PrecacheModel("materials/effects/blueblackflash.vmt");
War3_PrecacheSound(tribunal);
War3_PrecacheSound(darkorb);
}
public OnUltimateCommand(client,race,bool:pressed)
{
new userid=GetClientUserId(client);
if(race==thisRaceID && pressed && userid>1 && IsPlayerAlive(client) )
{
new ult_level=War3_GetSkillLevel(client,race,ULTIMATE_DARKORB);
if(ult_level>0)
{
if(!Silenced(client)&&War3_SkillNotInCooldown(client,thisRaceID,ULTIMATE_DARKORB,true))
{
//War3_GetTargetInViewCone(client,Float:max_distance=0.0,bool:include_friendlys=false,Float:cone_angle=23.0,Function:FilterFunction=INVALID_FUNCTION);
new target = War3_GetTargetInViewCone(client,DarkorbDistance,false,23.0,DarkorbFilter);
new Float:duration = DarkorbDuration[ult_level];
if(target>0 && !W3HasImmunity(target,Immunity_Ultimates)){
GetClientAbsOrigin(target,victimvec);
//W3FlashScreen(target,RGBA_COLOR_BLACK,duration,0.5,FFADE_OUT); RGBA_COLOR_etc doesn't work.
ClientCommand(target, "r_screenoverlay effects/tp_eyefx/tp_eyefx.vmt");
War3_ShakeScreen(target,0.2,10.0,10.0);
new Float:position[3];
GetClientAbsOrigin(target, position);
position[2]+=40;
TE_SetupGlowSprite(position, g_ef_muzzleflashX, 1.00, 0.30, 255);
TE_SetupGlowSprite(position, g_ef_animglow, 1.00, 0.50, 255);
CreateTimer(duration,unvis,target);
EmitSoundToAll(darkorb,target);
EmitSoundToAll(darkorb,target);
new Float:effectVector1[3];
GetClientAbsOrigin(target,effectVector1);
decl Float:effectVector2[3];
GetClientEyePosition(target,effectVector2);
effectVector2[2] -= 22.0;
for(new reptimes=0;reptimes<=5;reptimes++){
TE_SetupBubbles(effectVector1,effectVector2,100.0,GhostSprite,10,40.0);
TE_SendToAll();
}
//AttachThrowAwayParticle(target, "ghost_smoke", victimvec, "", duration);
War3_CooldownMGR(client,DarkorbCooldownTime,thisRaceID,ULTIMATE_DARKORB,_,_);
//W3Hint(target,HINT_COOLDOWN_NOTREADY,5.0,"You've been blinded by a Dark Elf!");
//W3Hint(client,HINT_COOLDOWN_NOTREADY,5.0,"DarkOrb blinded Successfully");
}
}
}
}
}
public bool:DarkorbFilter(client)
{
return (!W3HasImmunity(client,Immunity_Ultimates));
}
public OnW3TakeDmgBullet(victim,attacker,Float:damage)
{
if(IS_PLAYER(victim)&&IS_PLAYER(attacker)&&victim>0&&attacker>0&&attacker!=victim)
{
new vteam=GetClientTeam(victim);
new ateam=GetClientTeam(attacker);
if(vteam!=ateam)
{
new race_victim=War3_GetRace(victim);
if(race_victim==thisRaceID)
{
new skill_level_fade=War3_GetSkillLevel(victim,thisRaceID,SKILL_FADE);
if( skill_level_fade>0 &&!Hexed(victim,false) && GetRandomFloat(0.0,1.0)<=FadeChance[skill_level_fade] && !W3HasImmunity(attacker,Immunity_Skills))
{
W3FlashScreen(victim,{244,244,244,50},0.2,0.2,FFADE_OUT);
War3_SetBuff(victim,fInvisibilitySkill,thisRaceID,0.05);
CreateTimer(1.2,FadeTimer,victim);
}
}
}
}
}
public Action:unvis(Handle:timer,any:victim)
{
if(ValidPlayer(victim)){
ClientCommand(victim, "r_screenoverlay 0");
}
}
public Action:FadeTimer(Handle:timer,any:victim)
{
if(ValidPlayer(victim)){
War3_SetBuff(victim,fInvisibilitySkill,thisRaceID,1.0);
W3SetPlayerColor(victim,thisRaceID,40,40,40,240);
}
}
public OnAbilityCommand(client,ability,bool:pressed)
{
if(War3_GetRace(client)==thisRaceID && ability==0 && pressed && IsPlayerAlive(client))
{
new skilllvl = War3_GetSkillLevel(client,thisRaceID,SKILL_TRIBUNAL);
if(skilllvl > 0)
{
new Float:speed = TribunalSpeed[skilllvl];
new Float:decay = TribunalDecay[skilllvl];
if(!Silenced(client)&&War3_SkillNotInCooldown(client,thisRaceID,SKILL_TRIBUNAL,true))
{ //W3SetPlayerColor(client,raceid,r,g,b,a=255,overridepriority=GLOW_DEFAULT)
//W3SetPlayerColor(client,thisRaceID,128,0,128,255); //purple:D not sure if works
EmitSoundToAll(tribunal,client);
War3_SetBuff(client,fMaxSpeed,thisRaceID,speed);
bDecay[client]=true;
//War3_SetBuff(client,fHPDecay,thisRaceID,decay);
CreateTimer(TribunalDuration,TribunalTimer,client);
//W3Hint(client,HINT_COOLDOWN_NOTREADY,5.0,"You sacrificed for speed.");
War3_CooldownMGR(client,TribunalCooldownTime,thisRaceID,SKILL_TRIBUNAL,_,_);
}
}
}
}
public Action:TribunalTimer(Handle:timer,any:client)
{
War3_SetBuff(client,fMaxSpeed,thisRaceID,1.0);
bDecay[client]=false;
//War3_SetBuff(client,fHPDecay,thisRaceID,0.0);
W3ResetPlayerColor(client,thisRaceID);
}
public Action:Decayer(Handle:timer,any:client)
{
for(new client1=1; client1 <= MaxClients; client1++)
{
if(ValidPlayer(client1, true))
{
if(War3_GetRace(client1) == thisRaceID)
{
new level=War3_GetSkillLevel(client1,thisRaceID,SKILL_TRIBUNAL);
if(bDecay[client1]){
War3_DecreaseHP(client1,TCDecay[level]);
}
}
}
}
}
public Action:SlowfallTimer(Handle:timer,any:client)
{
for(new client1=1; client1 <= MaxClients; client1++) {
if(ValidPlayer(client1,true)) {
if(War3_GetRace(client1)==thisRaceID){
GetClientAbsOrigin(client1,prevdarkvec);
CreateTimer(0.1,Slowfall2Timer,client1);
}
}
}
}
public Action:Slowfall2Timer(Handle:timer,any:client)
{
GetClientAbsOrigin(client,darkvec);
new flags = GetEntityFlags(client);
if (!(flags & FL_ONGROUND)){
if (darkvec[2]<prevdarkvec[2]){
new skilllevel_levi=War3_GetSkillLevel(client,thisRaceID,SKILL_SLOWFALL);
new Float:gravity=SlowfallGravity[skilllevel_levi];
War3_SetBuff(client,fLowGravitySkill,thisRaceID,gravity);
new Float:effectVector1[3];
GetClientAbsOrigin(client,effectVector1);
decl Float:effectVector2[3];
GetClientEyePosition(client,effectVector2);
effectVector2[2] -= 22.0;
for(new reptimes=0;reptimes<=5;reptimes++){
TE_SetupBubbles(effectVector1,effectVector2,100.0,FallSprite,10,40.0);
TE_SendToAll();
}
//AttachThrowAwayParticle(client, "teleporter_blue_entrance", darkvec, "", 1.0);
}
else{
War3_SetBuff(client,fLowGravitySkill,thisRaceID,1.0);
//previousvec[2]=vec[2];
}
}
}
stock TE_SetupBubbles(Float:startposi[3],Float:finalposi[3],Float:fHeight,nModelIndex,nCount,Float:fSpeed)
{
TE_Start("Bubbles");
TE_WriteVector("m_vecMins", startposi);
TE_WriteVector("m_vecMaxs", finalposi);
TE_WriteFloat("m_fHeight", fHeight);
TE_WriteNum("m_nModelIndex", nModelIndex);
TE_WriteNum("m_nCount", nCount);
TE_WriteFloat("m_fSpeed", fSpeed);
}
public OnRaceSelected(client,newrace)
{
if(newrace!=thisRaceID){
War3_SetBuff(client,fLowGravitySkill,thisRaceID,1.0);
War3_SetBuff(client,fInvisibilitySkill,thisRaceID,1.0);
W3ResetPlayerColor(client,thisRaceID);
War3_SetBuff(client,fMaxSpeed,thisRaceID,1.0);
bDecay[client]=false;
//War3_SetBuff(client,fHPDecay,thisRaceID,0.0);
}
if(newrace==thisRaceID){
CreateTimer(0.5,equip,client);
}
}
public OnWar3EventSpawn(client)
{
new race=War3_GetRace(client);
if(race==thisRaceID){
CreateTimer(0.5,equip,client);
}
}
public Action:equip(Handle:timer,any:client)
{
if(ValidPlayer(client,true)){
SetEntityModel(client, "models/player/wowmodels/bloodelf/mage.mdl");
W3SetPlayerColor(client,thisRaceID,40,40,40,240);
}
}
Enjoy