4ªUƒtxt addoninfo6º}ÿÙÿÿnutscripts/vscriptsspecialladders/r‹úÿÙ ÿÿdirector_base_addon¶?:ºÿñ "ÿÿ"AddonInfo" { addonSteamAppID 550 addontitle "witch/tank ladder fix" addonversion 1 addonauthor "l0st" addonDescription "closes the biggest flaw in both the tank and the witch: ladders" addonContent_Script 1 } IncludeScript( "heavyutils" ) ::SpecialLadders <- { function IsAlive( special ) { return ( special.IsPlayer() ) ? HeavyUtils.IsAlive : special.GetHealth() > 0 } function IsOnLadder( player ) { return NetProps.GetPropInt( player, "movetype" ) == 9 } function IsGrounded( player ) { return NetProps.GetPropInt( player, "m_fFlags" ) & 1 } function Monitor() { if ( !HeavyUtils.IsReal( special ) || !SpecialLadders.IsAlive( special ) ) return HeavyUtils.RemoveMonitorDirectly( monitor, special ) local specialspot = special.GetCenter() local target = HeavyUtils.GetTarget( special ) if ( HeavyUtils.IsReal( target ) && target.GetCenter().z <= specialspot.z ) return 0.1 foreach( survivor in HeavyUtils.YieldSurvivors() ) { local survivorspot = survivor.GetCenter() if ( fabs( specialspot.x - survivorspot.x ) > 80 ) continue if ( fabs( specialspot.y - survivorspot.y ) > 80 ) continue if ( survivorspot.z <= specialspot.z ) continue if ( !SpecialLadders.IsOnLadder( survivor ) ) continue // local ladder = Entities.FindByClassnameWithin( null, "func_simpleladder", survivorspot, 200 ) // if ( !HeavyUtils.IsReal( ladder ) ) // return 0.5 // local amt = ( special.GetClassname() == "witch" ) ? 100 : 10 local amt = ( SpecialLadders.IsGrounded( special ) ) ? 20 : 12 local iswitch = special.GetClassname() == "witch" if ( iswitch ) amt *= 4 local vel = ( iswitch ) ? special.GetVelocity() * 0.02 : Vector( 0, 0, 0 ) special.SetVelocity( Vector( 0, 0, -4 ) ) special.SetOrigin( special.GetOrigin() + Vector( -vel.x, -vel.y, amt ) ) // 100 // special.SetVelocity( Vector( 0, 0, -4 ) ) if ( iswitch && target ) special.SetAngles( HeavyUtils.VectorAngles( witch.GetCenter() - target.EyePosition() ) ) if ( iswitch ) return 0.01 break } return 0.1 } function OnGameEvent_player_spawn( opts ) { if ( !HeavyUtils.AllPresent( opts, "userid" ) ) return local player = GetPlayerFromUserID( opts.userid ) if ( !HeavyUtils.IsReal( player ) || !IsPlayerABot( player ) || player.GetZombieType() != DirectorScript.ZOMBIE_TANK ) return HeavyUtils.AddMonitor( player, "specialladders_monitor", SpecialLadders.Monitor, { special = player } ) } function OnGameEvent_witch_harasser_set( opts ) { if ( !HeavyUtils.AllPresent( opts, "userid", "witchid" ) ) return local player = GetPlayerFromUserID( opts.userid ) if ( !HeavyUtils.IsReal( player ) ) return local witch = EntIndexToHScript( opts.witchid ) if ( !HeavyUtils.IsReal( witch ) ) return HeavyUtils.AddMonitor( witch, "specialladders_monitor", SpecialLadders.Monitor, { special = witch } ) } } __CollectEventCallbacks( SpecialLadders, "OnGameEvent_", "GameEventCallbacks", RegisterScriptGameEventListener ) IncludeScript( "specialladders" )