Openkore.com

OpenKore Forums
It is currently 22 Jun 2018, 20:50

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 20 Nov 2011, 23:32 
Offline
Developers
Developers

Joined: 24 Nov 2010, 03:08
Posts: 214
kLabMouse wrote:
That's not a solution. It's a hack!
There is a flag in packets, that indicate what type of Actor it is.


Is the flag what you say "type" ?
If it is "type".
The "type" of NPC is less than 1000 !
But, the "type" of Monster NPCs always is great than 1000 !


Top
 Profile  
 
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 21 Nov 2011, 02:36 
Offline
Developers
Developers

Joined: 05 Dec 2008, 05:42
Posts: 1811
object_type

We need something like that:
Code:
+ use constant {
+    PC_TYPE => 0x0,
+    NPC_TYPE => 0x1,
+    ITEM_TYPE => 0x2,
+    SKILL_TYPE => 0x3,
+    UNKNOWN_TYPE => 0x4,
+    NPC_MOB_TYPE => 0x5,
+    NPC_EVT_TYPE => 0x6,
+    NPC_PET_TYPE => 0x7,
+    NPC_HO_TYPE => 0x8,
+    NPC_MERSOL_TYPE => 0x9,
+    NPC_ELEMENTAL_TYPE => 0xa,
+ };

- if ($jobs_lut{$args->{type}}) {
+ if (defined $args->{object_type} ? $args->{object_type} == PC_TYPE : $jobs_lut{$args->{type}}) {

# similar things for other checks in sub actor_display


Top
 Profile  
 
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 23 Nov 2011, 19:40 
Offline
Developers
Developers

Joined: 24 Nov 2010, 03:08
Posts: 214
Yes !
I add some code lines in src/Network/Receive/ServerType0.pm, such as:
Code:
.....
   } elsif ($args->{type} >= 1000) { # FIXME: in rare cases RO uses a monster sprite for NPC's (JT_ZHERLTHSH = 0x4b0 = 1200) ==> use object_type ?
      my $obj_type = (defined $args->{object_type}) ? $args->{object_type} : -1;
      if ($obj_type == 6) {
      # Actor might be a monster NPC
         $actor = $npcsList->getByID($args->{ID});
         if (!defined $actor) {
            $actor = new Actor::NPC();
            $actor->{appear_time} = time;
            $mustAdd = 1;
         }
         $actor->{nameID} = $nameID;
      } else {
      # Actor might be a monster
      if ($args->{hair_style} == 0x64) {
.....

I has tested in the pay_dun03 and bra_fild01.
It seems to work !


Top
 Profile  
 
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 24 Nov 2011, 15:34 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
sofax222 wrote:
Yes !
I add some code lines in src/Network/Receive/ServerType0.pm, such as:
Code:
.....
   } elsif ($args->{type} >= 1000) { # FIXME: in rare cases RO uses a monster sprite for NPC's (JT_ZHERLTHSH = 0x4b0 = 1200) ==> use object_type ?
      my $obj_type = (defined $args->{object_type}) ? $args->{object_type} : -1;
      if ($obj_type == 6) {
      # Actor might be a monster NPC
         $actor = $npcsList->getByID($args->{ID});
         if (!defined $actor) {
            $actor = new Actor::NPC();
            $actor->{appear_time} = time;
            $mustAdd = 1;
         }
         $actor->{nameID} = $nameID;
      } else {
      # Actor might be a monster
      if ($args->{hair_style} == 0x64) {
.....

I has tested in the pay_dun03 and bra_fild01.
It seems to work !

If it RLY works good, and all the existing Tricks are detected, then it's good to have it in SVN.
You have the right to commit =)

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 29 Nov 2011, 04:02 
Offline
Developers
Developers

Joined: 24 Nov 2010, 03:08
Posts: 214
I already test OK in bra_fild01, pay_dun03 and hu_fild06

And, I has commited it !


Top
 Profile  
 
 Post subject: Re: How to identify a Monster NPC ?
PostPosted: 29 Nov 2011, 04:27 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
OK. Moved to Fixed Bugs.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group