Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

My npc dont speak with me :(


karpaz
 Share

Recommended Posts

hello again .. i have big problem .. my npc dont want speak with me ..

i use altar quest system , door system , edit max npc 30>to 50 and it is all :| how can i fix it ?

[![](http://img52.imageshack.us/img52/8738/screeenshot.png)](http://imageshack.us/photo/my-images/52/screeenshot.png/)
Link to comment
Share on other sites

@GoldSide:

> and give the health the Npc..

Off topic:
If you will look really closely, you can see that his NPC has already 20 health

On topic:
Podle toho, jak to NPC mas nastaveny, by ti to fungovat melo, problem bude nejspis s tim editem max poctu NPC na 50, jak rikal GoldSide, zkus restartovat server. Pokud to nepomuze, tak problem bude nejspis s tim, ze vetsina lidi rika, ze po takovyhlech editacich je treba smazat svoje mapy nebo NPC, nebo napsat converter (coz nemam paru jak), takze to nejako zkus.
A predtim ti to fungovalo (pred editem max NPC) nebo ne?
Link to comment
Share on other sites

Sub canplayerattacknpc

> Public Function CanPlayerAttackNpc(ByVal attacker As Long, ByVal mapNpcNum As Long, Optional ByVal IsSpell As Boolean = False) As Boolean
>     Dim mapNum As Long
>     Dim npcNum As Long
>     Dim NpcX As Long
>     Dim NpcY As Long
>     Dim attackspeed As Long
>
>     ' 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)).NPC(mapNpcNum).Num <= 0 Then
>         Exit Function
>     End If
>
>     mapNum = GetPlayerMap(attacker)
>     npcNum = MapNpc(mapNum).NPC(mapNpcNum).Num
>    
>     ' Make sure the npc isn't already dead
>     If MapNpc(mapNum).NPC(mapNpcNum).Vital(Vitals.HP) <= 0 Then
>         Exit Function
>     End If
>
>     ' Make sure they are on the same map
>     If IsPlaying(attacker) Then
>    
>         ' exit out early
>         If IsSpell Then
>             If npcNum > 0 Then
>                 If NPC(npcNum).Behaviour <> NPC_BEHAVIOUR_FRIENDLY And NPC(npcNum).Behaviour <> NPC_BEHAVIOUR_SHOPKEEPER Then
>                     CanPlayerAttackNpc = True
>                     Exit Function
>                 End If
>             End If
>         End If
>
>         ' attack speed from weapon
>         If GetPlayerEquipment(attacker, Weapon) > 0 Then
>             attackspeed = Item(GetPlayerEquipment(attacker, Weapon)).Speed
>         Else
>             attackspeed = 1000
>         End If
>
>         If npcNum > 0 And GetTickCount > TempPlayer(attacker).AttackTimer + attackspeed Then
>             ' Check if at same coordinates
>             Select Case GetPlayerDir(attacker)
>                 Case DIR_UP
>                     NpcX = MapNpc(mapNum).NPC(mapNpcNum).x
>                     NpcY = MapNpc(mapNum).NPC(mapNpcNum).y + 1
>                 Case DIR_DOWN
>                     NpcX = MapNpc(mapNum).NPC(mapNpcNum).x
>                     NpcY = MapNpc(mapNum).NPC(mapNpcNum).y - 1
>                 Case DIR_LEFT
>                     NpcX = MapNpc(mapNum).NPC(mapNpcNum).x + 1
>                     NpcY = MapNpc(mapNum).NPC(mapNpcNum).y
>                 Case DIR_RIGHT
>                     NpcX = MapNpc(mapNum).NPC(mapNpcNum).x - 1
>                     NpcY = MapNpc(mapNum).NPC(mapNpcNum).y
>             End Select
>
>             If NpcX = GetPlayerX(attacker) Then
>                 If NpcY = GetPlayerY(attacker) Then
>                     If NPC(npcNum).Behaviour <> NPC_BEHAVIOUR_FRIENDLY And NPC(npcNum).Behaviour <> NPC_BEHAVIOUR_SHOPKEEPER Then
>                         CanPlayerAttackNpc = True
>                     Else
>                         'ALATAR
>                         If NPC(npcNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY Then
>                             Call CheckTasks(attacker, QUEST_TYPE_GOTALK, npcNum)
>                             Call CheckTasks(attacker, QUEST_TYPE_GOGIVE, npcNum)
>                             Call CheckTasks(attacker, QUEST_TYPE_GOGET, npcNum)
>                            
>                             If NPC(npcNum).Quest = YES Then
>                                 If CanStartQuest(attacker, NPC(npcNum).QuestNum) Then
>                                     'if can start show the request message (chat1)
>                                     QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(1)), NPC(npcNum).QuestNum
>                                     Exit Function
>                                 End If
>                                 If QuestInProgress(attacker, NPC(npcNum).QuestNum) Then
>                                     'if the quest is in progress show the meanwhile message (chat2)
>                                     PlayerMsg attacker, Trim$(NPC(npcNum).Name) + ": " + Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), BrightGreen
>                                     'QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Chat(2)), 0
>                                     Exit Function
>                                 End If
>                             End If
>                         End If
>                         '/ALATAR
>                         If Len(Trim$(NPC(npcNum).AttackSay)) > 0 Then
>                             PlayerMsg attacker, Trim$(NPC(npcNum).Name) & ": " & Trim$(NPC(npcNum).AttackSay), White
>                         End If
>                     End If
>                 End If
>             End If
>         End If
>     End If
Link to comment
Share on other sites

I looked at ur project and I noticed that most of your playermsgs don't show up..
examples: welcome message , number of players online, message when u warp maps, notification when learning a spell, all resource related messages and others.. some do work like ur map msgs and "invalid trade target". I'll keep looking but  not really sure what to look for now :\ maybe someone can point u where to correct this
Link to comment
Share on other sites

@Justn:

> I looked at ur project and I noticed that most of your playermsgs don't show up..
> examples: welcome message , number of players online, message when u warp maps, notification when learning a spell, all resource related messages and others.. some do work like ur map msgs and "invalid trade target". I'll keep looking but  not really sure what to look for now :\ maybe someone can point u where to correct this

Sounds like a packet issue, then.

You probably screwed up the header enumeration so they're not synced. This'll cause all kinds of problems.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...