Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-03-2010, 05:02 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default COMMITTED: $oncursor

Similar to $hasitem, $oncursor checks the front item on the cursor for a specific item id.

Code:
Index: embparser.cpp
===================================================================
--- embparser.cpp	(revision 1581)
+++ embparser.cpp	(working copy)
@@ -532,6 +532,19 @@
 		}
 	}
 
+	// $oncursor
+	if(mob && mob->IsClient()) {
+		string hashname = packagename + std::string("::oncursor");
+		perl->eval(std::string("%").append(hashname).append(" = ();").c_str());
+		char *hi_decl = NULL;
+		int itemid = mob->CastToClient()->GetItemIDAt(30);
+		if(!HASITEM_ISNULLITEM(itemid)) {
+			MakeAnyLenString(&hi_decl, "push (@{$%s{%d}},%d);",hashname.c_str(),itemid,30);
+			perl->eval(hi_decl);
+			safe_delete_array(hi_decl);
+		}
+	}
+
 	//do any event-specific stuff...
 	switch (event) {
 		case EVENT_SAY: {
Usage:
Code:
if ($oncursor{67415}) { #Stone of Entry
  quest::say("$name has the item on the cursor.");
}
else {
  quest::say("$name is not holding that item.");
}
Works great for situations like this: The keyholder must hold the Stone of Entry on his/her cursor and say, "I wish to enter."
Reply With Quote
 


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 04:22 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