ref rContainerBegin OnAdd set rContainer to GetContainer rContainer.AddItem Pencil01 1 1 rContainer.RemoveItem Pencil01 1 1End
Cipscis
ref rContainerBegin OnAdd set rContainer to GetContainer rContainer.AddItem Pencil01 1 1 rContainer.RemoveItem Pencil01 1 1End
ref rContainerBegin OnAdd set rContainer to GetContainer rContainer.AddItem Pencil01 1 1 rContainer.RemoveItem Pencil01 1 1End
set iCount to ListGetCount SomeFormListset iIndex to 0Label 1if iIndex < iCount set rListItem to ListGetNthForm SomeFormList iIndex ; do stuff with rListItem set iIndex to iIndex + 1 Goto 1endif
set iCount to ListGetCount SomeFormListset iIndex to 0Label 1if iIndex < iCount set rListItem to ListGetNthForm SomeFormList iIndex ; do stuff with rListItem set iIndex to iIndex + 1 Goto 1endif
set rActor to GetFirstRef 42 ;42 is the TypeCode for NPCLabel 1if IsReference rActor ; do stuff with rActor set rActor to GetNextRef Goto 1endif
scn RKRDetectTokenScriptfloat timershort countref actorref actor2short startref objfloat detectvalfloat ddistfloat detectval2float ddist2short AlertOnce;-------------------------------------------------------------------------------------------Begin OnAddset actor to getContainerset start to 1End;-------------------------------------------------------------------------------------------Begin GameModeif start == 0 returnendifif timer > 0 set timer to timer - getSecondsPassed returnendifset timer to 10set count to count + 1if AlertOnce == 0 set obj to apple set obj to getFirstRef 200 Label 1 if obj != 0 set detectval to ( obj.getdetected actor ) set ddist to ( obj.getdistance actor ) if ( detectval > detectval2 ) && ( ddist < RKRdetectdist ) set detectval2 to detectval set actor2 to obj endif set obj to apple set obj to getNextRef goto 1 endif set AlertOnce to 1endifif ( detectval2 > RKRdetectlevel ) if RKRDebug == 1 PrintToConsole "Creating detection event %.0f" count endif actor2.createDetectionEvent player 100 endifendifif count < 3 returnendifremoveMereturnEnd
Label 1if obj != 0 if obj.getDead == 1 if (listRemoveForm oldList obj) != -1 && obj.isKiller player == 1 && tokenCount < RKRMaxTokenCount ;PrintToConsole "Adding detection token" set tokenCount to tokenCount + 1 set removeTimer to 30 obj.addItem RKRDetectToken 1 endif else obj.listAddReference newList endif set obj to apple set obj to getNextRef goto 1endif
if removeTimer > 0 set removeTimer to removeTimer - getSecondsPassedelse set tokenCount to 0endif
if RKRMainQuest.tokenCount > 0 set RKRMainQuest.tokenCount to RKRMainQuest.tokenCount - 1endif