Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
53 stars 40 forks source link

Not able use events on item. Bug? #1226

Closed Jhobean closed 2 months ago

Jhobean commented 2 months ago
[EVENTS e_potato]
on=@DropOn_Ground
serv.log DropOn_Ground work!

on=@DClick
serv.log dclick work!

on=@DropOn_Char
serv.log  DropOn_Char work!

[TYPEDEF T_potato] //(EDITED)
on=@DropOn_Ground
serv.log TEVENTS DropOn_Ground work!

on=@DClick
serv.log TEVENTS dclick work!

on=@DropOn_Char
serv.log TEVENTS DropOn_Char work!

[ITEMDEF 0f06]
DEFNAME=i_bottle_black
TYPE=t_potion
TDATA1=i_bottle_empty
WEIGHT=1.0
RESOURCES=1 i_bottle_empty
tevents=T_potato
CATEGORY=Magic
SUBSECTION=Potions (basic)
DESCRIPTION=Potion (Black)(Nightsite)
ON=@Create
   MORE1=s_night_sight
   MORE2={30.0 90.0}
   events= e_potato

It's normal I can't use events on an item?

xwerswoodx commented 2 months ago

tevents=T_potato

tevents stands for "type" events means you need to define it in [TYPEDEF] not [EVENTS]

Jhobean commented 2 months ago

Ok work for tevent.

But If I have an existing item and want add an event on it, it work?

.xevents + e_potato work and item have the events but it do nothing

xwerswoodx commented 2 months ago

Seems like events also works on TYPEDEF I am not sure if it's a default behaviour, as I have never used event on items. But if it's a default behaviour why TEVENTS added, probably it's an issue.

Jhobean commented 2 months ago

Ok made some test with Gladie.

Apparently Item can have event on them but it make nothing. You can add event on them but they must be define as a TYPEDEF. Example

[TYPEDEF ei_potato]
on=@DropOn_Ground
serv.log DropOn_Ground work!

after that you can do .xevents +ei_potato