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

RyokuHasu

Members
  • Posts

    1938
  • Joined

  • Last visited

    Never

Posts posted by RyokuHasu

  1. you go in and remove it from the map at this point…. or kill it (if you can)

    GO NEWS!!! Coming soon: Pet Stats scaling!!!! based on your level and STR the pet you summon will be stronger too =D

    WIP: Pet armor, give your pet paperdoll armor and get it back when it dies or is disbanded.

    ;D im making your pets better...
  2. **IMPORTANT EDIT**

    I ADDED back in the ability to take pets with you when you change maps

    Added:

    ```
    SpawnPet index, MapNum, Trim$(Player(index).Pet.SpriteNum)

    ```
    Find "  'switch maps" In modPlayer Add it under

    ```
    PetDisband index, OldMap

    ```
    if you already completed this tutorial before

    (yes it was as simple as using Trim$…. if only i figued that out 2 days ago when this was released >.<)
  3. =P i know its not the exact same

    BUT somtimes code breaks for an instant, its like that. One time while working on Bleach: Bladed's mirror people kept saying that thier kido spells were not calling the animations but still working (this is in a 3d combat MMO i made) I the code for some reason had a 1 in a 1000 chance of skiping the animation sequence, there was nothing i could do, i poured over it for 3 days looking for the problem, and cam back and said sorry, it looks fine.
  4. if adding Mp3's are possible, im sure adding other inage types is possible, BUT

    if you want to change image types easily use FREE and OPEN SOURCED GIMP

    http://www.gimp.org/

    The alternitive to ($500) Photoshop
  5. Sorry for tripple post but….

    I FIXED IT =D your pet will now die ... and not cause error

    basicly i made it check if the victim had an owner, if it did, its a pet, if it has no owner its a Regular NPC

    i just took the victim commands from Player attacking NPC and addapted them to the "if-then-else" i made

    and i added the loop remove target from all others for pet and NPC for mor complex battle conditions... i hope i helped... =D

    * * *

    Replace Sub NpcAttackNpc with:

    ```
    Sub NpcAttackNpc(ByVal MapNum As Long, ByVal attacker As Long, ByVal Victim As Long, ByVal Damage As Long)

        Dim i As Long
        Dim Buffer As clsBuffer
        Dim aNpcNum As Long
        Dim vNpcNum As Long
        Dim n As Long
        Dim PetOwner As Long

        If attacker <= 0 Or attacker > MAX_MAP_NPCS Then Exit Sub
        If Victim <= 0 Or Victim > MAX_MAP_NPCS Then Exit Sub
        If Damage <= 0 Then Exit Sub

          aNpcNum = MapNpc(MapNum).Npc(attacker).Num
          vNpcNum = MapNpc(MapNum).Npc(Victim).Num

        If aNpcNum <= 0 Then Exit Sub
        If vNpcNum <= 0 Then Exit Sub

        'set the victim's target to the pet attacking it
        MapNpc(MapNum).Npc(Victim).targetType = 2 'Npc
        MapNpc(MapNum).Npc(Victim).target = attacker

        ' Send this packet so they can see the person attacking
        Set Buffer = New clsBuffer
        Buffer.WriteLong SNpcAttack
        Buffer.WriteLong attacker
        SendDataToMap MapNum, Buffer.ToArray()
        Set Buffer = Nothing

        If Damage >= MapNpc(MapNum).Npc(Victim).Vital(Vitals.HP) Then
                SendActionMsg MapNum, "-" & Damage, BrightRed, 1, (MapNpc(MapNum).Npc(Victim).x * 32), (MapNpc(MapNum).Npc(Victim).y * 32)
                SendBlood MapNum, MapNpc(MapNum).Npc(Victim).x, MapNpc(MapNum).Npc(Victim).y

                ' npc is dead.
                'Call GlobalMsg(CheckGrammar(Trim$(Npc(vNpcNum).Name), 1) & " has been killed by " & CheckGrammar(Trim$(Npc(aNpcNum).Name)) & "!", BrightRed)
                  ' Set NPC target to 0
                  'Check if the Attacker has an owner, if it dose its a pet
                  If MapNpc(MapNum).Npc(attacker).PetData.Owner <> 0 Then

                        'If the NPC died, follow this
                          MapNpc(MapNum).Npc(attacker).target = 0
                          MapNpc(MapNum).Npc(attacker).targetType = 0
                          'reset the targetter for the player
                          TempPlayer(MapNpc(MapNum).Npc(attacker).PetData.Owner).target = 0
                          TempPlayer(MapNpc(MapNum).Npc(attacker).PetData.Owner).targetType = TARGET_TYPE_NONE
                          PetOwner = MapNpc(MapNum).Npc(attacker).PetData.Owner
                          SendTarget PetOwner
                          ' Drop the goods if they get it
                          'For n = 1 To MAX_NPC_DROPS
                            If Npc(vNpcNum).DropItem <> 0 Then
                            If Rnd <= Npc(vNpcNum).DropChance Then
                                  Call SpawnItem(Npc(vNpcNum).DropItem, Npc(vNpcNum).DropItemValue, MapNum, MapNpc(MapNum).Npc(Victim).x, MapNpc(MapNum).Npc(Victim).y)
                          End If
                          End If
                'Next
                          'Give the player the pet owner some experience from the kill
                          Call SetPlayerExp(PetOwner, GetPlayerExp(PetOwner) + Npc(MapNpc(MapNum).Npc(Victim).Num).exp)
                          CheckPlayerLevelUp PetOwner
                          SendActionMsg MapNum, "+" & Npc(MapNpc(MapNum).Npc(Victim).Num).exp & "EXP", Green, 1, GetPlayerX(PetOwner) * 32, GetPlayerY(PetOwner) * 32
                          SendEXP PetOwner
                            ' Reset victim's stuff so it dies in loop
                          MapNpc(MapNum).Npc(Victim).Num = 0
                          MapNpc(MapNum).Npc(Victim).SpawnWait = GetTickCount
                          MapNpc(MapNum).Npc(Victim).Vital(Vitals.HP) = 0

                          'Loop through entire map and purge NPC from targets
                For i = 1 To Player_HighIndex
                    If IsPlaying(i) And IsConnected(i) Then
                        If Player(i).Map = MapNum Then
                            If TempPlayer(i).targetType = TARGET_TYPE_NPC Then
                                If TempPlayer(i).target = Victim Then
                                    TempPlayer(i).target = 0
                                    TempPlayer(i).targetType = TARGET_TYPE_NONE
                                    SendTarget i
                                End If
                            End If
                        End If
                    End If
                Next

                ' send npc death packet to map
                      Set Buffer = New clsBuffer
                      Buffer.WriteLong SNpcDead
                      Buffer.WriteLong Victim
                      SendDataToMap MapNum, Buffer.ToArray()
                      Set Buffer = Nothing
                      PetFollowOwner PetOwner

                      Else
                      'If the Pet died Follow this
                      MapNpc(MapNum).Npc(Victim).Num = 0

                    ' send death to the map
                      Set Buffer = New clsBuffer
                      Buffer.WriteLong SNpcDead
                      Buffer.WriteLong Victim
                    SendDataToMap MapNum, Buffer.ToArray()
                    Set Buffer = Nothing

                  'Loop through entire map and purge NPC from targets
                    For i = 1 To Player_HighIndex
                        If IsPlaying(i) And IsConnected(i) Then
                            If Player(i).Map = MapNum Then
                                If TempPlayer(i).targetType = TARGET_TYPE_NPC Then
                                  If TempPlayer(i).target = Victim Then
                                      TempPlayer(i).target = 0
                                      TempPlayer(i).targetType = TARGET_TYPE_NONE
                                      SendTarget i
                                  End If
                                End If
                            End If
                          End If
                  Next
                End If

        Else
                ' npc not dead, just do the damage
                MapNpc(MapNum).Npc(Victim).Vital(Vitals.HP) = MapNpc(MapNum).Npc(Victim).Vital(Vitals.HP) - Damage
                ' Say damage
                SendActionMsg MapNum, "-" & Damage, BrightRed, 1, (MapNpc(MapNum).Npc(Victim).x * 32), (MapNpc(MapNum).Npc(Victim).y * 32)
                SendBlood MapNum, MapNpc(MapNum).Npc(Victim).x, MapNpc(MapNum).Npc(Victim).y
        End If
    'Send both Npc's Vitals to the client
    SendMapNpcVitals MapNum, attacker
    SendMapNpcVitals MapNum, Victim
    End Sub

    ```
×
×
  • Create New...