View Single Post
  #12  
Old 10-19-2016, 12:07 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by Maze_EQ View Post
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.
Well, the implementation of making the item lore, is to make handling easier (dare I say possible, without source changes/additions). Otherwise, with NukeItem you could quite possibly/easily nuke the unintended item.

The following assumes the item is lore, has not been tested, as I don't have Perl on the computer I'm on atm:

Code:
sub EVENT_LOOT {
	@eligibleitemidarray = (1,4); ## we could iterate through the keys of the hash each time but, technicaly more extensive load
	if ($itemid ~~ @eligibleitemidarray) {
		my %h = (
			1 => [[69,72,81],[69,72,81],[69,72,81],[69,72,81],[91,94,96],[100,142,214]],
			4 => [[45,75,81],[45,75,81],[45,75,81],[45,75,81],[45,75,81],[100,142,214]]
		);
		if (quest::ChooseRandom(1..10) < 10) { 
			$client->NukeItem($itemid);
			$client->SummonItem($itemid, 0, 1, ($h{$itemid}[0][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[0]) - 1 ))]),
			($h{$itemid}[1][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[1]) - 1 ))]),
			($h{$itemid}[2][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[2]) - 1 ))]),
			($h{$itemid}[3][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[3]) - 1 ))]),
			($h{$itemid}[4][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[4]) - 1 ))]),
			($h{$itemid}[5][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[5]) - 1 ))]));
		}
	}
}
Code:
@eligibleitemidarray
I choose to do a smart match on a predefined array/list of applicable item numbers, as iterating through the hash with every looting may be a little more taxing on the server. Who's to say though, and it would definitely depend on how far you may expand things in the future.

It's not clean (i.e. could use some clean up), but, should at the very least give you an idea of how you could go about things.

Now, if:

Code:
quest::addloot()
Could be expanded upon, to include augments, then what you want to do would be possible via scripting and would allow for universal "usage", that is to say, would/could be a useful change for everyone and not just your situation. (hint wink Kingly?)
Reply With Quote