Openkore.com

OpenKore Forums
It is currently 21 Nov 2017, 18:46

All times are UTC - 5 hours [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Patch to support backstab positioning
PostPosted: 11 Mar 2009, 17:21 
Offline
Noob
Noob
User avatar

Joined: 06 Apr 2008, 09:01
Posts: 7
Location: near respawn at Prontera
I created this patch that adds the check "fromBehind" to attackSkillSlot, allowing rogues to more effectively backstab monsters.

It's not 100% perfect (even on the client, I cant manage to land backstabs all the time :P), but works all right for me.

Here is the example config:
Code:
attackSkillSlot Back Step {
        lvl 10             
        dist 2.5
        fromBehind 1
        aggressives <= 2
        sp > 30%       
        maxAttempts 3
        timeout 0
        disabled 0
        target_timeout 0
        inLockOnly 1   
        monsters Porcellio, Mummy, Skel Archer, Skel Soldier,Golem, Verit, Dragon Fly, Hunter Fly, Hill Wind, Stem Worm
}


And here is the patch (against latest SVN):

Code:
--- Attack.pm.orig      2009-03-11 19:15:49.000000000 -0300
+++ Attack.pm   2009-03-11 19:15:58.000000000 -0300
@@ -592,8 +590,49 @@
                        my $slot = $args->{attackMethod}{skillSlot};
                        delete $args->{attackMethod};

                        ai_setSuspend(0);
+                       my $monsterLooking=$target->{look}{body};
+                       if ($config{'attackSkillSlot_'.$slot.'_fromBehind'} && $monsterLooking ) {
+                               my %behind;
+                               if ($monsterLooking eq 0 || $monsterLooking eq 8) {
+                                       $behind{x}=$target->{pos_to}{x} ;
+                                       $behind{y}=$target->{pos_to}{y} - 1;
+                               }       
+                               elsif ($monsterLooking eq 1) {
+                                       $behind{x}=$target->{pos_to}{x} + 1 ;
+                                       $behind{y}=$target->{pos_to}{y} - 1;
+                               }
+                               elsif ($monsterLooking eq 2) {
+                                       $behind{x}=$target->{pos_to}{x} + 1 ;
+                                       $behind{y}=$target->{pos_to}{y};
+                               }       
+                               elsif ($monsterLooking eq 3) {
+                                       $behind{x}=$target->{pos_to}{x} + 1;
+                                       $behind{y}=$target->{pos_to}{y} + 1;
+                               }
+                               elsif ($monsterLooking eq 4) { 
+                                       $behind{x}=$target->{pos_to}{x} ;
+                                       $behind{y}=$target->{pos_to}{y} + 1;
+                               }
+                               elsif ($monsterLooking eq 5) {
+                                       $behind{x}=$target->{pos_to}{x} - 1;
+                                       $behind{y}=$target->{pos_to}{y} + 1;
+                               }       
+                               elsif ($monsterLooking eq 6) {
+                                       $behind{x}=$target->{pos_to}{x} - 1;
+                                       $behind{y}=$target->{pos_to}{y} ;
+                               }
+                               elsif ($monsterLooking eq 7) {
+                                       $behind{x}=$target->{pos_to}{x} - 1;
+                                       $behind{y}=$target->{pos_to}{y} - 1;
+                               }       
+                               
+       
+                               message "Trying to move behind target ($target->{pos_to}{x},$target->{pos_to}{y} looking $directions_lut{$monsterLooking}) - ($
behind{x},$behind{y})\n";
+                               $messageSender->sendMove($behind{x}, $behind{y});
+
+                       }               
                        my $skill = new Skill(name => lc($config{"attackSkillSlot_$slot"}));
                        if (!ai_getSkillUseType($skill->getHandle())) {
                                ai_skillUse(
                                        $skill->getHandle(),


Hope it makes it's way into the mainstream codebase :)

_________________
Image


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 11 Mar 2009, 21:29 
Offline
Moderators
Moderators
User avatar

Joined: 04 Apr 2008, 09:30
Posts: 235
Location: My House
it could be more optimized *_*

_________________
Image
Follow The template in Asking Question or Be Trashed


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 11 Mar 2009, 21:31 
Offline
Perl Monk
Perl Monk

Joined: 04 Apr 2008, 17:26
Posts: 811
Wow, yeah, a shitload.

_________________
cs : ee : realist


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 11 Mar 2009, 22:06 
Offline
OpenKore Monk
OpenKore Monk

Joined: 04 Apr 2008, 10:10
Posts: 473
Beware of premature optimization :)

Let's give this a few days, then have it committed.

_________________
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 21 Jun 2009, 12:07 
Offline
Noob
Noob

Joined: 14 Sep 2008, 12:37
Posts: 2
Are you still working on it? Cause I'd love to use BackStab to level :o

Do i simply have to paste this in Attack.pm?


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 27 Jun 2009, 04:25 
Offline
Noob
Noob

Joined: 27 Jun 2009, 03:49
Posts: 1
im really a noob an if its okay could you start the code from the Hiding Skill to Back Stab?? Please... or could you explain further..


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 09 Sep 2009, 20:14 
Offline
Noob
Noob

Joined: 09 Sep 2009, 20:12
Posts: 3
please, help me, qhere i put this code?
Quote:
--- Attack.pm.orig 2009-03-11 19:15:49.000000000 -0300
+++ Attack.pm 2009-03-11 19:15:58.000000000 -0300
@@ -592,8 +590,49 @@
my $slot = $args->{attackMethod}{skillSlot};
delete $args->{attackMethod};

ai_setSuspend(0);
+ my $monsterLooking=$target->{look}{body};
+ if ($config{'attackSkillSlot_'.$slot.'_fromBehind'} && $monsterLooking ) {
+ my %behind;
+ if ($monsterLooking eq 0 || $monsterLooking eq 8) {
+ $behind{x}=$target->{pos_to}{x} ;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+ elsif ($monsterLooking eq 1) {
+ $behind{x}=$target->{pos_to}{x} + 1 ;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+ elsif ($monsterLooking eq 2) {
+ $behind{x}=$target->{pos_to}{x} + 1 ;
+ $behind{y}=$target->{pos_to}{y};
+ }
+ elsif ($monsterLooking eq 3) {
+ $behind{x}=$target->{pos_to}{x} + 1;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 4) {
+ $behind{x}=$target->{pos_to}{x} ;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 5) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 6) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} ;
+ }
+ elsif ($monsterLooking eq 7) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+
+
+ message "Trying to move behind target ($target->{pos_to}{x},$target->{pos_to}{y} looking $directions_lut{$monsterLooking}) - ($
behind{x},$behind{y})\n";
+ $messageSender->sendMove($behind{x}, $behind{y});
+
+ }
my $skill = new Skill(name => lc($config{"attackSkillSlot_$slot"}));
if (!ai_getSkillUseType($skill->getHandle())) {
ai_skillUse(
$skill->getHandle(),


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 09 Mar 2013, 05:56 
Offline
Noob
Noob

Joined: 09 Mar 2013, 05:27
Posts: 1
If for some reason the target is standing right up against a wall, just stand inside of them, it works fine.

_________________
http://plagiarismsoftware.org/
http://www.indiana.edu/wts/pamphlets/plagiarism.shtml
http://www.merriam-webster.com/dictionary/plagiarize


Top
 Profile  
 
 Post subject: Re: Patch to support backstab positioning
PostPosted: 25 Nov 2013, 00:19 
Offline
Noob
Noob

Joined: 19 Aug 2012, 18:13
Posts: 7
M4rk1nhu wrote:
please, help me, qhere i put this code?
Quote:
--- Attack.pm.orig 2009-03-11 19:15:49.000000000 -0300
+++ Attack.pm 2009-03-11 19:15:58.000000000 -0300
@@ -592,8 +590,49 @@
my $slot = $args->{attackMethod}{skillSlot};
delete $args->{attackMethod};

ai_setSuspend(0);
+ my $monsterLooking=$target->{look}{body};
+ if ($config{'attackSkillSlot_'.$slot.'_fromBehind'} && $monsterLooking ) {
+ my %behind;
+ if ($monsterLooking eq 0 || $monsterLooking eq 8) {
+ $behind{x}=$target->{pos_to}{x} ;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+ elsif ($monsterLooking eq 1) {
+ $behind{x}=$target->{pos_to}{x} + 1 ;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+ elsif ($monsterLooking eq 2) {
+ $behind{x}=$target->{pos_to}{x} + 1 ;
+ $behind{y}=$target->{pos_to}{y};
+ }
+ elsif ($monsterLooking eq 3) {
+ $behind{x}=$target->{pos_to}{x} + 1;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 4) {
+ $behind{x}=$target->{pos_to}{x} ;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 5) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} + 1;
+ }
+ elsif ($monsterLooking eq 6) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} ;
+ }
+ elsif ($monsterLooking eq 7) {
+ $behind{x}=$target->{pos_to}{x} - 1;
+ $behind{y}=$target->{pos_to}{y} - 1;
+ }
+
+
+ message "Trying to move behind target ($target->{pos_to}{x},$target->{pos_to}{y} looking $directions_lut{$monsterLooking}) - ($
behind{x},$behind{y})\n";
+ $messageSender->sendMove($behind{x}, $behind{y});
+
+ }
my $skill = new Skill(name => lc($config{"attackSkillSlot_$slot"}));
if (!ai_getSkillUseType($skill->getHandle())) {
ai_skillUse(
$skill->getHandle(),


id like to know that too....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group