Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2008, 10:33 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Okay, I finally got SLAY to work here:
Quote:
sub EVENT_SLAY
{
if(plugin::check_hasitem($client, 13732))
{
$client->NukeItem(13732);
}
}
Thanks for the help!
Reply With Quote
  #2  
Old 07-30-2009, 03:25 PM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Im attempting to use this as part of a Perl script that will allow NPC's to Add/remove loot to their loot tables according to wether or not they have a specific TASK.

I Have Tried these two different scripts:

Code:
 
sub EVENT_SIGNAL {
	if($signal == 11) && (plugin::check_hasitem($npc, 3233)) {
$npc->NukeItem(3233);
	quest::shout("got signal from trigger, removing 1 heart");
	} 
}
^^ Receives a signal from an outside trigger ^^

And simply
Code:
sub EVENT_EXIT
{
  if (quest::istaskactivityactive(500,0)) {
$client->Message(4, "left area, removing 1 heart");
$npc->NukeItem(3233);
}
}
Neither one seems to fire off at all, debugging using alot of client messages and shout messages... everytime perl gets to the $npc->NukeItem(3233); it simply just stops... not sure what else i can do to remove the items... I tried using signalwiths because i figured that the entity $npc hadnt been defined because its in the sub EVENT_EXIT (which is all $client) - I Think????

The situation is... Trakanon spawns, sets a radius... If anyone with a task enters the radius it adds 1 quest item (this parts working). Problem is, if characters leave and re-enter the radius he adds an extra heart - this is what im trying to combat. What i want to do is have it so that when the players leave the radius it will remove the same heart that was added when they entered.

Any responses will be greatly appreciated! =)
Reply With Quote
  #3  
Old 07-30-2009, 03:41 PM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Here is the Full Script... just incase its confusing..

TRAKANON
Code:
sub EVENT_SPAWN {
  my $x = $npc->GetX();
  my $y = $npc->GetY();
  my $range = 210;
  quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range);
}

sub EVENT_ENTER
{
  if (quest::istaskactivityactive(500,0)) {
$client->Message(4, "Quest Item Added To Loot Table");
quest::addloot(3233,1);

}
}

sub EVENT_EXIT
{
  if (quest::istaskactivityactive(500,0)) {
$client->Message(4, "signal sent");
quest::signalwith(999456,10,1);  #Signal to questloot_trigger to send signal back


}
}

sub EVENT_SIGNAL {
	if($signal == 11) && (plugin::check_hasitem($npc, 3233)) {
$npc->NukeItem(3233);
	quest::shout("got signal from trigger, removing 1 heart");
	} 
}
QUESTLOOT_TRIGGER
Code:
sub EVENT_SIGNAL {
	if($signal == 10) {
	quest::shout("TRIGGER RECIEVED GO AHEAD");
quest::signalwith(89154,11,1);  #Signal for trakky to remove the item
	} 
}
I Originally had it just try to remove the item when they EVENT_EXIT, but i think its not really sure who $npc is... Sorry im not very good with the quest objects yet; does it need to be defined somewhere?
Reply With Quote
  #4  
Old 07-31-2009, 08:54 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,500
Default

Here's at least 1 of your problems:

Code:
if($signal == 11) && (plugin::check_hasitem($npc, 3233)) {
should be

Code:
if(($signal == 11) && (plugin::check_hasitem($npc, 3233)) {
Haven't tested out the other portions for you yet.
Reply With Quote
  #5  
Old 07-31-2009, 10:00 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Using this bit of code... I can get trakanon to respond, the addition of the line:
$npc->NukeItem(3233);

Causes the script to break.

Code:
sub EVENT_SIGNAL {
	if($signal == 11) {
	quest::shout("got signal from trigger, removing 1 heart");
	} 
}
^^ WORKING

Code:
sub EVENT_SIGNAL {
	if($signal == 11) {
$npc->NukeItem(3233);
	quest::shout("got signal from trigger, removing 1 heart");
	} 
}
^^BROKEN^^

Anyone know what would cause that quest object to break my script???
Reply With Quote
  #6  
Old 07-31-2009, 10:04 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

OK i found the issue, using this page:
http://www.eqemulator.net/wiki/wikka...a=QuestObjects

Apparently the handle NukeItem is not supported for npc->

Anyone know another way of removing items from mobs via Quest script??? These scripts could prove quite usefull for any mob that has the ability to drop quest items...
Reply With Quote
  #7  
Old 07-31-2009, 10:30 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Here is the solution, after reading the list carefully i noticed this line:
RemoveItem(item_id, quantity= 0, slot= 0)
Therefore, $npc->RemoveItem(3233, 1); is the correct format/handle for NPCS to remove items

Completed Quest Script (No Trigger Mob or Signals):
Code:
##################
#ZONE - Sebilis
#NPC - Trakanon
#Quest - Green Dragon Hearts (Mobside)
#Author - Kilralpine
##################
#####
# This script will add the item 3233 to trakanon's loottable if a player with the task 500 enters his vicinity. 
# If a player is to leave his vicinity it will remove the item...
# Therefore this script allows npcs to drop quest items ONLY if a player near them has the correct task, this can be adapted to any npc/task/item. ###
#####

sub EVENT_SPAWN {
  my $x = $npc->GetX();
  my $y = $npc->GetY();
  my $range = 210;
  quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range);
}

sub EVENT_ENTER
{
  if (quest::istaskactivityactive(500,0)) {
quest::addloot(3233,1);

}
}

sub EVENT_EXIT
{
  if (quest::istaskactivityactive(500,0)) {
$npc->RemoveItem(3233, 1);

}
}
Gunna go ahead and add this to the custom quests section
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 10:38 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3