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

Ananke

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Posts posted by Ananke

  1. Ah it's auto-target when you use non AOE spell, but still, i want it to target the nearest NPC, or at last NPC in spell range.

    or maybe you know how to do AoE spell doesn't require auto-target?

    ps:

    Missed code (in modgamelogic):

    ```
    Function FindNPCInRange(ByVal Index As Long, ByVal mapnum As Long, ByVal Range As Long)
    Dim x As Long, y As Long
    Dim npcX As Long, npcY As Long
    Dim i As Long

    FindNPCInRange = 0

    For i = 1 To MAX_MAP_NPCS
    x = GetPlayerX(Index)
    y = GetPlayerY(Index)
    npcX = MapNpc(mapnum).NPC(i).x
    npcY = MapNpc(mapnum).NPC(i).y

    If isInRange(Range, x, y, npcX, npcY) Then
    If MapNpc(mapnum).NPC(i).Num > 0 Then
    If NPC(MapNpc(mapnum).NPC(i).Num).Behaviour = NPC_BEHAVIOUR_ATTACKONSIGHT Or NPC(MapNpc(mapnum).NPC(i).Num).Behaviour = NPC_BEHAVIOUR_ATTACKWHENATTACKED Then
    FindNPCInRange = i
    Exit Function
    End If
    End If
    End If

    Next i

    End Function

    ```
  2. ```
    Sub CheckPlayerLevelUp(ByVal index As Long)
    Dim i As Long
    Dim expRollover As Long
    Dim level_count As Long

    level_count = 0

    Do While GetPlayerExp(index) >= GetPlayerNextLevel(index)
    expRollover = GetPlayerExp(index) - GetPlayerNextLevel(index)

    ' can level up?
    If Not SetPlayerLevel(index, GetPlayerLevel(index) + 1) Then
    Exit Sub
    End If

    Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + x) "<- change this"
    Call SetPlayerExp(index, expRollover)
    level_count = level_count + 1
    Loop

    If level_count > 0 Then
    If level_count = 1 Then
    'singular
    GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown
    Else
    'plural
    GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown
    End If
    SendEXP index
    SendPlayerData index
    End If
    End Sub

    ```
×
×
  • Create New...