Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2013-01-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
January 24, 2013, 10:55:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Halloween Bosses  (Read 226 times)
iceman
Full Member
***
Posts: 177


View Profile
« on: October 27, 2012, 10:12:35 AM »

Can someone add xp/gold rewards for killing the HHH Monoculus and Merasmus plz?
Logged
-El Diablo
Sr. Member
****
Posts: 252


View Profile
« Reply #1 on: October 28, 2012, 11:39:54 AM »

If nobody gets to it before me... I'll check on how to do that.. I'm sure I can get it via a entityname like I did for the Boss Tank in MVM.
Logged
iceman
Full Member
***
Posts: 177


View Profile
« Reply #2 on: October 28, 2012, 12:26:53 PM »

cool thanks

events:
merasmus_killed
eyeball_boss_killed
eyeball_boss_killer
pumpkin_lord_killed "horsemann?"
Logged
-El Diablo
Sr. Member
****
Posts: 252


View Profile
« Reply #3 on: November 14, 2012, 11:56:50 AM »

I'll probably be adding this sometime soon.

I'll share it with war3source.

I've been really busy lately, but I'll probably get a beak next week as I'm moving to a new job.

Logged
-El Diablo
Sr. Member
****
Posts: 252


View Profile
« Reply #4 on: November 16, 2012, 05:59:06 AM »

It was a pain in the rear to figure out how to give XP / GOLD to the player who kills headless horseman.  There is no actual event information on telling you who killed him, so i had to hack the code dirty. If you spawn more than one horseman this code will not work correctly.  The event tells you when he dies, but not who kills him.  I had to watch which player last shot him.

I'll update the code this weekend...i can't copy and paste, as the code I'm working on has been heavily modified...but as promised, I'll update war3source when i find something that everyone can use.

I'll work on the other bosses another day.

I'll let everyone know when i update the svn.
Logged
-El Diablo
Sr. Member
****
Posts: 252


View Profile
« Reply #5 on: November 17, 2012, 10:02:14 AM »

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.

Code:
#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;
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!