Ok so I added quests, no errors, but they're bugs.
Ok, so basically I had to change the CanAttackNpc function DUH, but for some reason it kills Quest type NPC's... its weird, and when I attack em, it does not even start the quest, but if I add a Call playerMsg it gives a message..
Code:
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Dim MapNum As Long, npcnum As Long
Dim x As Long
Dim y As Long
CanAttackNpc = False
' Check for subscript out of range
If IsPlaying(Attacker) = False Or MapNpcNum <= 0 Or MapNpcNum > MAX_MAP_NPCS Then
Exit Function
End If
' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num <= 0 Then
Exit Function
End If
MapNum = GetPlayerMap(Attacker)
npcnum = MapNpc(MapNum, MapNpcNum).Num
' Make sure the npc isn't already dead
If MapNpc(MapNum, MapNpcNum).HP <= 0 Then
Exit Function
End If
' Make sure they are on the same map
If npcnum > 0 And GetTickCount > Player(Attacker).AttackTimer + 950 Then
' Check if at same coordinates
x = DirToX(GetPlayerX(Attacker), GetPlayerDir(Attacker))
y = DirToY(GetPlayerY(Attacker), GetPlayerDir(Attacker))
If (MapNpc(MapNum, MapNpcNum).y = y) And (MapNpc(MapNum, MapNpcNum).x = x) Then
'If (MapNpc(MapNum, MapNpcNum).y + 1 = GetPlayerY(Attacker)) And (MapNpc(MapNum, MapNpcNum).x = GetPlayerX(Attacker)) Then
If Npc(npcnum).Behavior <> NPC_BEHAVIOR_FRIENDLY And Npc(npcnum).Behavior <> NPC_BEHAVIOR_SHOPKEEPER And Npc(npcnum).Behavior <> NPC_BEHAVIOR_QUEST Then
CanAttackNpc = True
Else
If Npc(npcnum).Behavior = NPC_BEHAVIOR_QUEST Then
Call DoQuest(Npc(npcnum).Quest, Attacker, npcnum)
Else
Call PlayerMsg(Attacker, "You cannot attack a " & Trim(Npc(npcnum).Name) & "!", BrightBlue)
End If
' End If
End If
End If
End If
End Function