Author Topic: [Race]Venomancer  (Read 3457 times)

xxauroraxx

  • Newbie
  • *
  • Posts: 7
    • View Profile
[Race]Venomancer
« on: April 29, 2013, 08:59:52 PM »
THIS RACE HAS NOT BEEN TESTED YET

Fully tested and working ^^

Download here: http://www.4shared.com/zip/lHTLJ3Kd/venomancer.html

Venomancer


  • Poison Dagger
  • Your attack deals bonus damage followed by a small DOT


  • Plague Ward
  • Typical Wards


  • Poison Sting
  • Your attacks have a stacking DoT


  • Poison Nova
  • AOE Poison that hits enemies - The number of ticks, damage, and time are all configurable.
« Last Edit: April 30, 2013, 05:18:36 PM by xxauroraxx »

xxauroraxx

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: [Race]Venomancer
« Reply #1 on: April 30, 2013, 05:19:35 PM »
Tested and worked out the bugs, the race is good to go.

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: [Race]Venomancer
« Reply #2 on: May 01, 2013, 03:22:58 PM »
Slither - HON equilvalent :D

PreFiX

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: [Race]Venomancer
« Reply #3 on: December 26, 2015, 03:33:56 PM »
I still have .sp file but I don't have translations file anyone can share?

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: [Race]Venomancer
« Reply #4 on: December 28, 2015, 01:02:36 PM »
found the original zip on my old disk(check attachment)
#war3source on gamesurge

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #5 on: May 02, 2016, 05:06:58 AM »
When I try to compile this, I get this error:

Code: [Select]
War3Source_029_Venomancer.sp(74) : warning 213: tag mismatch
War3Source_029_Venomancer.sp(319) : error 035: argument type mismatch (argument 6)

1 Error.

Any idea?

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #6 on: May 02, 2016, 05:56:14 AM »
Grr - 4Share - PITA lol.

Can you post rows 74 and 319 please?

Row 74 at a guess means that you're using a float, but declared an int (or vice versa).

Row 319 will depend on the function in that row belongs to, but it says that the call on row 319, the 6th argument is a type mismatch as well (probably float / int as well?)

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #7 on: May 02, 2016, 06:25:35 AM »
Line 74:
Code: [Select]
PNovaDamagePerTick[x] = RoundToNearest(PNovaDamage[x] / PNovaTicks);
Line 319:
Code: [Select]
War3_CreateWard(client, location, 60, 300.0, 0.5, "damage", SKILL_PWARD, WardDamage);
Edit: Sorry, just realised formatting broke it.
« Last Edit: May 02, 2016, 08:48:50 AM by mart3h »

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #8 on: May 02, 2016, 06:55:28 AM »
Actually can u post the full race code u've got here please?  That'd be easier.
  I'm assuming PNovaDamage and PNovaTicks are both declared as ints

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #9 on: May 02, 2016, 07:07:13 AM »
No worries, it's just the one that Revan uploaded.

Code: [Select]
#pragma semicolon 1    ///WE RECOMMEND THE SEMICOLON

#include <sourcemod>
#include "W3SIncs/War3Source_Interface"

public Plugin:myinfo =
{
    name = "War3Source - Race - Venomancer",
    author = "Aurora",
    description = "The Venomancer race for War3Source."
};

new String:daggersnd[256]; //="war3source/venom/dagger.wav";
new String:ultsnd[256]; //="war3source/venom/ult.wav";
new String:wardsnd[256]; //="warsource/venom/ward.wav";
new String:stingsnd[256]; //="war3source/venom/sting.wav";

new thisRaceID;
new SKILL_PDAGGER, SKILL_PWARD, SKILL_APOISON, ULT_PNOVA;

// This skill does damage when the venomancer shoots someone. Initial damage followed by a DOT
new Float:DaggerFreq = 1.0; // How often the poison on the dagger deals damage
// Cooldown on Dagger
new Float:DaggerCooldown = 4.0;
// Dagger Initial Damage
new DaggerDamage[]={0,5,10,15,20};
new DaggerDOT[]={0,1,2,3,4};
new VictimDaggerTicks[MAXPLAYERSCUSTOM];
new DaggeredBy[MAXPLAYERSCUSTOM];

// Same as shamans ward
// Max Wards
new MaximumWards[]={0,1,2,3,4};
// Ward Damage
new WardDamage[]={0,1,2,3,4};

// Poison stacking effect, applied on hit
new Float:PoisonFreq = 1.0; // How often the poison ticks per second
new PoisonDamage[]={0,1,2,3,4}; // How much damage does a stack do?
new MaxPoisonStacks = 3; // How many stacks can the attacker dish out?
new VictimPoisonStacks[MAXPLAYERSCUSTOM]; // How many stacks does the victim have?
new VictimPoisonTicks[MAXPLAYERSCUSTOM];
new PoisonedBy[MAXPLAYERSCUSTOM]; // Who was the victim poisoned by?



new Float:PNovaFreq = 1.0;// How often the poison ticks per second
new PNovaDamage[] = {15, 30, 45}; //Total Poison Nova Damage
new VictimNovaTicks[MAXPLAYERSCUSTOM];
new PNovaBy[MAXPLAYERSCUSTOM];
new PNovaDuration = 4; //Time Poison Nova Lasts
new PNovaTicks;
new PNovaDamagePerTick[3];
// The rest of the variables will be modified inside OnPluginStart() as the functions were being picky   

new Handle:ultCooldownCvar;
new ultmaxdistance[] = {500, 600, 700, 800};
public OnPluginStart()
{
    CreateTimer(DaggerFreq, DaggerStackTimer , _, TIMER_REPEAT);  // Stacking Dagger DoT Timer
    CreateTimer(PoisonFreq, PoisonStackTimer , _, TIMER_REPEAT);  // Stacking Poison DoT Timer
    CreateTimer(PNovaFreq, PoisonNovaTimer, _, TIMER_REPEAT); // Poison Nova Timer
    LoadTranslations("w3s.race.venom.phrases");
    ultCooldownCvar=CreateConVar("war3_venom_ult_cooldown","30","Cooldown time for ult.");
   
    // The number of ticks is determined by how often the damage ticks within the duration of the poisoning
    // For example, if you have the ult tick once every half-second (.5) and the duration is 4 seconds,
    // it would tick 8 times (4 / .5 = 8). We round this to the nearest number
    PNovaTicks = RoundToNearest(PNovaDuration / PNovaFreq);   
   
    // We then set the damage per tick because the timer doesn't use the duration variable, it uses
    // the tick variable
    for(new x = 1; x < 3; x++){
        PNovaDamagePerTick[x] = RoundToNearest(PNovaDamage[x] / PNovaTicks);
    }
}

public OnWar3LoadRaceOrItemOrdered(num){

    if(num==290)
    {
        thisRaceID=War3_CreateNewRaceT("venom");
        SKILL_PDAGGER=War3_AddRaceSkillT(thisRaceID,"PoisonDagger",false,4);
        SKILL_PWARD=War3_AddRaceSkillT(thisRaceID,"PlagueWard",false,4);
        SKILL_APOISON=War3_AddRaceSkillT(thisRaceID,"PoisonSting",false,4);
        ULT_PNOVA=War3_AddRaceSkillT(thisRaceID,"PoisonNova",true,4);
        War3_CreateRaceEnd(thisRaceID); ///DO NOT FORGET THE END!!!
    }
}

public OnMapStart()
{
    War3_AddSoundFolder(daggersnd, sizeof(daggersnd), "venom/dagger.wav");
    War3_AddSoundFolder(ultsnd, sizeof(ultsnd), "venom/ult.wav");
    War3_AddSoundFolder(wardsnd, sizeof(wardsnd), "venom/ward.wav");
    War3_AddSoundFolder(stingsnd, sizeof(stingsnd), "venom/sting.wav");

    War3_PrecacheSound(daggersnd);
    War3_PrecacheSound(ultsnd);
    War3_PrecacheSound(wardsnd);
    War3_PrecacheSound(stingsnd);
}

public OnWar3EventSpawn(client)
{
   
    VictimPoisonStacks[client] = 0;  // Remove Poison Stacks
    VictimPoisonTicks[client] = 0;
}

public Action:PoisonStackTimer(Handle:h,any:data)
{
    new attacker;
    new damage;
    new skill;
    for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
    {
        if(ValidPlayer(i, true))
        {
            if(VictimPoisonTicks[i] > 0)
            {
                attacker = PoisonedBy[i];
                skill = War3_GetSkillLevel(attacker, thisRaceID, SKILL_APOISON);
                damage = VictimPoisonStacks[i] * PoisonDamage[skill]; // Number of stacks on the client * damage of the attacker
                   
                if(War3_GetGame() == Game_TF)
                {
                    War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
                }
                else
                {
                    if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
                        SetEntityHealth(i, GetClientHealth(i) - damage);
                    }
                    else{
                        War3_DealDamage(i, damage,attacker, _, "PoisonSting"); // Generic skill name
                    }
                }
                War3_ChatMessage(attacker,"%T","Poison Sting did {amount} damage", attacker, damage);
                War3_ChatMessage(i,"%T","Poison Sting did {amount} damage to you", i, damage);
                W3EmitSoundToAll(stingsnd,i);
                VictimPoisonTicks[i]--;
            }
        }
    }
}               


public Action:DaggerStackTimer(Handle:h,any:data)
{
    new attacker;
    new damage;
    new skill;
    for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
    {
        if(ValidPlayer(i, true))
        {
            if(VictimDaggerTicks[i] > 0)
            {
                attacker = DaggeredBy[i];
                skill = War3_GetSkillLevel(attacker, thisRaceID, SKILL_PDAGGER);
                damage = DaggerDOT[skill];
                   
                if(War3_GetGame() == Game_TF)
                {
                    War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
                }
                else
                {
                    if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
                        SetEntityHealth(i, GetClientHealth(i) - damage);
                    }
                    else{
                        War3_DealDamage(i, damage,attacker, _, "PoisonDagger"); // Generic skill name
                    }
                }
                VictimDaggerTicks[i]--;
            }
        }
    }
}       

public Action:PoisonNovaTimer(Handle:h,any:data)
{
    new attacker;
    new damage;
    new skill;
    for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
    {
        if(ValidPlayer(i, true))
        {
            if(VictimNovaTicks[i] > 0)
            {
                attacker = PNovaBy[i];
                skill = War3_GetSkillLevel(attacker, thisRaceID, ULT_PNOVA);
                damage = PNovaDamagePerTick[skill];
                   
                if(War3_GetGame() == Game_TF)
                {
                    War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
                }
                else
                {
                    if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
                        SetEntityHealth(i, GetClientHealth(i) - damage);
                    }
                    else{
                        War3_DealDamage(i, damage,attacker, _, "PoisonNova"); // Generic skill name
                    }
                }
                War3_ChatMessage(attacker,"%T","Poison Nova did {amount} damage", attacker, damage);
                VictimNovaTicks[i]--;
            }
        }
    }


public OnW3TakeDmgBullet(victim,attacker,Float:damage){
    if(ValidPlayer(victim, true) && ValidPlayer(attacker, false) && GetClientTeam(victim) != GetClientTeam(attacker))
    {
        if(War3_GetRace(attacker) == thisRaceID)
        {
            // Apply Poison Sting
            new skilllvl = War3_GetSkillLevel(attacker, thisRaceID, SKILL_APOISON);
            if(skilllvl > 0 && !Hexed(attacker) && !W3HasImmunity(attacker, Immunity_Skills) && War3_SkillNotInCooldown(attacker, thisRaceID, SKILL_APOISON, true))
            {

                if(VictimPoisonStacks[victim] < MaxPoisonStacks)
                {
                    VictimPoisonStacks[victim]++; //stack if less than max stacks
                }
               
                VictimPoisonTicks[victim] = 3 ; //always three ticks               
                PoisonedBy[victim] = attacker;
            }
           
            // Apply Poison Dagger           
            if(War3_SkillNotInCooldown(attacker, thisRaceID, SKILL_PDAGGER, true))
            {
                new skilllvl2 = War3_GetSkillLevel(attacker, thisRaceID, SKILL_PDAGGER);
                if(skilllvl2 > 0 && !Hexed(attacker) && !W3HasImmunity(attacker,Immunity_Skills) && !Silenced(attacker))
                {
                    War3_CooldownMGR(attacker, DaggerCooldown, thisRaceID, SKILL_PDAGGER, true, true);
                   
                    // Initial Damage from dagger
                    new daggerDamage = DaggerDamage[skilllvl2];
                    W3EmitSoundToAll(daggersnd,victim);
                    War3_ChatMessage(attacker,"%T","Dagger did {amount} damage and poisoned for {amount2}", attacker, daggerDamage, DaggerDOT[skilllvl2]);
                    War3_ChatMessage(victim,"%T","Dagger hit you for {amount} damage and poisoned for {amount2}", victim, daggerDamage, DaggerDOT[skilllvl2]);
                    if(War3_GetGame()==Game_TF)
                    {
                        War3_DealDamage(victim,daggerDamage,attacker,_,"bleed_kill"); // Bleeding Icon
                    }
                    else
                    {
                        if(GameCS() && GetClientHealth(victim) > daggerDamage){ //cs damages slows....
                            SetEntityHealth(victim, GetClientHealth(victim) - daggerDamage);
                        }
                        else{
                            War3_DealDamage(victim, daggerDamage, attacker, _, "PoisonDagger"); // Generic skill name
                        }
                    }
                   
                    // Dagger DOT damage               
                    VictimDaggerTicks[victim] = 3 ; //always three ticks               
                    DaggeredBy[victim] = attacker;
                   
                }
            }               
        }
    }
}

public OnAbilityCommand(client,ability,bool:pressed)
{
    if(War3_GetRace(client )== thisRaceID && ability == 0 && pressed && IsPlayerAlive(client))
    {
        new skill_level = War3_GetSkillLevel(client, thisRaceID, SKILL_PWARD);
        if(skill_level > 0)
        {
            if(!Silenced(client) && War3_GetWardCount(client) < MaximumWards[skill_level])
            {
                new iTeam=GetClientTeam(client);
                new bool:conf_found=false;
                if(War3_GetGame()==Game_TF)
                {
                    new Handle:hCheckEntities=War3_NearBuilding(client);
                    new size_arr=0;
                    if(hCheckEntities!=INVALID_HANDLE)
                        size_arr=GetArraySize(hCheckEntities);
                    for(new x=0;x<size_arr;x++)
                    {
                        new ent=GetArrayCell(hCheckEntities,x);
                        if(!IsValidEdict(ent)) continue;
                        new builder=GetEntPropEnt(ent,Prop_Send,"m_hBuilder");
                        if(builder>0 && ValidPlayer(builder) && GetClientTeam(builder)!=iTeam)
                        {
                            W3EmitSoundToAll(wardsnd,client);
                            conf_found=true;
                            break;                           
                        }
                    }
                    if(size_arr>0)
                        CloseHandle(hCheckEntities);
                }
                if(conf_found)
                {
                    W3MsgWardLocationDeny(client);
                }
                else
                {
                    if(War3_IsCloaked(client))
                    {
                        W3MsgNoWardWhenInvis(client);
                        return;
                    }
                    new Float:location[3];
                    GetClientAbsOrigin(client, location);
                    War3_CreateWard(client, location, 60, 300.0, 0.5, "damage", SKILL_PWARD, WardDamage);
                    W3MsgCreatedWard(client,War3_GetWardCount(client),MaximumWards[skill_level]);
                    W3EmitSoundToAll(wardsnd,client);
                }
            }
            else
            {
                W3MsgNoWardsLeft(client);
            }   
        }
    }
}


public OnUltimateCommand(client,race,bool:pressed)
{
    if(race==thisRaceID && pressed && ValidPlayer(client,true) &&!Silenced(client) && !Hexed(client) && War3_SkillNotInCooldown(client,thisRaceID,ULT_PNOVA,true))
    {
        new ult_level = War3_GetSkillLevel(client,race,ULT_PNOVA);
        if(ult_level > 0)       
        {
       
            new caster_team = GetClientTeam(client);
            new Float:start_pos[3];
            GetClientAbsOrigin(client,start_pos);
            new distance = ultmaxdistance[ult_level] + 1;
           
            for(new x = 1; x <= MaxClients; x++)
            {
                if(ValidPlayer(x,true) && caster_team != GetClientTeam(x) && !W3HasImmunity(x,Immunity_Ultimates))
                {
                    new Float:this_pos[3];
                    GetClientAbsOrigin(x, this_pos);
                    new Float:dist_check = GetVectorDistance(start_pos, this_pos);
                    if(dist_check <= distance)
                    {
                        W3EmitSoundToAll(ultsnd,client);
                        VictimNovaTicks[x] = PNovaTicks;   
                        War3_ChatMessage(x,"%T","Poison Nova has affected you!", x);                       
                    }
                }
            }

            War3_CooldownMGR(client,GetConVarFloat(ultCooldownCvar),thisRaceID,ULT_PNOVA,true,true);
           
        }
        else
        {
            W3MsgUltNotLeveled(client);
        }
    }
}

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #10 on: May 02, 2016, 11:24:13 PM »
Ok...
So to fix row 319, just change War3_CreateWard to War3_CreateWardMod (and leave everything else after that alone.)

To fix the tag mismatch error, change row74 to:
PNovaDamagePerTick
  • = PNovaDamage
  • / PNovaTicks;


And, just to avoid any issues with timers, change the values in the PNovaDamage array to:
new PNovaDamage[] = {16, 32, 48};

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #11 on: May 03, 2016, 01:00:16 AM »
Sorry but would you be able to paste the row 74 fix in code brackets? I think something stuffs up the formatting haha.

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #12 on: May 03, 2016, 01:32:20 AM »
Hmm.... that's weird...

Code: [Select]
PNovaDamagePerTick[x] = PNovaDamage[x] / PNovaTicks;

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #13 on: May 03, 2016, 02:01:37 AM »
Oh haha I think
Code: [Select]
[x] is the bb code for bullet point haha, makes sense now. Thanks, I'll try it now!

Edit: It compiled, now to test it out on the server.

Edit2: The only thing that doesn't seem to work is the ultimate. Maybe not too much of a problem as it's quite a strong race without it. Unless it's supposed to be knife only, in that case, the race is able to use guns.
« Last Edit: May 03, 2016, 02:15:14 AM by mart3h »

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #14 on: May 03, 2016, 03:04:25 AM »
If it's not restricted in the race, then it's not restricted.
But of course u can restrict if if u want - I'd recommend a pistol.
When u say the ultimate not working, can u expand on that?

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #15 on: May 03, 2016, 04:03:18 AM »
Oh okay cool yeah good idea actually.

Well, +ultimate doesn't seem to trigger the ultimate, there's no error or anything in console it just doesn't do anything.

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #16 on: May 03, 2016, 06:14:28 AM »
Hmmm - seems like pretty much the whole race was a mess...

Updated race code here - have removed the translation file requirements (as that was throwing a separate error)...

This should all work - still messy, but functional.

Code: [Select]
#pragma semicolon 1    ///WE RECOMMEND THE SEMICOLON

#include <sourcemod>
#include "W3SIncs/War3Source_Interface"

public Plugin:myinfo =
{
    name = "War3Source - Race - Venomancer",
    author = "Aurora",
    description = "The Venomancer race for War3Source."
};

new String:daggersnd[256]; //="war3source/venom/dagger.wav";
new String:ultsnd[256]; //="war3source/venom/ult.wav";
new String:wardsnd[256]; //="warsource/venom/ward.wav";
new String:stingsnd[256]; //="war3source/venom/sting.wav";

new thisRaceID;
new SKILL_PDAGGER, SKILL_PWARD, SKILL_APOISON, ULT_PNOVA;


// This skill does damage when the venomancer shoots someone. Initial damage followed by a DOT
new Float:DaggerFreq = 1.0; // How often the poison on the dagger deals damage
// Cooldown on Dagger
new Float:DaggerCooldown = 4.0;
// Dagger Initial Damage
new DaggerDamage[]={0,5,10,15,20};
new DaggerDOT[]={0,1,2,3,4};
new VictimDaggerTicks[MAXPLAYERSCUSTOM];
new DaggeredBy[MAXPLAYERSCUSTOM];

// Same as shamans ward
// Max Wards
new MaximumWards[]={0,1,2,3,4};
// Ward Damage
new WardDamage[]={0,1,2,3,4};

// Poison stacking effect, applied on hit
new Float:PoisonFreq = 1.0; // How often the poison ticks per second
new PoisonDamage[]={0,1,2,3,4}; // How much damage does a stack do?
new MaxPoisonStacks = 3; // How many stacks can the attacker dish out?
new VictimPoisonStacks[MAXPLAYERSCUSTOM]; // How many stacks does the victim have?
new VictimPoisonTicks[MAXPLAYERSCUSTOM];
new PoisonedBy[MAXPLAYERSCUSTOM]={-1, ...};// Who was the victim poisoned by?



new Float:PNovaFreq = 1.0;// How often the poison ticks per second
new PoisonNovaDamage[]={0,3,6,9,12};
new PoisonTicks[]={0,1,2,3,4};
new VictimNovaTicks[MAXPLAYERSCUSTOM]={0, ...};
new PNovaBy[MAXPLAYERSCUSTOM]={-1, ...};


new Handle:ultCooldownCvar;
new ultmaxdistance[] = {0, 500, 600, 700, 800};
public OnPluginStart()
{
    CreateTimer(DaggerFreq, DaggerStackTimer , _, TIMER_REPEAT);  // Stacking Dagger DoT Timer
    CreateTimer(PoisonFreq, PoisonStackTimer , _, TIMER_REPEAT);  // Stacking Poison DoT Timer
    CreateTimer(PNovaFreq, PoisonNovaTimer, _, TIMER_REPEAT); // Poison Nova Timer
    //LoadTranslations("w3s.race.venom.phrases");
    ultCooldownCvar=CreateConVar("war3_venom_ult_cooldown","30","Cooldown time for ult.");
}

public OnWar3LoadRaceOrItemOrdered(num){

    if(num==290)
    {
        thisRaceID=War3_CreateNewRace("venomancer","venom");
        SKILL_PDAGGER=War3_AddRaceSkill(thisRaceID,"PoisonDagger","Damages enemy and leaves DOT",false,4);
        SKILL_PWARD=War3_AddRaceSkill(thisRaceID,"PlagueWard","Release a powerful plague ward",false,4);
        SKILL_APOISON=War3_AddRaceSkill(thisRaceID,"PoisonSting","Your attacks have a stacking poison",false,4);
        ULT_PNOVA=War3_AddRaceSkill(thisRaceID,"PoisonNova","Releases a cloud of poison to enemies",true,4);
        War3_CreateRaceEnd(thisRaceID); ///DO NOT FORGET THE END!!!
    }
}


public OnMapStart()
{
    War3_AddSoundFolder(daggersnd, sizeof(daggersnd), "venom/dagger.wav");
    War3_AddSoundFolder(ultsnd, sizeof(ultsnd), "venom/ult.wav");
    War3_AddSoundFolder(wardsnd, sizeof(wardsnd), "venom/ward.wav");
    War3_AddSoundFolder(stingsnd, sizeof(stingsnd), "venom/sting.wav");

    War3_PrecacheSound(daggersnd);
    War3_PrecacheSound(ultsnd);
    War3_PrecacheSound(wardsnd);
    War3_PrecacheSound(stingsnd);
}

public OnWar3EventSpawn(client)
{
   
    VictimPoisonStacks[client] = 0;  // Remove Poison Stacks
    VictimPoisonTicks[client] = 0;
}


public Action:PoisonStackTimer(Handle:h,any:data)
{
    new attacker;
    new damage;
    new skill;
    for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
    {
        if(ValidPlayer(i, true))
        {
            if(VictimPoisonTicks[i] > 0)
            {
                attacker = PoisonedBy[i];
                skill = War3_GetSkillLevel(attacker, thisRaceID, SKILL_APOISON);
                damage = VictimPoisonStacks[i] * PoisonDamage[skill]; // Number of stacks on the client * damage of the attacker
                   
                if(War3_GetGame() == Game_TF)
                {
                    War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
                }
                else
                {
                    if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
                        SetEntityHealth(i, GetClientHealth(i) - damage);
                    }
                    else{
                        War3_DealDamage(i, damage,attacker, _, "PoisonSting"); // Generic skill name
                    }
                }
                War3_ChatMessage(attacker,"Poison Sting did %i damage", damage);
                War3_ChatMessage(i,"Poison Sting did %i damage to you", damage);
                W3EmitSoundToAll(stingsnd,i);
                VictimPoisonTicks[i]--;
            }
        }
    }
}               


public Action:DaggerStackTimer(Handle:h,any:data)
{
    new attacker;
    new damage;
    new skill;
    for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
    {
        if(ValidPlayer(i, true))
        {
            if(VictimDaggerTicks[i] > 0)
            {
                attacker = DaggeredBy[i];
                skill = War3_GetSkillLevel(attacker, thisRaceID, SKILL_PDAGGER);
                damage = DaggerDOT[skill];
                   
                if(War3_GetGame() == Game_TF)
                {
                    War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
                }
                else
                {
                    if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
                        SetEntityHealth(i, GetClientHealth(i) - damage);
                    }
                    else{
                        War3_DealDamage(i, damage,attacker, _, "PoisonDagger"); // Generic skill name
                    }
                }
                VictimDaggerTicks[i]--;
            }
        }
    }
}   

public Action:PoisonNovaTimer(Handle:h,any:data)
{
new attacker;
new damage;
new skill;
for(new i = 1; i <= MaxClients; i++) // Iterate over all clients
{
if(ValidPlayer(i, true))
{
if(VictimNovaTicks[i] > 0)
{
attacker = PNovaBy[i];
skill = War3_GetSkillLevel(attacker, thisRaceID, ULT_PNOVA);
damage = PoisonNovaDamage[skill];
   
if(War3_GetGame() == Game_TF)
{
War3_DealDamage(i, damage, attacker, _, "bleed_kill"); // Bleeding Icon
}
else
{
if(GameCS() && GetClientHealth(i) > damage){ //cs damages slows....
SetEntityHealth(i, GetClientHealth(i) - damage);
}
else{
War3_DealDamage(i,damage,attacker,DMG_CRUSH,"poison nova",_,W3DMGTYPE_MAGIC);
}
}
War3_ChatMessage(attacker,"Poison Nova did %i damage",damage);
VictimNovaTicks[i]--;
}
}
}
}     


public OnW3TakeDmgBullet(victim,attacker,Float:damage){
    if(ValidPlayer(victim, true) && ValidPlayer(attacker, false) && GetClientTeam(victim) != GetClientTeam(attacker))
    {
        if(War3_GetRace(attacker) == thisRaceID)
        {
            // Apply Poison Sting
            new skilllvl = War3_GetSkillLevel(attacker, thisRaceID, SKILL_APOISON);
            if(skilllvl > 0 && !Hexed(attacker) && !W3HasImmunity(attacker, Immunity_Skills) && War3_SkillNotInCooldown(attacker, thisRaceID, SKILL_APOISON, true))
            {

                if(VictimPoisonStacks[victim] < MaxPoisonStacks)
                {
                    VictimPoisonStacks[victim]++; //stack if less than max stacks
                }
               
                VictimPoisonTicks[victim] = 3 ; //always three ticks               
                PoisonedBy[victim] = attacker;
            }
           
            // Apply Poison Dagger           
            if(War3_SkillNotInCooldown(attacker, thisRaceID, SKILL_PDAGGER, true))
            {
                new skilllvl2 = War3_GetSkillLevel(attacker, thisRaceID, SKILL_PDAGGER);
                if(skilllvl2 > 0 && !Hexed(attacker) && !W3HasImmunity(attacker,Immunity_Skills) && !Silenced(attacker))
                {
                    War3_CooldownMGR(attacker, DaggerCooldown, thisRaceID, SKILL_PDAGGER, true, true);
                   
                    // Initial Damage from dagger
                    new daggerDamage = DaggerDamage[skilllvl2];
                    W3EmitSoundToAll(daggersnd,victim);
                    War3_ChatMessage(attacker,"Dagger did %i damage and poisoned for %i seconds",daggerDamage, DaggerDOT[skilllvl2]);
                    War3_ChatMessage(victim,"Dagger hit you for %i damage and poisoned for %i seconds", daggerDamage, DaggerDOT[skilllvl2]);
                    if(War3_GetGame()==Game_TF)
                    {
                        War3_DealDamage(victim,daggerDamage,attacker,_,"bleed_kill"); // Bleeding Icon
                    }
                    else
                    {
                        if(GameCS() && GetClientHealth(victim) > daggerDamage){ //cs damages slows....
                            SetEntityHealth(victim, GetClientHealth(victim) - daggerDamage);
                        }
                        else{
                            War3_DealDamage(victim, daggerDamage, attacker, _, "PoisonDagger"); // Generic skill name
                        }
                    }
                   
                    // Dagger DOT damage               
                    VictimDaggerTicks[victim] = 3 ; //always three ticks               
                    DaggeredBy[victim] = attacker;
                   
                }
            }               
        }
    }
}

public OnAbilityCommand(client,ability,bool:pressed)
{
    if(War3_GetRace(client )== thisRaceID && ability == 0 && pressed && IsPlayerAlive(client))
    {
        new skill_level = War3_GetSkillLevel(client, thisRaceID, SKILL_PWARD);
        if(skill_level > 0)
        {
            if(!Silenced(client) && War3_GetWardCount(client) < MaximumWards[skill_level])
            {
                new iTeam=GetClientTeam(client);
                new bool:conf_found=false;
                if(War3_GetGame()==Game_TF)
                {
                    new Handle:hCheckEntities=War3_NearBuilding(client);
                    new size_arr=0;
                    if(hCheckEntities!=INVALID_HANDLE)
                        size_arr=GetArraySize(hCheckEntities);
                    for(new x=0;x<size_arr;x++)
                    {
                        new ent=GetArrayCell(hCheckEntities,x);
                        if(!IsValidEdict(ent)) continue;
                        new builder=GetEntPropEnt(ent,Prop_Send,"m_hBuilder");
                        if(builder>0 && ValidPlayer(builder) && GetClientTeam(builder)!=iTeam)
                        {
                            W3EmitSoundToAll(wardsnd,client);
                            conf_found=true;
                            break;                           
                        }
                    }
                    if(size_arr>0)
                        CloseHandle(hCheckEntities);
                }
                if(conf_found)
                {
                    W3MsgWardLocationDeny(client);
                }
                else
                {
                    if(War3_IsCloaked(client))
                    {
                        W3MsgNoWardWhenInvis(client);
                        return;
                    }
                    new Float:location[3];
                    GetClientAbsOrigin(client, location);
                    War3_CreateWardMod(client, location, 60, 300.0, 0.5, "damage", SKILL_PWARD, WardDamage);
                    W3MsgCreatedWard(client,War3_GetWardCount(client),MaximumWards[skill_level]);
                    W3EmitSoundToAll(wardsnd,client);
                }
            }
            else
            {
                W3MsgNoWardsLeft(client);
            }   
        }
    }
}



public OnUltimateCommand(client,race,bool:pressed)
{
    if(ValidPlayer(client,true) && race==thisRaceID && pressed)
{
if(SkillAvailable(client,thisRaceID,ULT_PNOVA,true,true,true))
{
new ult_level = War3_GetSkillLevel(client,race,ULT_PNOVA);
if(ult_level > 0)       
{
new caster_team = GetClientTeam(client);
new Float:start_pos[3];
GetClientAbsOrigin(client,start_pos);
new distance = ultmaxdistance[ult_level] + 1;
   
for(new x = 1; x <= MaxClients; x++)
{
if(ValidPlayer(x,true) && caster_team != GetClientTeam(x) && !W3HasImmunity(x,Immunity_Ultimates))
{
new Float:this_pos[3];
GetClientAbsOrigin(x, this_pos);
new Float:dist_check = GetVectorDistance(start_pos, this_pos);
if(dist_check <= distance)
{
W3EmitSoundToAll(ultsnd,client);
VictimNovaTicks[x]=PoisonTicks[ult_level];
War3_ChatMessage(x,"Poison Nova has affected you!");   
PNovaBy[x]=client;
}
}
}

War3_CooldownMGR(client,GetConVarFloat(ultCooldownCvar),thisRaceID,ULT_PNOVA,true,true);
   
}
else
{
W3MsgUltNotLeveled(client);
}
}
}
}

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #17 on: May 03, 2016, 06:20:37 AM »
You're too kind, abgar, thanks a million! I'll test it out very soon.

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #18 on: May 05, 2016, 01:46:37 AM »
Works nicely, the only problem I guess is there's no visuals for poison nova, so victims can run through it without knowing. Still awesome, thanks!

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #19 on: May 05, 2016, 02:09:17 AM »
You can add that in yourself if you'd like - check out the TE_SetupBeamPoints function :)

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #20 on: May 05, 2016, 03:23:39 AM »
Oh okay, not too sure how to go about that just yet but I'll have a look into it. Also, I noticed in the code there is "//" in some of the sound file lines.

Code: [Select]
new String:daggersnd[256]; //="war3source/venom/dagger.wav";
new String:ultsnd[256]; //="war3source/venom/ult.wav";
new String:wardsnd[256]; //="warsource/venom/ward.wav";
new String:stingsnd[256]; //="war3source/venom/sting.wav";

I have the sounds in the folders and would like to use them in the race, would getting rid of the // turn them back on?

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race]Venomancer
« Reply #21 on: May 05, 2016, 03:31:09 AM »
If you've got the sound files in the right place on your server, they should play with the race file as it is.  Are they beign downloaded to your client?

The commented bits are just saying what the location of the sound files are - It's just for the coder, to make it easier to find them lol.
But the actual plugin gets that information from the OnMapStart function - you'll see the location there too. 

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race]Venomancer
« Reply #22 on: May 05, 2016, 03:46:18 AM »
Oh okay, strange, they're on the server and definitely on the fastdl server, but I'm not hearing them.

Also I've noticed that when I spawn 1 or more enemies on the other team will take 50hp damage on spawn if I'm using venomancer. Couldn't figure out why, I think maybe it's the ultimate though?

Edit: Seems like the poison is carrying over from the previous round. So when they spawn they take poison sting damage. Is there a quick fix for this at all?
« Last Edit: May 05, 2016, 08:53:12 AM by mart3h »

doctavio

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • Email
Re: [Race]Venomancer
« Reply #23 on: May 26, 2016, 01:01:45 PM »
Any one got a working fixed version of this class?

NickolasR

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [Race]Venomancer
« Reply #24 on: October 11, 2017, 09:50:18 AM »
If you've got the sound files in the right place on your server, they should play with the race file as it is.  Are they beign downloaded to your client?

The commented bits are just saying what the location of the sound files are - It's just for the coder, to make it easier to find them lol.
But the actual plugin gets that information from the OnMapStart function - you'll see the location there too.

That's what I'd like to know as well. Or has it been abandoned?