Octohunter Posted July 20, 2011 Author Share Posted July 20, 2011 So, as the title says, this is a tutorial on making Linear Spells. [![](http://www.freemmorpgmaker.com/files/imagehost/pics/2f5ed374ae88c9b7d7abd5ec72df0905.png)](http://www.freemmorpgmaker.com/files/imagehost/#2f5ed374ae88c9b7d7abd5ec72df0905.png)Special thanks to Captain Wabbit, whose Projectile System gave me the theory I needed to fix my old projectile system and make this. First, open modTypes. In```Private Type SpellRec``` before```End Type```insert```IsLinear As Boolean```Open up Sub Serverloop in modServerLoop. After this code```If GetTickCount > TempPlayer(i).spellBuffer.Timer + (Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).CastTime * 1000) Then```Place this.```If Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).IsLinear = False Then```After this code```              If Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).IsLinear = False Then                CastSpell i, TempPlayer(i).spellBuffer.Spell, TempPlayer(i).spellBuffer.target, TempPlayer(i).spellBuffer.tType                TempPlayer(i).spellBuffer.Spell = 0                TempPlayer(i).spellBuffer.Timer = 0                TempPlayer(i).spellBuffer.target = 0                TempPlayer(i).spellBuffer.tType = 0```Place this.```              Else                Call FireProjectile(i, GetPlayerDir(i), Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).Vital, Spell(Player(i).Spell(TempPlayer(i).spellBuffer.Spell)).Range, TempPlayer(i).spellBuffer.Spell)                TempPlayer(i).spellBuffer.Spell = 0                TempPlayer(i).spellBuffer.Timer = 0                TempPlayer(i).spellBuffer.target = 0                TempPlayer(i).spellBuffer.tType = 0              End If```Then, open modCombat. Search for```Select Case SpellCastType```Now, paste this code above it```If Spell(spellnum).IsLinear = False Then```And paste this code below the corresponding "End Select", right before "If HasBuffered Then".```Else  HasBuffered = TrueEnd If```Next, scroll down to the bottom of modCombat and paste this.```Public Sub FireProjectile(ByVal Index As Long, ByVal Dir As Long, ByVal Damage As Long, ByVal Range As Long, ByVal spellnum As Long)Dim i As LongDim r As LongDim MapNum As LongDim canShoot As BooleanDim DidCast As Boolean  MapNum = GetPlayerMap(Index)  If Damage = 0 Then    Damage = GetPlayerDamage(Index)  End If  canShoot = False  DidCast = FalseFor r = 1 To Range  If Dir = DIR_UP Then    If GetPlayerY(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) - r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) - r        Exit Sub      End If    End If  End If  If Dir = DIR_DOWN Then    If GetPlayerY(Index) + r > Map(MapNum).MaxY Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) + r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) + r        Exit Sub      End If    End If  End If  If Dir = DIR_LEFT Then    If GetPlayerX(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) - r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) - r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) - r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If Dir = DIR_RIGHT Then    If GetPlayerX(Index) + r > Map(MapNum).MaxX Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) + r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) + r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) + r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If DidCast = True Then    Call SetPlayerVital(Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) - Spell(spellnum).MPCost)    Call SendVital(Index, Vitals.MP)    ' send vitals to party if in one    If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index    TempPlayer(Index).SpellCD(spellnum) = GetTickCount + (Spell(spellnum).CDTime * 1000)    Call SendCooldown(Index, spellnum)    SendActionMsg MapNum, Trim$(Spell(spellnum).Name) & "!", BrightRed, ACTIONMSG_SCROLL, GetPlayerX(Index) * 32, GetPlayerY(Index) * 32    Exit Sub  End If  For i = 1 To MAX_MAP_NPCS    If CanPlayerAttackNpc(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) - r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) + r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_NPC        Exit Sub      Else        Call PlayerAttackNpc(Index, i, Damage)        Exit Sub      End If    End If    End If  Next  For i = 1 To Player_HighIndex    If i <> Index Then    If CanPlayerAttackPlayer(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) - r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) + r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_PLAYER        Exit Sub      Else        Call PlayerAttackPlayer(Index, i, Damage)        Exit Sub      End If    End If    End If    End If  NextNextEnd Sub```CLIENT SIDEFirst, make your way to modTypes. In```Private Type SpellRec``` before```End Type```insert```IsLinear As Boolean```, just like we did in the server section.Then, go to frmEditor_Spell. Paste this code at the bottom. ```Private Sub chkLinear_Click()  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  If chkLinear.Value = 0 Then    Spell(EditorIndex).IsLinear = False  Else    Spell(EditorIndex).IsLinear = True  End If  ' Error handler  Exit Suberrorhandler:  HandleError "chkLinear_Click", "frmEditor_Spell", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit SubEnd Sub```Now, open up the form and add a checkbox as shown in this picture. Call it chkLinear.[![](http://www.freemmorpgmaker.com/files/imagehost/pics/0c4a26f84add465bbd1b5607a2d77380.png)](http://www.freemmorpgmaker.com/files/imagehost/#0c4a26f84add465bbd1b5607a2d77380.png)Finally, search```    If Spell(EditorIndex).IsAoE Then      .chkAOE.Value = 1    Else      .chkAOE.Value = 0    End If```in SpellEditorInit, and add under it```    If Spell(EditorIndex).IsLinear Then      .chkLinear.Value = 1    Else      .chkLinear.Value = 0    End If```And you're done.I am aware that there are other, better ways to accomplish this, but the way I have outlined here gives you a nifty new sub, FireProjectile, that you can use. Please report any and all bugs, as well as give credit if you use this.EDIT: Added in support for PVP combat. Not tested, as I don't have someone else to test it with, but I think it should work.EDIT2: Partially rewrote code. Now supports AOEs, healing spells, mana damage, stuns, and DOTs. :D Link to comment Share on other sites More sharing options...
Dzastin Posted July 20, 2011 Share Posted July 20, 2011 When i use this, i don't have a cast anim of spell in the area, but NPC is damaged. Help? Link to comment Share on other sites More sharing options...
Octohunter Posted July 20, 2011 Author Share Posted July 20, 2011 Do you use a different version of EO instead of default 2.0? Because it worked fine when I implemented it in a vanilla copy of EO.EDIT: New sub, check tutorial. Link to comment Share on other sites More sharing options...
Octohunter Posted July 21, 2011 Author Share Posted July 21, 2011 Alright, partially rewrote the tutorial. If you followed the old version, simply replace your CastSpell sub with a vanilla EO CastSpell sub or remove anything related to IsLinear in that sub. Then, only replace your FireProjectile sub with the new one and do the step involving Sub ServerLoop.There's a good reason for the change, though; it adds support for AOEs, Mana Damage, and Healing! :D Link to comment Share on other sites More sharing options...
Octohunter Posted July 22, 2011 Author Share Posted July 22, 2011 Spells are now affected by solid objects. Now, if you attempt to cast a spell through a wall, the animation will play on the tile that the wall is on and nothing will happen.Just replace your FireProjectile sub with the new one or add this code```  If Dir = DIR_UP Then    If Map(mapNum).Tile(GetPlayerX(index), GetPlayerY(index) - r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(index), GetPlayerY(index) - r      Else        SendAnimation mapNum, Item(GetPlayerEquipment(index, Weapon)).animation, GetPlayerX(index), GetPlayerY(index) - r      End If      Exit Sub    End If  End If  If Dir = DIR_DOWN Then    If Map(mapNum).Tile(GetPlayerX(index), GetPlayerY(index) + r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(index), GetPlayerY(index) + r      Else        SendAnimation mapNum, Item(GetPlayerEquipment(index, Weapon)).animation, GetPlayerX(index), GetPlayerY(index) + r      End If      Exit Sub    End If  End If  If Dir = DIR_LEFT Then    If Map(mapNum).Tile(GetPlayerX(index) - r, GetPlayerY(index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(index) - r, GetPlayerY(index)      Else        SendAnimation mapNum, Item(GetPlayerEquipment(index, Weapon)).animation, GetPlayerX(index) - r, GetPlayerY(index)      End If      Exit Sub    End If  End If  If Dir = DIR_RIGHT Then    If Map(mapNum).Tile(GetPlayerX(index) + r, GetPlayerY(index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(index) + r, GetPlayerY(index)      Else        SendAnimation mapNum, Item(GetPlayerEquipment(index, Weapon)).animation, GetPlayerX(index) + r, GetPlayerY(index)      End If      Exit Sub    End If  End If```under```for r = 1 to Range``` Link to comment Share on other sites More sharing options...
tsuki Posted July 22, 2011 Share Posted July 22, 2011 Nice tutorial, man! Very useful for mage class! Link to comment Share on other sites More sharing options...
Octohunter Posted July 23, 2011 Author Share Posted July 23, 2011 Fixed a subscript out of range error when attempting to cast a spell beyond the boundaries of the map. Just replace your FireProjectile sub with```Public Sub FireProjectile(ByVal Index As Long, ByVal Dir As Long, ByVal Damage As Long, ByVal Range As Long, ByVal spellnum As Long)Dim i As LongDim r As LongDim MapNum As LongDim canShoot As BooleanDim DidCast As Boolean  MapNum = GetPlayerMap(Index)  If Damage = 0 Then    Damage = GetPlayerDamage(Index)  End If  canShoot = False  DidCast = FalseFor r = 1 To Range  If Dir = DIR_UP Then    If GetPlayerY(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) - r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) - r        Exit Sub      End If    End If  End If  If Dir = DIR_DOWN Then    If GetPlayerY(Index) + r > Map(MapNum).MaxY Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) + r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) + r        Exit Sub      End If    End If  End If  If Dir = DIR_LEFT Then    If GetPlayerX(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) - r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) - r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) - r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If Dir = DIR_RIGHT Then    If GetPlayerX(Index) + r > Map(MapNum).MaxX Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) + r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) + r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) + r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If DidCast = True Then    Call SetPlayerVital(Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) - Spell(spellnum).MPCost)    Call SendVital(Index, Vitals.MP)    ' send vitals to party if in one    If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index    TempPlayer(Index).SpellCD(spellnum) = GetTickCount + (Spell(spellnum).CDTime * 1000)    Call SendCooldown(Index, spellnum)    SendActionMsg MapNum, Trim$(Spell(spellnum).Name) & "!", BrightRed, ACTIONMSG_SCROLL, GetPlayerX(Index) * 32, GetPlayerY(Index) * 32    Exit Sub  End If  For i = 1 To MAX_MAP_NPCS    If CanPlayerAttackNpc(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) - r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) + r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_NPC        Exit Sub      Else        Call PlayerAttackNpc(Index, i, Damage)        Exit Sub      End If    End If    End If  Next  For i = 1 To Player_HighIndex    If i <> Index Then    If CanPlayerAttackPlayer(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) - r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) + r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_PLAYER        Exit Sub      Else        Call PlayerAttackPlayer(Index, i, Damage)        Exit Sub      End If    End If    End If    End If  NextNextEnd Sub``` Link to comment Share on other sites More sharing options...
SawQuart Posted July 23, 2011 Share Posted July 23, 2011 Do you mind posting a screenshot of this? I'm very interested, but not sure if I should add it or not. Link to comment Share on other sites More sharing options...
Octohunter Posted July 25, 2011 Author Share Posted July 25, 2011 @Jungle: All it is is the ability to "shoot" a spell in a straight line and draw the animation wherever it hits, be that a rock or a person. There's no projectile drawn to screen because I don't know how. If I post a screenshot, it would likely look like the default Origins spellcasting system except that there's no targeting reticule. Link to comment Share on other sites More sharing options...
Zetasis Posted July 26, 2011 Share Posted July 26, 2011 Hmm. Seems like a cool idea but I don't really get the point of it if there is now projectile drawn on the screen. I guess maybe some really basic line of sight system is all this could really be used for. Either way nice tutorial and with some editing I could see this being pretty useful. Link to comment Share on other sites More sharing options...
canido Posted July 26, 2011 Share Posted July 26, 2011 screenshot? Link to comment Share on other sites More sharing options...
Octohunter Posted July 26, 2011 Author Share Posted July 26, 2011 @Zetasis: I'll delve into Captain Wabbit's code and see if I can modify this to work with his ranged system. :)@screenshot people:[![](http://www.freemmorpgmaker.com/files/imagehost/pics/2f5ed374ae88c9b7d7abd5ec72df0905.png)](http://www.freemmorpgmaker.com/files/imagehost/#2f5ed374ae88c9b7d7abd5ec72df0905.png)Edit: New FireProjectile sub up, fixed bug in which spellcasting into a wall didn't take away MP, set the cooldown, or draw the spell text; for those who don't want to scroll up, here```Public Sub FireProjectile(ByVal Index As Long, ByVal Dir As Long, ByVal Damage As Long, ByVal Range As Long, ByVal spellnum As Long)Dim i As LongDim r As LongDim MapNum As LongDim canShoot As BooleanDim DidCast As Boolean  MapNum = GetPlayerMap(Index)  If Damage = 0 Then    Damage = GetPlayerDamage(Index)  End If  canShoot = False  DidCast = FalseFor r = 1 To Range  If Dir = DIR_UP Then    If GetPlayerY(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) - r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) - r        Exit Sub      End If    End If  End If  If Dir = DIR_DOWN Then    If GetPlayerY(Index) + r > Map(MapNum).MaxY Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index), GetPlayerY(Index) + r).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + r        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index), GetPlayerY(Index) + r        Exit Sub      End If    End If  End If  If Dir = DIR_LEFT Then    If GetPlayerX(Index) - r < 0 Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) - r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) - r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) - r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If Dir = DIR_RIGHT Then    If GetPlayerX(Index) + r > Map(MapNum).MaxX Then      Exit Sub    End If    If Map(MapNum).Tile(GetPlayerX(Index) + r, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then      If spellnum > 0 Then        SendAnimation MapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) + r, GetPlayerY(Index)        DidCast = True      Else        SendAnimation MapNum, Item(GetPlayerEquipment(Index, Weapon)).Animation, GetPlayerX(Index) + r, GetPlayerY(Index)        Exit Sub      End If    End If  End If  If DidCast = True Then    Call SetPlayerVital(Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) - Spell(spellnum).MPCost)    Call SendVital(Index, Vitals.MP)    ' send vitals to party if in one    If TempPlayer(Index).inParty > 0 Then SendPartyVitals TempPlayer(Index).inParty, Index    TempPlayer(Index).SpellCD(spellnum) = GetTickCount + (Spell(spellnum).CDTime * 1000)    Call SendCooldown(Index, spellnum)    SendActionMsg MapNum, Trim$(Spell(spellnum).Name) & "!", BrightRed, ACTIONMSG_SCROLL, GetPlayerX(Index) * 32, GetPlayerY(Index) * 32    Exit Sub  End If  For i = 1 To MAX_MAP_NPCS    If CanPlayerAttackNpc(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) - r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) + r = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = MapNpc(MapNum).Npc(i).x And GetPlayerY(Index) = MapNpc(MapNum).Npc(i).y Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_NPC        Exit Sub      Else        Call PlayerAttackNpc(Index, i, Damage)        Exit Sub      End If    End If    End If  Next  For i = 1 To Player_HighIndex    If i <> Index Then    If CanPlayerAttackPlayer(Index, i, True) Then    If Dir = DIR_UP Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) - r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_DOWN Then      If GetPlayerX(Index) = GetPlayerX(i) And GetPlayerY(Index) + r = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_LEFT Then      If GetPlayerX(Index) - r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If Dir = DIR_RIGHT Then      If GetPlayerX(Index) + r = GetPlayerX(i) And GetPlayerY(Index) = GetPlayerY(i) Then        canShoot = True      End If    End If    If canShoot = True Then      If spellnum > 0 Then        CastSpell Index, spellnum, i, TARGET_TYPE_PLAYER        Exit Sub      Else        Call PlayerAttackPlayer(Index, i, Damage)        Exit Sub      End If    End If    End If    End If  NextNextEnd Sub``` Link to comment Share on other sites More sharing options...
SawQuart Posted July 28, 2011 Share Posted July 28, 2011 I'm sorry, but I don't understand your last step. Where is SpellEditorInit and where do I have to search? Link to comment Share on other sites More sharing options...
Justn Posted July 28, 2011 Share Posted July 28, 2011 @Jungle:> I'm sorry, but I don't understand your last step. Where is SpellEditorInit and where do I have to search?umm cant u just search (whole project) for 'If Spell(EditorIndex).IsAoE Then' then look for          .chkAOE.Value = 1    Else         .chkAOE.Value = 0   End If–-- then under it add the new piece of code Link to comment Share on other sites More sharing options...
SawQuart Posted July 28, 2011 Share Posted July 28, 2011 God, I'm such a newb at this…But how do you search the whole project? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted July 28, 2011 Share Posted July 28, 2011 @Jungle:> God, I'm such a newb at this…> > But how do you search the whole project?[This.](http://php.webuda.com/eclipse/guide/ctrlf/slideshow.html)In other words, Control + F, Alt + C, Alt + F, (type), Alt + N. Link to comment Share on other sites More sharing options...
SawQuart Posted July 28, 2011 Share Posted July 28, 2011 Ctrl+F doesnt bring up anything. Is there anyway to get there manually?EDIT:Never mind, it looks like you posted it.EDIT 2:Yeah, none of them work. Link to comment Share on other sites More sharing options...
Justn Posted July 28, 2011 Share Posted July 28, 2011 its in modGameEditors look for ' ////////////////// then go down alittle further and you'll see it at the                         ' // Spell Editor //bottom of ' set values i still dont understand why u                         ' ////////////////// cant search though :confused: Link to comment Share on other sites More sharing options...
SawQuart Posted July 28, 2011 Share Posted July 28, 2011 Thanks man! You were really helpful! If I could rep you I would.I dont understand why I cant search either. This is going to make Programming hell -_- Link to comment Share on other sites More sharing options...
games4life Posted July 30, 2011 Share Posted July 30, 2011 @Jungle:> Thanks man! You were really helpful! If I could rep you I would.> > I dont understand why I cant search either. This is going to make Programming hell -_-FYI you can open the search manually by first; opening any module (Or right clicking any form and click view code) Then open the tab "Edit" at the top of the window and scroll down to, Find.Anyways, This looks like it may be what i was looking for, I'll have to try it out later. Thanks! :) Link to comment Share on other sites More sharing options...
SeeingBlue Posted July 31, 2011 Share Posted July 31, 2011 Or go to Edit>Find? Link to comment Share on other sites More sharing options...
Octohunter Posted September 3, 2011 Author Share Posted September 3, 2011 Bump. Link to comment Share on other sites More sharing options...
ZeoWorks Posted September 6, 2011 Share Posted September 6, 2011 ~~Can I ask, What exsactly is a Linear Spell and what does it do? Thanks!~~EDIT: Nvm, I figured it out. :) Link to comment Share on other sites More sharing options...
Clueless Posted November 23, 2011 Share Posted November 23, 2011 Sorry but nothing seems to happen when I did this the spell editor looks exactly the same. Did I miss something? :huh: Link to comment Share on other sites More sharing options...
Justn Posted November 23, 2011 Share Posted November 23, 2011 is the new checkbox's visible set to true? and did u compile the project after editing? 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