Пример #1
0
    def do_delnpc(self, session, line):
        self.barn = Select.getNpc(line)

        if self.barn: #If the object exists
            Delete.deleteNpc(self.barn[0])
            session.push(tpl.DELNPC % line)
        else: session.push(tpl.DELNPC_ERR)
Пример #2
0
 def do_npcdesc(self, session, line):
     if not line: session.push(tpl.NPCDESC_ERR)
     
     self.splitarg = line.split(' ', 1)
     self.barn = Select.getNpc(self.splitarg[0].lower())
     
     if self.barn:
         setNpcDesc(self.barn[0], self.splitarg[1])
         session.push(tpl.NPCDESC % str(self.splitarg[0]).lower())
     else: session.push(tpl.NPCDESC_ERR)
Пример #3
0
    def do_clone(self, session, line):
        self.obj = Select.getItemNameId(line.lower())
        self.npc = Select.getNpc(line.lower())

        if self.obj:
            Insert.cloneItem(self.obj[0], session.p_id, time.time())
            session.push(tpl.CLONE % str(self.obj[1]))
        elif self.npc:
            Insert.cloneItem(self.obj[0], session.p_id, time.time())
            session.push(tpl.CLONE % str(self.npc[1]))
        else: session.push(tpl.CLONE_ERR)