shinobugmaster Posted March 18, 2013 Author Share Posted March 18, 2013 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 castlets 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 sideform workat spell editor add a 1 frame , 2 scrollbars , and 2 labels also add a "Item" on cmbTypename the following1 scrollbar = scrlitem (make the min of this scrlbar to 1 and max to 255)1 scrollbar = scrlitemvalue1 label = lblitem1 label = lblitemvalueadd 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 sidefind```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 More sharing options...
barreytor Posted March 18, 2013 Share Posted March 18, 2013 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. Link to comment Share on other sites More sharing options...
damian666 Posted March 18, 2013 Share Posted March 18, 2013 guess you could let a item appear magicly? xd Link to comment Share on other sites More sharing options...
shinobugmaster Posted March 18, 2013 Author Share Posted March 18, 2013 well when you cast a spell , it will give you item Link to comment Share on other sites More sharing options...
abhi2011 Posted March 18, 2013 Share Posted March 18, 2013 Or a one time use spell that costs. Like a really powerful attack. It would be good if the scrolls can stack. Link to comment Share on other sites More sharing options...
barreytor Posted March 18, 2013 Share Posted March 18, 2013 > well when you cast a spell , it will give you itemYes, 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. Link to comment Share on other sites More sharing options...
Matt Posted March 18, 2013 Share Posted March 18, 2013 > 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 More sharing options...
Wortel Angels Posted March 18, 2013 Share Posted March 18, 2013 I will use itSpell -> Pick up StoneItem -> StoneStone needed for other spell ;-) Link to comment Share on other sites More sharing options...
barreytor Posted March 18, 2013 Share Posted March 18, 2013 Duh, why of course, a spell that makes water and a spell that makes bread, simplest things ever, to go with any game with hunger/thirst mechanics.I should have thought of that earlier.Nice tutorial anyway. Link to comment Share on other sites More sharing options...
RyokuHasu Posted March 19, 2013 Share Posted March 19, 2013 reminds me of my Item type that can give you other items =D Link to comment Share on other sites More sharing options...
Elihu Posted March 19, 2013 Share Posted March 19, 2013 > 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 More sharing options...
escfoe2 Posted March 22, 2013 Share Posted March 22, 2013 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 More sharing options...
DarkDino Posted August 25, 2013 Share Posted August 25, 2013 This can change to Ammo, for Spell Type Arrow and use a 1 Arrow per hit!. NICE!. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now