Add /killbless, /killpotion and /noflask commands - #15
Conversation
/killbless (/killb) removes any Bless spells on the pc /killpotion (/killp) removes any stat potion spells from the pc /noflask prevents the creation of empty flasks when using health/mana/combo or stat potions. Added CF_TUTOR to CF_Tab in create.c for parity with server.h
/killpotion now correctly states that a potion wasn't not found if one isn't active rather than saying that Bless isn't found. Changed "Another potion is still active." to mention that /killpotion can be used.
DanielBrockhaus
left a comment
There was a problem hiding this comment.
24.01.26 19:09:11 [003-01]: item Empty Potion (19465): not linked. fixing.
24.01.26 19:09:11 [003-01]: ITEM: name=Empty Potion, description=A small flask made of glass.
24.01.26 19:09:11 [003-01]: ITEM: value=25, ID=0, driver=32
24.01.26 19:09:11 [003-01]: ITEM: mod 0: index=0, value=0
24.01.26 19:09:11 [003-01]: ITEM: mod 1: index=0, value=0
24.01.26 19:09:11 [003-01]: ITEM: mod 2: index=0, value=0
24.01.26 19:09:11 [003-01]: ITEM: mod 3: index=0, value=0
24.01.26 19:09:11 [003-01]: ITEM: mod 4: index=0, value=0
You need to also free the items you remove from characters:
remove_item_char(in);
free_item(in);
Please always test your code, and check the .elog.
Perfect oppertunity for using a util function, something like : edit: I shouldn't reply before reading properly, you suggested pretty much exactly that :D |
|
That's odd. I didn't get any further errors despite testing it over several days and using potions while testing a quest. I'll test further. |
|
Could it have been a leftover unfreed item from prior? |
| it[in].drdata[2] * POWERSCALE); | ||
|
|
||
| if (empty) replace_item_char(in, in2); | ||
| if (empty && (!(ch[cn].flags & CF_NOFLASK))) replace_item_char(in, in2); |
There was a problem hiding this comment.
in2 gets lost here.
A much cleaner way would be to not create the empty bottle in the first place.




/killbless (/killb) removes any Bless spells on the pc /killpotion (/killp) removes any stat potion spells from the pc /noflask prevents the creation of empty flasks when using health/mana/combo or stat potions.
Added CF_TUTOR to CF_Tab in create.c for parity with server.h