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

[EO] Custom Spell Made By An Idiot - Not Working(of course)


viciousdead
 Share

Recommended Posts

Ok, so I wanted to make a spell, obviously it was bound to fail. How can I turn this pile of shet into a working spell? :(? I have no idea what I'm doing.. I was wanting a spell that would hit enemies around you multiply times every few seconds, I HAVE NO IDEA WHAT IM DOING. For one I'm missing a timer, two GetVar isn't even a command… Eh, someone please help.  :cry:

>! ```
                Case SPELL_TYPE_DOT
                x = MapNpc(MapNum).Npc(Target).x
                y = MapNpc(MapNum).Npc(Target).y

                If isInRange(AoE, GetPlayerX(index), GetPlayerY(index), x, y) Then
                    SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, I
                    AttackNpc index, I, Vital, spellnum
                    If GetVar "\Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 0 Then
                    PutVar "Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 1
                    ElseIf GetVar("\Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 1) Then
                    PutVar "Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 2
                    ElseIf GetVar("\Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 2) Then
                    PutVar "Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 3
                    ElseIf GetVar("\Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 3) Then
                    PutVar "Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 4
                    ElseIf GetVar("\Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 4) Then
                    PutVar "Charextras\Status\" & GetPlayerName(index) & ".ini", "Status", "BURNING STAR", 5
                    End If
                End If
                If GetVar("Charextras\Status" & GetPlayerName & ".ini", "Status", "BURNING STAR", 5) Then
                    DidCast = True
                    End Select
                Else
                    Loop
                End If
```
Link to comment
Share on other sites

nice  ;D

but why Loop in there?'-'
you can subs the Ini files for a tempplayer state

like
go to

> Public Type TempPlayerRec

above End Type you add

> BurnState as byte

Putvar.. = Tempplayer(index).BurnState = 1
getvar..= Tempplayer(index).burnState

you will need timer all this chit out too(gettickcount) '-'
I dont know answer this part  :renzo:
I think its complexy
Link to comment
Share on other sites

@Helladen:

> Yeah man only use INIs for small stuff. Not stuff used constantly, that's not very good.

INIs should not be used for automated systems _at all_. Their only use should be for settings which are editable by the user, and these should be loaded once when the program starts and stored in a variable.

The huge amount of INI abuse in previous versions of Eclipse can be attributed to the limiting scripting API. If you learnt how to script on old versions of Eclipse, forget everything you learnt and start fresh. Use Origins for a leaning tool, not that outdated stuff.
Link to comment
Share on other sites

@Robin:

> @Helladen:
>
> > Yeah man only use INIs for small stuff. Not stuff used constantly, that's not very good.
>
> INIs should not be used for automated systems _at all_. Their only use should be for settings which are editable by the user, and these should be loaded once when the program starts and stored in a variable.
>
> The huge amount of INI abuse in previous versions of Eclipse can be attributed to the limiting scripting API. If you learnt how to script on old versions of Eclipse, forget everything you learnt and start fresh. Use Origins for a leaning tool, not that outdated stuff.

Robin I understand where your coming from, but I don't know how to store variables, period. I guess I'll google some stuff, maybe I can figure out how this shet works, someday…

Guys, this script does not work, the whole point of me posting it here was to get some tips and what not...
You guys spamming about .ini and w/e isn't really helping me much.  :huh:

@DshWinchester:

> nice  ;D
>
> but why Loop in there?'-'
> you can subs the Ini files for a tempplayer state
>
> like
> go to
>
> > Public Type TempPlayerRec
>
> above End Type you add
>
> > BurnState as byte
>
> Putvar.. = Tempplayer(index).BurnState = 1
> getvar..= Tempplayer(index).burnState
>
> you will need timer all this chit out too(gettickcount) '-'
> I dont know answer this part  :renzo:
> I think its complexy

What ? I have no idea what I'm doing, I'm just copy and pasting code based on my limited knowledge…
Link to comment
Share on other sites

@ShawnyBoy:

> Robin I understand where your coming from, but I don't know how to store variables, period. I guess I'll google some stuff, maybe I can figure out how this shet works, someday…
>
> Guys, this script does not work, the whole point of me posting it here was to get some tips and what not...
> You guys spamming about .ini and w/e isn't really helping me much.  :huh:

You haven't taken the time to learn how Origins works and yet you assume you'll be able to just prance in and write a custom spell?

Before you start dicking around in the source code you need to go learn some of the basics.
Link to comment
Share on other sites

A variable is a piece of memory with a name. It stores an object in your RAM which makes access to it very quick.

An INI is a format to a file. Disk I/O is VERY slow compared to accessing a piece of memory. You should avoid disk I/O wherever possible, that's why we cache a lot of things. I think Robin caches a lot of stuff in Origins, really.

As for this problem, I would advise you to do some reading if you're serious about doing this by yourself sometime. If all you're looking for is a shortcut to get this done, I might advise you recruit someone whom is familiar to do it for you. ^^
Link to comment
Share on other sites

@Robin:

> @ShawnyBoy:
>
> > Robin I understand where your coming from, but I don't know how to store variables, period. I guess I'll google some stuff, maybe I can figure out how this shet works, someday…
> >
> > Guys, this script does not work, the whole point of me posting it here was to get some tips and what not...
> > You guys spamming about .ini and w/e isn't really helping me much.  :huh:
>
> You haven't taken the time to learn how Origins works and yet you assume you'll be able to just prance in and write a custom spell?
>
> Before you start dicking around in the source code you need to go learn some of the basics.

Dam it Robin, listen closely to what I'm saying! I KNOW THE BASICS, I've followed several online tutorials.
What I can't figure out is how EO works, or much less Mirage. I don't understand a single dam thing about it…
How do you, Robin, suppose I learn how EO works?  :rolleyes:
Link to comment
Share on other sites

@ShawnyBoy:

> Dam it Robin, listen closely to what I'm saying! I KNOW THE BASICS, I've followed several online tutorials.
> What I can't figure out is how EO works, or much less Mirage. I don't understand a single dam thing about it…
> How do you, Robin, suppose I learn how EO works?  :rolleyes:

I said quite clearly that you need to learn the basics of Origins, not vb6.
Link to comment
Share on other sites

@ShawnyBoy:

> @Robin:
>
> > I said quite clearly that you need to learn the basics of Origins, not vb6.
>
> How do you go about doing that?  :huh:

Open up the source code, and look at bits that you don't understand. Try and find a few examples in the source, and see how they work.
Link to comment
Share on other sites

@Lightning:

> @ShawnyBoy:
>
> > @Robin:
> >
> > > I said quite clearly that you need to learn the basics of Origins, not vb6.
> >
> > How do you go about doing that?  :huh:
>
> Open up the source code, and look at bits that you don't understand. Try and find a few examples in the source, and see how they work.

Ok, I guess I'll look around at TempPlayer… o :huh:
Link to comment
Share on other sites

Ok, I got a burn state working, only thing is it damages healh 1 time per full duration(Duration = say 10 secs, after 10scs or whatever they get 1 dmg…)

Here is the code:

>! ```
    ' if burnned, damage health
    If TempPlayer(index).BurnDuration > 0 Then
        Call SetPlayerVital(index, Vitals.HP, GetPlayerVital(index, Vitals.HP) - 10)
        Exit Sub
    End If
```

How do I make it repeat, like every 2 seconds or w/e?
Link to comment
Share on other sites

Modify your sub to this:

```
Sub BurnPlayer(ByVal Index As Long)
    ' if burnned, damage health
        Call SetPlayerVital(index, Vitals.HP, GetPlayerVital(index, Vitals.HP) - 10)
        BurnTick = GetTickCount + 10000
        Exit Sub
End Sub
```
Declare a Global Variable BurnTick:

```
Public BurnTick As Long
```
Under this in modGameLogic:

```
' check if trade timed out
            If TradeRequest Then
                If TradeTimer < Tick Then
                    AddText "You took too long to decide. Please try again.", BrightRed
                    TradeRequest = False
                    TradeTimer = 0
                End If
            End If
```
Add this:
```
If TempPlayer(index).BurnDuration > 0 Then
  If GetTickCount > BurnTick Then
      Call BurnPlayer(Index)
  End If
End If
```
You might also want to check whether the player dies from the burn too.
Link to comment
Share on other sites

@Lightning:

> Modify your sub to this:
>
> ```
> Sub BurnPlayer(ByVal Index As Long)
>     ' if burnned, damage health
>         Call SetPlayerVital(index, Vitals.HP, GetPlayerVital(index, Vitals.HP) - 10)
>         BurnTick = GetTickCount + 10000
>         Exit Sub
> End Sub
> ```
> Declare a Global Variable BurnTick:
>
> ```
> Public BurnTick As Long
> ```
> Under this in modGameLogic:
>
> ```
> ' check if trade timed out
>             If TradeRequest Then
>                 If TradeTimer < Tick Then
>                     AddText "You took too long to decide. Please try again.", BrightRed
>                     TradeRequest = False
>                     TradeTimer = 0
>                 End If
>             End If
> ```
> Add this:
> ```
> If TempPlayer(index).BurnDuration > 0 Then
>   If GetTickCount > BurnTick Then
>       Call BurnPlayer(Index)
>   End If
> End If
> ```
> You might also want to check whether the player dies from the burn too.

you need set the BurnTick to 0 right?Or on "Gettickcount = gettickcount + 10000" already set?'-'
like gettickcount = 0 + 10 sec

this too

> If TempPlayer(index).BurnDuration > 0 Then
>   If GetTickCount > BurnTick Then
>       Call BurnPlayer(Index)
>     **TempPlayer(index).BurnDuration = 0**
>   End If
> End If

right? :huh:

ty for the code
Link to comment
Share on other sites

Dear jesus people, I said here was the code, I wasn't refering to the whole thing, I've got it working, I just need to make the server dmg the player every 2 seconds..

I didn't read your long code yet, I will after this posts.. :o

EDIT: I didn't make that a sub… I placed it in another sub, lol. Thats why theres a random End If at the bottm of the code. Ugh, If your sub will tick down dmg, then I'll use it, mine only dmg's one time.. :o Oh, and I never thought of looking at trade for an example. XD

I like your version better except for the tick + 10000, I made a scroll bar for that one.
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...