Jump to content
  • 0
MikZ

@autoattack specific map

Question

Good day Hercules.


Requesting a script that will allow @autoattack plugin/command available or can be use in gold room only.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 1


ACMD(autoattack)

{

if (sd->bl.m != map->mapname2mapid("gold_room_map_name")) {

clif->message(fd, "AutoAttack cannot be used on this map.");

return false;

}

if (sd->sc.option & OPTION_AUTOATTACK) {

sd->sc.option &= ~OPTION_AUTOATTACK;

unit->stop_attack(&sd->bl);

clif->message(fd, "Auto Attack OFF");

} else {

sd->sc.option |= OPTION_AUTOATTACK;

timer->add(timer->gettick()+200, autoattack_timer, sd->bl.id, 0);

clif->message(fd, "Auto Attack ON");

}

clif->changeoption(&sd->bl);

return true;

}

Share this post


Link to post
Share on other sites
  • 0

I assume you are using the plugin from here: https://github.com/dastgir/HPM-Plugins/tree/master/src/plugins

Without needing to modify the plugin you could add a simple bindatcmd npc

*bindatcmd("command", "<NPC object name>::<event label>"{, <group level>, <group level char>, <log>})

You can find more info in doc/script_commands.txt

then when the player does @autoattack check their map using getmapxy. Then do an if statement checking if the map is the one you specified, if not then just end the script, if so then allow them to run the command using *atcommand("<command>")

 

Otherwise someone who feels comfortable can offer advice how to modify the plugin, I am not confident enough to give that advice. 

Share this post


Link to post
Share on other sites
  • 0

No new update for this? i download it i got error 

autoattack.c: In function autoattack_motion’:
autoattack.c:65:7: error: struct unit_interface has no member named walktoxy
   unit->walktoxy(&sd->bl, sd->bl.x+(rand()%2==0?-1:1)*(rand()%10), sd->bl.y+(rand()%2==0?-1:1)*(rand()%10),0);

 

Share this post


Link to post
Share on other sites
  • 0
On 7/6/2020 at 1:42 AM, Chatterboy said:

No new update for this? i download it i got error 

autoattack.c: In function ‘autoattack_motion’: autoattack.c:65:7: error: ‘struct unit_interface’ has no member named ‘walktoxy’ unit->walktoxy(&sd->bl, sd->bl.x+(rand()%2==0?-1:1)*(rand()%10), sd->bl.y+(rand()%2==0?-1:1)*(rand()%10),0);


autoattack.c: In function autoattack_motion’:
autoattack.c:65:7: error: struct unit_interface has no member named walktoxy
   unit->walktoxy(&sd->bl, sd->bl.x+(rand()%2==0?-1:1)*(rand()%10), sd->bl.y+(rand()%2==0?-1:1)*(rand()%10),0);

 

No more update on this one the only autoattack successfuly rebuilt is from levRO.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.