#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#-------------------------------------------------------------------------------  
 | 
#  
 | 
##@package UseItem.Item_AddMagicWeaponUpExp  
 | 
#  
 | 
# @todo:Ôö¼Ó·¨±¦ÉýÐǾÑé  
 | 
# @author xdh  
 | 
# @date 2018-10-22  
 | 
# @version 1.0  
 | 
#  
 | 
# ÏêϸÃèÊö: Ôö¼Ó·¨±¦ÉýÐǾÑé  
 | 
#  
 | 
#-------------------------------------------------------------------------------  
 | 
#"""Version = 2018-10-22 12:00"""  
 | 
#-------------------------------------------------------------------------------  
 | 
  
 | 
import PlayerControl  
 | 
import PlayerMagicWeapon  
 | 
import ItemCommon  
 | 
import ChConfig  
 | 
  
 | 
def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):  
 | 
    ##ÅúÁ¿Ê¹ÓÃÎïÆ·  
 | 
    itemTypeID = curRoleItem.GetItemTypeID()  
 | 
    curEff = curRoleItem.GetEffectByIndex(0)  
 | 
    mwID = curEff.GetEffectValue(0)  
 | 
    addExp = curEff.GetEffectValue(1) * useCnt  
 | 
    isActive = PlayerMagicWeapon.GetIsActiveMagicWeapon(curPlayer, mwID)  
 | 
    if not isActive:  
 | 
        PlayerControl.NotifyCode(curPlayer, 'UseItem_2', [mwID, itemTypeID])  
 | 
        return False  
 | 
      
 | 
    PlayerMagicWeapon.AddMagicWeaponUpExp(curPlayer, mwID, addExp)  
 | 
    PlayerControl.NotifyCode(curPlayer, 'UseItem_1', [itemTypeID, mwID, addExp])  
 | 
    ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_MagicWeapon)  
 | 
    return True, useCnt  
 | 
  
 |