1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- PickUpItem = {}
- local this = PickUpItem
- local pickUpType = 25
- local pickUpTimer = 668
- function PickUpItem.login(actor)
- setontimer(actor, pickUpTimer, 2)
- end
- function PickUpItem.exit(actor)
- setofftimer(actor, pickUpTimer)
- end
- function ontimer668(actor)
- this.rangPickUp(actor)
- end
- function this.rangPickUp(actor)
-
- local hp = getbaseinfo(actor, "hp")
- if hp <= 0 then
- return
- end
- if insafezone(actor) then
- return
- end
- if not this.getState(actor) then
- return
- end
- pickuprangeitem(actor)
- end
- function PickUpItem.updateState(actor, type, oldValue, value)
- if type == pickUpType then
- lg(type, oldValue, value)
- setplaydef(actor, "T$rang_pickup_state", value)
- end
- end
- function this.getState(actor)
- return getplaydef(actor, "T$rang_pickup_state") or false
- end
|