drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 I can get Case 0 to work, but once I add a second case neither of them work. Anyone know what I'm doing wrong?' Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script)Select Case Script' Teleport Spell (for testing)Case 0Dim pmDim pmmpm = GetPlayerMp(Index)pmm = GetPlayerMaxMp(Index)Call PlayerMsg(Index, "Teleport Spell", WHITE)Call PlayerMsg(Index, "Magic Points = "& pm, WHITE) If pm > 500 ThenCall PlayerMsg(Index, "Mana is higher then 500", WHITE) Call PlayerWarp(index, 1, 10, 10) Call SetPlayerMP(index, pm - pm) Else Call PlayerMsg(Index, "Teleport Spell did not work, why?", WHITE) End IfCase 1Dim pmpm = GetPlayerMp(Index)Call PlayerMsg(Index, "Magic Points = "& pm, WHITE)Case ElseCall PlayerMsg(Index, "Case Else Statemenet", WHITE)Exit SubEnd SelectEnd Sub Link to comment Share on other sites More sharing options...
Tyr Posted October 22, 2008 Share Posted October 22, 2008 u did set your scripted spell to 1 in the spell editor did u? Link to comment Share on other sites More sharing options...
Bobosk Posted October 22, 2008 Share Posted October 22, 2008 you're double dimming… you only need to dim a var once in a sub, so remove the "Dim pm" after "Case 1" then try it again...Also tyr, try not to assume it's user error right away.. Link to comment Share on other sites More sharing options...
drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 Thank you Bobosk you were correct, that fixed it! Link to comment Share on other sites More sharing options...
drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 Ok now i have added to it and nothing works again. = (I do have a Sub Buff that I got somewhere on these forums. I posted it after my script.Sub ScriptedSpell(Index, Script)Select Case Script' Teleport Spell (for testing)Dim pmDim pmmDim psCase 0pm = GetPlayerMp(Index)pmm = GetPlayerMaxMp(Index)Call PlayerMsg(Index, "Teleport Spell", WHITE)Call PlayerMsg(Index, "Magic Points = "& pm, WHITE) If pm > 500 ThenCall PlayerMsg(Index, "Mana is higher then 500", WHITE) Call PlayerWarp(index, 1, 10, 10) Call SetPlayerMP(index, pm - pm) Else Call PlayerMsg(Index, "Teleport Spell did not work, why?", WHITE) End If Exit SubCase 1pm = GetPlayerMP(Index)ps = GetPlayerStr(Index)If GetPlayerTarget(Index) > 0 Then Call PlayerMsg(Index, "Magic Points = "& pm, WHITE) Call Buff(GetPlayerTarget(Index), 0, 33, 60) Call PlayerMsg(Index, "Strength = "& ps,WHITE)Else Call PlayerMsg(Index, "You do not have a target!", WHITE)End IfCase ElseCall PlayerMsg(Index, "Case Else Statemenet", WHITE)Exit SubEnd SelectEnd Sub***********************************************Sub Buff(index, stat, amount, duration)If GetVar("Buff.ini", GetPlayerName(index), CStr(stat)) = "" Then Select Case stat Case 0 Call SetPlayerStr(index, GetPlayerStr(index) + Int(Amount)) Case 1 Call SetPlayerDef(index, GetPlayerDef(index) + Int(Amount)) Case 2 Call SetPlayerMagi(index, GetPlayerMagi(index) + Int(Amount)) Case 3 Call SetPlayerSpeed(index, GetPlayerSpeed(index) + Int(Amount)) Case Else Exit Sub End Select Call SendStats(index) Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), Cstr(amount)) duration = duration * 1000 Call SetTimer("Debuff " & index & ", " & CStr(stat), duration) Call SendHP(index) Call SendMP(index) Call SendSP(index) End IfEnd SubSub Debuff(index, stat)Amount = GetVar("Buff.ini", GetPlayerName(index), CStr(stat)) Select Case statCase "0" Call SetPlayerStr(index, GetPlayerStr(index) - Int(Amount))Case "1" Call SetPlayerDef(index, GetPlayerDef(index) - Int(Amount))Case "2" Call SetPlayerMagi(index, GetPlayerMagi(index) - Int(Amount))Case "3" Call SetPlayerSpeed(index, GetPlayerSpeed(index) - Int(Amount)) End SelectCall SendStats(index)Call PutVar("Buff.ini", GetPlayerName(index), CStr(stat), "")Call RemoveTimer("Debuff " & index & ", " & CStr(stat))Call SendHP(index)Call SendMP(index)Call SendSP(index)End Sub Link to comment Share on other sites More sharing options...
Bobosk Posted October 22, 2008 Share Posted October 22, 2008 I don't see any reason why it shouldn't be working… other than perhaps, you don't have a ' infront of all the * which can have problems.. Link to comment Share on other sites More sharing options...
drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 OK Now I'm using the below script and it appears to be working, but i ran into another problem. I have to re-memorize each spell everytime i switch back and forth to use them. For example: I use the "Teleport" spell and then if I try and use the "test" spell it actually tries to use the "Teleport" spell again. I have to double click it in the spell list to re-memorize it and then I can use it. I thought I read something about this being a bug and some fix out there for it, but I'm not sure. If there is a fix I can't find it.Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script) Select Case Script' Teleport Spell (for testing)Case 0Dim pmDim pmmpm = GetPlayerMp(Index)pmm = GetPlayerMaxMp(Index)Call PlayerMsg(Index, "Teleport Spell", WHITE)Call PlayerMsg(Index, "Magic Points = "& pm, WHITE)If pm > 500 Then Call PlayerMsg(Index, "Mana is higher then 500", WHITE) Call PlayerWarp(index, 1, 10, 10) Call SetPlayerMP(index, pm - pm)Else Call PlayerMsg(Index, "Teleport Spell did not work, why?", WHITE)End IfCase 1pm = GetPlayerMp(Index)Call PlayerMsg(Index, "Magic Points = "& pm, WHITE)If pm >9 Then Call Buff(GetPlayerTarget(index), 0, 10, 60) Call SetPlayerMP(Index, pm - 10)Else Call PlayerMsg(Index, "You do not have enough mana", WHITE)End IfCase ElseCall PlayerMsg(Index, "Case Else Statemenet", WHITE) Exit Sub End SelectEnd Sub Link to comment Share on other sites More sharing options...
Bobosk Posted October 22, 2008 Share Posted October 22, 2008 no, that's how Eclipse is setup, you double-click the spell to memorize it, then to memorize a different one you have to double-click that spell… Link to comment Share on other sites More sharing options...
drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 So that I understand this correctly. Each time I want to switch to a different spell i have to double click it first to "memorize" it? Link to comment Share on other sites More sharing options...
Bobosk Posted October 22, 2008 Share Posted October 22, 2008 yes Link to comment Share on other sites More sharing options...
drktemplar Posted October 22, 2008 Author Share Posted October 22, 2008 Was this the original functionality or a bug?Is there a way to correct this, or a way to write macros to do this action for the user?I just don't care for that, and if possible would like a workaround. Link to comment Share on other sites More sharing options...
DarkMazer Posted October 23, 2008 Share Posted October 23, 2008 There's two ways to cast a spell in Eclipse:After selecting your target…1\. Double-click on it to memorize it, then press Insert.2\. Select it on the Spells menu (single click), then click "Cast". If you're going to be switching spells a lot, it's probably better to keep the spell menu open so you can click on a new spell and click Cast a bit faster. Having more than one key to which you could assign spells would be nice, but it's not the way Eclipse normally functions. I hope that answers your question. Link to comment Share on other sites More sharing options...
drktemplar Posted October 23, 2008 Author Share Posted October 23, 2008 Well it doesn't work that way for me.If I single click a different spell in my spell list and double click cast, the last spell i had cast is the one that goes off. Even though I single clicked a different one in the list. If i double click and re-memorize the second spell then I can cast it.If this is the way it's written then that's fine. But Is there a way to write macros within EE 2.7? Link to comment Share on other sites More sharing options...
Bobosk Posted October 23, 2008 Share Posted October 23, 2008 that is the way it's written, and really, the only way you can create macro's is by source coding.. 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