|
Title: Paladin - First race, helpful info would be nice Post by: Stranger Danger on August 23, 2012, 02:52:57 PM Code: /** * File: War3Source_Paladin.sp * Description: WoW Class for War3Source. * Author: Stranger Danger */ #pragma semicolon 1 #include <sourcemod> #include "W3SIncs/War3Source_Interface #invlude <sdktools> public W3ONLY(){} new thisRaceID; new Handle:BubbleCooldownCvar; // cooldown new SKILL_HOLYLIGHT, SKILL_RETRIBUTION, SKILL_JUDGEMENT, ULT_BUBBLE; // Chance/Data Arrays new Float:AddHP[5]={10.0,15.0,20.0,25.0,30.0}; new Float:RetributionReturnDamage[5]={0.0,0.5,0.10,0.15,0.20}; new Float:JudgementDamagePercent[5]={0.0,0.10,0.15,0.20,0.25}; new Handle:ultCooldownCvar; new Float:BubbleDuration[5]={0.0,.5,1.0,1.5,2.0}; new bool:Bubble[65]; new String:ultimateSound[]="war3source/divineshield.wav"; public Plugin:myinfo = { name = "Paladin", author = "Stranger Danger", description = "WoW Class", version = "1.0.0.0" url = "http://tmuservers.net/" }; public OnPluginStart() { BubbleCooldownCvar=CreatConVar("war3_paladin_bubble_cooldown","25","Cooldown timer (ultimate)"); } public OnMapStart() { War3_PrecacheSound(ultimateSound); } public OnWar3PlayerAuthed(client) { Bubble[client]=false; } public OnWar3LoadRaceOrItemOrdered(num) { if(num==100) { thisRaceID=War3_CreateNewRaceT("hunter"); SKILL_HOLYLIGHT=War3_AddRaceSkillT(thisRaceID,"Holy Light",false,4); SKILL_RETRIBUTION=War3_AddRaceSkillT(thisRaceID,"ThornsAura",false,4); SKILL_JUDGEMENT=War3_AddRaceSkillT(thisRaceID,"Judgement",false,4); ULT_BUBBLE=War3_AddRaceSkillT(thisRaceID,"Bubble",true,4; War3_CreateRaceEnd(thisRaceID); W3Faction(thisRaceID,"WoW",true); } } new ClientTracer; public bool:AimTargetFilter(entity,mask) { return !(entity==ClientTracer); } public OnUltimateCommand(client,race,bool:pressed) { new userid=GetClientUserId(client); if(race==thisRaceID && pressed && userid>1 && IsPlayerAlive(client) ) { new ult_level=War3_GetSkillLevel(client,race,ULT_BUBBLE); if(ult_level>0) { if(!Silenced(client)&&War3_SkillNotInCooldown(client,thisRaceID,ULT_BUBBLE,true)) { Bubble[client]=true; W3SetPlayerColor(client,thisRaceID,255,200,0,_,GLOW_ULTIMATE); //255,200,0); CreateTimer(UltimateDuration[ult_level],EndBubble,client); new Float:cooldown= GetConVarFloat(ultCooldownCvar); War3_CooldownMGR(client,cooldown,thisRaceID,ULT_BUBBLE,_,_); W3MsgUsingBubble(client); W3EmitSoundToAll(ultimateSound,client); W3EmitSoundToAll(ultimateSound,client); } } else { W3MsgUltNotLeveled(client); } } } public Action:EndBubble(Handle:timer,any:client) { Bubble[client]=false; W3ResetPlayerColor(client,thisRaceID); if(ValidPlayer(client,true)) { W3MsgBubbleEnded(client); } } public OnW3TakeDmgAllPre(victim,attacker,Float:damage) { if(IS_PLAYER(victim)&&IS_PLAYER(attacker)&&victim>0&&attacker>0) //block self inflicted damage { if(Bubble[victim]&&attacker==victim){ War3_DamageModPercent(0.0); return; } new vteam=GetClientTeam(victim); new ateam=GetClientTeam(attacker); if(vteam!=ateam) { if(Bubble[victim]) { if(!W3HasImmunity(attacker,Immunity_Ultimates)) { if(War3_GetGame()==Game_TF){ decl Float:pos[3]; GetClientEyePosition(victim, pos); pos[2] += 4.0; War3_TF_ParticleToClient(0, "miss_text", pos); //to the attacker at the enemy pos //War3_TF_ParticleToClient(0, "healthgained_blu", pos); } War3_DamageModPercent(0.0); } else { W3MsgEnemyHasImmunity(victim,true); } } } } return; } } // Events public OnWar3EventSpawn(client){ Bubble[client]=false; } public OnW3TakeDmgBulletPre(victim,attacker,Float:damage) { if(IS_PLAYER(victim)&&IS_PLAYER(attacker)&&victim>0&&attacker>0&&attacker!=victim) { new vteam=GetClientTeam(victim); new ateam=GetClientTeam(attacker); if(vteam!=ateam) { new race_attacker=War3_GetRace(attacker); new race_victim=War3_GetRace(victim); //new skill_level_thorns=War3_GetSkillLevel(victim,thisRaceID,SKILL_RETRIBUTION); new skill_level_trueshot=War3_GetSkillLevel(attacker,thisRaceID,SKILL_JUDGEMENT); //evade //if they are not this race thats fine, later check for race if(race_victim==thisRaceID ) { new skill_level_evasion=War3_GetSkillLevel(victim,thisRaceID,SKILL_EVADE); if( skill_level_evasion>0 &&!Hexed(victim,false) && GetRandomFloat(0.0,1.0)<=EvadeChance[skill_level_evasion] && !W3HasImmunity(attacker,Immunity_Skills)) { W3FlashScreen(victim,RGBA_COLOR_BLUE); War3_DamageModPercent(0.0); //NO DAMAMGE W3MsgEvaded(victim,attacker); if(War3_GetGame()==Game_TF){ decl Float:pos[3]; GetClientEyePosition(victim, pos); pos[2] += 4.0; War3_TF_ParticleToClient(0, "miss_text", pos); //to the attacker at the enemy pos } } /* //thorns only if he didnt evade else if( skill_level_thorns>0 && IsPlayerAlive(attacker)&&!Hexed(victim,false)) { if(!W3HasImmunity(attacker,Immunity_Skills)) { new damage_i=RoundToFloor(damage*ThornsReturnDamage[skill_level_thorns]); if(damage_i>0) { if(damage_i>40) damage_i=40; // lets not be too unfair ;] //PrintToChatAll("1 %d",W3GetDamageIsBullet()); War3_DealDamage(attacker,damage_i,victim,_,"thorns",_,W3DMGTYPE_PHYSICAL); // PrintToChatAll("2 %d",W3GetDamageIsBullet()); //W3ForceDamageIsBullet(); W3PrintSkillDmgConsole(attacker,victim,War3_GetWar3DamageDealt(),SKILL_THORNS); } //} } }*/ } // Trueshot Aura if(race_attacker==thisRaceID && skill_level_trueshot>0 && IsPlayerAlive(attacker)&&!Hexed(attacker,false)) { if(!W3HasImmunity(victim,Immunity_Skills)) { War3_DamageModPercent(TrueshotDamagePercent[skill_level_trueshot]+1.0); W3FlashScreen(victim,RGBA_COLOR_RED); } } } } } public OnWar3EventPostHurt(victim,attacker,damage){ if(W3GetDamageIsBullet()&&ValidPlayer(victim,true)&&ValidPlayer(attacker,true)&&GetClientTeam(victim)!=GetClientTeam(attacker)) { if(War3_GetRace(victim)==thisRaceID) { new skill_level=War3_GetSkillLevel(victim,thisRaceID,SKILL_RETRIBUTION); if(skill_level>0&&!Hexed(victim,false)) { if(!W3HasImmunity(attacker,Immunity_Skills)){ new damage_i=RoundToFloor(damage*RetributionReturnDamage[skill_level]); if(damage_i>0) { if(damage_i>40) damage_i=40; // lets not be too unfair ;] if(War3_DealDamage(attacker,damage_i,victim,_,"retribution",_,W3DMGTYPE_PHYSICAL)){ decl Float:iVec[3]; decl Float:iVec2[3]; GetClientAbsOrigin(attacker, iVec); GetClientAbsOrigin(victim, iVec2); iVec[2]+=35.0, iVec2[2]+=40.0; TE_SetupBeamPoints(iVec, iVec2, TeleBeam, TeleBeam, 0, 45, 0.4, 10.0, 10.0, 0, 0.5, {255,35,15,255}, 30); TE_SendToAll(); iVec2[0]=iVec[0]; iVec2[1]=iVec[1]; iVec2[2]=80+iVec[2]; TE_SetupBubbles(iVec, iVec2, HaloSprite, 35.0,GetRandomInt(6,8),8.0); TE_SendToAll(); } } } } } } } stock TE_SetupBubbles(const Float:vecOrigin[3], const Float:vecFinish[3],modelIndex,const Float:heightF,count,const Float:speedF) { TE_Start("Bubbles"); TE_WriteVector("m_vecMins", vecOrigin); TE_WriteVector("m_vecMaxs", vecFinish); TE_WriteFloat("m_fHeight", heightF); TE_WriteNum("m_nModelIndex", modelIndex); TE_WriteNum("m_nCount", count); TE_WriteFloat("m_fSpeed", speedF); } Title: Re: Paladin - First race, helpful info would be nice Post by: Revan on August 24, 2012, 01:23:59 PM "helpful info would be nice"???
give us some information :) Title: Re: Paladin - First race, helpful info would be nice Post by: Stranger Danger on August 24, 2012, 04:19:15 PM "helpful info would be nice"??? give us some information :) Well first off I dont have a compiler so I don't know if I am missing any { or " and what not and this is my first race. So when I mean helpful info I mean if you see something wrong what is wrong and what is the right way to do it. Thanks, |