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

[EO] Adding an arena tile


kibbelz
 Share

Recommended Posts

Hey there, Just about 15 mins ago i decided to make an arena system for my game. (without pvp penalty's, admin access etc effecting the combat and an on death warp), So i thought why not release it for eclipse, so i did.

First Client side:

On frmeditor_map add a new option to the attributes called "OptArena"

Next double click on OptArena and add this code:

```
    ClearAttributeDialogue
    picAttributes.Visible = True
    fraMapWarp.Visible = True

    scrlMapWarp.Max = MAX_MAPS
    scrlMapWarp.Value = 1
    scrlMapWarpX.Max = MAX_BYTE
    scrlMapWarpY.Max = MAX_BYTE
    scrlMapWarpX.Value = 0
    scrlMapWarpY.Value = 0
```
Then in Sub MapEditorMouseDown, search for:

```
                ' slide
                If frmEditor_Map.optSlide.Value Then
                    .Type = TILE_TYPE_SLIDE
                    .Data1 = MapEditorSlideDir
                    .Data2 = 0
                    .Data3 = 0
                End If
```
And underneath add:

```
                ' Arena
                If frmEditor_Map.OptArena.Value Then
                    .Type = TILE_TYPE_ARENA
                    .Data1 = EditorWarpMap
                    .Data2 = EditorWarpX
                    .Data3 = EditorWarpY
                End If
```
After that, in Function BltMapAttributes search for:

```
                            Case TILE_TYPE_SLIDE
                                DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)
```
Underneath add:

```
                            Case TILE_TYPE_ARENA
                                DrawText TexthDC, tX, tY, "A", QBColor(Black)
```
And finally in ModConstants find:

```
Public Const TILE_TYPE_SLIDE As Byte = 14
```
And underneath add:

```
Public Const TILE_TYPE_ARENA As Byte = 15
```
And now to the server:

Find in ModConstants:

```
Public Const TILE_TYPE_SLIDE As Byte = 14
```
And underneath add:

```
Public Const TILE_TYPE_ARENA As Byte = 15
```
Then make your way over to ModCombat, In Function CanPlayerAttackPlayer Find:

```
    ' 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
```
Add above:

```
    'Checks if it is an Arena
    If Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Type = TILE_TYPE_ARENA Then
        CanPlayerAttackPlayer = True
        Exit Function
    End If
```
And we now go to Sub PlayerAttackPlayer and find:

```
            If GetPlayerPK(victim) = NO Then
                If GetPlayerPK(attacker) = NO Then
                    Call SetPlayerPK(attacker, YES)
                    Call SendPlayerData(attacker)
                    Call GlobalMsg(GetPlayerName(attacker) & " has been deemed a Player Killer!!!", BrightRed)
                End If

            Else
                Call GlobalMsg(GetPlayerName(victim) & " has paid the price for being a Player Killer!!!", BrightRed)
            End If
```
Change to:

```
        'Checks if it is an Arena
        If Not Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Type = TILE_TYPE_ARENA Then
            If GetPlayerPK(victim) = NO Then
                If GetPlayerPK(attacker) = NO Then
                    Call SetPlayerPK(attacker, YES)
                    Call SendPlayerData(attacker)
                    Call GlobalMsg(GetPlayerName(attacker) & " has been deemed a Player Killer!!!", BrightRed)
                End If

            Else
                Call GlobalMsg(GetPlayerName(victim) & " has paid the price for being a Player Killer!!!", BrightRed)
            End If
        End If
```
And finally, in the same sub still, Find:

```
Call OnDeath(victim)
```
Change to:

```
        'Checks if it is an Arena
        If Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Type = TILE_TYPE_ARENA Then
            Call PlayerWarp(victim, Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Data1, Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Data2, Map(GetPlayerMap(victim)).Tile(GetPlayerX(victim), GetPlayerY(victim)).Data3)
        Else
            Call OnDeath(victim)
        End If
```
That is all i belive, If i have missed anything out post it.
Link to comment
Share on other sites

If you have ever played or used ES then it is exactly like that. you simply make an arena out of tiles and then add the arena attribute to them. With a warp for the looser who dies. You do not gain Player Killer status while in an arena and you can attack in the arena even if you are an admin etc. Was it that hard to understand >.>
Link to comment
Share on other sites

  • 3 weeks later...
@Erwin:

> I have added it but then I kill someone in an arena (both admins) they dont get the Player Killer message and the victim is losing exp.

The whole point of the arena is to make it so that you don't get a PK status >.>. But i left in the exp for fun ;3 you can always remove it if you wish.
Link to comment
Share on other sites

  • 4 months later...
@Likestodraw:

> All right now, how do you do this if you are just editing with notepad? If you'd rather just give me the files, I haven't added anything else to the map editor stuff yet.

[A quick search could have told you you need Visual Basic 6 to make any source edits.](http://www.touchofdeathforums.com/smf/index.php/topic,68399.msg736833.html#msg736833)
Link to comment
Share on other sites

  • 1 month later...
Yes, **I think so**  :embarrassed: **I clicked this**:

![](http://img259.imageshack.us/img259/5033/88543316.png)

And I made a **new option in the attributes**, I called it **OptArena**

![](http://img12.imageshack.us/img12/3315/rteterterter.png)

And next I double click to OptArena and added this code:

![](http://img688.imageshack.us/img688/4849/ertetetertre.png)

**I really don't know** what was going on  :sad: and **I very please help**  :sad:
Link to comment
Share on other sites

Oh yeah! **it works!** thanks **Scootaloo** and **Zesh** you are so cool :P

**PS**:  I have one more question, **who can help me with this problem**:
http://www.touchofdeathforums.com/smf/index.php/topic,62538.msg827373.html#msg827373 ?  :embarrassed:

**And once again thanks**  :cheesy:
Link to comment
Share on other sites

  • 1 month later...

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...