Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2011, 01:06 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default Task Plugins

Wrote these to support a work around for Group/Raid based Task assigning, updating and failing for now with what I am currently working on with at the moment. I look to add more functions to support group and raid but am posting these for now. These are all functional, tested and committed to plugins SVN.

*Added support for the raid switch, by using "raid" it will default to group updates if there is no raid existing at the time so you do not have to rework your scripts.

Note: these plugins will update the group or raid that the client triggered these on. For example, if Player A picked up a ground object and triggered sub EVENT_PLAYER_PICKUP , it will update throughout all players in relation to the triggerer.

*Requires Revision 1953

###UpdateTaskActivity(UpdateType=[solo, group, raid], TaskID, ActivityID, Count);
###AssignTask(UpdateType=[solo, group, raid], TaskID, [NPCID = 0] ($npc->GetID());
###FailTask(UpdateType=[solo, group, raid], TaskID);

Code:
###Akkadius###
###AssignTask(UpdateType=[solo, group, raid], TaskID, [NPCID = 0] ($npc->GetID());
sub AssignTask{
	my $UT = $_[0];
	my $TaskID = $_[1];
	my $NPCID = $_[2] || 0;
	my $client = plugin::val('$client');
	my $npc = plugin::val('$npc');
	my $entity_list = plugin::val('$entity_list');
	my $name = plugin::val('$name');
	
	if($UT eq "solo"){
		$client->AssignTask($TaskID, $NPCID);
	}
	
	if($UT eq "group"){
		my $group = $client->GetGroup();
		if($group)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->AssignTask($TaskID, $NPCID);
					}
				}
			}
		}
	}
	
	if($UT eq "raid"){
		my $raid = $client->GetRaid();
		if($raid)
		{
			for($count = 0; $count < 72; $count++)
			{
				my $cur = $raid->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->AssignTask($TaskID, $NPCID);
					}
				}
			}
		}
		my $group = $client->GetGroup();
		if($group && !$raid)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->AssignTask($TaskID, $NPCID);
					}
				}
			}
		}
	}
}

###FailTask(UpdateType=[solo, group, raid], TaskID);
sub FailTask{
	my $UT = $_[0];
	my $TaskID = $_[1];
	my $client = plugin::val('$client');
	my $npc = plugin::val('$npc');
	my $entity_list = plugin::val('$entity_list');
	my $name = plugin::val('$name');
	
	if($UT eq "solo"){
		$client->FailTask($TaskID);
	}
	
	if($UT eq "group"){
		my $group = $client->GetGroup();
		if($group)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->FailTask($TaskID);
					}
				}
			}
		}
	}
	
	if($UT eq "raid"){
		my $raid = $client->GetRaid();
		if($raid)
		{
			for($count = 0; $count < 72; $count++)
			{
				my $cur = $raid->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->FailTask($TaskID);
					}
				}
			}
		}
		my $group = $client->GetGroup();
		if($group && !$raid)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->AssignTask($TaskID, $NPCID);
					}
				}
			}
		}
	}
}

###UpdateTaskActivity(UpdateType=[solo, group, raid], TaskID, ActivityID, Count);
sub UpdateTaskActivity{
	my $UT = $_[0];
	my $TaskID = $_[1];
	my $ActivityID = $_[2];
	my $TCount = $_[3];
	my $client = plugin::val('$client');
	my $npc = plugin::val('$npc');
	my $entity_list = plugin::val('$entity_list');
	my $name = plugin::val('$name');
	
	if($UT eq "solo"){
		$client->UpdateTaskActivity($TaskID, $ActivityID, $TCount);
	}
	
	if($UT eq "group"){
		my $group = $client->GetGroup();
		if($group)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->UpdateTaskActivity($TaskID, $ActivityID, $TCount);
					}
				}
			}
		}
	}
	
	if($UT eq "raid"){
		my $raid = $client->GetRaid();
		if($raid)
		{
			for($count = 0; $count < 72; $count++)
			{
				my $cur = $raid->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->UpdateTaskActivity($TaskID, $ActivityID, $TCount);
					}
				}
			}
		}
		my $group = $client->GetGroup();
		if($group && !$raid)
		{
			for($count = 0; $count < 6; $count++)
			{
				my $cur = $group->GetMember($count);
				if($cur)
				{
					if($cur->IsClient())
					{
						$cur->AssignTask($TaskID, $NPCID);
					}
				}
			}
		}
	}
}

return 1;

Last edited by Akkadius; 06-28-2011 at 01:22 AM.. Reason: Code changes
Reply With Quote
  #2  
Old 02-23-2012, 02:21 PM
mamba700
Fire Beetle
 
Join Date: Oct 2010
Posts: 5
Default

I was playing around with this plugin for a group task.

Here is what worked for me.

plugin::AssignTask("group", 254, ($npc->GetID()));

I had to put group in quotes. I originally tried "UpdateType=group" and that didn't work.

254 is my task ID -

for NPC I originally just put in the ID number of the NPC I am not sure why but using ($npc->GetID()) worked instead.


I just tought I would share for those of you trying to use this plugin. It is great especially when you want to implement raid or group tasks. Doing individual tasks was no problem, but I wanted to implement some group and raid tasks on my server.

Thank You very much Akkadius for all of your contributions to the EQEMU community.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:06 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3