////BUFF SYSTEM #pragma semicolon 1 #include #include #include "W3SIncs/War3Source_Interface" public Plugin:myinfo= { name="War3Source Buff MAXHP", author="Ownz (DarkEnergy)", description="War3Source Core Plugins", version="1.1", url="http://war3source.com/" }; new Handle:mytimer[MAXPLAYERSCUSTOM]; //INVLAID_HHANDLE is default 0 new Float:LastDamageTime[MAXPLAYERSCUSTOM]; public OnPluginStart() { // for(new i=0;i0) { new newmaxhp=ORIGINALHP[client]+hpadd; War3_SetMaxHP_INTERNAL(client,newmaxhp); new newhp=GetClientHealth(client)+newmaxhp-oldmaxhp; if(newhp<1){ newhp=1; } SetEntityHealth(client,newhp); bHealthAddedThisSpawn[client]=true; }*/ ///method 2 new oldbuff=War3_GetMaxHP(client)-ORIGINALHP[client]; new newbuff=W3GetBuffSumInt(client,iAdditionalMaxHealth); War3_SetMaxHP_INTERNAL(client,ORIGINALHP[client]+newbuff); //set max hp new newhp=GetClientHealth(client)+newbuff-oldbuff; //difference if(newhp<1){ newhp=1; } //add or decrease health SetEntityHealth(client,newhp); //DP("CheckHP2 old %d new %d",oldbuff,newbuff ); } } public OnWar3EventPostHurt(victim,attacker,damage){ if (ValidPlayer(victim)) { LastDamageTime[victim]=GetEngineTime(); } } public Action:TFHPBuff(Handle:h,any:data){ if(War3_GetGame()==Game_TF){ new Float:now=GetEngineTime(); //only create timer of TF2 for(new i=1;i<=MaxClients;i++){ if(ValidPlayer(i,true)){ if(now>LastDamageTime[i]+10.0){ // Devotion Aura new curhp =GetClientHealth(i); new hpadd=W3GetBuffSumInt(i,iAdditionalMaxHealth); new maxhp =War3_GetMaxHP(i)-hpadd; //nomal player hp if(curhp>=maxhp&&curhpmaxhp+hpadd){ newhp=maxhp+hpadd; } //SetEntPropEnt(entity, PropType:type, const String:prop[], other); //SetEntPropEnt(client,SetEntPropEnt(entity, PropType:type, const String:prop[], other); //SetEntityHealth(i,newhp); //SetEntProp(i, Prop_Data , "m_iMaxHealth", maxhp+hpadd); SetEntityHealth(i, newhp); //SetEntProp(i, Prop_Send, "m_iHealth", newhp , 1); //curhp =GetClientHealth(i); //if(curhp>maxhp&&curhp<=maxhp+hpadd) //{ // TF2_AddCondition(i, TFCond_Healing, 1.0); //TF2 AUTOMATICALLY ADDS PARTICLES? // } //else{ //} } } } } } }