PDA

View Full Version : $npc->AddItem IF 'reqlevel' is....


vithmiris
06-03-2014, 07:53 PM
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:if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
$npc->AddItem(ID, -1, 1);
}

vithmiris
06-04-2014, 12:13 PM
Try this: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
Try this: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
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
Try this:if ($npc->GetItemStat(ID, "reqlevel") >= 65) {
$npc->AddItem(ID, -1, 1);
}

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
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
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
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.