This will add a scroll bar to control the frequency of npc movement. This was only tested on MSE1.
Difficulty: 1/5
::Server Side::
modGeneralSub GameAi Search for
Code:
i = Int(Rnd * 5)
Replace with
Code:
i = Int(Rnd * Npc(NpcNum).Movement) + 1
modTypesNpcRec add:
Code:
Movement As Byte
modDatabase Sub LoadNpcs add:
Code:
Npc(i).Movement = Val(GetVar(FileName, "NPC" & i, "Movement"))
Sub SaveNpc add:
Code:
Call PutVar(FileName, "NPC" & NpcNum, "Movement", Trim$(Npc(NpcNum).Movement))
modServerTcpsub SendEditNpcTo add and the end of the packet
Code:
Npc(NpcNum).Movement
modHandleDatafind "savenpc" add
Code:
Npc(N).Movement = Val(Parse$(15))
::Client Side::
modHandleDatafind "updatenpc" add
Code:
Npc(n).Movement = 0
find "editnpc" add
Code:
Npc(n).Movement = Val(Parse$(15))
modTypesfind NpcRec add
Code:
Movement as Byte
modGameLogicSub NpcEditorInit add
Code:
frmNpcEditor.scrlMovement.Value = Npc(EditorIndex).Movement
sub NpcEditorOk add
Code:
Npc(EditorIndex).Movement = frmNpcEditor.scrlMovement.Value
modClientTCPsub sendsavenpc Add to the end of the packet
Code:
.Movement
Add a scroll bar in frmNpcEditor for the movement
Add a label for displaying the movement number
Add
Code:
Private Sub scrlMovement_Change()
lblMovement.Caption = (scrlMovement.Value)
End Sub
If there any errors please let me know.