SeiferTim
New member
It took some time to figure out the "consult" command, but I came up with a very neat script that runs when I'm adventuring.
It checks if I have enough MP to cast a specific skill (thrust-smack, for my Seal clubber), and if I do casts it, otherwise, if I have at least one Mountain Stream soda, I drink one, if I'm out of soda, I attack.
In order for this to work, save the script in your "Scripts" folder as something.ash, then edit your custom combat script to say:
Where "something" is whatever you want it to be.
There may be more advanced, and neater ways to do this, comments/suggestions welcome.
It checks if I have enough MP to cast a specific skill (thrust-smack, for my Seal clubber), and if I do casts it, otherwise, if I have at least one Mountain Stream soda, I drink one, if I'm out of soda, I attack.
Code:
void main(int iRound, monster eek, string sText){
if ( my_mp() >= mp_cost( $skill[thrust-smack] ) ) {
print("MP sufficient... casting skill.");
use_skill( $skill[thrust-smack] );
} else {
print("MP insufficient... trying to recover MP...");
if (item_amount( $item[Mountain Stream soda] ) > 0 ) {
print("Drinking a soda...");
throw_item( $item[Mountain Stream soda] );
} else {
print("No soda, attacking");
attack();
}
}
return;
}
In order for this to work, save the script in your "Scripts" folder as something.ash, then edit your custom combat script to say:
Code:
[ default ]
1: consult something.ash
There may be more advanced, and neater ways to do this, comments/suggestions welcome.