Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20446
Modified Files:
ChangeLog pythonscript.cpp pythonscript.h skills.cpp
Log Message:
Source Updates for Player vendors.
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** pythonscript.h 27 Oct 2004 14:06:53 -0000 1.45
--- pythonscript.h 29 Oct 2004 23:44:04 -0000 1.46
***************
*** 92,95 ****
--- 92,97 ----
EVENT_CHECKVICTIM,
EVENT_DODAMAGE,
+ EVENT_SNOOPING,
+ EVENT_REMOTEUSE,
EVENT_COUNT,
};
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.234
retrieving revision 1.235
diff -C2 -d -r1.234 -r1.235
*** skills.cpp 21 Oct 2004 12:11:18 -0000 1.234
--- skills.cpp 29 Oct 2004 23:44:04 -0000 1.235
***************
*** 285,288 ****
--- 285,312 ----
void cSkills::Snooping( P_PLAYER player, P_ITEM container )
{
+ P_CHAR owner = container->getOutmostChar();
+
+ if (!owner)
+ return; // Snooping into something thats not equipped?!
+
+ PyObject *args = Py_BuildValue("(NNN)", owner->getPyObject(), container->getPyObject(), player->getPyObject());
+
+ // Event prüfen
+ if (player->canHandleEvent(EVENT_SNOOPING)) {
+ if (player->callEventHandler(EVENT_SNOOPING, args)) {
+ Py_DECREF(args);
+ return;
+ }
+ }
+
+ if (owner->canHandleEvent(EVENT_SNOOPING)) {
+ if (owner->callEventHandler(EVENT_SNOOPING, args)) {
+ Py_DECREF(args);
+ return;
+ }
+ }
+
+ Py_DECREF(args);
+
cUOSocket* socket = player->socket();
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** pythonscript.cpp 27 Oct 2004 14:37:25 -0000 1.57
--- pythonscript.cpp 29 Oct 2004 23:44:04 -0000 1.58
***************
*** 580,583 ****
--- 580,604 ----
"onDoDamage",
+ /*
+ \event onSnooping
+ \param owner The owner of the container that is trying to be looked into.
+ \param item The item that is being snooped into.
+ \param player The player trying to snoop into the container.
+ \return True if you want to handle this skill use.
+ \condition Triggered for the player trying to snoop first, then for the owner of the
+ container that is being snooped into.
+ */
+ "onSnooping",
+
+ /*
+ \event onRemoteUse
+ \param player The player who used the item.
+ \param item The item that was used.
+ \return Return True if the item may be used, False otherwise.
+ \condition Triggered when a player tries to use an item that is within the belongings of another character.
+ \notes This even is called for the using player, then for the current owner of the item.
+ */
+ "onRemoteUse",
+
0
};
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.125
retrieving revision 1.126
diff -C2 -d -r1.125 -r1.126
*** ChangeLog 27 Oct 2004 16:19:42 -0000 1.125
--- ChangeLog 29 Oct 2004 23:44:04 -0000 1.126
***************
*** 10,13 ****
--- 10,18 ----
- Implemented a walktest command for testing walking.
- Fixed several other walking bugs.
+ - Implemented onRemoteUse for checking if an object that is in the belonging
+ of another char may be used. First called for the using char, then for the
+ owner of the object.
+ - Implemented onSnooping that is called for the owner and for the player trying to
+ open a container.
Wolfpack 12.9.12 Beta (18. October 2004)
|