Openkore.com
http://forums.openkore.com/

Patch to add config options for supressing misses
http://forums.openkore.com/viewtopic.php?f=58&t=5699
Page 1 of 1

Author:  mrmojo [ 15 Apr 2009, 14:49 ]
Post subject:  Patch to add config options for supressing misses

On a high-flee char it's much cleaner to supress enemy misses so you can see easier when you get hit. I added config options to hide misses:

Code:
--- src/Network/Receive.pm   2009-04-15 12:31:16.000000000 -0600
+++ src/Network/Receive.pm   2009-04-15 13:06:52.000000000 -0600
@@ -831,7 +831,9 @@ sub actor_action {
      Misc::checkValidity("actor_action (attack 3)");

      if ($args->{sourceID} eq $accountID) {
-         message("$status $msg", $totalDamage > 0 ? "attackMon" : "attackMonMiss");
+         if ($totalDamage > 0 || !$config{hidePlayerMisses}) {
+            message("$status $msg", $totalDamage > 0 ? "attackMon" : "attackMonMiss");
+         }
         if ($startedattack) {
            $monstarttime = time();
            $monkilltime = time();
@@ -842,7 +844,9 @@ sub actor_action {
         Misc::checkValidity("actor_action (attack 5)");

      } elsif ($args->{targetID} eq $accountID) {
-         message("$status $msg", $args->{damage} > 0 ? "attacked" : "attackedMiss");
+         if ($args->{damage} > 0 || !$config{hideEnemyMisses}) {
+            message("$status $msg", $args->{damage} > 0 ? "attacked" : "attackedMiss");
+         }
         if ($args->{damage} > 0) {
            $damageTaken{$source->{name}}{attack} += $args->{damage};
         }
@@ -5338,7 +5342,12 @@ sub skill_use {
         'disp' => \$disp
      });

-   message $disp, $domain, 1;
+   if ($args->{targetID} eq $accountID && ($args->{damage} > 0 || !$config{hideEnemyMisses})) {
+      message $disp, $domain, 1;
+   }
+   elsif ($args->{sourceID} eq $accountID && ($args->{damage} > 0 || !$config{hidePlayerMisses})) {
+      message $disp, $domain, 1;
+   }

   if ($args->{targetID} eq $accountID && $args->{damage} > 0) {
      $damageTaken{$source->{name}}{$skill->getName()} += $args->{damage};


Sample config.txt usage:
Code:
hideEnemyMisses 1
hidePlayerMisses 0

Author:  iamanoob [ 24 May 2009, 13:14 ]
Post subject:  Re: Patch to add config options for supressing misses

would squelchDomains be different with this patch?
im confused... :roll:

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/