L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Thread Closed 
 
Thread Rating:
  • 54 Vote(s) - 3.07 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PvP External Editor Help
Author Message
Hellion Offline
Gremlin
*

Posts: 9
Joined: Feb 2011
Reputation: 0
Version: 1.4.1.95
Post: #1
PvP External Editor Help

Im not really understanding what "class aggro" means or what to set this number to. I understand what "Range max" means, but I don't understand the "Range Max Threat" nor the "range modifier".

What number do I set the "target my party" to attack that class?

How do I not target certain classes? For instance I don't want to target Tanks/dwarfs/sws/bd.
(This post was last modified: 06-16-2011 23:18 PM by Hellion.)
06-16-2011 23:17 PM
Find all posts by this user
ClockMan Offline
All Mighty
*******

Posts: 2,886
Joined: Jan 2011
Reputation: 499
Version: 1.4.3.143
Post: #2
RE: PvP External Editor Help

every number adds "agro" to char. You target char with bigest agro.
class agro is base class agro.
range max is max target range.
range max threat is maximum target range for specyfic class.
range modifier - i dont know what is this, for sure next numer what doing some calculations.




    C++ Programming
bool 
AutoTarget::TickPvp()
{
	BEGIN_GUARD
	if (!CONFIG->data.pvp.enabled) return false;
	if ( DB->GetMyself ( m_myself ) == false )
	{
		return false;
	}
 
	EngineLayer::DataIndexList & players = DataCollection::GetSingleton()->GetPlayerList();
 
	int top_aggro = 0;
	DataMonster * victim = NULL;
	std::set<DataMonster *>::const_iterator iter;
	for ( iter = players.GetList().begin(); iter != players.GetList().end(); ++iter )
	{
		DataMonster * player = *iter;
		if (NULL == player) continue;
		LOG(TEXT("Testing pvp: %p %s pawn=%p\n"), player, player == NULL ? TEXT("none") : player->GetName(), player->GetPawn() );
 
		if (!player->IsValid() || !player->IsEnemy() ||!player->CanSeeMe()) continue;
 
		LOG(TEXT("Player is enemy pvp: %s\n"), player->GetName() );
 
		int base_aggro = 10000;
		base_aggro = base_aggro * ModifyStaticPvpAggro ( player ) / 100;
		LOG(TEXT("Player aggro: %d\n"), base_aggro );
		base_aggro = base_aggro * ModifyDynamicPvpAggro( player ) / 100;
		LOG(TEXT("Player aggro: %d\n"), base_aggro );
		if ( base_aggro > 0 && base_aggro > top_aggro )
		{
			top_aggro = base_aggro;
			victim = player;
		}
	}
 
	LOG(TEXT("Found victim = %p ( aggro = %d )\n"), victim, top_aggro );
 
	if ( victim != NULL )
	{
		TARGET->Target(victim->GetId(), EngineLayer::TARGET_BY_PVP_AUTOTARGET);
	}
	else
	{
		TARGET->CancelTarget(EngineLayer::TARGET_BY_PVP_AUTOTARGET);
	}
 
	LOG(TEXT("Im done)\n") );
	return true;
	END_GUARD
}
 
// Funkcja ta przetwarza statyczne dane o graczu ktore sa niezalezne od jego klasy.
int 
AutoTarget::ModifyStaticPvpAggro( DataMonster * player )
{
	BEGIN_GUARD
 
	L2TowerShared::PvpClassAggro & data = CONFIG->GetSharedConfiguration().GetData().pvp_class;
 
	int retval = 100;
 
	if ( data.skip_dead && player->IsAlikeDeath() == true )
	{
		return 0;
	}
 
	if ( player->IsPvPFlag() == true )
	{
		retval += data.flagged;
	}
	if ( player->IsPvPFlagBlink() == true )
	{
		retval += data.flagged_blink;
	}
 
	if ( TARGET->GetTarget(EngineLayer::TARGET_BY_MYSELF) == player->GetId() )
	{
		retval += data.target_onselftarget;
	}
	else if ( TARGET->GetTarget(EngineLayer::TARGET_BY_PVP_AUTOTARGET) == player->GetId() )
	{
		retval += data.target_onautotarget;
	}
 
	return retval;
	END_GUARD
}
 
// przetwarzamy dynamiczne dane przypisane do klasy gracza. [ moga byc edytowane real-time z zewnatrz ]
int 
AutoTarget::ModifyDynamicPvpAggro( DataMonster * player )
{
	BEGIN_GUARD
	const L2TowerShared::PvpClassData & data = CONFIG->GetSharedConfiguration().GetData().pvp_class.CLASS_Data[player->GetClass()];
	int retval = data.class_aggro;
	int targetId = player->target_id;
 
	if ( targetId != 0 )
	{
		DataMonster * target = DB->GetMById ( targetId );
		if ( target != NULL )
		{
			if ( target->IsMyPartyMember() )
			{
				retval += data.target_my_party;
			}
			else if ( target->IsMyClanMember() )
			{
				retval += data.target_my_clan;
			}
		}
	}
	if ( data.range_modifier != 100 && data.range_max_threat > m_myself->GetRangeTo ( player ))
	{
		retval += data.range_modifier;
	}
 
	if ( data.range_max > m_myself->GetRangeTo( player ) )
	{
		retval = 0; // do not target someone outside max range!
	}
	return 100;
	END_GUARD
}


[Image: owner.gif]
06-16-2011 23:36 PM
Visit this user's website Find all posts by this user
Hellion Offline
Gremlin
*

Posts: 9
Joined: Feb 2011
Reputation: 0
Version: 1.4.1.95
Post: #3
RE: PvP External Editor Help

I set the class aggro for tanks to "0" but I still target tanks. =/

I really don't want to target tanks/dwarf/sws/bd at all on my archer.
06-17-2011 07:04 AM
Find all posts by this user
Geddys Offline
Administrator
*******

Posts: 265
Joined: Dec 2010
Reputation: 89
Version: 1.4.1.93
Post: #4
RE: PvP External Editor Help

(06-17-2011 07:04 AM)Hellion Wrote:  I set the class aggro for tanks to "0" but I still target tanks. =/

I really don't want to target tanks/dwarf/sws/bd at all on my archer.

Maybe try MaxRange to 0 for those classes.
06-17-2011 09:40 AM
Find all posts by this user
Hellion Offline
Gremlin
*

Posts: 9
Joined: Feb 2011
Reputation: 0
Version: 1.4.1.95
Post: #5
RE: PvP External Editor Help

(06-17-2011 09:40 AM)Geddys Wrote:  
(06-17-2011 07:04 AM)Hellion Wrote:  I set the class aggro for tanks to "0" but I still target tanks. =/

I really don't want to target tanks/dwarf/sws/bd at all on my archer.

Maybe try MaxRange to 0 for those classes.

I tried that but I am still targeting tanks =/ I guess I am doing something wrong. When I type /xcfg ingame I see all the settings I made so I know everything it is saving. Both range and max range are set to "0", aggro is as well set to "0".

I even tried setting all classes to "0" everything but I still target everyone at 1200 range.

Maybe it has something to do with the server I play on?
(This post was last modified: 06-18-2011 08:34 AM by Hellion.)
06-18-2011 08:31 AM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  l2tower editor and script not run potage2 7 6,073 10-04-2015 14:31 PM
Last Post: glxakias1990
  [External Script/Tool] Mouse-over window activator MonkeyNuts 2 3,044 10-29-2014 11:38 AM
Last Post: MonkeyNuts
  L2tower.editor not working ? akoystika 0 2,306 07-31-2014 22:25 PM
Last Post: akoystika
  Editor Arabaico 1 2,644 03-27-2014 16:06 PM
Last Post: whitesnake
  L2 Configuration Editor wont open zVenFTW 0 2,953 09-22-2013 10:37 AM
Last Post: zVenFTW
Photo Editor Problem Tony 0 2,187 08-15-2013 19:21 PM
Last Post: Tony
  l2 editor and script potage2 0 2,664 07-11-2013 14:18 PM
Last Post: potage2
  L2 tower editor problem gothenks 1 2,982 07-10-2013 14:09 PM
Last Post: gothenks
  Tower editor Arabaico 1 3,005 07-01-2013 14:12 PM
Last Post: diabolica
  Configuration Editor Exception l4xb4ll3r 0 3,809 05-31-2013 16:45 PM
Last Post: l4xb4ll3r



User(s) browsing this thread: 1 Guest(s)