Long story short I'm trying to make my race randomly give either 1-5 gold, 10-50 xp or +10-50 health upon damaging an enemy. However, I'd rather keep it as one skill, instead of splitting it up.
I know this won't work, but basically
Code:
public OnWar3EventPostHurt( victim, attacker, damage )
{
if( W3GetDamageIsBullet() && ValidPlayer( victim, true ) && ValidPlayer( attacker, true ) && GetClientTeam( victim ) != GetClientTeam( attacker ) )
{
if( War3_GetRace( attacker ) == thisRaceID )
{
new skill_dmg = War3_GetSkillLevel( attacker, thisRaceID, SKILL_DMG );
if( !Hexed( attacker, false ) && skill_dmg > 0
Dice[1]=<code for gaining extra xp>
Dice[2]=<code for gaining extra gold>
Dice[3]=<code for gaining health>
}
}
}
{
if( W3GetDamageIsBullet() && ValidPlayer( victim, true ) && ValidPlayer( attacker, true ) && GetClientTeam( victim ) != GetClientTeam( attacker ) )
{
if( War3_GetRace( attacker ) == thisRaceID )
{
new skill_dmg = War3_GetSkillLevel( attacker, thisRaceID, SKILL_DMG );
if( !Hexed( attacker, false ) && skill_dmg > 0
Dice[1]=<code for gaining extra xp>
Dice[2]=<code for gaining extra gold>
Dice[3]=<code for gaining health>
}
}
}
Assuming that makes sense, how would I impliment this? I'm sure I've seen it somewhere but now I can't seem the find it T_T





Logged