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 12-22-2012, 05:04 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

Code:
use List::Util qw(first);

sub EVENT_COMBAT
{
    return()unless($combat_state);
    $npc->Heal();
    quest::say(($npc->GetRace()==54?"Your blood will spill.":"Time to die, $name!"));
}

sub EVENT_DEATH
{
    return()if($npc->GetRace()==54);
    my($extra_loot)={
        join(' ',1..3)=>[15270,15275,15075,15271,15279,15212,15079,15274,15272],
        join(' ',4..6)=>[5043,6032,6030,7022,7024,94155,6031],
        join(' ',7..9)=>[2031,2036,2030,2034,2027,2038,2026,2029,2025,2032,2028,2033]
    };
    $extra_loot->{'10 10'}=$extra_loot->{join(' ',4..6)};
    my($roll)=quest::ChooseRandom(1..10);
    quest::addloot(quest::ChooseRandom(@{$extra_loot->{first{$roll~~[split(' ',$_)]}keys(%$extra_loot)}}),1);
}
Reply With Quote
  #2  
Old 01-04-2013, 11:48 PM
javewow's Avatar
javewow
Sarnak
 
Join Date: Aug 2012
Location: work
Posts: 74
Default

Quote:
Originally Posted by c0ncrete View Post
Code:
use List::Util qw(first);

sub EVENT_COMBAT
{
    return()unless($combat_state);
    $npc->Heal();
    quest::say(($npc->GetRace()==54?"Your blood will spill.":"Time to die, $name!"));
}

sub EVENT_DEATH
{
    return()if($npc->GetRace()==54);
    my($extra_loot)={
        join(' ',1..3)=>[15270,15275,15075,15271,15279,15212,15079,15274,15272],
        join(' ',4..6)=>[5043,6032,6030,7022,7024,94155,6031],
        join(' ',7..9)=>[2031,2036,2030,2034,2027,2038,2026,2029,2025,2032,2028,2033]
    };
    $extra_loot->{'10 10'}=$extra_loot->{join(' ',4..6)};
    my($roll)=quest::ChooseRandom(1..10);
    quest::addloot(quest::ChooseRandom(@{$extra_loot->{first{$roll~~[split(' ',$_)]}keys(%$extra_loot)}}),1);
}
you's .pl no working no loot!
__________________
To create the most beautiful server for "!!~[BP] PLARYBOT EQ~!" Welcome to our server
Reply With Quote
  #3  
Old 01-04-2013, 11:58 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by javewow View Post
you's .pl no working no loot!
Code:
use warnings;

sub EVENT_SPAWN {
	my $rands	= quest::ChooseRandom(15270,15275,15075,15271,15279,15212,15079,15274,15272);
	my $randa	= quest::ChooseRandom(2031,2036,2030,2034,2027,2038,2026,2029,2025,2032,2028,2033);
	my $randw	= quest::ChooseRandom(5043,6032,6030,7022,7024,94155,6031);
	my $rewardr	= quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);

	if($NPCRace!=54)
	{

		if($rewardr < 4) {
			quest::addloot($rands,1);
		}
		elsif($rewardr ~~ [4..6]) {
			quest::addloot($randw,1);
		}
		elsif($rewardr ~~ [7..9]) {
			quest::addloot($randa,1);
		}
		elsif($rewardr > 9)
		{quest::addloot($randw,1);
		}
	}
}

sub EVENT_COMBAT {
	my $NPCRace = $npc->GetRace();

	if($combat_state == 1) {
		$npc->Heal();
	}

	if($NPCRace==54) {
		quest::say("your blood will spill.");
	}
	else {
		quest::say("Time to die $name!");
	}
}


sub EVENT_DEATH
{
		quest::say("Arrg defeated by a subroutine reversion!");
}
I did not test the above, give it a try, or, try changing:

Code:
sub EVENT_DEATH
{
to

Code:
sub EVENT_SPAWN
{
To see if it returns more favorable results. Perl therefore quests are indeed working otherwise right?

*edited: excuse the odd code format, copy/pasted from a PM I sent and I see it retained it's odd format once again.. wierd.
Reply With Quote
  #4  
Old 01-05-2013, 12:02 AM
javewow's Avatar
javewow
Sarnak
 
Join Date: Aug 2012
Location: work
Posts: 74
Default

Below for random drop of class----loot

You can add more later in the class ???? HELP


%item = ("Warrior" => 76600,
"Rogue" => 76601,
"Monk" => 76602,
"Berserker" => 76603,
"Shadowknight" => 76604,
"Paladin" => 76605,
"Ranger" => 76607,
"Bard" => 76608,
"Beastlord" => 76609,
"Cleric" => 76610,
"Druid" => 76611,
"Shaman" => 76612,
"Wizard" => 76613,
"Magician" => 76614,
"Enchanter" => 76615,
"Necromancer" => 76616);
sub EVENT_AGGRO {
my $Phrase1 = "Your faithless devotion to a false god leaves me no choice.";
my $Phrase2 = "I shall rid the land of another infamous villain.";
my $Phrase3 = "Your foul deeds have earned my contempt.";
my $Phrase4 = "${class}s like you are better left dead than alive.";
my $Phrase5 = "It's ${race}s like you who have ruined your own lands, You'll not ruin mine!";
my $Phrase6 = "Heathen! Unbeliever! Norrath must be cleansed!";
my $Phrase7 = "Your beliefs are an insult to us all!";
my $Phrase8 = "Your actions and history are a personal affront to all I stand for.";
my $Phrase9 = "Your intolerable reputation insults all in this realm.";
my $Phrase10 = "It's time for you to take your blasphemy into the next realm.";
my $Phrase11 = "${race}s like you are better left dead than alive.";
my $class_item = $item{$class};
my $Phrase = quest::ChooseRandom($Phrase1,$Phrase2,$Phrase3,$Ph rase4,$Phrase5,$Phrase6,$Phrase7,$Phrase8,$Phrase9 ,$Phrase10,$Phrase11);
quest::say("Rrrrrrrrooooaaakkk!");
my $Chance = quest::ChooseRandom(1,2,3,4);
if ($Chance == '1') {
quest::say("$Phrase");
quest::addloot($class_item,1);
}
}

--------------------------------------------------------

%item = ("Warrior" => 76600, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Rogue" => 76601, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Monk" => 76602, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Berserker" => 76603, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Shadowknight" => 76604, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Paladin" => 76605, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Ranger" => 76607, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Bard" => 76608, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Beastlord" => 76609, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Cleric" => 76610, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Druid" => 76611, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Shaman" => 76612, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Wizard" => 76613, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Magician" => 76614, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Enchanter" => 76615, XXXX, XXXXX, XXXXXX, XXXX, XXXX,
"Necromancer" => 76616),XXXX, XXXXX, XXXXXX, XXXX, XXXX, ;
sub EVENT_AGGRO {
my $Phrase1 = "Your faithless devotion to a false god leaves me no choice.";
my $Phrase2 = "I shall rid the land of another infamous villain.";
my $Phrase3 = "Your foul deeds have earned my contempt.";
my $Phrase4 = "${class}s like you are better left dead than alive.";
my $Phrase5 = "It's ${race}s like you who have ruined your own lands, You'll not ruin mine!";
my $Phrase6 = "Heathen! Unbeliever! Norrath must be cleansed!";
my $Phrase7 = "Your beliefs are an insult to us all!";
my $Phrase8 = "Your actions and history are a personal affront to all I stand for.";
my $Phrase9 = "Your intolerable reputation insults all in this realm.";
my $Phrase10 = "It's time for you to take your blasphemy into the next realm.";
my $Phrase11 = "${race}s like you are better left dead than alive.";
my $class_item = $item{$class};
my $Phrase = quest::ChooseRandom($Phrase1,$Phrase2,$Phrase3,$Ph rase4,$Phrase5,$Phrase6,$Phrase7,$Phrase8,$Phrase9 ,$Phrase10,$Phrase11);
quest::say("Rrrrrrrrooooaaakkk!");
my $Chance = quest::ChooseRandom(1,2,3,4);
if ($Chance == '1') {
quest::say("$Phrase");
quest::addloot($class_item,1);
}
}
__________________
To create the most beautiful server for "!!~[BP] PLARYBOT EQ~!" Welcome to our server
Reply With Quote
  #5  
Old 01-05-2013, 12:37 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

Quote:
Originally Posted by javewow View Post
you's .pl no working no loot!
sorry, it is quite possible that's because i changed when the events are run in my source. previously, they were fired off after the corpse was created and the npc in question was removed from the entity list, if i remember correctly. i moved the block that runs the events up to right before those things occur in my source.

you could also change it to where the loot is added in EVENT_COMBAT (where $combat_state is 1). then you could save the itemID that is added in an EntityVariable for that npc, then remove the item it in EVENT_COMBAT (where $combat_state is 0).

Last edited by c0ncrete; 01-05-2013 at 12:47 AM.. Reason: added suggestion
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:12 PM.


 

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