|
Title: [Help] HobGoblin Post by: Scyther on September 06, 2010, 03:47:14 AM Code: /** * File: War3Source_UndeadScourge.sp * Description: The Undead Scourge race for War3Source. * Author(s): Anthony Iacono */ #pragma semicolon 1 #include <sourcemod> #include "W3SIncs/War3Source_Interface" #include <sdktools> #include <sdktools_functions> #include <sdktools_tempents> #include <sdktools_tempents_stocks> // War3Source stuff new thisRaceID; new BeamSprite; new MyWeaponsOffset,AmmoOffset; public Plugin:myinfo = { name = "SH Hero HobGoblin", author = "Scyther", description = "SH Hero", version = "1.0.0.0", url = "http://war3source.com" }; // War3Source Functions public OnPluginStart() { HookEvent("hegrenade_detonate", GrenadeDetonate); HookEvent("weapon_fire", GrenadeThrown); MyWeaponsOffset=FindSendPropOffs("CBaseCombatCharacter","m_hMyWeapons"); } public OnMapStart() { BeamSprite=PrecacheModel("materials/sprites/lgtning.vmt"); } public OnWar3LoadRaceOrItemOrdered(num) { if(num==30) { thisRaceID=SHRegisterHero( "HobGoblin", "hobg", "Never ending supply of hobgoblin grenades (crit nades)", "Never ending supply of hobgoblin grenades (crit nades)", false ); } } public OnWar3EventSpawn(client) if(SHHasHero(client,thisRaceID)) { GivePlayerItem(client, "weapon_hegrenade"); } public Action:GrenadeThrown(Handle:event, const String:name[], bool:dontBroadcast) { } public Action:GrenadeDispense(Handle:timer,any:index) { if(ValidPlayer(index)&&IsPlayerAlive(index)) { GivePlayerItem(index,"weapon_hegrenade"); } } public Action:GrenadeDetonate(Handle:event, const String:name[], bool:dontBroadcast) { new userid=GetEventInt(event,"userid"); new index=GetClientOfUserId(userid); if(index>0) { new race=War3_GetRace(index); if(SHHasHero(index,thisRaceID)) { GivePlayerItem(index,"weapon_hegrenade"); } } return Plugin_Continue; } public PlayerHurtEvent(Handle:event,const String:name[],bool:dontBroadcast) { new userid=GetEventInt(event,"userid"); new attacker_userid=GetEventInt(event,"attacker"); new victim=GetClientOfUserId(userid); new attacker=GetClientOfUserId(attacker_userid); new dmg=GetEventInt(event,"dmg_health"); if(War3_GetGame()==Game_TF) dmg=GetEventInt(event,"damageamount"); if(victim>0&&attacker>0&&victim!=attacker) { new race_attacker=War3_GetRace(attacker); if(SHHasHero(attacker,thisRaceID) && War3_GetGame()!=Game_TF&&!Silenced(attacker,false)) { decl String:weapon[64]; GetEventString(event,"weapon",weapon,63); if(StrEqual(weapon,"hegrenade",false) && !W3HasImmunity(victim,Immunity_Skills)) { new Float:percent=1.8; new originaldamage=dmg; new health_take=RoundFloat((float(dmg)*percent)); new onehp=false; ///you cannot die from orc nade unless the usual nade damage kills you if(GetClientHealth(victim)>originaldamage&&health_take>GetClientHealth(victim)){ health_take=GetClientHealth(victim) -1; onehp=true; } ////new new_health=GetClientHealth(victim)-health_take; //if(new_health<0) // new_health=0; //SetEntityZHealth(victim,new_health); if(War3_DealDamage(victim,health_take,attacker,_,"criticalnade",W3DMGORIGIN_SKILL,W3DMGTYPE_PHYSICAL)) { W3PrintSkillDmgHintConsole(victim,attacker,health_take,"Critical Nade"); PrintHintText(attacker,"Your Grenades do 1.8x damage!"); if(onehp){ SetEntityHealth(victim,1); } } } } } } The crit nades dont work though the regeneration of nades works perfectly.. :/ Title: Re: [Help] HobGoblin Post by: gghh3322 on September 06, 2010, 05:07:34 AM Code: if(StrEqual(weapon,"hegrenade",false) && !W3HasImmunity(victim,Immunity_Skills)) if(StrEqual(weapon,"hegrenade",false) it's..{ new Float:percent=1.8; new originaldamage=dmg; new health_take=RoundFloat((float(dmg)*percent)); new onehp=false; ///you cannot die from orc nade unless the usual nade damage kills you if(GetClientHealth(victim)>originaldamage&&health_take>GetClientHealth(victim)){ health_take=GetClientHealth(victim) -1; onehp=true; } ////new new_health=GetClientHealth(victim)-health_take; //if(new_health<0) // new_health=0; //SetEntityZHealth(victim,new_health); if(War3_DealDamage(victim,health_take,attacker,_,"criticalnade",W3DMGORIGIN_SKILL,W3DMGTYPE_PHYSICAL)) { W3PrintSkillDmgHintConsole(victim,attacker,health_take,"Critical Nade"); PrintHintText(attacker,"Your Grenades do 1.8x damage!"); if(onehp){ SetEntityHealth(victim,1); } } allow the gun?(i'm not sure..) Title: Re: [Help] HobGoblin Post by: Scyther on September 06, 2010, 05:44:51 AM Well thats what it said in orc which has working crit nades.. which is why i cant work out why it doesnt work :S ive moved on to making unlimited ammo hero (punisher) hopefully someone can work out why this doesnt work and then it can be finished :)
Title: Re: [Help] HobGoblin Post by: Ownz on September 06, 2010, 08:29:40 AM u didnt hook even damage
Title: Re: [Help] HobGoblin Post by: Scyther on September 06, 2010, 03:50:40 PM OHhh right thanks ownz
|