What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Problem with Kupo's Spell.Cast

Ichiba

New Member
Joined
Jun 14, 2014
Messages
258
DoAction and CanCast don't agree.

Pretty simple

Why does this work?
Code:
Actionmanager.DoAction("Ninjutsu", Core.Player.CurrentTarget)

but this doesn't do anything?
Code:
Spell.Cast("Ninjutsu", r => true, r => Core.Player.CurrentTarget)


Edit: Hmmm.... looks like CanCast only returns true if the target is Core.Player, but DoAction has to be Core.Player.CurrentTarget.

Edit2: I guess I wrote around it, but it would be nice to not have to.
 
Last edited:
Pretty simple

Why does this work?
Code:
Actionmanager.DoAction("Ninjutsu", Core.Player.CurrentTarget)

but this doesn't do anything?
Code:
Spell.Cast("Ninjutsu", r => true, r => Core.Player.CurrentTarget)


Edit: Hmmm.... looks like CanCast only returns true if the target is Core.Player, but DoAction has to be Core.Player.CurrentTarget.

Edit2: I guess I wrote around it, but it would be nice to not have to.

Are you sure DoAction on Player doesn't work as well? I guess Ninjutsu is handled weird :S

On a random tangent: if you don't like specifying targets in your rotation, you could edit the cast function: if cancast on target fails, check cancast on self and replace XD but I guess that would be bad >_>
 
Are you sure DoAction on Player doesn't work as well? I guess Ninjutsu is handled weird :S

On a random tangent: if you don't like specifying targets in your rotation, you could edit the cast function: if cancast on target fails, check cancast on self and replace XD but I guess that would be bad >_>


This..I assume if cancast only returns correct value on the player then it needs to be cast on the player. Don't have a ninja so cant say.
 
This..I assume if cancast only returns correct value on the player then it needs to be cast on the player. Don't have a ninja so cant say.

It's wrong, though. For anything that requires being casted on an enemy target like Fuma Shuriken, Raiton, or Suiton,
Code:
Log(Actionmanager.CanCast("Ninjutsu", Core.Player));
Log(Actionmanager.CanCast("Ninjutsu", Core.Player.CurrentTarget));
Log(Actionmanager.DoAction("Ninjutsu", Core.Player));
Log(Actionmanager.DoAction("Ninjutsu", Core.Player.CurrentTarget));
Returns
Code:
True
False
False
True
 
Thanks for the testing!

I think the best workaround would be a special cast function that cancasts the player :D
 
Yeah I ran into this when I was banging my head against the LastSpell wall. At first I thought it might be because the game sees it as the new spell name and not "Ninjutsu" but I couldn't get a "True" out of anything but "Ninjutsu".

I've tried the "DoAction" route but it doesn't work nearly as well/consistently as Cast (at least in my case). Hopefully someone smarter than me will figure something out soon. :cool:
 
Yeah I ran into this when I was banging my head against the LastSpell wall. At first I thought it might be because the game sees it as the new spell name and not "Ninjutsu" but I couldn't get a "True" out of anything but "Ninjutsu".

I've tried the "DoAction" route but it doesn't work nearly as well/consistently as Cast (at least in my case). Hopefully someone smarter than me will figure something out soon. :cool:

you still need all the logic behind a standard cast function instead of just using a doaction :P you just copy the cast function, rename it something else and replace the CanCast(data, o ?? Core.Player.CurrentTarget) with a CanCast(data, Core.Player)
 
Yeah I made that post right after I woke up this morning, didn't make much sense. Was just venting that I had a lot of trouble getting it working right last night but didn't come out right lol.
 
Back
Top