Hey guys, so I’m having a bit of trouble with the syntax of putting this code together. Or perhaps my logic is not the most efficient way of doing this.
The concept is simple: Add a new attribute for weapons that would be considered an “element”. Add those same attributes to NPCs. During combat, it would check to see if player(index).weapon.element.fire (or whatever) is true, then damage = damage x 2, else damage = damage.
First off, I went Server Side:
ModTypes - under ItemRec, below “ToolReq as Long” I added “Element as Long”. From my understanding, this will store data as Item(index).Element, correct?
-under NpcRec, below “Level as Long”, I added “Element as Long” again.
I repeated this in the Client’s ModTypes as well.
Now is where I’m lost with syntax. In FrmEditor_Item, I added a scrollbar (scrlElement), min=0, max=5 (for starters, maybe I’ll add more elements later), I set up a label next to it so it will display the scrollbar value.
I did the same thing in FrmEditor_NPC with a scrollbar and label.
Private Sub scrlElement_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If scrlElement.Value = 0 Then lblElement.Caption = "E: None" ElseIf scrlElement.Value = 1 Then lblElement.Caption = "E: Fire" ElseIf scrlElement.Value = 2 Then lblElement.Caption = "E: Ice" ElseIf scrlElement.Value = 3 Then lblElement.Caption = "E: Bolt" ElseIf scrlElement.Value = 4 Then lblElement.Caption = "E: Holy" ElseIf scrlElement.Value = 5 Then lblElement.Caption = "E: Dark" End If ' Error handler Exit Sub errorhandler: HandleError "scrlElement_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub
From what I can tell, this doesn’t change anything in the ItemRec’s Element - so how can I do that? AND, what would be the proper syntax of calling that variable again ServerSide under the ModCombat module?
Would it just be GetItem(index).Element? I think I’m going in the right direction, but a little foggy.
I have added Item(EditorIndex).Element = scrlElement.Value - and it compiled with no errors. I’m still having trouble figuring out how exactly do I call that data in ModCombat.
GetPlayerEquipment(index, equipment).element = 3
I think that is correct - but I am having difficulty with grabbing the NPC(index).Element…do I need to add an Element long variable under the MapNpcRec as well?