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 10-17-2016, 09:01 AM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default Possible to add augment to loot items?

Can you have a perl script add augments to an item it is adding to a mob when it spawns? If have tried and repeatedly failed to get this to happen lol. I am to the point if someone more knowledge would want to write a quest to do the below please send me a message. I would be willing to work out a donation for the code and time spent.

Below obviously is just what I am looking for in layman’s terms not actual code:

When a mob spawns I want a perl quest that fires to add an item to the mob. I want the item added to have random augments inserted into the item. In the zone folder I will name the quest the mobs name but there are different variations of the mob so I need it to trigger different items for each unique npc type id.

Code:
sub EVENT_SPAWN
1 in 10 chance to trigger 
if npc id = XXX
add random item from list (1, 4) to npc to loot
if 1
add random augment (69, 72, 81) to aug slot 1
add random augment (69, 72, 81) to aug slot 2
add random augment (69, 72, 81) to aug slot 3
add random augment (69, 72, 81) to aug slot 4
add random augment (91, 94, 96) to aug slot 5
add random augment (100, 142, 214) to aug slot 6
if 4
add random augment (45, 75, 81) to aug slot 1
add random augment (45, 75, 81) to aug slot 2
add random augment (45, 75, 81) to aug slot 3
add random augment (45, 75, 81) to aug slot 4
add random augment (45, 75, 81) to aug slot 5
add random augment (100, 142, 214) to aug slot 6
if npc id = XXX
add random item from list (6, 9) to npc to loot
**repeating as many times as needed**
Reply With Quote
  #2  
Old 10-18-2016, 08:36 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

So no one can even answer the question of if this is possible or not? :(
Reply With Quote
  #3  
Old 10-19-2016, 10:00 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

With an attitude like that, ain't noone gonna help you.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #4  
Old 10-19-2016, 10:18 AM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Quote:
Originally Posted by Maze_EQ View Post
With an attitude like that, ain't noone gonna help you.

lol how is that an attitude? please look through all my post and try and find me ever getting an attitude. Pro tip: see the sad face at the end. That helps you determine the emotion the text was written with.
Reply With Quote
  #5  
Old 10-19-2016, 10:25 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Source change would be necessary (from what I recall from the last time I looked at the source which is currently unavailable to me) to accomplish what you want in the way that you want.

However, if you wanted to handle this at EVENT_LOOT level, then yes, it should be very well possible using Perl. The only immediate downside I can think of it, is, it may cause a "blip" of the item while on cursor, where it temporarily disappears, but then reappears. Hell it may not even be noticeable.

Basically, it would entail allowing the player to loot the item (and it would need to be LORE, more on this later), which kicks off EVENT_LOOT (player.pl in the zone this special circumstance belongs, or global_player.pl if it could be multiple zones for simplicity of code management), logical comparison of item looted, if qualifying item, nuke it, then
Code:
$client->SummonItem(item_id, charges, attune, aug1, aug2, aug3, aug4, aug5)
With the applicable augment itemid(s) being passed. However, the "tricky" part or at least involving more Perl code is, if they DONT loot with a "left click", thus placing it directly into their inventory. This is why I say, the item would need to be LORE, at least with currently available exported Perl commands. I -suppose- there is a way around that as well, handling the "LORE" type of features through Perl as well. That would involve looking at the players inventory (carried, bank, shared bank) for the item, then essentially checking to see if they already have that item, with the augment the randomization code (in Perl) wishes to place on the item, exists. Then, what do you do from there? Nuke it altogether and say "Sorry you already have that item." or have another go at the randomization until it settles on an augmentation scheme that doesn't already exist in inventory.

TBH, I think most would likely settle on simply modifying the loot tables, so that the NPC has the item (100%), then handle the randomization of the augment through the loot table as well. Then just let the player add the augments. If you want to force stats, then just create an item with those stats from the get go.

I know Kingly recently added (I think it was him, my apologies to the dev if it wasnt him that did it) IsAugment() or maybe it was IsAugmented() which the latter making a little more sense imo. However, I'm not sure a Perl/LUA export exists to find just WHICH augments are on an item. I'd have to look at the source, as http://wiki.eqemulator.org/p?Ultimate_Perl_Reference hasn't received an update in awhile.

TL;DR - With source code changes, yes. With just Perl, perhaps.
Reply With Quote
  #6  
Old 10-19-2016, 10:28 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

Quote:
Originally Posted by ghanja View Post
Source change would be necessary (from what I recall from the last time I looked at the source which is currently unavailable to me) to accomplish what you want in the way that you want.

However, if you wanted to handle this at EVENT_LOOT level, then yes, it should be very well possible using Perl. The only immediate downside I can think of it, is, it may cause a "blip" of the item while on cursor, where it temporarily disappears, but then reappears. Hell it may not even be noticeable.

Basically, it would entail allowing the player to loot the item (and it would need to be LORE, more on this later), which kicks off EVENT_LOOT (player.pl in the zone this special circumstance belongs, or global_player.pl if it could be multiple zones for simplicity of code management), logical comparison of item looted, if qualifying item, nuke it, then
Code:
$client->SummonItem(item_id, charges, attune, aug1, aug2, aug3, aug4, aug5)
With the applicable augment itemid(s) being passed. However, the "tricky" part or at least involving more Perl code is, if they DONT loot with a "left click", thus placing it directly into their inventory. This is why I say, the item would need to be LORE, at least with currently available exported Perl commands. I -suppose- there is a way around that as well, handling the "LORE" type of features through Perl as well. That would involve looking at the players inventory (carried, bank, shared bank) for the item, then essentially checking to see if they already have that item, with the augment the randomization code (in Perl) wishes to place on the item, exists. Then, what do you do from there? Nuke it altogether and say "Sorry you already have that item." or have another go at the randomization until it settles on an augmentation scheme that doesn't already exist in inventory.

TBH, I think most would likely settle on simply modifying the loot tables, so that the NPC has the item (100%), then handle the randomization of the augment through the loot table as well. Then just let the player add the augments. If you want to force stats, then just create an item with those stats from the get go.

I know Kingly recently added (I think it was him, my apologies to the dev if it wasnt him that did it) IsAugment() or maybe it was IsAugmented() which the latter making a little more sense imo. However, I'm not sure a Perl/LUA export exists to find just WHICH augments are on an item. I'd have to look at the source, as http://wiki.eqemulator.org/p?Ultimate_Perl_Reference hasn't received an update in awhile.

TL;DR - With source code changes, yes. With just Perl, perhaps.
You took the words right out of my mouth, it must've been while you were kissing meeeeeee.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #7  
Old 10-19-2016, 10:42 AM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Quote:
Originally Posted by ghanja View Post
Source change would be necessary (from what I recall from the last time I looked at the source which is currently unavailable to me) to accomplish what you want in the way that you want.

However, if you wanted to handle this at EVENT_LOOT level, then yes, it should be very well possible using Perl. The only immediate downside I can think of it, is, it may cause a "blip" of the item while on cursor, where it temporarily disappears, but then reappears. Hell it may not even be noticeable.

Basically, it would entail allowing the player to loot the item (and it would need to be LORE, more on this later), which kicks off EVENT_LOOT (player.pl in the zone this special circumstance belongs, or global_player.pl if it could be multiple zones for simplicity of code management), logical comparison of item looted, if qualifying item, nuke it, then
Code:
$client->SummonItem(item_id, charges, attune, aug1, aug2, aug3, aug4, aug5)
With the applicable augment itemid(s) being passed. However, the "tricky" part or at least involving more Perl code is, if they DONT loot with a "left click", thus placing it directly into their inventory. This is why I say, the item would need to be LORE, at least with currently available exported Perl commands. I -suppose- there is a way around that as well, handling the "LORE" type of features through Perl as well. That would involve looking at the players inventory (carried, bank, shared bank) for the item, then essentially checking to see if they already have that item, with the augment the randomization code (in Perl) wishes to place on the item, exists. Then, what do you do from there? Nuke it altogether and say "Sorry you already have that item." or have another go at the randomization until it settles on an augmentation scheme that doesn't already exist in inventory.

TBH, I think most would likely settle on simply modifying the loot tables, so that the NPC has the item (100%), then handle the randomization of the augment through the loot table as well. Then just let the player add the augments. If you want to force stats, then just create an item with those stats from the get go.

I know Kingly recently added (I think it was him, my apologies to the dev if it wasnt him that did it) IsAugment() or maybe it was IsAugmented() which the latter making a little more sense imo. However, I'm not sure a Perl/LUA export exists to find just WHICH augments are on an item. I'd have to look at the source, as http://wiki.eqemulator.org/p?Ultimate_Perl_Reference hasn't received an update in awhile.

TL;DR - With source code changes, yes. With just Perl, perhaps.
I was afraid it would lean more toward source code. I probably should have figured this part out before I made 2,000 unique augments for a Diablo style loot server lol. Got excited before understanding how augments work. I assumed if there was code to make #augmentitem work then you could just some how make that fire in a perl quest. Which probably just shows my ignorance with the whole process as I try and learn and piece stuff together. Thank you very much for the reply and back to the drawing board.
Reply With Quote
  #8  
Old 10-19-2016, 10:53 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

Can always add the item using $client->SummonItem though.

Code:
 sub EVENT_LOOT{

if($itemid == x)

$client->NukeItem(itemnum)

$client->SummonItem($item_id, charges, attune, aug1, aug2, aug3, aug4, aug5)
}

Then add an array for each 5 augments with a random chance to apply by passing $aug1, $aug2, $aug3, $aug4, $aug5.


Note: This is just an example, but that's totes how i'd do it.

Or if you really want to make this "Diablo Style"

Add an NPC that will identify magic items and set tyhem from an NPC, and just provide the unidentified item as a shit item.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #9  
Old 10-19-2016, 11:03 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Maze_EQ View Post
Then add an array for each 5 augments with a random chance to apply by passing $aug1, $aug2, $aug3, $aug4, $aug5.


Note: This is just an example, but that's totes how i'd do it.
Yep, pretty much as explained above. However, when coding, I always try to think of "what can the player do to screw this up?"

And the immediate one I can think of, as mentioned above, is if they do a right click (immediate) loot, making the item land in their inventory. But, this should be an issue if the item itself is LORE. That is likely the route I would go, rather than having Perl handle the traits of a "LORE" like item, as it just makes an already complex way to handle giving items/augments (in my humble opinion) more complex.
Reply With Quote
  #10  
Old 10-19-2016, 11:07 AM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Quote:
Originally Posted by Maze_EQ View Post
Can always add the item using $client->SummonItem though.

Code:
 sub EVENT_LOOT{

if($itemid == x)

$client->NukeItem(itemnum)

$client->SummonItem($item_id, charges, attune, aug1, aug2, aug3, aug4, aug5)
}

Then add an array for each 5 augments with a random chance to apply by passing $aug1, $aug2, $aug3, $aug4, $aug5.


Note: This is just an example, but that's totes how i'd do it.

Or if you really want to make this "Diablo Style"

Add an NPC that will identify magic items and set tyhem from an NPC, and just provide the unidentified item as a shit item.
Awesome info. This may help me make what I am trying possible. Thank you very much
Reply With Quote
  #11  
Old 10-19-2016, 11:29 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

In diablo, there were no lore items or lore augments remove lore and gucci.

Except Wirt's leg, but let's be honest, Wirt was a jerkoff.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #12  
Old 10-19-2016, 01:47 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

If you take to an NPC, I would just have the player trade the item, then summon it to the players cursor (the augmented version).
Reply With Quote
  #13  
Old 10-19-2016, 01:50 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

That looks like a general concept.

Run with it!
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #14  
Old 10-19-2016, 02:03 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default

Well thank you both for the help. I cant wait to get home from work and try some of this out.
Reply With Quote
  #15  
Old 10-19-2016, 02:20 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by lordnivek1 View Post
Well thank you both for the help. I cant wait to get home from work and try some of this out.
Not entirely sure of the "modified" behavior you're looking for, since you've found it's almost surely not possible (at this time) to add an augmented item without source changes.

However, I would use quest::ChooseRandom in place of Perl's rand. Also, know, that rand(4) would produce fractions (i.e. 0.43456, 1.2235, etc.) so that conditional, while it -could- some year be true as you have it written, if you are insistent on using rand(), then:

Code:
my $random = int(rand(3));
Is what you'd be after. Why only 3? Because a pointer to an array element begins at 0, not 1. You have four elements listed, so, 0, 1, 2 and 3 would be valid pointers.

Here is an example of something (without iterating through the %itemcount hash for simplicity, as I'm not sure your comfort level of hashes) utilizing an EVENT_ITEM (i.e. trade) event:

Code:
sub EVENT_ITEM {
	@eligibleitemidarray = (100,200,300,400);
	if (($item1 ~~ @eligibleitemidarray) || 
	($item2 ~~ @eligibleitemidarray) || 
	($item3 ~~ @eligibleitemidarray) || 
	($item4 ~~ @eligibleitemidarray)) {
		my @add_aug1 = ('1000', '1001', '1005', '1007');
		my @add_aug2 = ('5000', '5001', '5005', '5007');
		my $random = quest::ChooseRandom(0..3);
		$client->SummonItem(XXX, 0, 1, $add_aug1[$random], $add_aug2[$random])
	}
	else {
		plugin::return_items(\%itemcount);
	}	
}
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 04:48 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3