As I'm going to be moving monday, I don't have time to update the SVN .. as a current project I'm working on is going to be a Huge one...
Here is the code if you want to add it yourself:
I thought of moving the return Plugin_Handled; into the last statement of ValidPlayer IF statement of the Event_HorsemannKilled, but since its working.. decided to keep it there.
if you want to create your own CVAR for changing your gold randoms, etc.. you'll have to add that in yourself. I currently have non-temporary variables.
Current Bugs: You can only Summon one horseman at a time.. if you summon more than one, it will give the xp gold to the person trying to kill the last living horseman.
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include "W3SIncs/War3Source_Interface"
// global variables
new String:NameClientKilledHorseman[MAX_NAME_LENGTH] = "";
new ClientKilledHorseman;
public OnPluginStart()
{
// You'll need both hooks to get this to work.
HookEvent("npc_hurt", Event_NPC); //
HookEvent("pumpkin_lord_killed", Event_HorsemannKilled); //
}
public Action:Event_HorsemannKilled(Handle:event, const String:name[], bool:dontBroadcast)
{
new RandXP=GetRandomInt(100,200);
new RandGOLD=GetRandomInt(1,10);
if(ValidPlayer(ClientKilledHorseman))
{
W3GiveXPGold(ClientKilledHorseman, XPAwardByGeneric, RandXP, RandGOLD, "killing the headless horseman");
PrintCenterTextAll("%s killed the Headless Horseman! ",NameClientKilledHorseman);
PrintToChatAll("%s gained %i XP and %i gold for killing the Headless Horseman!",NameClientKilledHorseman,RandXP,RandGOLD);
}
return Plugin_Handled;
}
/*
"npc_hurt"
{
"entindex" "short"
"health" "short"
"attacker_player" "short"
"weaponid" "short"
"damageamount" "short"
"crit" "bool"
}*/
public Action:Event_NPC(Handle:event, const String:name[], bool:dontBroadcast)
{
//Define what "client" is, since this is an event, and "client" isn't naturally defined
new NPC = GetEventInt(event, "entindex");
new String:aName[64];
GetEntityClassname(NPC, aName, sizeof(aName));
if(StrEqual(aName,"headless_hatman"))
{
ClientKilledHorseman = GetClientOfUserId(GetEventInt(event, "attacker_player"));
GetClientName (ClientKilledHorseman, NameClientKilledHorseman, sizeof (NameClientKilledHorseman));
return Plugin_Handled;
}
return Plugin_Continue;
}