Jump to content
  • 0
MikZ

@autoattack specific map

Question

7 answers to this question

Recommended Posts

  • 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
  • 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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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