Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin CSC_Katti
- ; 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 morning
- short evening
- if ( GameHour >= 9 )
- if ( GameHour < 21 )
- if ( morning == 0 )
- PositionCell -131545 220782 90 0 "Солстхейм, побережьe Фелсаад" (-17, 26 ) ; без CELLID, если НПЦ должен быть в экстерьере
- set morning to 1
- set evening to 0
- endif
- endif
- elseif ( GameHour < 9 )
- if ( GameHour <= 21 )
- if ( evening == 0 )
- PositionCell 3633 2868 12726 10800 "Каюта Катти Сарк"; gradus выставляет НПЦ относительно севера (север берется за 0 ) по часовой стрелке, но не в градусах, а в минутах
- set evening to 1
- set morning to 0
- endif
- endif
- endif
- 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 ( 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