Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2014, 07:59 AM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

Awesome, drajor! I've got this working in its natural form. Now, I just need to find the condition to check if a player has an item. I could actually really use an example of that if you don't mind helping me out just a bit more. I've searched around but everything I've found deals with checking items in quest scripts but not in the source code
Reply With Quote
  #2  
Old 09-24-2014, 08:20 AM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default

Quick and nasty;
Code:
if (ClientEntry->IsTrader())
	WAPP2->RankMSGID = 12315;
else if (ClientEntry->IsBuyer())
	WAPP2->RankMSGID = 6056;
else if (ClientEntry->Admin() >= 10)
	WAPP2->RankMSGID = 12312;
else if (ClientEntry->GetInv()->HasItem(20542) > -1)
	WAPP2->RankMSGID = 8043;
else
	WAPP2->RankMSGID = 0xFFFFFFFF;
This (should) check whether that character has item 20542(Singing Short Sword) and change their /who output to have Lyricist prefix.. e.g.

Lyricist[1 Bard] Drajor (Barbarian)
__________________
Drajor regards you indifferently -- what would you like your tombstone to say?
Reply With Quote
  #3  
Old 09-24-2014, 08:25 AM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

Code:
Error	10	error C2819: type 'Inventory' does not have an overloaded member 'operator ->'	C:\EQ\Source\zone\entity.cpp	4076	1	zone
Error	11	error C2232: '->Inventory::HasItem' : left operand has 'class' type, use '.'	C:\EQ\Source\zone\entity.cpp	4076	1	zone
I get these errors when compiling with that code... seems like we're getting really close to having this figured out.. I copy/pasted what you posted, checking now to make sure I didn't leave some ; or something out from being sloppy

Edit:
Code:
            else if (ClientEntry->GetInv().HasItem(17181, 0, 0xff))
	            WAPP2->RankMSGID = 8043;
compiled successfully, testing now...

Edit: Everything compiles successfully, the server runs without error, but having the specified item doesn't return any sort of string before the level and class in /who ... experimenting more with this
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:31 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3