Mirage Engine
Stop killing the NPC! - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Stop killing the NPC! (/showthread.php?tid=1986)



Stop killing the NPC! - jsventor - 03-08-2008

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 MAX_MAP_NPCS Then
Exit Function
End If

' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num


Re: Stop killing the NPC! - jsventor - 03-08-2008

Its in there lol


Re: Stop killing the NPC! - jsventor - 03-08-2008

None of it works, I tried that all Cry


Re: Stop killing the NPC! - jsventor - 03-08-2008

I reviewed EVERYTHING, the quest editor, everything, its weird, and I just provided that code because I figured that's where the bug was, I'll go over the packets again


Re: Stop killing the NPC! - Rian - 03-08-2008

I had the same problem with my quests man. It really is strange. I tried every variant I could think of to make sure the code was executed only when the npc isn't attackable. I ended up making a function that checks if you're standing next to a friendly npc with a quest and say the the words "hi", "hey", and "hello" to start the quest process.


Re: Stop killing the NPC! - Leighland - 05-08-2008

Try this:

[code]
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Dim MapNum As Long, npcnum As Long

CanAttackNpc = False

' Check for subscript out of range
If IsPlaying(Attacker) = False Or MapNpcNum MAX_MAP_NPCS Then
Exit Function
End If

' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num