EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   COMMITTED: $oncursor (https://www.eqemulator.org/forums/showthread.php?t=31591)

joligario 07-03-2010 05:02 AM

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

steve 07-03-2010 09:35 AM

Will come in handy for the qinimi trial :)

joligario 07-03-2010 01:42 PM

That's exactly what I am using it for! Helping out Jaekob with BIC 1.

joligario 07-05-2010 01:58 PM

Committed in r1583

trevius 07-06-2010 06:08 AM

Thanks for committing that, and GRATZ on SVN access :D


All times are GMT -4. The time now is 12:44 AM.

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