finished: CostToCast Scriptlet

Scriptlet that returns the Cost To cast a skill as a int.

In preparation for writing this script, I downloaded Nightmists SkillToInt scriptlet, and upon looking at it, I decided to switch from writing the script to just data entry. Alas, I changed the return values for all the skills I know the MP to cast, and commented out the ones I didn't.

I guess this is kind of a help request. Is there anyone who can fill in the missing info?

To use:
Code:
CostToCast( $skill[*Skill Here*])

Returns 0 if it cant find the skill.

Not yet tested.

Edit added Hillarious objects cost to still partially complete list.
Edit2, see second post for a more complete, if not complete version :)
 

Attachments

  • CostToCast.ash
    6.9 KB · Views: 107

Nightmist

Member
Re: Unfinished: CostToCast Scriptlet

To use:
Code:
SkillCost( $skill[*Skill Name*])

Returns 0 if the skill is a in-battle or passive or it simply cant find it. (Removed in-battle and passives to cut down on the list of skills)
 
Re: Unfinished: CostToCast Scriptlet

[quote author=Nightmist link=topic=61.msg204#msg204 date=1144554559]
To use:
Code:
SkillCost( $skill[*Skill Name*])

Returns 0 if the skill is a in-battle or passive or it simply cant find it. (Removed in-battle and passives to cut down on the list of skills)
[/quote]

Effectively the same thing, but less wastefull. Great!
 
I made a couple of adjustments. In this version, the function name has been changed to SkillBaseCost instead of SkillCost, to reflect the fact that it's returning the default cost of using the skill.

There is a new function int SpellCostModifier() that checks to see if the character is wearing a plexiglass pocketwatch, stainless steel solitaire, or baconstone bracelet and returns a result from 0 to -3 as appropriate. Note that in order to perform the check, the script attempts to remove and re-wear the item, so one should try to call this function once at the beginning of a script and remember the result, as each call to this function could potentially cause up to 5 server hits.

Finally there is a function AdjustedSpellCost(skill theSkill, int theModifier) that returns an integer computed from the other two; it will call SkillBaseCost for you, but you need to provide the modifier to it because hopefully you are following my advice from the previous paragraph. :)
 
[quote author=Bucket de Mowbray link=topic=61.msg561#msg561 date=1146404808]
I made a couple of adjustments. In this version, the function name has been changed to SkillBaseCost instead of SkillCost, to reflect the fact that it's returning the default cost of using the skill.

There is a new function int SpellCostModifier() that checks to see if the character is wearing a plexiglass pocketwatch, stainless steel solitaire, or baconstone bracelet and returns a result from 0 to -3 as appropriate. Note that in order to perform the check, the script attempts to remove and re-wear the item, so one should try to call this function once at the beginning of a script and remember the result, as each call to this function could potentially cause up to 5 server hits.

Finally there is a function AdjustedSpellCost(skill theSkill, int theModifier) that returns an integer computed from the other two; it will call SkillBaseCost for you, but you need to provide the modifier to it because hopefully you are following my advice from the previous paragraph. :)
[/quote]

Wowsers!!! More stuff to potentially add to my icy peak meat farming script!
 
Top