@autoattack specific map

MikZ

New member
Messages
461
Points
0
Good day Hercules.

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

 
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. 

 
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;

}

 
Well there ya go
default_biggrin.png


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

Code:
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 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.

 
Back
Top