Disguise event plugin

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Post Reply
Message
Author
manticora
Documentation Writers
Documentation Writers
Posts: 29
Joined: 29 Jan 2010, 05:59
Noob?: No

Disguise event plugin

#1 Post by manticora »

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: Select all

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: Select all

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: Select all

#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: Select all

loadPlugins_list macro,profiles,breakTime,raiseStat,raiseSkill,map,reconnect,eventMacro,item_weight_recorder,xconf,DisguiseEventPlugin

fadreus
The Kore Devil
The Kore Devil
Posts: 724
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Disguise event plugin

#2 Post by fadreus »

If it's working, why not make PR in git? :D
More power to you.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

SkylorD
Moderators
Moderators
Posts: 1163
Joined: 16 Dec 2011, 02:53
Noob?: Yes
Location: Brazil

Re: Disguise event plugin

#3 Post by SkylorD »

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
Learn rules

angely
Noob
Noob
Posts: 6
Joined: 29 Mar 2014, 09:42
Noob?: No

Re: Disguise event plugin

#4 Post by angely »

Nice job :D !

Post Reply