mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
Create simple_but_improved.js
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
var attack_mode=true
|
||||||
|
|
||||||
|
setInterval(function(){
|
||||||
|
|
||||||
|
if(character.hp<400 || character.mp<300) use_hp_or_mp();
|
||||||
|
loot();
|
||||||
|
|
||||||
|
if(!attack_mode || character.moving) return;
|
||||||
|
|
||||||
|
var target=get_targeted_monster();
|
||||||
|
if(!target)
|
||||||
|
{
|
||||||
|
target=get_nearest_monster({min_xp:100,max_att:120,path_check:true,no_target:true});
|
||||||
|
if(target) change_target(target);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_message("No Monsters");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!in_attack_range(target))
|
||||||
|
{
|
||||||
|
move(
|
||||||
|
character.real_x+(target.real_x-character.real_x)/2,
|
||||||
|
character.real_y+(target.real_y-character.real_y)/2
|
||||||
|
);
|
||||||
|
// Walk half the distance
|
||||||
|
}
|
||||||
|
else if(can_attack(target))
|
||||||
|
{
|
||||||
|
set_message("Attacking");
|
||||||
|
attack(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
},250);
|
||||||
Reference in New Issue
Block a user