доброго времени суток. подскажите пож что не так? вот часть скрипта. нужно чтобы при атаке с вероятностью давался итэм атакующему.
def onAttack (self,npc,player,damage,isPet):
npcId = npc.getNpcId()
if npcId in MOBS and (Rnd.get(2) == 1):
player.giveItems(4356,1)
return
вот часть лога ГС при атаке данного НПС:
Traceback (innermost last):
File "__init__.py", line 98, in onAttack
AttributeError: giveItems
at org.python.core.Py.AttributeError(Unknown Source)
at org.python.core.PyInstance.invoke(Unknown Source)
at org.python.pycode._pyx55.onAttack$5(__init__.py:98)
at org.python.pycode._pyx55.call_function(__init__.py)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyFunction.__call__(Unknown Source)
at org.python.core.PyMethod.__call__(Unknown Source)
at org.python.core.PyObject.__call__(Unknown Source)
at org.python.core.PyObject._jcallexc(Unknown Source)
at org.python.core.PyObject._jcall(Unknown Source)
at org.python.proxies.main$ahosey$52.onAttack(Unknown Source)
at com.l2jfrozen.gameserver.model.quest.Quest.notifyAttack(Quest.java:43
9)
at com.l2jfrozen.gameserver.model.L2Attackable.addDamageHate(L2Attackabl
e.java:1099)
at com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance.addDa
mageHate(L2MonsterInstance.java:299)
at com.l2jfrozen.gameserver.model.L2Attackable.addDamage(L2Attackable.ja
va:1029)
at com.l2jfrozen.gameserver.model.L2Attackable.reduceCurrentHp(L2Attacka
ble.java:497)
at com.l2jfrozen.gameserver.model.L2Attackable.reduceCurrentHp(L2Attacka
ble.java:432)
at com.l2jfrozen.gameserver.model.L2Character.onHitTimer(L2Character.jav
a:6721)
at com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.onHitTimer
(L2PcInstance.java:5450)
at com.l2jfrozen.gameserver.model.L2Character$HitTask.run(L2Character.ja
va:2859)
at com.l2jfrozen.gameserver.thread.ThreadPoolManager$RunnableWrapper.run
(ThreadPoolManager.java:91)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
заранее благодарю.