IPB

 
 
Reply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> Anti Geographer Plugins, Openkore 2.0.7

phaw16
post Sep 4 2009, 05:45 PM
Post #1


Newbie
*

Race: Humans
Posts: 24
Spawned: 3 Sep 09
From: Valenzuela City
Spawn ID: 41,234



make a new folder on your openkore 2.0.7 directory and name it plugins then open notepad paste the code below save it as geographer.pl..


enjoy...



#------------------------------------------------------------
# Geographer plugin - OpenKore Team
#
# Prohibit attacking a geographer:
# + healed by another one
# + situated too close to another one
# Stop attacking monsters under above circumstances
# (prohibit to attack means setting up null damage from kore
# and 1 damage from player (from kore's id))
#------------------------------------------------------------

package geographer;

use strict;
use Globals;
use Log;
use Misc;
use Plugins;
use Utils;

Plugins::register("geographer", "Reaction on two close geographers", \&Unload);
my $hooks = Plugins::addHooks(
["AI_pre",\&positionReact, undef],
["packet/skill_cast", \&healReact, undef],
["packet/skill_used_no_damage", \&healReact, undef]);

sub positionReact {
foreach (@monstersID) {
my $monster = $monsters{$_};
if ($monster->{type} == 1368 && !$monster->{dmgFromPlayer}) {
foreach my $mobCopy (@monstersID) {
my $monsterCopy = $monsters{$mobCopy};
if ($monsterCopy->{type} == 1368) {
if ($monster->{ID} ne $monsterCopy->{ID}) {
if (distance($monster->{pos},$monsterCopy->{pos}) <= 10) {
prohibitAttacking($monster);
prohibitAttacking($monsterCopy);
last;
}
}
}
}
}
}
}
sub healReact {
# After cast, not before
my $monsterS = $monsters{@_[1]->{sourceID}};
my $monsterO = $monsters{@_[1]->{targetID}};
if(!$monsterO
|| @_[1]->{skillID} != 28
|| $monsterO->{type} != 1368) {
return;
}
prohibitAttacking($monsterO);
if ($monsterS->{type} == 1368) {
prohibitAttacking($monsterS);
}
}
sub prohibitAttacking {
undef @_[0]->{dmgFromYou};
undef @_[0]->{missedFromYou};
@_[0]->{dmgFromPlayer}{$char->{ID}} = 1;
if (AI::action eq "attack" && AI::args()->{ID} eq @_[0]->{ID}) {
AI::dequeue;
stopAttack();
}
}
sub Unload {
Plugins::delHooks($hooks);
}
1;


--------------------
user posted image
PrInCe Pa0Lo
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
jhayzc
post Oct 9 2010, 10:17 AM
Post #2


Newbie
*

Race: Humans
Posts: 5
Spawned: 28 Apr 06
Spawn ID: 4,246



What does this really do? does it just leave the geographer if the monster have two geographer?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
silver23rd
post Oct 14 2010, 07:18 AM
Post #3


Newbie
*

Race: Humans
Posts: 10
Spawned: 27 Aug 09
Spawn ID: 40,926



Yup,,I have seen that.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
siele
post Oct 30 2010, 06:11 AM
Post #4


Newbie
*

Race: Humans
Posts: 4
Spawned: 29 Oct 10
Spawn ID: 62,123



Pano to?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Reply to this topicTopic OptionsStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
 

Lo-Fi Version Time is now: 20th May 2012 - 02:39 AM

Visitor Counter:

pinoytopsites