41
Character skill advancement / Re: Gaderian's Remove Trap trainer
« Last post by wyvern690 on April 29, 2024, 07:29:34 PM »Thx for sharing this over here.
Heh there actually should have been a cast function in there. You are the first person to point out it's missing/broken. I'll add it in if I ever do an update. Right now there seems to be no interest, so no reason too. Your fix should work fine, may need to add a slight delay after Orion.Cast since my cast function adds the delays based on fcr, etc.Thank you for your answer. You are right, must be delay because script activate Whirwind attack very fast. And also tried to activate this attack with busido abilities but it no possible. So modification in progress. If you can give me some advices i will be appreciate. Thank you in advance.Code: [Select]function cast(spell, target){
var fcr = (6 - Player.FCR()) / 4 * 1000 + 250;
Orion.CancelWaitTarget();
if(Orion.HaveTarget())
Orion.CancelTarget();
if(Player.Frozen())
return;
if(target)
Orion.CastTarget(spell, target);
else
Orion.Cast(spell);
Orion.Wait(500);
while(Player.Frozen() && !Player.Paralyzed())
Orion.Wait(10);
Orion.Wait(fcr);
}
Adding that to the script should solve a lot of issues. If you find anymore, feel free to post them here. Seems more people are getting interested, i may do an update to make sure everything is tweaked correctly and add some other features i have handy if it keeps up
function equipSlayer(graphic){
var tags = loadTags(graphic);
if(!tags.slayer) return;
var weapon = Orion.FindTypeEx('0x0F4B', any, backpack).filter(function(weap){
return Orion.Contains(weap.Properties(), tags.slayer +" Slayer");
})[0];
if(!weapon) return;
Orion.SetTimer('weaponSwap');
Orion.Print(color.purple.norm, tags.slayer +" slayer equipped");
Orion.Wait('moveitemdelay');
Orion.Equip(weapon.Serial());
}
function cast(spell, target){
var fcr = (6 - Player.FCR()) / 4 * 1000 + 250;
Orion.CancelWaitTarget();
if(Orion.HaveTarget())
Orion.CancelTarget();
if(Player.Frozen())
return;
if(target)
Orion.CastTarget(spell, target);
else
Orion.Cast(spell);
Orion.Wait(500);
while(Player.Frozen() && !Player.Paralyzed())
Orion.Wait(10);
Orion.Wait(fcr);
}
function loadTags(graphic){
var tags = Orion.GetFindList('mobTypes').Items()
.filter(function(type){
return type.Graphic() == graphic;
}).map(function(tag){
var comments = tag.Comment().split('|');
return {
name : comments[0] ? comments[0].toString() : "missing",
slayer : comments[1] ? comments[1].toString() : false,
ignore : comments[2] ? Boolean(comments[1]) : false
}
});
return tags || false;
}