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

Spells to get out of movement imparing


haileelipse
 Share

Recommended Posts

I have added sleep, silence, bind to my game instead of just stun
Bind ; Stops them moving
Sleep ; stops them doing anything untill they take damage
Silence ; stops casting
Stun ; stops everything

I added spell_type_unstun, spell_type_unsilence, spell_type_unsleep, spell_type_unbind as well to counteract these imparing spells.

I added checks to castspell;
If silenceduration > 0 then exitsub
If Sleepduration > 0 then exitsub
If stunduration > 0 then exitsub

and added to walkingsub
if bindduration > 0 then exit sub
if stunduration > 0 then exit sub
if sleepduration > 0 then exit sub

I then added this to checks to see if im casting movement unimpairing abilities as thats all i want to be able to cast when silenced / stuned or asleep.

so in cast sub i used

if silenceduration > 0 then
    If spell(spellslot).type <> spell_type_unsilence then
        Exit Sub
    End if
End if

if Sleepduration > 0 then
    If spell(spellslot).type <> spell_type_unsleep then
        Exit Sub
    End if
End if

if Stunduration> 0 then
    If spell(spellslot).type <> spell_type_un stunthen
        Exit Sub
    End if
End if

Now the problem is for some reason when stuned i can only cast unsleep, when silenced i can only cast unbind and when asleep I can only cast unsilence >.<….

Ive checked spell_types as I thought they must be getting muked up but there all in the same order so what could be causing this mix up any ideas?
Link to comment
Share on other sites

I'm going to move this over to the Source Questions board, if you don't mind.

Alright, make sure that the order for the spell selection list client-side is the same as the order you use for the spell constants server-side (you said you did this, make sure). Make sure that the appropriate packets are sent to set off each of these (like the packet for Silence doesn't send the packet for Sleep).
Link to comment
Share on other sites

Sorry thought I placed it there :S thanks for the post I checked looks right it is meant to start at 0 right? xD

' Spell constants both client and server
Public Const SPELL_TYPE_DAMAGEHP As Byte = 0
Public Const SPELL_TYPE_DAMAGEMP As Byte = 1
Public Const SPELL_TYPE_HEALHP As Byte = 2
Public Const SPELL_TYPE_HEALMP As Byte = 3
Public Const SPELL_TYPE_WARP As Byte = 4
Public Const SPELL_TYPE_PET As Byte = 5
Public Const SPELL_TYPE_TRANSFORMATION As Byte = 6
Public Const SPELL_TYPE_BUFFER As Byte = 7
Public Const SPELL_TYPE_Flash As Byte = 8
Public Const SPELL_TYPE_unstun As Byte = 9
Public Const SPELL_TYPE_unbind As Byte = 10
Public Const SPELL_TYPE_unsilence As Byte = 11
Public Const SPELL_TYPE_unsleep As Byte = 12
Public Const SPELL_TYPE_undo As Byte = 13
Public Const SPELL_TYPE_itemsummon As Byte = 14

spell selection list
Damage HP
Damage MP
Heal HP
Heal MP
Warp
Pet
Transform
Buff
Flash
unstun
unbind
unsilence
unsleep
undo
Itemsummon
Link to comment
Share on other sites

  • 3 weeks 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...