EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   $npc->AddItem IF 'reqlevel' is.... (https://www.eqemulator.org/forums/showthread.php?t=38356)

vithmiris 06-03-2014 07:53 PM

$npc->AddItem IF 'reqlevel' is....
 
I'm using a modified version of a perl script for random loot drops in some zones (posted by Trubles).

I was wondering if it is possible to expand on this to only 'AddItem' if the random itemid was an item that had a 'reqlevel' of <= 65.

Thanks!

Kingly_Krab 06-03-2014 08:29 PM

Try this:
Code:

if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
    $npc->AddItem(ID, -1, 1);
}


vithmiris 06-04-2014 12:13 PM

Quote:

Originally Posted by Kingly_Krab (Post 230991)
Try this:
Code:

if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
    $npc->AddItem(ID, -1, 1);
}



Thanks Kingly, I will do so as soon as I get out of work. :-D

Scorpious2k 06-04-2014 12:49 PM

Quote:

Originally Posted by Kingly_Krab (Post 230991)
Try this:
Code:

if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
    $npc->AddItem(ID, -1, 1);
}


Ummmm.... didn't vithmiris ask for <= 65 not >= 65?

*pokes the Krab. :)

vithmiris 06-04-2014 12:52 PM

Quote:

Originally Posted by Scorpious2k (Post 231004)
Ummmm.... didn't vithmiris ask for <= 65 not >= 65?

*pokes the Krab. :)

Hahah, I noticed that, but of course no biggie ;)

Kingly_Krab 06-04-2014 03:25 PM

My bad, I was doing some other stuff and I thought I could help, so I wrote that. :P

Scorpious2k 06-04-2014 04:02 PM

Quote:

Originally Posted by Kingly_Krab (Post 230991)
Try this:
Code:

if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
    $npc->AddItem(ID, -1, 1);
}


Quote:

Originally Posted by Kingly_Krab (Post 231009)
My bad, I was doing some other stuff and I thought I could help, so I wrote that. :P

Don't take it the wrong way, I was just joking with you. Every time I look you are helping someone! We need more like you.

Kingly_Krab 06-04-2014 06:55 PM

Quote:

Originally Posted by Scorpious2k (Post 231010)
Don't take it the wrong way, I was just joking with you. Every time I look you are helping someone! We need more like you.

I know, haha. And yeah, I know!

vithmiris 06-04-2014 09:04 PM

That did the trick, thanks again Kingly!

Kingly_Krab 06-04-2014 11:08 PM

Quote:

Originally Posted by vithmiris (Post 231013)
That did the trick, thanks again Kingly!

You're welcome. By the way, is your server public? If so, what's the name?

vithmiris 06-05-2014 10:00 AM

Quote:

Originally Posted by Kingly_Krab (Post 231014)
You're welcome. By the way, is your server public? If so, what's the name?

LAN based private server; at the moment anyways.
I have lots to learn, but am having a blast so far.


All times are GMT -4. The time now is 01:22 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.