Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2016, 06:15 AM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default Can anyone make a script for this...

I need a script that prevents someone from looting an item from a corpse that has a required or recommended level above their current level. Is this possible? Willing to donate. Thanks. And/or makes the item on the corpse invisible to the player that doesn't meet the req lvl, race, class.
Reply With Quote
  #2  
Old 10-08-2016, 03:00 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
Default

I don't think this is in the realm of built in quest scripts, it sounds like a source change to me.
__________________

~Shin Noir
DungeonEQ.com
Reply With Quote
  #3  
Old 10-08-2016, 03:42 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Quote:
Originally Posted by Shin Noir View Post
I don't think this is in the realm of built in quest scripts, it sounds like a source change to me.
Hmm k is it possible to edit the source? I remember reading someone saying they can disable buttons and things like that.
Reply With Quote
  #4  
Old 10-08-2016, 06:17 PM
Nerdgasm
Discordant
 
Join Date: Apr 2013
Posts: 419
Default

Thought there was a script that put loot on mobs based off of level, but I cannot think of a script that would prevent you entirely from looting said item or making said item invisible to a person not of that class/race/level...

Maybe that level script could add a factor in for checking race/class? -shrug- not something I'm familiar with... Sorry I couldn't be of much help.
__________________
I am the All Mighty Mittens!
Reply With Quote
  #5  
Old 10-08-2016, 06:44 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Quote:
Originally Posted by Nerdgasm View Post
Thought there was a script that put loot on mobs based off of level, but I cannot think of a script that would prevent you entirely from looting said item or making said item invisible to a person not of that class/race/level...

Maybe that level script could add a factor in for checking race/class? -shrug- not something I'm familiar with... Sorry I couldn't be of much help.
Thanks for that. The use of this would be to allow anyone to loot a corpse but only people high enough level to use items could loot them. Like allowing a server wide boss fight type thing.
Reply With Quote
  #6  
Old 10-08-2016, 06:56 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Anyone to loot..but, only high enough to use it sounds like current default server behavior.


If you're talking about being able to equip items and they have a yellow background because you don't meet the level requirements..

..that's a client behavior found in Underfoot and higher clients.

The server really isn't coded to handle that issue at the moment.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #7  
Old 10-08-2016, 09:01 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Sorry what I meant was anyone could "loot the corpse" but can only remove items off the corpse that they can use. So basically the corpses are all unlocked but if your level 5 for example you couldn't loot level 70 req items from the corpse.
Reply With Quote
  #8  
Old 10-08-2016, 09:51 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

The scripts work because of a trigger event in the loot corpse function: https://github.com/EQEmu/Server/blob...rpse.cpp#L1173

By the time you get to this point..there's not much you can do without a recode..especially since there's no conditional on the call.


Ideally, you would want to not send the packet for any item they can't use.

Code Ref: https://github.com/EQEmu/Server/blob...rpse.cpp#L1015

You could add something like this:
Code:
	if(client && item) {
		if (item->ReqLevel && (item->ReqLevel > client->GetLevel()))
			continue;
	
		ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned);
That would eliminate lower levels from seeing the item on the corpse..but, not disturb the actual corpse looting process.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #9  
Old 10-08-2016, 10:20 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Interesting. So would it be possible to block the item packet being sent as well as prevent them from seeing it? What I'm understanding is that script will prevent low levels from seeing the item but it would still be there and they could remove it from the corpse is that correct? Or are you saying the item will just not be present at all if a low level loots the corpse, then the corpse would dissapear like there was nothing on it?

If it isn't possible to fully do what I want with this, another option would be is it possible to "instance" the corpse so multiple people can loot the items off it? Mabye as part of the fix in addition.

For example if we can block an item from bieng on a corpse if the person looting doesn't meet the lvl req, and also have the corpse instanced so multiple people can loot the same corpse, then the people who do meet the req will all be able to loot the item and those that don't meet the req would not.
Reply With Quote
  #10  
Old 10-08-2016, 10:40 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

That would be a minor code change and a recompile would be needed.

But, yes... The item would be invisible to clients who did not meet the level requirement..but, still remain on the corpse - which would keep it from disappearing
after closing the loot window.

The client can only loot items that it can see..so, no loot packets would ever come from the client for those items.


Instancing the corpse for multiple individuals is not a viable option since nothing server-side is set up for that (code, database, etc...)

That would just be asking for major issues down the road.

You'd probably be better off just adding multiples of that item..like certain keys are handled.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #11  
Old 10-08-2016, 10:46 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Quote:
Originally Posted by Uleat View Post
That would be a minor code change and a recompile would be needed.

But, yes... The item would be invisible to clients who did not meet the level requirement..but, still remain on the corpse - which would keep it from disappearing
after closing the loot window.
Amazing, so that meets my requirements then it seems! I will give it a go within the next couple days and let you know. Also how could I modify the code to include checks for class and race in addition to level? Thanks a bunch!
Reply With Quote
  #12  
Old 10-08-2016, 10:49 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Just remember that's off the cuff...

Keep an eye out for in-game issues and let me know if that doesn't compile - I'll double-check the property references.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #13  
Old 10-08-2016, 11:02 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Cool. How can I modify that code to check for class and race in addition to level.

Basically to check for level and race and class.
Reply With Quote
  #14  
Old 10-08-2016, 11:25 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

That's a little more involved since items use bitmasks instead of integral values for those fields..

Currently, this is a good code reference for it: https://github.com/EQEmu/Server/blob..._base.cpp#L170

But, you could just do:
Code:
	if (item->ReqLevel && (item->ReqLevel > client->GetLevel()))
		continue;
	if (item->Races && (item->Races & ~GetPlayerRaceBit(client->GetRace())))
		continue;
	if (item->Classes && (item->Classes & ~GetPlayerClassBit(GetPlayerClassValue(client->GetClass()))))
		continue;
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #15  
Old 10-08-2016, 11:33 PM
NostalgiaEQ
Banned
 
Join Date: Sep 2016
Location: us
Posts: 201
Default

Of course, that's genius. I really really appreciate it! I will give it a go and let you know how it works. Hopefuly others can find it useful as well.
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 02:00 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