Spell Delay is not grabbing the right value (proof of this bug:
Open up magic missile, give it a spell delay routine, make it log this.
name(). It shouldn't ever log even when magic missile is used, indirect
proof. Direct proof would be spammy without my combat system patch,
add this.name() to the spell delay routine in StdAbility. Which would
work for abilities that take no pre-processor command like cast/pray/etc.
Answer is in EnglishParser.getToExecute() and a COPY of the
command string.)
It's downcasting to an Ability to extract the delay time from the object.
But this doesn't work as expected. Try having it print this.name in the
spell delay to the log(In StdAbility.)
In skills like Recall and kick that don't take in a pre-proccessor
command (spell, pray, etc.) it will likely print out the correct this.name()
to the log. But try with a spell like, magic missile, it will print the incorrect
name. This is because it's downcasting the object to an ability, based
on the command given (which would be kick in the first example, or
CAST in the second example), and it would then try to extract the spell
delay time from the first CASTable command the player has access to
(seems alphabetical)
In my combat system patch there's a fix (The patch isn't actually very
large, maybe 800 lines, but it's only the parts in StdMob (maybe 100
lines), and the way it calls (in dequeCommand) the spell tick
messages(it first sends it through a new english parser routine, which
sends a copy of the command string to getToExecute(..) and then
actually executes the message (from english parser.) beucase
getToExecute modifies the string value sent to it, which needs to be
intact inside the command vector.
Anonymous
Logged In: YES
user_id=782576
Here's my fix:
In stdmob change tickDown=isInCombat?..... to:
tickDown=EnglishPaser.getDelay(this,commands);
In english paser.java add:
public static int getDelay(MOB mob, Vector commands) {
// we need to copy the command vector to use with getToEvoke.
// getToEvoke changes the command buffer, resulting in threadlocks
int commsize = commands.size();
while(commsize > 0) {
--commsize;
cmdstoUse.insertElementAt(commands.elementAt(commsize),
0);
}
Ability evokableAbility=getToEvoke(mob,cmdstoUse);
if(evokableAbility==null)
{
mob.tell(getScr("AbilityEvoker","evokeerr1"));
return false;
}
if((CMAble.qualifyingLevel(mob,evokableAbility)>=0)
&&(!CMAble.qualifiesByLevel(mob,evokableAbility)))
{
mob.tell(getScr("AbilityEvoker","evokeerr2"));
return false;
}
return mob.isInCombat()?evokeableAbility.combatCastingTime():
evokeableAbility.castingTime()
//
}
Logged In: YES
user_id=782576
Sorry, that other snippet I pasted before I tried compiling it.. here's one that
works:
public static int getDelay(MOB mob, Vector commands) {
// we need to copy the command vector to use with getToEvoke.
// getToEvoke changes the command buffer, resulting in threadlocks
int commsize = commands.size();
while(commsize > 0) {
--commsize;
cmdstoUse.insertElementAt(commands.elementAt(commsize),
0);
}
Ability evokableAbility=getToEvoke(mob,cmdstoUse);
if(evokableAbility==null)
{
mob.tell(getScr("AbilityEvoker","evokeerr1"));
return 0;
}
if((CMAble.qualifyingLevel(mob,evokableAbility)>=0)
&&(!CMAble.qualifiesByLevel(mob,evokableAbility)))
{
mob.tell(getScr("AbilityEvoker","evokeerr2"));
return 0;
}
return mob.isInCombat()?evokableAbility.combatCastingTime():
evokableAbility.castingTime();
// evokableAbility.spellTickMessage(mob)
};