Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin EM_Kidsschedulescript
- ; By Nigedo.
- ; This script is for all kids who require only scheduled behaviour and recall when attacked
- ; scripts disable/enable while unseen and timing reworked by abot
- Short nolore
- Short knowyou
- Short OnPCHitMe
- Short removeDay
- Short count
- Short extraBounty
- short i1
- float t1
- float x1
- float y1
- float x2
- float y2
- float x3
- float y3
- if ( MenuMode == 1 )
- return
- endif
- if ( i1 >= 10 )
- set x2 to ( GetDistance player )
- if ( x2 > 500 )
- set i1 to 1
- set x1 to ( player->GetPos X )
- set y1 to ( player->GetPos Y )
- set y3 to ( player->GetAngle Z )
- set x2 to GetPos X
- set y2 to GetPos Y
- set x2 to ( x2 - x1 )
- set y2 to ( y2 - y1 )
- set x3 to ( y2 * y2 )
- if ( x3 < 0.000001 )
- return
- endif
- set x3 to ( x2 / y2 )
- if ( x2 > 0 )
- if ( y2 > 0 )
- if ( x3 > 1 )
- if ( y3 < -45 )
- set i1 to 0
- endif
- else
- if ( y3 < -90 )
- set i1 to 0
- endif
- if ( y3 > 135 )
- set i1 to 0
- endif
- endif
- else
- if ( x3 < -1 )
- if ( y3 < 0 )
- if ( y3 > -135 )
- set i1 to 0
- endif
- endif
- else
- if ( y3 < 45 )
- if ( y3 > -90 )
- set i1 to 0
- endif
- endif
- endif
- endif
- else
- if ( y2 > 0 )
- if ( x3 < -1 )
- if ( y3 > 45 )
- set i1 to 0
- endif
- else
- if ( y3 > 90 )
- set i1 to 0
- endif
- if ( y3 < -135 )
- set i1 to 0
- endif
- endif
- else
- if ( x3 > 1 )
- if ( y3 > 0 )
- if ( y3 < 135 )
- set i1 to 0
- endif
- endif
- else
- if ( y3 > -35 )
- if ( y3 < 90 )
- set i1 to 0
- endif
- endif
- endif
- endif
- endif
- if ( i1 == 0 ) ; player is not looking at me
- if ( GetDisabled == 0 )
- disable
- else
- enable
- endif
- endif
- endif
- set i1 to 0
- endif
- if ( t1 < 5 )
- set t1 to ( t1 + GetSecondsPassed )
- else
- set t1 to ( ( Random 10001 ) / 10000.0 )
- if ( GameHour > 20 )
- set i1 to 1
- elseif ( GameHour < 8 )
- set i1 to 1
- else
- set i1 to 0
- endif
- if ( i1 == 1 )
- if ( GetDisabled == 0 )
- set i1 to 10
- return
- endif
- else ; daytime
- if ( day != removeDay )
- if ( GetDisabled == 1 )
- set i1 to 20
- return
- endif
- endif
- endif
- endif
- if ( CellChanged == 1 )
- if ( GameHour > 20 )
- set i1 to 1
- elseif ( GameHour < 8 )
- set i1 to 1
- else
- set i1 to 0
- endif
- if ( GetInterior == 1 )
- if ( i1 == 1 )
- if ( GetDisabled == 0 )
- disable
- endif
- elseif ( GetDisabled == 1 )
- enable
- endif
- return
- endif
- endif
- if ( GetDisabled == 1 )
- return
- endif
- if ( GetEffect sEffectRecall ) ; Recall cast completed
- set removeDay To Day; Trigger unscheduled disable for one day
- disable
- return
- elseif ( OnPCHitMe == 1 )
- SetHealth 1000 ; Prevent more attacks from killing kid
- Cast "1EM_kidsrecall" Player ; Face Player and cast kids recall spell
- if ( extraBounty == 0 )
- ModPCCrimeLevel 2000 ; Add extra fine for this crime
- set extraBounty To 1
- elseif ( GetPCCrimeLevel == 0 )
- set OnPCHitMe To 0
- set extraBounty To 0
- endif
- endif
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement