[EO]Sistemas de Projeteis com Munições
+16
Fogomax
BiosGamer
SkNzinho
RedBuster
ramonazaro
LythZerou
Yohanson
Guardian
Storm™
xurana321
xHunter
lucas100vzs
Over~
Valentine
Eduardo
Alumaary
20 participantes
Página 1 de 1
[EO]Sistemas de Projeteis com Munições
Client~Side
Crie uma frame com qualquer name e dentro dela crie: 4 labeis e 4 scrollbar com as seguintes configurações:
Serve~Side
Mude toda a Function CanPlayerAttackPlayer para:
agora vamo adicionar flechas balas etc...
Client
Procure por:
agora em frmEditor_item crie uma frame qalqer e crie uma checkbox com o nome de:
e uma labem vom nome de:
dé 2 clicks em scrlAmmo e cole isso dentro:
depois 2 clicks em Chkammo e cole isto:
no frmeditor_item em baixo de:
Procure por:
Server
em modtypes procure por:
em Modhandledata na sub Handleprojectileattack procura por
FIM! faça bom uso kkk'Crie uma frame com qualquer name e dentro dela crie: 4 labeis e 4 scrollbar com as seguintes configurações:
- Código:
Label1
Name: lblProjectilePic
Caption: Pic: 0
scrlProjectilePic
Label2
Name: lblProjectileRange
Caption: Range: 0
scrlProjectileRange
Label3
Name: lblProjectileSpeed
Caption: Speed: 0
scrlProjectileSpeed
Label4
Name: lblProjectileDamage
Caption: Damage: 0
scrlProjectileDamage
- Código:
' projectile
Private Sub scrlProjectileDamage_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectileDamage.Caption = "Damage: " & scrlProjectileDamage.Value
Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
' projectile
Private Sub scrlProjectilePic_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectilePic.Caption = "Pic: " & scrlProjectilePic.Value
Item(EditorIndex).ProjecTile.Pic = scrlProjectilePic.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
' ProjecTile
Private Sub scrlProjectileRange_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectileRange.Caption = "Range: " & scrlProjectileRange.Value
Item(EditorIndex).ProjecTile.Range = scrlProjectileRange.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlProjectileRange_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
' projectile
Private Sub scrlProjectileSpeed_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectileSpeed.Caption = "Speed: " & scrlProjectileSpeed.Value
Item(EditorIndex).ProjecTile.Speed = scrlProjectileSpeed.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlRarity_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
- Código:
Public Const MAX_PARTY_MEMBERS As Long = 4
- Código:
Public Const MAX_PLAYER_PROJECTILES As Long = 20
- Código:
' projectiles
Public Sub CheckProjectiles()
Dim i As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
i = 1
While FileExist(GFX_PATH & "Projectiles\" & i & GFX_EXT)
NumProjectiles = NumProjectiles + 1
i = i + 1
Wend
If NumProjectiles = 0 Then Exit Sub
ReDim DDS_Projectile(1 To NumProjectiles)
ReDim DDSD_Projectile(1 To NumProjectiles)
' Error handler
Exit Sub
errorhandler:
HandleError "CheckItems", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
Sub ClearProjectile(ByVal Index As Long, ByVal PlayerProjectile As Long)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
With Player(Index).ProjecTile(PlayerProjectile)
.Direction = 0
.Pic = 0
.TravelTime = 0
.x = 0
.Y = 0
.Range = 0
.Damage = 0
.Speed = 0
End With
' Error handler
Exit Sub
errorhandler:
HandleError "ClearProjectile", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
- Código:
Public DDS_Bars As DirectDrawSurface7
- Código:
Public DDS_Projectile() As DirectDrawSurface7
- Código:
Public DDSD_Bars As DDSURFACEDESC2
- Código:
Public DDSD_Projectile() As DDSURFACEDESC2
- Código:
Public NumSpellIcons As Long
- Código:
Public NumProjectiles As Long
- Código:
For i = 1 To NumFaces
Set DDS_Face(i) = Nothing
ZeroMemory ByVal VarPtr(DDSD_Face(i)), LenB(DDSD_Face(i))
Next
- Código:
For i = 1 To NumProjectiles
Set DDS_Projectile(i) = Nothing
ZeroMemory ByVal VarPtr(DDSD_Projectile(i)), LenB(DDSD_Projectile(i))
Next
- Código:
' draw animations
If NumAnimations > 0 Then
For i = 1 To MAX_BYTE
If AnimInstance(i).Used(0) Then
BltAnimation i, 0
End If
Next
End If
- Código:
' blt projec tiles for each player
For i = 1 To Player_HighIndex
For x = 1 To MAX_PLAYER_PROJECTILES
If Player(i).ProjecTile(x).Pic > 0 Then
BltProjectile i, x
End If
Next
Next
- Código:
' player Projectiles
Public Sub BltProjectile(ByVal Index As Long, ByVal PlayerProjectile As Long)
Dim x As Long, Y As Long, PicNum As Long, i As Long
Dim rec As DxVBLib.RECT
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
' check for subscript error
If Index < 1 Or PlayerProjectile < 1 Or PlayerProjectile > MAX_PLAYER_PROJECTILES Then Exit Sub
' check to see if it's time to move the Projectile
If GetTickCount > Player(Index).ProjecTile(PlayerProjectile).TravelTime Then
With Player(Index).ProjecTile(PlayerProjectile)
' set next travel time and the current position and then set the actual direction based on RMXP arrow tiles.
Select Case .Direction
' down
Case 0
.Y = .Y + 1
' check if they reached maxrange
If .Y = (GetPlayerY(Index) + .Range) + 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' up
Case 1
.Y = .Y - 1
' check if they reached maxrange
If .Y = (GetPlayerY(Index) - .Range) - 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' right
Case 2
.x = .x + 1
' check if they reached max range
If .x = (GetPlayerX(Index) + .Range) + 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' left
Case 3
.x = .x - 1
' check if they reached maxrange
If .x = (GetPlayerX(Index) - .Range) - 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
End Select
.TravelTime = GetTickCount + .Speed
End With
End If
' set the x, y & pic values for future reference
x = Player(Index).ProjecTile(PlayerProjectile).x
Y = Player(Index).ProjecTile(PlayerProjectile).Y
PicNum = Player(Index).ProjecTile(PlayerProjectile).Pic
' check if left map
If x > Map.MaxX Or Y > Map.MaxY Or x < 0 Or Y < 0 Then
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
' check if we hit a block
If Map.Tile(x, Y).Type = TILE_TYPE_BLOCKED Then
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
' check for player hit
For i = 1 To Player_HighIndex
If x = GetPlayerX(i) And Y = GetPlayerY(i) Then
' they're hit, remove it
If Not x = Player(MyIndex).x Or Not Y = GetPlayerY(MyIndex) Then
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
End If
Next
' check for npc hit
For i = 1 To MAX_MAP_NPCS
If x = MapNpc(i).x And Y = MapNpc(i).Y Then
' they're hit, remove it
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
Next
' if projectile is not loaded, load it, female dog.
If DDS_Projectile(PicNum) Is Nothing Then
Call InitDDSurf("projectiles\" & PicNum, DDSD_Projectile(PicNum), DDS_Projectile(PicNum))
End If
' get positioning in the texture
With rec
.top = 0
.Bottom = SIZE_Y
.Left = Player(Index).ProjecTile(PlayerProjectile).Direction * SIZE_X
.Right = .Left + SIZE_X
End With
' blt the projectile
Call Engine_BltFast(ConvertMapX(x * PIC_X), ConvertMapY(Y * PIC_Y), DDS_Projectile(PicNum), rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
' Error handler
Exit Sub
errorhandler:
HandleError "BltProjectile", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
- Código:
SPartyVitals
- Código:
SHandleProjectile
- Código:
CPartyLeave
- Código:
CProjecTileAttack
- Código:
If frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_CONSUME Then
frmEditor_Item.fraVitals.Visible = True
frmEditor_Item.scrlAddHp.text = .AddHP
frmEditor_Item.scrlAddMP.text = .AddMP
frmEditor_Item.scrlAddExp.text = .AddEXP
frmEditor_Item.scrlCastSpell.text = .CastSpell
frmEditor_Item.chkInstant.Value = .instaCast
Else
frmEditor_Item.fraVitals.Visible = False
End If
- Código:
If frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_WEAPON Then
frmEditor_Item.Frame4.Visible = True
With Item(EditorIndex).ProjecTile
frmEditor_Item.scrlProjectileDamage.Value = .Damage
frmEditor_Item.scrlProjectilePic.Value = .Pic
frmEditor_Item.scrlProjectileRange.Value = .Range
frmEditor_Item.scrlProjectileSpeed.Value = .Speed
End With
End If
- Código:
Public Sub CheckAttack()
Dim Buffer As clsBuffer
Dim attackspeed As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If ControlDown Then
If SpellBuffer > 0 Then Exit Sub ' currently casting a spell, can't attack
If StunDuration > 0 Then Exit Sub ' stunned, can't attack
' speed from weapon
If GetPlayerEquipment(MyIndex, Weapon) > 0 Then
attackspeed = Item(GetPlayerEquipment(MyIndex, Weapon)).Speed
Else
attackspeed = 1000
End If
If Player(MyIndex).AttackTimer + attackspeed < GetTickCount Then
If Player(MyIndex).Attacking = 0 Then
With Player(MyIndex)
.Attacking = 1
.AttackTimer = GetTickCount
End With
If GetPlayerEquipment(MyIndex, Weapon) > 0 Then
If Item(GetPlayerEquipment(MyIndex, Weapon)).ProjecTile.Pic > 0 Then
' projectile
Set Buffer = New clsBuffer
Buffer.WriteLong CProjecTileAttack
SendData Buffer.ToArray()
Set Buffer = Nothing
Exit Sub
End If
End If
' non projectile
Set Buffer = New clsBuffer
Buffer.WriteLong CAttack
SendData Buffer.ToArray()
Set Buffer = Nothing
End If
End If
End If
' Error handler
Exit Sub
errorhandler:
HandleError "CheckAttack", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
- Código:
Call CheckSpellIcons
- Código:
Call CheckProjectiles
- Código:
HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)
- Código:
HandleDataSub(SHandleProjectile) = GetAddress(AddressOf HandleProjectile)
- Código:
Sub HandleProjectile(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim PlayerProjectile As Long
Dim Buffer As clsBuffer
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
' create a new instance of the buffer
Set Buffer = New clsBuffer
' read bytes from data()
Buffer.WriteBytes Data()
' recieve projectile number
PlayerProjectile = Buffer.ReadLong
Index = Buffer.ReadLong
' populate the values
With Player(Index).ProjecTile(PlayerProjectile)
' set the direction
.Direction = Buffer.ReadLong
' set the direction to support file format
Select Case .Direction
Case DIR_DOWN
.Direction = 0
Case DIR_UP
.Direction = 1
Case DIR_RIGHT
.Direction = 2
Case DIR_LEFT
.Direction = 3
End Select
' set the pic
.Pic = Buffer.ReadLong
' set the coordinates
.x = GetPlayerX(Index)
.Y = GetPlayerY(Index)
' get the range
.Range = Buffer.ReadLong
' get the damge
.Damage = Buffer.ReadLong
' get the speed
.Speed = Buffer.ReadLong
End With
' Error handler
Exit Sub
errorhandler:
HandleError "HandleProjectile", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
- Código:
Private Type PlayerRec
- Código:
Public Type ProjectileRec
TravelTime As Long
Direction As Long
x As Long
Y As Long
Pic As Long
Range As Long
Damage As Long
Speed As Long
End Type
- Código:
' projectiles
ProjecTile(1 To MAX_PLAYER_PROJECTILES) As ProjectileRec
- Código:
ProjecTile As ProjectileRec
Serve~Side
Mude toda a Function CanPlayerAttackPlayer para:
- Código:
Function CanPlayerAttackPlayer(ByVal attacker As Long, ByVal victim As Long, Optional ByVal IsSpell As Boolean = False, Optional ByVal IsProjectile As Boolean = False) As Boolean
If Not IsSpell And Not IsProjectile Then
' Check attack timer
If GetPlayerEquipment(attacker, Weapon) > 0 Then
If GetTickCount < TempPlayer(attacker).AttackTimer + Item(GetPlayerEquipment(attacker, Weapon)).Speed Then Exit Function
Else
If GetTickCount < TempPlayer(attacker).AttackTimer + 1000 Then Exit Function
End If
End If
' Check for subscript out of range
If Not IsPlaying(victim) Then Exit Function
' Make sure they are on the same map
If Not GetPlayerMap(attacker) = GetPlayerMap(victim) Then Exit Function
' Make sure we dont attack the player if they are switching maps
If TempPlayer(victim).GettingMap = YES Then Exit Function
If Not IsSpell And Not IsProjectile Then
' Check if at same coordinates
Select Case GetPlayerDir(attacker)
Case DIR_UP
If Not ((GetPlayerY(victim) + 1 = GetPlayerY(attacker)) And (GetPlayerX(victim) = GetPlayerX(attacker))) Then Exit Function
Case DIR_DOWN
If Not ((GetPlayerY(victim) - 1 = GetPlayerY(attacker)) And (GetPlayerX(victim) = GetPlayerX(attacker))) Then Exit Function
Case DIR_LEFT
If Not ((GetPlayerY(victim) = GetPlayerY(attacker)) And (GetPlayerX(victim) + 1 = GetPlayerX(attacker))) Then Exit Function
Case DIR_RIGHT
If Not ((GetPlayerY(victim) = GetPlayerY(attacker)) And (GetPlayerX(victim) - 1 = GetPlayerX(attacker))) Then Exit Function
Case Else
Exit Function
End Select
End If
' Check if map is attackable
If Not Map(GetPlayerMap(attacker)).Moral = MAP_MORAL_NONE Then
If GetPlayerPK(victim) = NO Then
Call PlayerMsg(attacker, "This is a safe zone!", BrightRed)
Exit Function
End If
End If
' Make sure they have more then 0 hp
If GetPlayerVital(victim, Vitals.HP) <= 0 Then Exit Function
' Check to make sure that they dont have access
If GetPlayerAccess(attacker) > ADMIN_MONITOR Then
Call PlayerMsg(attacker, "Admins cannot attack other players.", BrightBlue)
Exit Function
End If
' Check to make sure the victim isn't an admin
If GetPlayerAccess(victim) > ADMIN_MONITOR Then
Call PlayerMsg(attacker, "You cannot attack " & GetPlayerName(victim) & "!", BrightRed)
Exit Function
End If
' Make sure attacker is high enough level
If GetPlayerLevel(attacker) < 10 Then
Call PlayerMsg(attacker, "You are below level 10, you cannot attack another player yet!", BrightRed)
Exit Function
End If
' Make sure victim is high enough level
If GetPlayerLevel(victim) < 10 Then
Call PlayerMsg(attacker, GetPlayerName(victim) & " is below level 10, you cannot attack this player yet!", BrightRed)
Exit Function
End If
CanPlayerAttackPlayer = True
End Function
- Código:
Public Const MAX_PARTY_MEMBERS As Long = 4
- Código:
Public Const MAX_PLAYER_PROJECTILES As Long = 20
- Código:
Sub ClearProjectile(ByVal Index As Long, ByVal PlayerProjectile As Long)
' clear the projectile
With TempPlayer(Index).ProjecTile(PlayerProjectile)
.Direction = 0
.Pic = 0
.TravelTime = 0
.X = 0
.Y = 0
.Range = 0
.Damage = 0
.Speed = 0
End With
End Sub
- Código:
SPartyVitals
- Código:
SHandleProjectile
- Código:
CPartyLeave
- Código:
CProjecTileAttack
- Código:
Public Sub HandleProjecTile(ByVal Index As Long, ByVal PlayerProjectile As Long)
Dim X As Long, Y As Long, i As Long
' check for subscript out of range
If Index < 1 Or Index > MAX_PLAYERS Or PlayerProjectile < 1 Or PlayerProjectile > MAX_PLAYER_PROJECTILES Then Exit Sub
' check to see if it's time to move the Projectile
If GetTickCount > TempPlayer(Index).ProjecTile(PlayerProjectile).TravelTime Then
With TempPlayer(Index).ProjecTile(PlayerProjectile)
' set next travel time and the current position and then set the actual direction based on RMXP arrow tiles.
Select Case .Direction
' down
Case DIR_DOWN
.Y = .Y + 1
' check if they reached maxrange
If .Y = (GetPlayerY(Index) + .Range) + 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' up
Case DIR_UP
.Y = .Y - 1
' check if they reached maxrange
If .Y = (GetPlayerY(Index) - .Range) - 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' right
Case DIR_RIGHT
.X = .X + 1
' check if they reached max range
If .X = (GetPlayerX(Index) + .Range) + 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
' left
Case DIR_LEFT
.X = .X - 1
' check if they reached maxrange
If .X = (GetPlayerX(Index) - .Range) - 1 Then ClearProjectile Index, PlayerProjectile: Exit Sub
End Select
.TravelTime = GetTickCount + .Speed
End With
End If
X = TempPlayer(Index).ProjecTile(PlayerProjectile).X
Y = TempPlayer(Index).ProjecTile(PlayerProjectile).Y
' check if left map
If X > Map(GetPlayerMap(Index)).MaxX Or Y > Map(GetPlayerMap(Index)).MaxY Or X < 0 Or Y < 0 Then
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
' check if hit player
For i = 1 To Player_HighIndex
' make sure they're actually playing
If IsPlaying(i) Then
' check coordinates
If X = Player(i).X And Y = GetPlayerY(i) Then
' make sure it's not the attacker
If Not X = Player(Index).X Or Not Y = GetPlayerY(Index) Then
' check if player can attack
If CanPlayerAttackPlayer(Index, i, False, True) = True Then
' attack the player and kill the project tile
PlayerAttackPlayer Index, i, TempPlayer(Index).ProjecTile(PlayerProjectile).Damage
ClearProjectile Index, PlayerProjectile
Exit Sub
Else
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
End If
End If
End If
Next
' check for npc hit
For i = 1 To MAX_MAP_NPCS
If X = MapNpc(GetPlayerMap(Index)).NPC(i).X And Y = MapNpc(GetPlayerMap(Index)).NPC(i).Y Then
' they're hit, remove it and deal that damage
If CanPlayerAttackNpc(Index, i, True) Then
PlayerAttackNpc Index, i, TempPlayer(Index).ProjecTile(PlayerProjectile).Damage
ClearProjectile Index, PlayerProjectile
Exit Sub
Else
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
End If
Next
' hit a block
If Map(GetPlayerMap(Index)).Tile(X, Y).Type = TILE_TYPE_BLOCKED Then
' hit a block, clear it.
ClearProjectile Index, PlayerProjectile
Exit Sub
End If
End Sub
- Código:
HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)
- Código:
HandleDataSub(CProjecTileAttack) = GetAddress(AddressOf HandleProjecTileAttack)
- Código:
Private Sub HandleProjecTileAttack(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim curProjecTile As Long, i As Long, CurEquipment As Long
' prevent subscript
If Index > MAX_PLAYERS Or Index < 1 Then Exit Sub
' get the players current equipment
CurEquipment = GetPlayerEquipment(Index, Weapon)
' check if they've got equipment
If CurEquipment < 1 Or CurEquipment > MAX_ITEMS Then Exit Sub
' set the curprojectile
For i = 1 To MAX_PLAYER_PROJECTILES
If TempPlayer(Index).ProjecTile(i).Pic = 0 Then
' just incase there is left over data
ClearProjectile Index, i
' set the curprojtile
curProjecTile = i
Exit For
End If
Next
' check for subscript
If curProjecTile < 1 Then Exit Sub
' populate the data in the player rec
With TempPlayer(Index).ProjecTile(curProjecTile)
.Damage = Item(CurEquipment).ProjecTile.Damage
.Direction = GetPlayerDir(Index)
.Pic = Item(CurEquipment).ProjecTile.Pic
.Range = Item(CurEquipment).ProjecTile.Range
.Speed = Item(CurEquipment).ProjecTile.Speed
.X = GetPlayerX(Index)
.Y = GetPlayerY(Index)
End With
' trololol, they have no more projectile space left
If curProjecTile < 1 Or curProjecTile > MAX_PLAYER_PROJECTILES Then Exit Sub
' update the projectile on the map
SendProjectileToMap Index, curProjecTile
End Sub
- Código:
' Checks to update player vitals every 5 seconds - Can be tweaked
If Tick > LastUpdatePlayerVitals Then
UpdatePlayerVitals
LastUpdatePlayerVitals = GetTickCount + 5000
End If
- Código:
For i = 1 To Player_HighIndex
If IsPlaying(i) Then
For X = 1 To MAX_PLAYER_PROJECTILES
If TempPlayer(i).ProjecTile(X).Pic > 0 Then
' handle the projec tile
HandleProjecTile i, X
End If
Next
End If
Next
- Código:
Sub SendProjectileToMap(ByVal Index As Long, ByVal PlayerProjectile As Long)
Dim Buffer As clsBuffer
Set Buffer = New clsBuffer
Buffer.WriteLong SHandleProjectile
Buffer.WriteLong PlayerProjectile
Buffer.WriteLong Index
With TempPlayer(Index).ProjecTile(PlayerProjectile)
Buffer.WriteLong .Direction
Buffer.WriteLong .Pic
Buffer.WriteLong .Range
Buffer.WriteLong .Damage
Buffer.WriteLong .Speed
End With
SendDataToMap GetPlayerMap(Index), Buffer.ToArray()
Set Buffer = Nothing
End Sub
- Código:
Private Type PlayerRec
- Código:
Public Type ProjectileRec
TravelTime As Long
Direction As Long
X As Long
Y As Long
Pic As Long
Range As Long
Damage As Long
Speed As Long
End Type
- Código:
ProjecTile(1 To MAX_PLAYER_PROJECTILES) As ProjectileRec
- Código:
ProjecTile As ProjectileRec
agora vamo adicionar flechas balas etc...
Client
Procure por:
- Código:
Public Type BuffRec
Use As Byte
SpellNum As Long
tempo As Long
target As Long
- Código:
ammo as long
ammoreq as long
agora em frmEditor_item crie uma frame qalqer e crie uma checkbox com o nome de:
- Código:
ChkAmmo
- Código:
scrlAmmo
e uma labem vom nome de:
- Código:
lblammo
dé 2 clicks em scrlAmmo e cole isso dentro:
- Código:
If scrlAmmo.Value > 0 Then
lblAmmo.Caption = "Weapon: " + Item(scrlAmmo.Value).name
Else
lblAmmo.Caption = "Weapon: None"
End If
Item(EditorIndex).Ammo = scrlAmmo.Value
depois 2 clicks em Chkammo e cole isto:
- Código:
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
Item(EditorIndex).ammoreq =Chkammo.Value
no frmeditor_item em baixo de:
- Código:
scrlPaperdoll.Max = NumPaperdolls
- Código:
ScrlAmmo.max = MAX_ITEMS
Procure por:
- Código:
frmEditor_Item.txtDesc.text = Trim$(.Desc)
- Código:
frmEditor_Item.ScrlAmmo.Value = Item(EditorIndex).Ammo
frmEditor_Item.Chkammo.Value = Item(EditorIndex).ammoreq
Server
em modtypes procure por:
- Código:
LoopTime(0 To 1) As Long
- Código:
ammo as long
ammoreq as long
em Modhandledata na sub Handleprojectileattack procura por
- Código:
CurEquipment = GetPlayerEquipment(Index, Weapon)
- Código:
If Item(CurEquipment).ammoreq > 0 Then
If HasItem(Index, Item(CurEquipment).ammo) <= 0 Then
Call PlayerMsg(Index, "You Dont Have Any Arrows!", BrightRed)
Exit Sub
End If
Call TakeInvItem(Index, Item(CurEquipment).ammo, 1)
End If
Alumaary- Membro Sênior
- Mensagens : 407
Re: [EO]Sistemas de Projeteis com Munições
Bom se foi você parabéns mais vi alguns erros no tuto , se mandou procurar o buffrec não seria ItemRec e no fim por isso lol, bom outra coloque os creditos do criador se não for você bom + 1 pela colaboração ou rip isso é você quem vai dizer
Eduardo- Membro Veterano
- Mensagens : 1178
Re: [EO]Sistemas de Projeteis com Munições
Para melhorar um pouco ao invés de usar
Use:
E então declare tmr10, substituindo
Isso irá melhorar e irá forçar menos o servidor.
Atenciosamente, Valentine.
- Código:
For i = 1 To Player_HighIndex
If IsPlaying(i) Then
For x = 1 To MAX_PLAYER_PROJECTILES
If TempPlayer(i).ProjecTile(x).Pic > 0 Then
' handle the projec tile
HandleProjecTile i, x
End If
Next
End If
Next
Use:
- Código:
If Tick > tmr10 Then
For i = 1 To Player_HighIndex
If IsPlaying(i) Then
For x = 1 To MAX_PLAYER_PROJECTILES
If TempPlayer(i).ProjecTile(x).Pic > 0 Then
' handle the projec tile
HandleProjecTile i, x
End If
Next
End If
Next
tmr10 = GetTickCount + 10
End If
E então declare tmr10, substituindo
- Código:
Dim tmr25 As Long, tmr500 As Long, tmr1000 As Long
- Código:
Dim tmr25 As Long, tmr500 As Long, tmr1000 As Long, tmr10 As Long
Isso irá melhorar e irá forçar menos o servidor.
Atenciosamente, Valentine.
Re: [EO]Sistemas de Projeteis com Munições
Ótimo Sistema Causo Foi Você Mesmo Que O Fez, Parabéns Ae Alumary!
+1Cred
+1Cred
Over~- Membro Vitalicio
- Mensagens : 565
Re: [EO]Sistemas de Projeteis com Munições
Muito bom mesmo Aluumary, apesar de eu já saber este tutorial, tê-lo em minha Engine há pouco tempo atrás, será muito, mas muito útil mesmo pra quem não tinha e/ou não sabia como fazer o sistema....(E este não é o sistema que queria na dúvida...esse é de item....agora tenta projectile Spell xD).... +1 Crédito pela colaboração conosco ! Continue assim Amigo !!!!
lucas100vzs- Membro Sênior
- Mensagens : 396
Re: [EO]Sistemas de Projeteis com Munições
aaatah projectile spell vo tentar fazer aqi dae te passo as scripts
Alumaary- Membro Sênior
- Mensagens : 407
Re: [EO]Sistemas de Projeteis com Munições
desculpa ressucitar mas ta dando erro aqui
help ai gente =/
- Código:
If Item(CurEquipment).[u][b]ammoreq[/b][/u] > 0 Then
help ai gente =/
xurana321- Membro Sênior
- Mensagens : 297
Re: [EO]Sistemas de Projeteis com Munições
Over~ escreveu:Ótimo Sistema Causo Foi Você Mesmo Que O Fez, Parabéns Ae Alumary!
+1Cred
Re: [EO]Sistemas de Projeteis com Munições
xurana321 escreveu:desculpa ressucitar mas ta dando erro aquio erro ta na ammoreq ai da Method or data member not found
- Código:
If Item(CurEquipment).[u][b]ammoreq[/b][/u] > 0 Then
help ai gente =/
Deixe assim :
- Código:
If Item(CurEquipment).ammoreq > 0 Then
Aqueles códigos entre colchetes era aqui para o fórum, para deixar em negrito e talz. Porém eles não funcionam dentro de Code, o que pode ter te confundido.
Guardian- Membro de Honra
- Mensagens : 781
Re: [EO]Sistemas de Projeteis com Munições
tu não explico como funciona o sistema com a munição!
LythZerou- Membro
- Mensagens : 108
Re: [EO]Sistemas de Projeteis com Munições
mesmo assim da erro na ammoreq e essa parte aqui q nao existe
- Código:
Public Type BuffRec
Use As Byte
SpellNum As Long
tempo As Long
target As Long
xurana321- Membro Sênior
- Mensagens : 297
Re: [EO]Sistemas de Projeteis com Munições
Ta dando um erro
Variable Not definide
o erro refere-se a scrlProjectileDamage
Variable Not definide
o erro refere-se a scrlProjectileDamage
ramonazaro- Novato
- Mensagens : 37
Re: [EO]Sistemas de Projeteis com Munições
Você criou a ScrollBar ??
Aposto que não, é por isso que deu erro.. crie á.
Aposto que não, é por isso que deu erro.. crie á.
Re: [EO]Sistemas de Projeteis com Munições
Vou deixar mais explicado.
Nome do erro
Copile error:
Variable not definied
Codigo os se localiza o erro:
' projectile
Private Sub scrlProjectileDamage_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectileDamage.Caption = "Damage: " & scrlProjectileDamage.Value
Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
Linha do codigo aonde ta o erro
Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value
Especificamente aonde ta o erro:
scrlProjectileDamage
Se eu tiver que definir a variavel. como á definir?
Nome do erro
Copile error:
Variable not definied
Codigo os se localiza o erro:
' projectile
Private Sub scrlProjectileDamage_Change()
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub
lblProjectileDamage.Caption = "Damage: " & scrlProjectileDamage.Value
Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value
' Error handler
Exit Sub
errorhandler:
HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
Linha do codigo aonde ta o erro
Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value
Especificamente aonde ta o erro:
scrlProjectileDamage
Se eu tiver que definir a variavel. como á definir?
ramonazaro- Novato
- Mensagens : 37
Re: [EO]Sistemas de Projeteis com Munições
fiz tudo so que a parte do scroll bar e da check box nao ta aparecendo
SkNzinho- Membro
- Mensagens : 139
Re: [EO]Sistemas de Projeteis com Munições
Desculpa reviver mais funciona no eclipse origins 3.0?
BiosGamer- Novato
- Mensagens : 49
Re: [EO]Sistemas de Projeteis com Munições
Se for a com Dx8 não funciona.
Fogomax- Membro Veterano
- Mensagens : 1167
Re: [EO]Sistemas de Projeteis com Munições
Tem um problema nesse sistema, o dano da flecha é apenas o dano que você colocar no itemeditor, ele não calcula com sua força nem nada, oquê você colocar no itemeditor vai dar de dano, não importando nada.
Mark-- Membro
- Mensagens : 148
Re: [EO]Sistemas de Projeteis com Munições
Para isso existem os códigos, para você arrumar, ou melhor, deixar do jeito que você qéMark- escreveu:Tem um problema nesse sistema, o dano da flecha é apenas o dano que você colocar no itemeditor, ele não calcula com sua força nem nada, oquê você colocar no itemeditor vai dar de dano, não importando nada.
dazateam- Membro Vitalicio
- Mensagens : 690
Re: [EO]Sistemas de Projeteis com Munições
Eu até consegui aqui, mas acho que é bom que quem fazer o tutorial saber disso
Mark-- Membro
- Mensagens : 148
Re: [EO]Sistemas de Projeteis com Munições
Caralho os cara n quer papinha n boca n ? é so colocar para diminuir o dano do projetil - o status desejado '-.-
guifs- Membro Vitalicio
- Mensagens : 561
Re: [EO]Sistemas de Projeteis com Munições
Se você acha que só isso vai adiantar, não vai não, e o critico, e o bloquear, e o dodge e o dano aleatório?
Eu fiz de um jeito aqui que calcula tudo isso, mas se você diminuir apenas o dano igual você disse, nada disso vai acontecer, então vai na fé!
Eu fiz de um jeito aqui que calcula tudo isso, mas se você diminuir apenas o dano igual você disse, nada disso vai acontecer, então vai na fé!
Mark-- Membro
- Mensagens : 148
Re: [EO]Sistemas de Projeteis com Munições
Já que o ultimo tópico ta em dezembro...
aqui está dando um erro quando eu salvo(Make)
If X = Player(i).X And Y = GetPlayerY(i) Then
ele diz:
"Compile error:
Method or data member not found"
e ele deixa em destaque o ".X"
(If X = Player(i)".X" And Y = GetPlayerY(i) Then)
isto é na gameLogic/handleProjectTile abaixo de ' check coordinates
acima de ' make sure it's not the attacker
Server~
aqui está dando um erro quando eu salvo(Make)
If X = Player(i).X And Y = GetPlayerY(i) Then
ele diz:
"Compile error:
Method or data member not found"
e ele deixa em destaque o ".X"
(If X = Player(i)".X" And Y = GetPlayerY(i) Then)
isto é na gameLogic/handleProjectTile abaixo de ' check coordinates
acima de ' make sure it's not the attacker
Server~
davi147- Membro Junior
- Mensagens : 80
Tópicos semelhantes
» [Dúvida] Projeteis
» Sistema de projeteis
» [Dúvida]Armas Com Projeteis
» Ajuda no Sistema de Projeteis com Munição
» [TUTO]Animação De Projeteis,Linear
» Sistema de projeteis
» [Dúvida]Armas Com Projeteis
» Ajuda no Sistema de Projeteis com Munição
» [TUTO]Animação De Projeteis,Linear
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|
Dom 08 Abr 2018, 18:40 por JorgeZinhoo002
» Ojkjeeeee
Seg 10 Out 2016, 23:19 por Frozen
» Naruto Great Ninja Batle
Dom 09 Out 2016, 14:29 por GuiinhoLP
» Recrutamento de um Designer para jogo de CDZ.
Sex 23 Set 2016, 18:37 por newbie123
» Serviços de suporte maker( Programação , Design , PixelArt ) E Vendas de Jogos
Qui 22 Set 2016, 20:11 por Eduardo
» Serviços de suporte maker( Programação , Design , PixelArt ) E Vendas de Jogos
Qui 22 Set 2016, 20:11 por Eduardo
» Serviços de suporte maker( Programação , Design , PixelArt ) E Vendas de Jogos
Qui 22 Set 2016, 20:09 por Eduardo
» Projeto Dbz
Qua 31 Ago 2016, 23:46 por 157
» Avaliação - Sprites Naruto
Qua 31 Ago 2016, 17:09 por 157
» [Sprites] DBZ (Plix)
Qua 31 Ago 2016, 14:13 por 157
» Super Pack - Bleach V.2
Qua 31 Ago 2016, 13:02 por 157
» [PEDIDO][PROJETO][RECRUTAMENTO] DYNISTYGAMES
Ter 30 Ago 2016, 10:04 por 157
» [PEDIDO][PROJETO][RECRUTAMENTO] DYNISTYGAMES
Ter 30 Ago 2016, 10:03 por 157
» [PEDIDO][PROJETO][RECRUTAMENTO] DYNISTYGAMES
Ter 30 Ago 2016, 10:02 por 157
» [Pedido] Contador de resets na FrmMain
Sáb 13 Ago 2016, 17:45 por killers97
» [Recrutamento]
Qua 10 Ago 2016, 23:09 por Monsters
» Ajuda erro no Cliente e Servidor do EEB 2.6!
Qua 20 Jul 2016, 19:53 por Binholx
» Como criar tilesets para Eclipse Origins 3.0 (POKÉMON)
Qua 29 Jun 2016, 19:46 por Sir Aaron
» Recursos Pokemons
Qua 29 Jun 2016, 19:34 por Sir Aaron
» erro frm flash
Qua 25 maio 2016, 13:51 por vava123
» Pedido - Pack de star wars
Qui 19 maio 2016, 05:06 por edsonpet
» [Ajuda] Sobre como por o servidor on por ip fixo
Ter 17 maio 2016, 16:14 por vava123
» Illusion Dimension - O Misterio do ID: BETA TESTE ONLINE
Sex 06 maio 2016, 20:02 por LksFlorencio
» [NSME] Naruto Shinobi Maker Engine
Qua 23 Mar 2016, 15:11 por luana1457
» Script /base,/casa Igual DBZ Forces
Dom 21 Fev 2016, 07:34 por JorgeZinhoo002
» [Pedido]Colar Tsunade item sprite eclipse origin
Qui 21 Jan 2016, 07:38 por lawllietbr
» [Pedido] Elysium
Sáb 19 Dez 2015, 11:31 por luana1457
» Naruto - Recruta
Ter 15 Dez 2015, 18:40 por Uchiha ~
» [Avaliação] - Kirito from Sword Art Online; Red and Pikachu from Pokemon.
Qua 25 Nov 2015, 13:43 por Thanakii
» [Avaliação] - Kenpachi Zaraki from Bleach; Libra Shiryu From Saint Seiya.
Qua 25 Nov 2015, 12:55 por Thanakii
» Demonstração de Sprites (Á VENDA!)
Qua 25 Nov 2015, 12:40 por Thanakii
» [Sistema de Reset]Para Eclipse .
Ter 24 Nov 2015, 16:51 por VithorUchi
» Cada Guild Nascer em Certo Mapa
Qui 12 Nov 2015, 06:13 por fabiofeijó_HIT
» Dragon Ball z Fusion A Grande Volta
Qui 29 Out 2015, 15:17 por fabiofeijó_HIT
» Ajuda com Ip fixo
Seg 26 Out 2015, 16:07 por GalaxyHells15
» Como Fazer um GUI no Eclipse Origins
Dom 18 Out 2015, 22:10 por Jeanleee
» Shisui Susanoo
Dom 18 Out 2015, 20:23 por Jeanleee
» Fantasy Art Online
Dom 18 Out 2015, 16:41 por daviih123
» Ajuda !!
Seg 05 Out 2015, 12:13 por andersonzika
» como passar o usuário e senha para o MainMenu?
Seg 28 Set 2015, 22:03 por Bëzerk
» Ru time ero 13 Type mismatch
Seg 28 Set 2015, 09:08 por andredarle
» Jarvis 1.3 Download
Qua 23 Set 2015, 18:42 por soares125
» [Avaliação/Disponibilização]Árvore 64x64
Qua 23 Set 2015, 15:15 por Over~
» Mlk's Zikas Signatures
Ter 22 Set 2015, 21:15 por Aikawa Reborn'
» Pedido de Sistemas
Dom 20 Set 2015, 18:05 por cleyton_05
» [AjudaEEB]Gerador de EXP
Qua 16 Set 2015, 14:04 por Over~
» [Avaliar] Base, Humano e Goblin.
Seg 14 Set 2015, 22:51 por .iBlaz3.
» Fabrica do Tio Cronos!
Dom 13 Set 2015, 21:31 por [ADM]Cronos
» [PixelArt] Minion - Meu malvado favorito
Dom 13 Set 2015, 12:51 por [ADM]Cronos
» [Avaliar] Goku Dragon Ball Z
Qua 05 Ago 2015, 21:36 por Setrux