File 'Farmer Mod v4.3.esp' is not a valid TES file. Но перед этим есть еще: Где мне сложно продублировать изменения ) MEE - cейчас пробую. Стражник нападает. [buspoiler] begin fm_guardscript
short state
short DoOnce
short wtower
short intower
short TowerSlot
short foundtower
short GuardType
short GuardRan
short BDay
short owned
short IsGuarding
short Followed
short GLCont
short GLContID
short cIsGuarding
short StayOutside
float GuardCounter
if ( GetTarget,player )
StopCombat,player;)
endif
if ( DoOnce != 1 )
set StayOutside to 0
set cIsGuarding to 0
set intower to 0
set wtower to 0
set state to 0
set foundtower to 0
set IsGuarding to 0
set GuardCounter to 0
set Followed to 0
set DoOnce to 1
set GLCont to 0
set GLContID to 0
set GuardRan to Random, 100
if ( GuardRan < 25 )
set GuardType to 1
elseif ( GuardRan < 45 )
set GuardType to 2
elseif ( GuardRan < 60 )
set GuardType to 3
elseif ( GuardRan < 75 )
set GuardType to 4
elseif ( GuardRan < 85 )
set GuardType to 5
elseif ( GuardRan < 92 )
set GuardType to 6
elseif ( GuardRan < 98 )
set GuardType to 7
elseif ( GuardRan <= 100 )
set GuardType to 8
endif
if ( GuardType == 1 )
SetLevel 5
AddItem, "chitin cuirass" , 1
AddItem, "chitin pauldron - left" , 1
AddItem, "chitin pauldron - right" , 1
AddItem, "chitin greaves" , 1
AddItem, "chitin boots" , 1
AddItem, "chitin guantlet - left" , 1
AddItem, "chitin guantlet - right" , 1
AddItem, "chitin spear" , 1
; Additem, "chitin short bow", 1
; Additem, "chitin arrow", 25
elseif ( GuardType == 2 )
SetLevel 10
AddSpell "fm_guardspell_10"
AddItem, "iron_cuirass" , 1
AddItem, "iron_pauldron_left" , 1
AddItem, "iron_pauldron_right" , 1
AddItem, "iron_greaves" , 1
AddItem, "iron boots" , 1
AddItem, "iron_gauntlet_left" , 1
AddItem, "iron_gauntlet_right" , 1
AddItem, "iron spear" , 1
; Additem, "short bow", 1
; Additem, "iron arrow", 25
elseif ( GuardType == 3 )
SetLevel 15
AddSpell "fm_guardspell_15"
AddItem, "steel_cuirass" , 1
AddItem, "steel_pauldron_left" , 1
AddItem, "steel_pauldron_right" , 1
AddItem, "steel_greaves" , 1
AddItem, "steel_boots" , 1
AddItem, "steel_gauntlet_left" , 1
AddItem, "steel_gauntlet_right" , 1
AddItem, "steel spear" , 1
; Additem, "long bow", 1
; Additem, "iron arrow", 25
elseif ( GuardType == 4 )
SetLevel 20
AddSpell "fm_guardspell_20"
AddItem, "silver_cuirass" , 1
AddItem, "imperial left pauldron" , 1
AddItem, "imperial right pauldron" , 1
AddItem, "imperial_greaves" , 1
AddItem, "imperial boots" , 1
AddItem, "imperial left gauntlet" , 1
AddItem, "imperial right gauntlet" , 1
AddItem, "silver spear" , 1
; Additem, "long bow", 1
; Additem, "steel arrow", 25
elseif ( GuardType == 5 )
SetLevel 25
AddSpell "fm_guardspell_25"
AddItem, "bonemold_cuirass" , 1
AddItem, "bonemold_armun-an_pauldron_l" , 1
AddItem, "bonemold_armun-an_pauldron_r" , 1
AddItem, "bonemold_greaves" , 1
AddItem, "bonemold_boots" , 1
AddItem, "bonemold_bracer_left" , 1
AddItem, "bonemold_bracer_right" , 1
AddItem, "silver spear" , 1
; Additem, "bonemold long bow", 1
; Additem, "silver arrow", 25
elseif ( GuardType == 6 )
SetLevel 30
AddSpell "fm_guardspell_30"
AddItem, "indoril cuirass" , 1
AddItem, "indoril pauldron left" , 1
AddItem, "indoril pauldron right" , 1
AddItem, "indoril boots" , 1
AddItem, "indoril left gauntlet" , 1
AddItem, "indoril right gauntlet" , 1
AddItem, "ebony spear" , 1
; Additem, "bonemold long bow", 1
; Additem, "glass arrow", 25
elseif ( GuardType == 7 )
SetLevel 40
AddSpell "fm_guardspell_40"
AddItem, "Helsethguard_cuirass" , 1
AddItem, "Helsethguard_pauldron_left" , 1
AddItem, "Helsethguard_pauldron_right" , 1
AddItem, "Helsethguard_greaves" , 1
AddItem, "Helsethguard_boots" , 1
AddItem, "Helsethguard_gauntlet_left" , 1
AddItem, "Helsethguard_gauntlet_right" , 1
AddItem, "ebony spear" , 1
; Additem, "bonemold long bow", 1
; Additem, "daedric arrow", 25
elseif ( GuardType == 8 )
SetLevel 50
AddSpell "fm_guardspell_50"
AddItem, "adamantium_cuirass" , 1
AddItem, "adamantium_pauldron_left" , 1
AddItem, "adamantium_pauldron_right" , 1
AddItem, "adamantium_greaves" , 1
AddItem, "adamantium boots" , 1
AddItem, "adamantium_bracer_left" , 1
AddItem, "adamantium_bracer_right" , 1
AddItem, "daedric spear" , 1
; Additem, "daedric long bow", 1
; Additem, "daedric arrow", 25
endif
AddSpell "fm_guardspell_base"
set BDay to DaysPassed
set owned to 0
endif
if ( GetDisabled == 1 )
return
endif
if ( owned == 0 )
if ( bday < DaysPassed )
Disable
endif
endif
if ( cIsGuarding != 0 )
set IsGuarding to 0
set cIsGuarding to 0
set GuardCounter to 0.0
if ( GetItemCount "fm_heavy" > 0 )
RemoveItem, "fm_heavy", 1
StartScript "fm_c_EquipMelee"
endif
return
endif
if ( IsGuarding == 1 )
if ( GuardCounter >= 10 )
if ( cIsGuarding != 0 )
set IsGuarding to 0
set cIsGuarding to 0
set GuardCounter to 0.0
if ( GetItemCount "fm_heavy" > 0 )
RemoveItem, "fm_heavy", 1
StartScript "fm_c_EquipMelee"
endif
return
endif
if ( GetWeaponDrawn == 0 )
AiWander, 250,0,0,0,0,0,0,0,0
endif
if ( GetItemCount "fm_heavy" > 0 )
StartScript "fm_c_EquipMelee"
endif
while ( GetItemCount "fm_heavy" > 0 )
RemoveItem, "fm_heavy" , 1
endwhile
set GuardCounter to 0.0
set Followed to 0
elseif ( GuardCounter >= 5 )
if ( Followed == 0 )
if ( cIsGuarding != 0 )
set IsGuarding to 0
set cIsGuarding to 0
set GuardCounter to 0.0
if ( GetItemCount "fm_heavy" > 0 )
RemoveItem, "fm_heavy", 1
StartScript "fm_c_EquipMelee"
endif
return
endif
set Followed to 1
if ( GetWeaponDrawn == 0 )
AiFollow, Player, 0,0,0,0
AddItem, "fm_heavy" , 1
StartScript "fm_c_EquipBow"
endif
else
if ( cIsGuarding == 0 )
if ( GetItemCount "fm_heavy" > 0 )
StartScript "fm_c_Refill"
endif
else
set IsGuarding to 0
set cIsGuarding to 0
set GuardCounter to 0.0
if ( GetItemCount "fm_heavy" > 0 )
RemoveItem, "fm_heavy", 1
StartScript "fm_c_EquipMelee"
endif
return
endif
set GuardCounter to ( GuardCounter + GetSecondsPassed )
endif
else
; if ( cIsGuarding != 0 )
; set IsGuarding to 0
; set cIsGuarding to 0
; set GuardCounter to 0.0
; if ( GetItemCount "fm_heavy" > 0 )
; RemoveItem, "fm_heavy", 1
; StartScript "fm_c_EquipMelee"
; endif
; return
; endif
set GuardCounter to ( GuardCounter + GetSecondsPassed )
endif
endif
if ( cIsGuarding == 1 )
set cIsGuarding to 0
endif
if ( GLCont == 0 )
if ( GetDistance, fm_cont_arano < 2000 )
set Arano_GuardLevel to ( Arano_GuardLevel + ( GuardType ) )
set GLCont to 1
set GLContID to 1
elseif ( GetDistance, fm_cont_ieneth < 2000 )
set Ieneth_GuardLevel to ( Ieneth_GuardLevel + ( GuardType ) )
set GLCont to 1
set GLContID to 2
elseif ( GetDistance, fm_cont_drom < 2000 )
set Drom_GuardLevel to ( Drom_GuardLevel + ( GuardType ) )
set GLCont to 1
set GLContID to 3
elseif ( GetDistance, fm_cont_new < 2000 )
set New_GuardLevel to ( New_GuardLevel + ( GuardType ) )
set GLCont to 1
set GLContID to 4
endif
else
if ( GLContID == 1 )
if ( GetDistance, fm_cont_arano >= 2000 )
set Arano_GuardLevel to ( Arano_GuardLevel - ( GuardType ) )
set GLCont to 0
endif
elseif ( GLContID == 2 )
if ( GetDistance, fm_cont_ieneth >= 2000 )
set Ieneth_GuardLevel to ( Ieneth_GuardLevel - ( GuardType ) )
set GLCont to 0
endif
elseif ( GLContID == 3 )
if ( GetDistance, fm_cont_drom >= 2000 )
set Drom_GuardLevel to ( Drom_GuardLevel - ( GuardType ) )
set GLCont to 0
endif
elseif ( GLContID == 4 )
if ( GetDistance, fm_cont_new>= 2000 )
set New_GuardLevel to ( New_GuardLevel - ( GuardType ) )
set GLCont to 0
endif
endif
endif
if ( state == 1 )
if ( GetDistance, fm_cont_drom < 3000 )
if ( fm_cont_drom.tower == 1 )
if ( Drom_GTO < 2 )
if ( Drom_GSlot1 == 0 )
set TowerSlot to 0
set Drom_GSlot1 to 1
else
set TowerSlot to 1
set Drom_GSlot2 to 1
endif
set foundtower to 1
set wtower to 1
set Drom_GTO to ( Drom_GTO + 1 )
AiTravel 47503, -59819, 902
else
set foundtower to 1
MessageBox "Ближайшая Сторожевая башня не может вместить в себя больше охранников"
endif
endif
elseif ( GetDistance, fm_cont_ieneth < 3000 )
if ( fm_cont_ieneth.tower == 1 )
if ( Ieneth_GTO < 2 )
if ( Ieneth_GSlot1 == 0 )
set TowerSlot to 0
set Ieneth_GSlot1 to 1
else
set TowerSlot to 1
set Ieneth_GSlot2 to 1
endif
set foundtower to 1
set wtower to 2
set Ieneth_GTO to ( Ieneth_GTO + 1 )
AiTravel 35267, -62677, 831
else
set foundtower to 1
MessageBox "Ближайшая Сторожевая башня не может вместить в себя больше охранников"
endif
endif
elseif ( GetDistance, fm_cont_arano < 3000 )
if ( fm_cont_arano.tower == 1 )
if ( Arano_GTO < 2 )
if ( Arano_GSlot1 == 0 )
set TowerSlot to 0
set Arano_GSlot1 to 1
else
set TowerSlot to 1
set Arano_GSlot2 to 1
endif
set foundtower to 1
set wtower to 3
set Arano_GTO to ( Arano_GTO + 1 )
AiTravel 36141, -51108, 804
else
set foundtower to 1
MessageBox "Ближайшая Сторожевая башня не может вместить в себя больше охранников"
endif
endif
endif
if ( foundtower == 0 )
MessageBox "Поблизости нет Сторожевых башен"
endif
set foundtower to 0
set state to 0
endif
if ( wtower != 0 )
if ( intower != 1 )
if ( GetAiPackageDone == 1 )
if ( wtower == 1 )
if ( TowerSlot == 0 )
position 47187, -60049, 1682, 97
else
position 47129, -59952, 1682, 349
endif
elseif ( wtower == 2 )
if ( TowerSlot == 0 )
position 34988, -62475, 1615, 57
else
position 34930, -62580, 1615, 189
endif
elseif ( wtower == 3 )
if ( TowerSlot == 0 )
position 36344, -51083, 1463, 200
else
position 36338, -50958, 1463, 333
endif
endif
set intower to 1
AddItem, "fm_heavy", 1
AiFollow, player, 1,1,1,1
; Levelled Section (Merged Scripts)
if ( GetLevel == 5 )
removeitem, "chitin spear",1
additem, "chitin short bow",1
additem, "chitin arrow",25
elseif ( GetLevel == 10 )
removeitem,"iron spear",1
additem, "short bow",1
additem, "iron arrow",25
elseif ( GetLevel == 15 )
removeitem,"steel spear",1
additem, "long bow",1
additem, "iron arrow",25
elseif ( GetLevel == 20 )
removeitem,"silver spear",1
additem, "long bow",1
additem, "steel arrow",25
elseif ( GetLevel == 25 )
removeitem,"silver spear",1
additem, "bonemold long bow",1
additem, "silver arrow",25
elseif ( GetLevel == 30 )
removeitem,"ebony spear",1
additem, "bonemold long bow",1
additem, "glass arrow",25
elseif ( GetLevel == 40 )
removeitem,"ebony spear",1
additem, "bonemold long bow",1
additem, "daedric arrow",25
elseif ( GetLevel == 50 )
removeitem,"daedric spear",1
additem, "daedric long bow",1
additem, "daedric arrow",25
endif
endif
endif
endif
; Give the guard an infinite supply of arrows
; And a constantly renewing bow (so it doesn't brake)
if ( intower == 1 )
; Another Leveled Area
if ( GetLevel == 5 )
if ( GetItemCount "chitin arrow" < 1 )
removeitem, "chitin short bow",1
additem, "chitin short bow",1
additem, "chitin arrow",25
endif
elseif ( GetLevel == 10 )
if ( GetItemCount "iron arrow" < 1 )
removeitem, "short bow",1
additem, "short bow",1
additem, "iron arrow",25
endif
elseif ( GetLevel == 15 )
if ( GetItemCount "iron arrow" < 1 )
removeitem, "long bow",1
additem, "long bow",1
additem, "iron arrow",25
endif
elseif ( GetLevel == 20 )
if ( GetItemCount "steel arrow" < 1 )
removeitem, "long bow",1
additem, "long bow",1
additem, "steel arrow",25
endif
elseif ( GetLevel == 25 )
if ( GetItemCount "silver arrow" < 1 )
removeitem, "bonemold long bow",1
additem, "bonemold long bow",1
additem, "silver arrow",25
endif
elseif ( GetLevel == 30 )
if ( GetItemCount "glass arrow" < 1 )
removeitem, "bonemold long bow",1
additem, "bonemold long bow",1
additem, "glass arrow",25
endif
elseif ( GetLevel == 40 )
if ( GetItemCount "daedric arrow" < 1 )
removeitem, "bonemold long bow",1
additem, "bonemold long bow",1
additem, "daedric arrow",25
endif
elseif ( GetLevel == 50 )
if ( GetItemCount "daedric arrow" < 1 )
removeitem, "daedric long bow",1
additem, "daedric long bow",1
additem, "daedric arrow",25
endif
endif
endif
if ( state == 2 )
set intower to 0
if ( GetLevel == 5 )
additem, "chitin spear",1
removeitem, "chitin short bow",1
while ( GetItemCount, "chitin arrow" > 0 )
removeitem, "chitin arrow",1
endwhile
elseif ( GetLevel == 10 )
additem, "iron spear",1
removeitem, "short bow",1
while ( GetItemCount, "iron arrow" > 0 )
removeitem, "iron arrow",1
endwhile
elseif ( GetLevel == 15 )
additem, "steel spear",1
removeitem, "long bow",1
while ( GetItemCount, "steel arrow" > 0 )
removeitem, "steel arrow",1
endwhile
elseif ( GetLevel == 20 )
additem, "silver spear",1
removeitem, "long bow",1
while ( GetItemCount, "steel arrow" > 0 )
removeitem, "steel arrow",1
endwhile
elseif ( GetLevel == 25 )
additem, "silver spear",1
removeitem, "bonemold long bow",1
while ( GetItemCount, "silver arrow" > 0 )
removeitem, "silver arrow",1
endwhile
elseif ( GetLevel == 30 )
additem, "ebony spear",1
removeitem, "bonemold long bow",1
while ( GetItemCount, "glass arrow" > 0 )
removeitem, "glass arrow",1
endwhile
elseif ( GetLevel == 40 )
additem, "ebony spear",1
removeitem, "bonemold long bow",1
while ( GetItemCount, "daedric arrow" > 0 )
removeitem, "daedric arrow",1
endwhile
elseif ( GetLevel == 50 )
additem, "daedric spear",1
removeitem, "daedric long bow",1
while ( GetItemCount, "daedric arrow" > 0 )
removeitem, "daedric arrow",1
endwhile
endif
if ( wtower == 1 )
position 47409, -59804, 883, 46
set Drom_GTO to ( Drom_GTO - 1 )
if ( TowerSlot == 0 )
set Drom_GSlot1 to 0
else
set Drom_GSlot2 to 0
endif
elseif ( wtower == 2 )
position 35265, -62719, 831, 120
set Ieneth_GTO to ( Ieneth_GTO - 1 )
if ( TowerSlot == 0 )
set Ieneth_GSlot1 to 0
else
set Ieneth_GSlot2 to 0
endif
elseif ( wtower == 3 )
position 35977, -51160, 804, 263
set Arano_GTO to ( Arano_GTO - 1 )
if ( TowerSlot == 0 )
set Arano_GSlot1 to 0
else
set Arano_GSlot2 to 0
endif
endif
set wtower to 0
set state to 0
RemoveItem, "fm_heavy",1
set IsGuarding to 1
endif
end[/buspoiler] Скрипт вбит через MEE. if ( GetTarget,player )
StopCombat,player;)
endif Может в каком-то случае не срабатывать, если находится сразу после объявления переменных?