Posts
167
Respect
44Add +1
Forum Rank
Pack-a-Puncher
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!zombie_damage( mod, hit_location, hit_origin, player, amount )
{
if( is_magic_bullet_shield_enabled( self ) )
{
return;
}
player.use_weapon_type = mod;
if(isDefined(self.marked_for_death))
{
return;
}
if( !IsDefined( player ) )
{
return;
}
if ( self check_zombie_damage_callbacks( mod, hit_location, hit_origin, player, amount ) )
{
return;
}
else if( self zombie_flame_damage( mod, player ) )
{
if( self zombie_give_flame_damage_points() )
{
player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self.isdog );
}
}
else if( self maps\_zombiemode_weap_tesla::is_tesla_damage( mod ) )
{
self maps\_zombiemode_weap_tesla::tesla_damage_init( hit_location, hit_origin, player );
return;
}
else
{
if ( self maps\_zombiemode_weap_freezegun::is_freezegun_damage( self.damagemod ) )
{
self thread maps\_zombiemode_weap_freezegun::freezegun_damage_response( player, amount );
}
if ( !self maps\_zombiemode_weap_freezegun::is_freezegun_shatter_damage( self.damagemod ) )
{
if( player_using_hi_score_weapon( player ) )
{
damage_type = "damage";
}
else
{
damage_type = "damage_light";
}
if ( !is_true( self.no_damage_points ) )
{
player maps\_zombiemode_score::player_add_points( damage_type, mod, hit_location, self.isdog );
}
}
}
if ( IsDefined( self.zombie_damage_fx_func ) )
{
self [[ self.zombie_damage_fx_func ]]( mod, hit_location, hit_origin, player );
}
modName = remove_mod_from_methodofdeath( mod );
if ( self maps\_zombiemode_weap_freezegun::is_freezegun_damage( self.damagemod ) )
{
;
}
else if( is_placeable_mine( self.damageweapon ) )
{
if ( IsDefined( self.zombie_damage_claymore_func ) )
{
self [[ self.zombie_damage_claymore_func ]]( mod, hit_location, hit_origin, player );
}
else if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, player);
}
else
{
self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, undefined );
}
}
else if ( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" )
{
if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number + randomintrange( 100, 200 ), self.origin, player, 0, modName, hit_location);
}
else
{
self DoDamage( level.round_number + randomintrange( 100, 200 ), self.origin, undefined, 0, modName, hit_location );
}
}
else if( mod == "MOD_PROJECTILE" || mod == "MOD_EXPLOSIVE" || mod == "MOD_PROJECTILE_SPLASH" )
{
if ( isdefined( player ) && isalive( player ) )
{
self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, player, 0, modName, hit_location);
}
else
{
self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, undefined, 0, modName, hit_location );
}
}
if( IsDefined( self.a.gib_ref ) && (self.a.gib_ref == "no_legs") && isalive( self ) )
{
if ( isdefined( player ) )
{
rand = randomintrange(0, 100);
if(rand < 10)
{
player create_and_play_dialog( "general", "crawl_spawn" );
}
}
}
else if( IsDefined( self.a.gib_ref ) && ( (self.a.gib_ref == "right_arm") || (self.a.gib_ref == "left_arm") ) )
{
if( self.has_legs && isalive( self ) )
{
if ( isdefined( player ) )
{
rand = randomintrange(0, 100);
if(rand < 7)
{
player create_and_play_dialog( "general", "shoot_arm" );
}
}
}
}
if(player HasPerk("specialty_deadshot"))
{
self thread deadshot_damage(amount, hit_origin, player, hit_location);
}
if(player.half_damage == true)
{
amount = int(amount / 2);
self.health += amount;
//iprintln(self.health);
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
this function is called "after" the damage is dealt
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
Is there a function I can use that is called before the damage is dealt?
not that im aware of, maybe theres a damage multiplier DVAR or something, but otherwise, damage is already dealt before any point you can intervene that i know of, all my scripts was "adding" to said damage
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
