Campaign/Forgotten Legacy/Items
From The Battle for Wesnoth Wiki
#define OBJ_KARANDILS_MACE X Y [event] name=prestart [item] x,y={X},{Y} image=items/karandils_mace.png [/item] {VARIABLE karandils_mace_taken no} [/event] [event] name=moveto first_time_only=no [filter] side=1 x,y={X},{Y} [/filter] [message] speaker=unit message= _ "This looks like a truly ancient sarcofagus. I can barely make the inscription on it's base." [/message] [message] speaker=narrator message= _ "*Let it be known that here lies Karandil, the best of us and a true champion of light. He who defeated the accursed lich Damarcius was treacherously poisoned in his sleep by his nemesis' final henchman. His Assasin will now eternaly guard him in his final rest." [/message] {IF karandils_mace_taken equals no ( [then] {STORE_UNIT_VAR (x,y={X},{Y}) user_description item_taker_name} {VARIABLE_OP take_item_option format ( _ "Let $item_taker_name take it")} [message] speaker=unit message= _ "There seems to be a mace resting atop this tomb. Shall I take it? I'll need to smash the sarcophagus to retrieve it." [option] message=$take_item_option [command] [object] name= _ "Depraved mace" description= _ "The mace seems to glow with an inner light. It was meant to dispose of the undead." cannot_use_message=NONE image=items/karandils_mace.png duration=forever [filter] x,y={X},{Y} [/filter] [then] [removeitem] x,y={X},{Y} [/removeitem] [/then] [effect] apply_to=new_attack name= _ "Karandil's Mace" icon=attacks/mace.png type=holy range=melee damage=9 number=4 [sound] time=-200 sound=staff.wav [/sound] [sound] time=0 sound=squishy-hit.wav sound_miss=dagger-swish.wav [/sound] [/effect] [/object] {VARIABLE karandils_mace_taken yes} [/command] [/option] [option] message= _ "Leave it" [command] [allow_undo][/allow_undo] [/command] [/option] [/message] {CLEAR_VARIABLE item_taker_name} {CLEAR_VARIABLE take_item_option} [/then] )} [/event] #enddef