Author Topic: [Race] Paladin  (Read 3308 times)

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
[Race] Paladin
« on: November 15, 2010, 05:09:18 PM »
Requested by a friend.

With +ability you can select an aura. Only one aura can be active at a time.

Skills:
Healing Aura: Gives nearby players 1/2/3/4 % HP regeneration and the Paladin 0.5/1/1.5/2% (Stacks!)
Offensive Aura: Gives nearby players 5/10/15/20 % more damage and the Paladin 2.5/5/7.5/10%
Defensive Aura:Gives nearby players 5/10/15/20 % more armor and the Paladin 2.5/5/7.5/10%

Ultimate: Aura Overdrive: Activates the other 2 auras for 10 seconds at the level of Overdrive and gives the Paladins the full effect of all.

Notes:
To cast "Aura Overdrive" you need "Holy energy". Holy energy is accumulated by having teammates nearby, giving one point per teammate each second. When you have 100 points you can activate overdrive, wich stops you from gaining holy energy and drains 10 points per second. In TF2 you have a message in the HUD displaying your holy energy, CS:S sadly has nothing yet.
If multiple Paladins are in range the highest level aura will be applied. So if there are 2 Paladins in range, one with level 2 offensive aura and one with level 3 and both have it activated, level 3 will apply to players. The exception for this is Healing Aura, wich stacks with other Paladins (might be subject to change)
« Last Edit: November 15, 2010, 05:11:04 PM by Foolishfox »

[Oddity]TeacherCreature

  • Sr. Member
  • ****
  • Posts: 467
    • View Profile
Re: [Race] Paladin
« Reply #1 on: November 15, 2010, 06:14:01 PM »
cute thanks -

I have been avoiding making this race :)

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: [Race] Paladin
« Reply #2 on: November 15, 2010, 08:27:21 PM »
CSS has some side hud message

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: [Race] Paladin
« Reply #3 on: November 16, 2010, 12:34:12 AM »
You mean DialogType_Msg? I messed around with that, but it's kinda shitty.

A) It has a minimum lifetime of 10 seconds
B) You need to set a priority for the message to be displayed. Lowest priority is displayed.
-> I need to refresh the HUD each 10 seconds and each time it updates, counting down a global counter each time.

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: [Race] Paladin
« Reply #4 on: November 16, 2010, 12:46:51 AM »
shitty indeed

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: [Race] Paladin
« Reply #5 on: October 03, 2011, 10:47:36 AM »
Here's a redone version for L4D that uses the Aura engine. I'm pretty sure noone ever used the aura engine since it had a few bugs but we ironed them out and now it's fully usable... So if you want to make a aura race, here's an example how to use the aura engine for it.


qwerty

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: [Race] Paladin
« Reply #6 on: October 03, 2011, 03:35:33 PM »
hmmm, so the ult only gives the pally 20% attack, 20% damage reduction, and 5% regen?

i don't know, for a class that seems mostly about helping your team, the ult doesn't really do much for them.  at least, not once the other skills are fully leveled.  those 10 seconds will be just like every other group of 10 seconds.  unless only 1 aura can be active at a time normally?

Glider⠠⠵

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 472
  • ⠠⠵
    • View Profile
Re: [Race] Paladin
« Reply #7 on: October 03, 2011, 04:29:35 PM »
Only 1 aura can be active at the same time. Keep in mind that race is eons old and was one of the first things I've written. Not much SourcePawn experience and not much experience with races, balancing and so on.

Jumpman

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: [Race] Paladin
« Reply #8 on: April 26, 2016, 04:44:22 PM »
I know this plugin is old but i try anyway

I get this errors in my logs

Code: [Select]
L 04/26/2016 - 00:12:19: [SM]   [0]  Line 105, War3Source_Engine_DamageSystem.sp::Native_War3_DamageModPercent()
L 04/26/2016 - 00:12:19: [SM] Plugin encountered error 25: Call was aborted
L 04/26/2016 - 00:12:19: [SM] Native "War3_DamageModPercent" reported: Error encountered while processing a dynamic native
L 04/26/2016 - 00:12:19: [SM] Displaying call stack trace for plugin "w3s/War3Source_CustomRace_Paladin.smx":
L 04/26/2016 - 00:12:19: [SM]   [0]  Line 646, War3Source_CustomRace_Paladin.sp::OnW3TakeDmgBullet()
L 04/26/2016 - 00:12:19: [SM] Plugin encountered error 25: Call was aborted
L 04/26/2016 - 00:12:19: [SM] Native "ThrowError" reported: You may not set damage mod percent here, use ....Pre forward
L 04/26/2016 - 00:12:19: [SM] Displaying call stack trace for plugin "w3s/War3Source_Engine_DamageSystem.smx":

Can this be fix ?
« Last Edit: April 26, 2016, 04:48:02 PM by Jumpman »
[+35]Jumpman

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race] Paladin
« Reply #9 on: April 26, 2016, 09:32:06 PM »
In line number 633, change the function heading from:
OnW3TakeDmgBullet
To
OnW3TakeDmgBulletPre

That should (i believe) resolve both of your issues.

The reason it's erroring is becaues it's currently using the Post damage hook, where the damage value has already been completed, and can't be changed with War3_DamageModPercent.
Using the Pre damage hook, allows you to modify the damage before it's passed.


Jumpman

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: [Race] Paladin
« Reply #10 on: April 27, 2016, 12:09:49 AM »
Thanks i recompile and test i working later.

I just found one more error can you help with this one to ?

L 04/26/2016 - 09:24:55: [SM] Unable to load plugin "w3s/War3Source_Addon_GiveGold.smx": Native "W3GetMaxGold" was not found
[+35]Jumpman

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race] Paladin
« Reply #11 on: April 27, 2016, 01:12:32 AM »
Can you post the full .sp for that file here and i can have a look.

Jumpman

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: [Race] Paladin
« Reply #12 on: April 27, 2016, 02:35:54 AM »
Yes of course her it is

Code: [Select]
/*
* War3Source Addon - Give Gold
*
* File: War3Source_Addon_GiveGold.sp
* Description: The Give Gold Addon for War3Source. Allows a player to share his gold with another one.
* Author: M.A.C.A.B.R.A
*
* Changelog:
*
* v1.2.2
* - modified messages and translation files
*
* v1.2.1
* - modified help instructions
*
* v1.2.0
* - adjustment messages to translate
* - added translations (en, pl)
*
* v1.1.1
* - added shortcuts
* - modified messages
* - modified help instructions
*
* v1.1.0
* - added in-game plugin advertisement
* - added advertisement cvar
* - fixed messages bugs
*
* v1.0.0
* - initial release
*/

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

#define PLUGIN_VERSION "1.2.2"

#define SPEC_GREY "\x07CCCCCC"
#define T_RED "\x07FF4040"
#define CT_BLUE "\x0799CCFF"

public Plugin:myinfo =
{
name = "War3Source Addon - Give Gold",
author = "M.A.C.A.B.R.A",
description = "The Give Gold Addon for War3Source. Allows a player to share his gold with another one.",
version = PLUGIN_VERSION,
url = "http://strefagier.com.pl/"
};

new Handle:GiveGoldPluginON = INVALID_HANDLE;
new Handle:GiveGoldAdvertisement = INVALID_HANDLE;
new Handle:GiveGoldMin = INVALID_HANDLE;
new Handle:GiveGoldMax = INVALID_HANDLE;

/* *********************** OnPluginStart *********************** */
public OnPluginStart()
{
LoadTranslations("common.phrases");
LoadTranslations("war3.givegold.phrases");

CreateConVar("war3_givegold_version", PLUGIN_VERSION, "Give Gold plugin version.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
GiveGoldPluginON = CreateConVar("war3_givegold_on", "1", "Enables/Disables Give Gold plugin.", 0, true, 0.0, true, 1.0);
GiveGoldAdvertisement = CreateConVar("war3_givegold_advertisement", "1", "Enables/Disables Give Gold advertisement on chat.", 0, true, 0.0, true, 1.0);
GiveGoldMin = CreateConVar("war3_givegold_min", "1", "Minimum amount of gold that player can donate to another one.", 0, true, 1.0, false);
GiveGoldMax = CreateConVar("war3_givegold_max", "500", "Maximum amount of gold that player can donate to another one.", 0, true, 2.0, false);

RegConsoleCmd("givegold", GiveGold, "Allows you to give a part of your gold to another player.");
RegConsoleCmd("gg", GiveGold, "Allows you to give a part of your gold to another player.");
RegConsoleCmd("givegoldhelp", GiveGoldHelp, "Shows Give Gold help instructions.");
RegConsoleCmd("gghelp", GiveGoldHelp, "Shows Give Gold help instructions.");

CreateTimer(150.0, BroadcastAdvertisement,_,TIMER_REPEAT);
}

/* *********************** BroadcastAdvertisement *********************** */
public Action:BroadcastAdvertisement(Handle:timer, any:userid)
{
if(GetConVarBool(GiveGoldAdvertisement))
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Advertisement1");
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Advertisement2");
}
}

/* *********************** GiveGold *********************** */
public Action:GiveGold(client, args)
{
if(client == 0)
{
return Plugin_Handled;
}

if(!GetConVarBool(GiveGoldPluginON))
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Error - Plugin Disabled", T_RED);
return Plugin_Handled;
}

if(args != 2)
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Error - Arguments");
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Help Advertisement");
return Plugin_Handled;
}
else
{
new String:name[64];
GetCmdArg(1, name, sizeof(name));
new receiver = FindTarget(client, name, false, false);

if(receiver < 1)
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Error - Player");
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Help Advertisement");
return Plugin_Handled;
}

new String:strGold[15];
GetCmdArg(2, strGold, sizeof(strGold));
new Gold = StringToInt(strGold);

GiveGoldTransaction(client, receiver, Gold);
}

return Plugin_Handled;
}

/* *********************** GiveGoldTransaction *********************** */
public Action:GiveGoldTransaction(client, receiver, Gold)
{
if(client == receiver)
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Error - Self");
return Plugin_Handled;
}

new GiveGoldMinAmount = GetConVarInt(GiveGoldMin);
new GiveGoldMaxAmount = GetConVarInt(GiveGoldMax);

if(Gold < GiveGoldMinAmount || Gold > GiveGoldMaxAmount)
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Error - Gold");
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Help Advertisement");
return Plugin_Handled;
}

new DonatorGold = War3_GetGold(client);
new ReceiverGold = War3_GetGold(receiver);

if(DonatorGold < Gold)
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - No Gold");
return Plugin_Handled;
}

new DonatorTeam = GetClientTeam(client);
new ReceiverTeam = GetClientTeam(receiver);
new MaxGoldAmount = W3GetMaxGold();

new String:DonatorName[32];
GetClientName(client, DonatorName, sizeof(DonatorName));
new String:ReceiverName[32];
GetClientName(receiver, ReceiverName, sizeof(ReceiverName));

if(ReceiverGold + Gold > MaxGoldAmount)
{
Gold = MaxGoldAmount-ReceiverGold;
if(Gold == 0)
{
switch(ReceiverTeam)
{
case 1: // spec
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - No Place", SPEC_GREY, ReceiverName);
}
case 2: // t
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - No Place", T_RED, ReceiverName);
}
case 3: // ct
{
CPrintToChat(client, "{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - No Place", CT_BLUE, ReceiverName);
}
}
return Plugin_Handled;
}
}

if(DonatorTeam == ReceiverTeam)
{
switch(DonatorTeam)
{
case 1: // spec
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", SPEC_GREY, DonatorName, SPEC_GREY, ReceiverName, Gold);
}
case 2: // t
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", T_RED, DonatorName, T_RED, ReceiverName, Gold);
}
case 3: // ct
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", CT_BLUE, DonatorName, CT_BLUE, ReceiverName, Gold);
}
}
}
else
{
switch(DonatorTeam)
{
case 1: // spec
{
switch(ReceiverTeam)
{
case 2: // t
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", SPEC_GREY, DonatorName, T_RED, ReceiverName, Gold);
}
case 3: // ct
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", SPEC_GREY, DonatorName, CT_BLUE, ReceiverName, Gold);
}
}
}
case 2: // t
{
switch(ReceiverTeam)
{
case 1: // spec
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", T_RED, DonatorName, SPEC_GREY, ReceiverName, Gold);
}
case 3: // ct
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", T_RED, DonatorName, CT_BLUE, ReceiverName, Gold);
}
}
}
case 3: // ct
{
switch(ReceiverTeam)
{
case 1: // spec
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", CT_BLUE, DonatorName, SPEC_GREY, ReceiverName, Gold);
}
case 2: // t
{
CPrintToChatAll("{green}[{lightgreen}Give Gold{green}]{default} %t ", "Transaction - Succesfull", CT_BLUE, DonatorName, T_RED, ReceiverName, Gold);
}
}

}
}
}

War3_SetGold(client,DonatorGold - Gold);
War3_SetGold(receiver,ReceiverGold + Gold);
return Plugin_Handled;
}

/* *********************** GiveGoldHelp *********************** */
public Action:GiveGoldHelp(client, args)
{
if(client == 0)
{
return Plugin_Handled;
}
else
{
GiveGoldHelpMainMenu(client);
}
return Plugin_Handled;
}

/* *********************** GiveGoldHelpMainMenu *********************** */
GiveGoldHelpMainMenu(client)
{
new String:HelpMainCommandsTxt[512];
Format(HelpMainCommandsTxt,sizeof(HelpMainCommandsTxt),"%T", "Help - Main Commands",client);
new String:HelpMainShortCutsTxt[128];
Format(HelpMainShortCutsTxt,sizeof(HelpMainShortCutsTxt),"%T", "Help - Main Shortcuts",client);
new String:HelpMainCreditsTxt[256];
Format(HelpMainCreditsTxt,sizeof(HelpMainCreditsTxt),"%T", "Help - Main Credits",client);
new String:HelpMainSendTxt[128];
Format(HelpMainSendTxt,sizeof(HelpMainSendTxt),"%T", "Help - Main Send To Console",client);

new Handle:HelpMainMenu = CreateMenu(HelpMainMenuSelect);
SetMenuTitle(HelpMainMenu, "%T", "Help  - Main Menu Title",client);
AddMenuItem(HelpMainMenu, "commands", HelpMainCommandsTxt);
AddMenuItem(HelpMainMenu, "shortcuts", HelpMainShortCutsTxt);
AddMenuItem(HelpMainMenu, "credits", HelpMainCreditsTxt);
AddMenuItem(HelpMainMenu, "sendtoconsole", HelpMainSendTxt);
SetMenuExitButton(HelpMainMenu, true);
DisplayMenu(HelpMainMenu, client, MENU_TIME_FOREVER);
}

/* *********************** HelpMainMenuSelect *********************** */
public HelpMainMenuSelect(Handle:HelpMainMenu, MenuAction:action, client, param2)
{
if (action == MenuAction_Select)
    {
new GiveGoldMinAmount = GetConVarInt(GiveGoldMin);
new GiveGoldMaxAmount = GetConVarInt(GiveGoldMax);
new ExampleAmount = GetRandomInt(GiveGoldMinAmount, GiveGoldMaxAmount);
new String:Name[32];
GetClientName(client, Name, sizeof(Name));
new String:HelpBackToMain[32];
Format(HelpBackToMain,sizeof(HelpBackToMain),"%T", "Help - Back To Main",client);

new String:info[32];
GetMenuItem(HelpMainMenu, param2, info, sizeof(info));
if(StrEqual(info,"commands"))
        {
new Handle:HelpMenuCommands = CreateMenu(HelpMenuOptionSelect);
SetMenuTitle(HelpMenuCommands, "%T", "Help - Commands Menu Title",client, GiveGoldMinAmount, GiveGoldMaxAmount, Name, ExampleAmount);
AddMenuItem(HelpMenuCommands, "backtomainhelp", HelpBackToMain);
SetMenuExitButton(HelpMenuCommands, true);
DisplayMenu(HelpMenuCommands, client, MENU_TIME_FOREVER);
        }
else if(StrEqual(info,"shortcuts"))
        {
new Handle:HelpMenuShortcuts = CreateMenu(HelpMenuOptionSelect);
SetMenuTitle(HelpMenuShortcuts, "%T", "Help - Shortcuts Menu Title",client);
AddMenuItem(HelpMenuShortcuts, "backtomainhelp", HelpBackToMain);
SetMenuExitButton(HelpMenuShortcuts, true);
DisplayMenu(HelpMenuShortcuts, client, MENU_TIME_FOREVER);
        }
else if(StrEqual(info,"credits"))
        {
new Handle:HelpMenuCredits = CreateMenu(HelpMenuOptionSelect);
SetMenuTitle(HelpMenuCredits, "%T", "Help - Credits Menu Title",client, PLUGIN_VERSION);
AddMenuItem(HelpMenuCredits, "backtomainhelp", HelpBackToMain);
SetMenuExitButton(HelpMenuCredits, true);
DisplayMenu(HelpMenuCredits, client, MENU_TIME_FOREVER);
        }
else if(StrEqual(info,"sendtoconsole"))
        {
PrintToConsole(client, "%T", "Help Console Text", client, GiveGoldMinAmount, GiveGoldMaxAmount, Name, ExampleAmount, PLUGIN_VERSION);

new Handle:HelpMenuSend = CreateMenu(HelpMenuOptionSelect);
SetMenuTitle(HelpMenuSend, "%T", "Help - Send Menu Title",client);
AddMenuItem(HelpMenuSend, "backtomainhelp", HelpBackToMain);
SetMenuExitButton(HelpMenuSend, true);
DisplayMenu(HelpMenuSend, client, MENU_TIME_FOREVER);
        }
}
else if(action == MenuAction_End)
{
        CloseHandle(HelpMainMenu);
    }
}

/* *********************** HelpMenuOptionSelect *********************** */
public HelpMenuOptionSelect(Handle:menu, MenuAction:action, client, param2)
{
if(action==MenuAction_Select)
{
GiveGoldHelpMainMenu(client);
}
if(action==MenuAction_End)
{
CloseHandle(menu);
}
}
[+35]Jumpman

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race] Paladin
« Reply #13 on: May 02, 2016, 03:57:20 AM »
Ok - so line number 161 currently reads as:
new MaxGoldAmount = W3GetMaxGold();

Replace it with this:
   new Handle:g_hMaxCurrency = FindConVar("war3_max_currency");
   new MaxGoldAmount = GetConVarInt(g_hMaxCurrency);


Let us know how that goes

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race] Paladin
« Reply #14 on: May 02, 2016, 04:49:06 AM »
After changing line 633, it compiles but it seems that the defending aura doesn't give extra armour. Regen is defintiely working and I believe extra damage is working but I'm not certain. Would love for there to be a way to see point on the hud too.

abgar

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: [Race] Paladin
« Reply #15 on: May 02, 2016, 05:52:41 AM »
The wording could probably be changed.  Defensive aura actually grants a damage reduction (20% to allies, and 10% to self).

Because it's using the OnW3TakeDmgBullet function to calculate, there's no way to show on hud.

The only way for you to accurate confirm is to:
Aim at stationary target, shoot without damage aura.
Ask what damage was done.
Without changing aim, weapon, or moving, shoot again once defence aura is active.
Ask what damage was done.
Compare the two.

(REPEAT STEPS ABOVE WITH OFFENSIVE AURA TO ENSURE THAT EXTRA DAMAGE IS GIVEN)

I have the ShowDamage (https://forums.alliedmods.net/showthread.php?p=763425) plugin active on my testserver, which will show every damage i deal, so i can test on stationary bots.
If you use ShowDamage, do it on a test server - not your active server, as it changes game play a bit when you know for sure how much damage you've given someone :)

But confirming that it is definitely working.

mart3h

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • evo.S//
Re: [Race] Paladin
« Reply #16 on: May 02, 2016, 06:23:00 AM »
Oh I see, thanks I'll test it out soon and confirm!