Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24809/commands
Modified Files:
add.py
Log Message:
Added .static
Index: add.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/add.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** add.py 25 Aug 2004 17:03:04 -0000 1.10
--- add.py 21 Sep 2004 08:00:21 -0000 1.11
***************
*** 25,30 ****
player.socket.sysmessage("You can't add the multi there.")
return
!
multi = wolfpack.addmulti(str(arguments[0]))
multi.moveto(target.pos)
multi.update()
--- 25,37 ----
player.socket.sysmessage("You can't add the multi there.")
return
!
multi = wolfpack.addmulti(str(arguments[0]))
+
+ # If arguments[1] is true, make the item
+ # static
+ if arguments[1]:
+ multi.decay = False
+ multi.movable = 3
+
multi.moveto(target.pos)
multi.update()
***************
*** 33,38 ****
# Target response for adding an item
#
! def additem(player, arguments, target):
item = wolfpack.additem(str(arguments[0]))
if target.item:
if target.item.type == 1:
--- 40,52 ----
# Target response for adding an item
#
! def additem(player, arguments, target):
item = wolfpack.additem(str(arguments[0]))
+
+ # If arguments[1] is true, make the item
+ # static
+ if arguments[1]:
+ item.decay = False
+ item.movable = 3
+
if target.item:
if target.item.type == 1:
***************
*** 50,53 ****
--- 64,83 ----
#
+ # Add an item and make it nodecay + movable 2
+ #
+ def static(socket, command, arguments):
+ if len(arguments) > 0:
+ if wolfpack.getdefinition(WPDT_ITEM, arguments):
+ socket.sysmessage("Where do you want to place the item '%s'?" % arguments)
+ socket.attachtarget("commands.add.additem", [arguments, True])
+ elif wolfpack.getdefinition(WPDT_MULTI, arguments):
+ socket.sysmessage("Where do you want to place the multi '%s'?" % arguments)
+ socket.attachtarget("commands.add.addmulti", [arguments, True])
+ else:
+ socket.sysmessage('No Item, NPC or Multi definition by that name found.')
+ else:
+ socket.sysmessage('Usage: static <id>')
+
+ #
# Add an item or character or
# show the addmenu.
***************
*** 57,61 ****
if wolfpack.getdefinition(WPDT_ITEM, arguments):
socket.sysmessage("Where do you want to place the item '%s'?" % arguments)
! socket.attachtarget("commands.add.additem", [arguments])
elif wolfpack.getdefinition(WPDT_NPC, arguments):
socket.sysmessage("Where do you want to spawn the npc '%s'?" % arguments)
--- 87,91 ----
if wolfpack.getdefinition(WPDT_ITEM, arguments):
socket.sysmessage("Where do you want to place the item '%s'?" % arguments)
! socket.attachtarget("commands.add.additem", [arguments, False])
elif wolfpack.getdefinition(WPDT_NPC, arguments):
socket.sysmessage("Where do you want to spawn the npc '%s'?" % arguments)
***************
*** 63,67 ****
elif wolfpack.getdefinition(WPDT_MULTI, arguments):
socket.sysmessage("Where do you want to place the multi '%s'?" % arguments)
! socket.attachtarget("commands.add.addmulti", [arguments])
else:
socket.sysmessage('No Item, NPC or Multi definition by that name found.')
--- 93,97 ----
elif wolfpack.getdefinition(WPDT_MULTI, arguments):
socket.sysmessage("Where do you want to place the multi '%s'?" % arguments)
! socket.attachtarget("commands.add.addmulti", [arguments, False])
else:
socket.sysmessage('No Item, NPC or Multi definition by that name found.')
***************
*** 219,222 ****
--- 249,253 ----
def onLoad():
wolfpack.registercommand('add', add)
+ wolfpack.registercommand('static', static)
def onUnload():
***************
*** 226,232 ****
"""
\command add
! \description Add a npc or item and if no definition was specified, open a menu.
\usage - <code>add npc-id</code>
- <code>add item-id</code>
- <code>add</code>
If neither a npc nor an item id is passed to the add command, a menu with all
--- 257,264 ----
"""
\command add
! \description Add a npc, item or multi and if no definition was specified, open a menu.
\usage - <code>add npc-id</code>
- <code>add item-id</code>
+ - <code>add multi-id</code>
- <code>add</code>
If neither a npc nor an item id is passed to the add command, a menu with all
***************
*** 235,236 ****
--- 267,275 ----
based on the <category> tag.
"""
+
+ """
+ \command static
+ \description Add an item or multi and make it not decay and not movable.
+ \usage - <code>add item-id</code>
+ - <code>add multi-id</code>
+ """
|