#textdomain wesnoth # # Macros for items and objects # #define ITM_WISHINGWELL X Y [item] x={X} y={Y} image=scenery/well.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [message] speaker=narrator message= _ "You have come across a wishing well. What would you like to wish for?" image=scenery/well.png [option] label= _ "A swift victory" [command] [gold] amount=-1 side=1 [/gold] [message] speaker=unit message= _ "With this golden coin, I wish that this battle end in a swift and safe victory." [/message] [/command] [/option] [option] label= _ "Lots of gold" [command] [gold] side=$side_number amount=-1 [/gold] [message] speaker=unit message= _ "I wish this single gold coin be returned ten-fold to me." [/message] [/command] [/option] [option] label= _ "Peace throughout Wesnoth." [command] [gold] side=$side_number amount=-1 [/gold] [message] speaker=unit message= _ "The only thing worth wishing for is peace throughout the land." [/message] [/command] [/option] [option] label= _ "Don’t make a wish." [/option] [/message] [/event] #enddef #define PICKUPPABLE_ITEM ID X Y CAN_TAKE_FILTER_WML IMAGE TEXT TAKE_IT_STRING LEAVE_IT_STRING CANNOT_TAKE_TEXT OBJECT_WML # This places an item on the map which can be picked up once, but allows the # player to choose whether the unit stepping on it should take it or not. # The "object" doesn't necessarily need to be an [object], any action works. # # An example which shows the: # ! {PICKUPPABLE_ITEM ring_of_hp 8 12 race=human items/ring-red.png # ! _"$unit.name finds a pretty ring. Should he pick it up?" # ! _"ring of HP^Take it" # ! _"ring of HP^Leave it" # ! _"$unit.name finds a pretty ring. But only a human can take it!" ( # ! [object] # ! name= _ "Ring of HP" # ! image=items/ring-red.png # ! description= _ "This ring grants the wearer +10 max hp!" # ! # ! [effect] # ! apply_to=hitpoints # ! increase_total=10 # ! [/effect] # ! [/object] # ! )} [item] x,y={X},{Y} image={IMAGE} [/item] [event] name=moveto first_time_only=no [filter] x,y={X},{Y} [/filter] [if] [have_unit] x,y={X},{Y} {CAN_TAKE_FILTER_WML} [/have_unit] [variable] name=item_{ID}_picked_up not_equals=yes [/variable] [then] [message] speaker=narrator message={TEXT} image={IMAGE} [option] label={TAKE_IT_STRING} [command] {OBJECT_WML} [remove_item] x,y={X},{Y} image={IMAGE} [/remove_item] [set_variable] name=item_{ID}_picked_up value=yes [/set_variable] [/command] [/option] [option] label={LEAVE_IT_STRING} [command] [allow_undo] [/allow_undo] [/command] [/option] [/message] [/then] [else] [if] [variable] name=item_{ID}_picked_up not_equals=yes [/variable] [then] [message] speaker=narrator message={CANNOT_TAKE_TEXT} image={IMAGE} side_for=$side_number # the above is used to prevent an AI side from # accidentally triggering this dialog [/message] [/then] [/if] [allow_undo] [/allow_undo] [/else] [/if] [/event] [event] name=victory [clear_variable] name=item_{ID}_picked_up [/clear_variable] [/event] #enddef #define OBJ_POTION_HEALING X Y ID [item] x={X} y={Y} image=items/potion-red.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Potion of Healing" image=items/potion-red.png duration=scenario description= _ "A feeling of well-being overwhelms the drinker." cannot_use_message= _ "You are not worthy of healing." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=hitpoints increase=10% [/effect] [/object] [/event] #enddef #define OBJ_POTION_POISON X Y ID [item] x={X} y={Y} image=items/potion-yellow.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Poison" image=items/potion-yellow.png duration=scenario description= _ "Poison is seeping through the veins of this unit at this very moment." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=status add=poisoned [/effect] [/object] [/event] #enddef #define OBJ_POTION_HOLY X Y ID {PICKUPPABLE_ITEM {ID} {X} {Y} ( side=1 [has_attack] range=melee [not] type=arcane [/not] [/has_attack] ) items/holy-water.png _"Sprinkling this water on melee weapons grants them the arcane damage type until the end of the current scenario. Should $unit.name use it?" _"holy water^Take it" _"holy water^Leave it" _"$unit.name has no need for this Holy Water! Let another take it." ( [object] name= _ "Holy Water" image=items/holy-water.png duration=scenario description= _ "This water will make melee weapons have the arcane damage type until the end of the current scenario." [effect] apply_to=attack range=melee set_type=arcane [/effect] [/object] [sound] name={SOUND_LIST:HOLY} [/sound] )} #enddef #define OBJ_POTION_STRONG X Y ID [item] x={X} y={Y} image=items/potion-red.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Potion of Strength" image=items/potion-red.png duration=scenario description= _ "Strength is given to the drinker." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=attack range=melee increase_damage=1 [/effect] [effect] apply_to=hitpoints increase_total=2 heal_full=yes [/effect] [/object] [/event] #enddef #define OBJ_POTION_DECAY X Y ID [item] x={X} y={Y} image=items/potion-blue.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Potion of Decay" image=items/potion-blue.png duration=scenario description= _ "This poor unit drank something really bad." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=hitpoints increase=-10% [/effect] [/object] [/event] #enddef #define OBJ_RING_REGENERATION X Y ID [item] x={X} y={Y} image=items/ring-red.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Ring of Regeneration" image=items/ring-red.png duration=forever description= _ "This ring will heal the bearer a little each turn." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=new_ability [abilities] {ABILITY_REGENERATES} [/abilities] [/effect] [/object] [/event] #enddef #define OBJ_RING_SLOW X Y ID [item] x={X} y={Y} image=items/ring-brown.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Ring of Slowness" image=items/ring-brown.png duration=forever description= _ "The bearer of this ring is slowed." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=status add=slowed [/effect] [/object] [/event] #enddef #define OBJ_STAFF_SPEED X Y ID [item] x={X} y={Y} image=items/staff.png [/item] [event] name=moveto first_time_only=no [filter] x={X} y={Y} [/filter] [object] id={ID} name= _ "Staff of Swiftness" image=items/staff.png duration=forever description= _ "This staff will grant the bearer swift movement." cannot_use_message= _ "Only magical beings can wield such an object." [filter] x={X} y={Y} [/filter] [then] [remove_item] x,y={X},{Y} [/remove_item] [/then] [effect] apply_to=movement increase=2 [/effect] [/object] [/event] #enddef #wmllint: markcheck off #define LIGHTNING_ANIMATION NAME_STRING DIRECTION_NUMBER #"Effect generating a new animation that throws lightning in a specified direction." [effect] apply_to=new_animation id={NAME_STRING}_{DIRECTION_NUMBER} [attack_anim] [filter_attack] name={NAME_STRING} [/filter_attack] {LIGHTNING_BOLT {DIRECTION_NUMBER}} {SOUND:HIT_AND_MISS lightning.ogg lightning-miss.ogg -200} [/attack_anim] [/effect] #enddef #define OBJ_TRIDENT_STORM X Y ID {PICKUPPABLE_ITEM {ID} {X} {Y} ( race=merman [not] [has_attack] name="storm trident" [/has_attack] [/not] ) items/storm-trident.png _"Should $unit.name pick up the trident?" _"storm trident^Take it" _"storm trident^Leave it" _"$unit.name cannot use this Storm Trident! Let one of the merfolk who can wield it have it." ( [object] name= _ "Storm Trident" image=items/storm-trident.png duration=forever description= _ "This trident gives merfolk the power to throw lightning at their enemies." [effect] apply_to=new_attack name="storm trident" description= _ "storm trident" icon=attacks/lightning.png type=fire range=ranged [specials] {WEAPON_SPECIAL_MAGICAL} [/specials] damage=14 number=2 [/effect] {LIGHTNING_ANIMATION "storm trident" 1} {LIGHTNING_ANIMATION "storm trident" 2} {LIGHTNING_ANIMATION "storm trident" 3} [/object] )} #enddef #wmllint: markcheck on #define SCEPTRE_OF_FIRE_EFFECT [effect] apply_to=new_attack name=sceptre of fire description= _ "sceptre of fire" icon=attacks/fireball.png type=fire range=ranged [specials] {WEAPON_SPECIAL_MAGICAL} [/specials] damage=15 number=4 [/effect] [effect] apply_to=new_animation id="sceptre of fire" [attack_anim] [filter_attack] name=sceptre of fire [/filter_attack] {MISSILE_FRAME_FIREBALL_XY 0 0} start_time=-200 [frame] sound=fire.wav [/frame] [/attack_anim] [/effect] #enddef