Openkore.com

OpenKore Forums
It is currently 18 Oct 2018, 17:57

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Disguise event plugin
PostPosted: 29 Sep 2018, 12:41 
Offline
Documentation Writers
Documentation Writers

Joined: 29 Jan 2010, 05:59
Posts: 28
Here is plugin for rhe "Disguise event". The bot must be "manual AI" and "move prontera 162 155".

.\openkore\GGamerzRO\openkore\src\Network\Receive.pm
Please add the line: Plugins::callHook('disguise_event', {hh => $args->{type}});
Code:
sub actor_display {
...
...
      # Actor Connected (new)

      if ($actor->isa('Actor::Player')) {
         my $domain = existsInList($config{friendlyAID}, unpack("V", $args->{ID})) ? 'parseMsg_presence' : 'parseMsg_presence/player';
         debug "Player Connected: ".$actor->name." ($actor->{binID}) Level $args->{lv} $sex_lut{$actor->{sex}} $jobs_lut{$actor->{jobID}} ($coordsTo{x}, $coordsTo{y})\n", $domain;

         Plugins::callHook('player', {player => $actor});  #backwards compatibailty

         Plugins::callHook('player_connected', {player => $actor});
      } else {
         debug "Unknown Connected: $args->{type} - \n", "parseMsg";
         # Manticora 16.09.2018. Next line is for the Disguise Event on ggamerz-ro.com
         Plugins::callHook('disguise_event', {hh => $args->{type}});
      }


.\openkore\plugins\DisguiseEventPlugin\DisguiseEventPlugin.pl
Code:
package DisguiseEventPlugin;
use strict;
use Globals qw/$char $net $messageSender/;
use Log qw/message/;
use Misc qw/sendMessage/;

my $hooks = Plugins::addHooks(
   ['disguise_event', \&disguise_event],
);

Plugins::register('DisguiseEventPlugin', 'Disguise Event', sub { Plugins::delHooks($hooks) }); #TODO: Description? Link to iRO-wiki?

sub disguise_event {
   my ($hookname, $args) = @_;
   my $monsterId = $args->{hh}; #TODO: Rename the argument

   if ($net && $net->getState != Network::NOT_CONNECTED) {
      #move prontera 162 155
      if ($char->{pos}{x} == 162 && $char->{pos}{y} == 155) { #TODO: check if Prontera
         if ($monsterId != 795) { #TODO:
            if (exists $::monsters_lut{$monsterId}) {
               message "The monster is: [$monsterId] $::monsters_lut{$monsterId}\n"; #TODO: Localization
               sendMessage($messageSender, "c", $::monsters_lut{$monsterId}, ""); #TODO: add a delay x*length. timeout?
               #TODO: the monster name is not correct --> error message?
            } else {
               message "There is no monster with id $monsterId. Please check your tables/monsters.txt\n"; #TODO: Localization
            }
         }
      }
   }
}

1;


.\openkore\tables\monsters.txt
Code:
#A default english table has been provided
#Remove all lines below to have Kore auto-generate this table
1001 Scorpion
1002 Poring
1003 Test Egg
1004 Hornet
1005 Familiar
1006 Thief Bug's Larva
1007 Fabre
1008 Pupa
1009 Condor
1010 Willow
1011 Chonchon
1012 Roda frog
1013 Wolf
1014 Spore
1015 Zombie
1016 Skel Archer
1017 Female Thief Bug
1018 Creamy
1019 Pecopeco
1020 Mandragora
1021 Male Thief Bug
1022 Were Wolf
1023 Orc Warrior
1024 Worm Tail
...


.\openkore\GGamerzRO\openkore\control\sys.txt
Add the DisguiseEventPlugin to the loadPlugins_list:
Code:
loadPlugins_list macro,profiles,breakTime,raiseStat,raiseSkill,map,reconnect,eventMacro,item_weight_recorder,xconf,DisguiseEventPlugin


Top
 Profile  
 
 Post subject: Re: Disguise event plugin
PostPosted: 29 Sep 2018, 23:17 
Offline
OpenKore Monk
OpenKore Monk
User avatar

Joined: 17 Nov 2017, 23:32
Posts: 430
Location: Genting Highland, Malaysia
If it's working, why not make PR in git? :D
More power to you.

_________________

iRO server supporter.
Wiki & Google are your best allies.
I'll not give answers, I only show you the way to find it.
Image


Top
 Profile  
 
 Post subject: Re: Disguise event plugin
PostPosted: 02 Oct 2018, 21:40 
Offline
Moderators
Moderators
User avatar

Joined: 16 Dec 2011, 02:53
Posts: 1211
Location: Brazil
Awnt i love his nickname! Now i can understand about classes and this.

Oh man, then is it a monster and a npc at the same time ?
I would never think about this.
Why this man ?

Image

_________________
"'There are three things all wise men fear: the sea in storm, a night with no moon, and the anger of a gentle man.'" :P

viewtopic.php?f=10&t=16117

Thanks for this Eternal! =D <3<3


Top
 Profile  
 
 Post subject: Re: Disguise event plugin
PostPosted: 10 Oct 2018, 10:27 
Offline
Noob
Noob

Joined: 29 Mar 2014, 09:42
Posts: 5
Nice job :D !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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