Bug - Fixed use_skill() returns true for combat-skills

I've been souping up my buffbots when I noticed that it wasn't sending out errors for certain requests. Namely, it attempts to cast "moxious maneuver" on players, and use_skill() was returning true.

I thought this was quite odd considering that that particular skill is neither a buff nor usable outside combat.

Tried it with other combat skills, same story.
 

Veracity

Developer
Staff member
use_skill has special code in it with the following comment:

// Just in case someone assumed that use_skill would also work
// in combat, go ahead and allow it here.

...and for combat skills, it attempts to pass it to fight.php. I suppose the three-argument for of use_skill could require that the skill be a buff, if the third argument is not you. assuming it can figure that out.

Seems like an easy solution is for your buffbot not to advertise skills which are not buffs.
 
I suppose the three-argument for of use_skill could require that the skill be a buff, if the third argument is not you. assuming it can figure that out.

Seems like an easy solution is for your buffbot not to advertise skills which are not buffs.

It returns true even in the two-argument version, outside of battle; so while the fix suggested would work for me, it'd still be slightly wonky behavior. As for the latter suggestion, I wasn't really "advertising" non-buffs, I just recently noticed my override was being skipped (community support thread), so things like "mox" were being interpreted as Moxie of the Mariachi instead of Moxious Madrigal.
Is it possible to do file_to_map() on mafia's default data files without an override present? (or some other easy way to see if a given skill is a buff?)
 

Winterbay

Active member
file_to_map(classskills.txt , variable) should work, shouldn't it? You just need to set the variable up in a good way. That has no way of telling if something is a buff or not though...
 

Veracity

Developer
Staff member
Internally, we categorize skills like this:

Passive, Summon, Remedy, Self-Only, Buff, Combat

SkillDatabase.getSkillType( int skillId ) returns the type code. It wouldn't be too hard to write an ASH runtime library function which takes a skill, calls that function, and translates the resulting type to a string, like "passive" or "buff". string skill_type( skill )
 
file_to_map(classskills.txt , variable) should work, shouldn't it? You just need to set the variable up in a good way. That has no way of telling if something is a buff or not though...

Um... doesn't a "4" in the third field of "classskills.txt" (also, would I leave out the quotes for inline data?) denote a buff?
 

Winterbay

Active member
Very possible... I missed the "type" column when I looked at it :)
I think file_to_map loads everything that isn't a comment but I may be wrong on this since I've only used scritps that use this feature and not tried to use it myself.
 

Veracity

Developer
Staff member
It wouldn't be too hard to write an ASH runtime library function which takes a skill, calls that function, and translates the resulting type to a string, like "passive" or "buff". string skill_type( skill )
Looks like $skill is a candidate for another ProxyRecord type, eh?
 
Top