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

[EO] Spell Type Item Creation


shinobugmaster
 Share

Recommended Posts

Hello maybe this will be my first tut , so don't go easy on me , this will allow you to create a spell type that will give you item after cast

lets start at client side and server side shall we? add this at spell constant

```

Public Const SPELL_TYPE_ITEM As Byte = 5

```

on spellrec add this 2 line

```

GItemNum As Long

GItemValue As Long

```

client side

form work

at spell editor add a 1 frame , 2 scrollbars , and 2 labels also add a "Item" on cmbType

name the following

1 scrollbar = scrlitem (make the min of this scrlbar to 1 and max to 255)

1 scrollbar = scrlitemvalue

1 label = lblitem

1 label = lblitemvalue

add this at scrlitem

```

lblItem.Caption = "Item: " & Trim$(Item(scrlItem.Value).Name)

Spell(EditorIndex).GItemNum = scrlItem.Value

```

add this at scrlitemvalue

```

lblItemValue.Caption = "Value: " & scrlItemValue.Value

Spell(EditorIndex).GItemValue = scrlItemValue.Value

```

at spelleditorinit add this where ever you see it fit

```

.scrlItem.Value = Spell(EditorIndex).GItemNum

.scrlItemValue.Value = Spell(EditorIndex).GItemValue

```

server side

find

```

Case SPELL_TYPE_WARP

SendAnimation mapnum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index

PlayerWarp Index, Spell(spellnum).Map, Spell(spellnum).x, Spell(spellnum).y

SendAnimation GetPlayerMap(Index), Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index

DidCast = True

```

add this below

```

Case SPELL_TYPE_ITEM

SendAnimation GetPlayerMap(Index), Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index

GiveInvItem Index, Spell(spellnum).GItemNum, Spell(spellnum).GItemValue

DidCast = True

```

now you can do the modification if you want , that's all thank you
Link to comment
Share on other sites

> Yes, that is the whole point of the tutorial, and I got that.
>
> What I can't think of is any practical application of an spell that makes an item appear.
>
> At least not right now.

Honestly, it depends on the game. Regardless, it doesn't matter. He made a tutorial in hopes that someone could use it. Chances are, someone will.

Although this is rather obvious to experienced programmers, you may want to point out that if they have more than five spell types to use the next number available instead of five. Something like

```

Public Const SPELL_TYPE_ITEM As Byte = 5 'or the next number available.

```

Other than that, good work! ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png)
Link to comment
Share on other sites

> This might sound stupid, but… Can you give an example of a practical application of this spell type?
>
> Because it's looking good and all, but I can't think what it would be useful for.

Um…...Making a class that can conjure things out of mana, thin air or resources? The resource part would come from adding the "Spell Require Item" Source Tutorial. It would be like.....Hm...An alchemist or support class or something? If it weren't one of those, the idea of making spells where a character can pull crap out of their butt isn't really needed in my opinion. But still, most interesting source tutorial i'v seen so far.
Link to comment
Share on other sites

Pro's: Nicely done. Getting into the art of programming takes time and dedication. Not a bad start here. Getting yourself out there is good.

Con's: Just try to keep your code inputs clean. Don't leave all the messed up spacing if you can help it. For people who are new to programming and only copy/paste, this will work, but it won't look right. As you move on to bigger projects and better things in life, you'll realize pretty things are more likely to be noticed.
Link to comment
Share on other sites

  • 5 months 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...