1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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