Difference between revisions of "A Shop Like Thing"

From The Battle for Wesnoth Wiki
m
m (automated change of forum links)
Line 3: Line 3:
 
In the first section of code, it defines on what coordinates on the map are the shops located. it also shows which sides can use them. You can take out any item in [options] tags and this code still works., as long as you have the beginning and the end bits.
 
In the first section of code, it defines on what coordinates on the map are the shops located. it also shows which sides can use them. You can take out any item in [options] tags and this code still works., as long as you have the beginning and the end bits.
  
"side=1,2,3,4
+
"side=1,2,3,4
 
x=37,34,40,37
 
x=37,34,40,37
y=1,2,2,4"
+
y=1,2,2,4"
  
 
  [event]
 
  [event]
Line 21: Line 21:
 
  [message]
 
  [message]
 
  speaker=narrator
 
  speaker=narrator
  message=_ "What items would you like to purchase?"
+
  message=_ "What items would you like to purchase?"
  
  
 
  [option]
 
  [option]
  message=_ "Sharpen Melee Weapon g:140 dmg:2"
+
  message=_ "Sharpen Melee Weapon g:140 dmg:2"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 51: Line 51:
  
 
  [option]
 
  [option]
  message=_ "Enchance Ranged Weapon g:150 dmg:2"
+
  message=_ "Enchance Ranged Weapon g:150 dmg:2"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 76: Line 76:
  
 
  [option]
 
  [option]
  message=_ "Crystal Orb g:150 dmg:+2 Magical"
+
  message=_ "Crystal Orb g:150 dmg:+2 Magical"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 101: Line 101:
  
 
  [option]
 
  [option]
  message=_ "Toughness Increase Scroll g:250 hp:10"
+
  message=_ "Toughness Increase Scroll g:250 hp:10"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 125: Line 125:
  
 
  [option]
 
  [option]
  message=_ "Flying Boots g:400 m:to 10"
+
  message=_ "Flying Boots g:400 m:to 10"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 149: Line 149:
  
 
  [option]  
 
  [option]  
  message=_ "Boot Upgrade g:400 m:+1"
+
  message=_ "Boot Upgrade g:400 m:+1"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 173: Line 173:
  
 
  [option]
 
  [option]
  message=_ "Healing Fountain g:All hp:+50"
+
  message=_ "Healing Fountain g:All hp:+50"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 198: Line 198:
  
 
  [option]
 
  [option]
  message=_ "Rage Stone g:300 atks:+1 Melee"
+
  message=_ "Rage Stone g:300 atks:+1 Melee"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 223: Line 223:
  
 
  [option]  
 
  [option]  
  message=_ "Sight Stone g:350 atks:+1 ranged"
+
  message=_ "Sight Stone g:350 atks:+1 ranged"
 
  [command]
 
  [command]
 
  [if]
 
  [if]
Line 248: Line 248:
  
 
  [option]
 
  [option]
  message=_ "Fire Scepter g:350 atks:8-1 ranged magical fire"
+
  message=_ "Fire Scepter g:350 atks:8-1 ranged magical fire"
 
  [command]  
 
  [command]  
 
  [if]   
 
  [if]   
Line 277: Line 277:
  
 
  [option]
 
  [option]
  message=_ "Ice Scepter g:350 atks:8-1 ranged magical Ice"
+
  message=_ "Ice Scepter g:350 atks:8-1 ranged magical Ice"
 
  [command]
 
  [command]
 
  [if]
 
  [if]

Revision as of 16:25, 21 January 2006

Just paste this code into your scenario: The code inside each [option] tag are different items, their attributes can easily be changed. In the first section of code, it defines on what coordinates on the map are the shops located. it also shows which sides can use them. You can take out any item in [options] tags and this code still works., as long as you have the beginning and the end bits.

"side=1,2,3,4 x=37,34,40,37 y=1,2,2,4"

[event]
name=moveto 
first_time_only=no
[filter]
side=1,2,3,4
x=37,34,40,37
y=1,2,2,4
[/filter]
[store_gold]
side=$side_number
variable=gold
[/store_gold]
[message]
speaker=narrator
message=_ "What items would you like to purchase?"


[option]
message=_ "Sharpen Melee Weapon g:140 dmg:2"
[command]
[if]
[variable]
name=gold
greater_than=140
[/variable]
[then]
[gold]
amount=-140
side=$side_number
[/gold]
[object]
[effect]
apply_to=attack
range=short
increase_damage=2
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]


[option]
message=_ "Enchance Ranged Weapon g:150 dmg:2"
[command]
[if]
[variable]
name=gold
greater_than=150
[/variable]
[then]
[gold]
side=$side_number
amount=-150
[/gold]
[object]
[effect]
apply_to=attack
range=long
increase_damage=2
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Crystal Orb g:150 dmg:+2 Magical"
[command]
[if]
[variable]
name=gold
greater_than=150
[/variable]
[then]
[gold]
amount=-150
side=$side_number
[/gold]
[object]
[effect]
apply_to=attack
special=magical
increase_damage=2
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Toughness Increase Scroll g:250 hp:10"
[command]
[if]
[variable]
name=gold
greater_than=250
[/variable]
[then]
[gold]
amount=-250
side=$side_number
[/gold]
[object]
[effect]
apply_to=hitpoints
increase_total=10
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Flying Boots g:400 m:to 10"
[command]
[if]
[variable]
name=gold
greater_than=400
[/variable]
[then]
[gold]
amount=-400
side=$side_number
[/gold]
[object] 
[effect] 
apply_to=movement
set=10
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option] 
message=_ "Boot Upgrade g:400 m:+1"
[command]
[if]
[variable]
name=gold
greater_than=400
[/variable]
[then]
[gold]
amount=-400
side=1
[/gold]
[object]
[effect]
apply_to=movement
increase=1
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option] 
[option]
message=_ "Healing Fountain g:All hp:+50"
[command]
[if]
[variable]
name=gold
greater_than=0
[/variable]
[then]
[gold]
amount=0
side=$side_number
[/gold]
[object]
[effect]
apply_to=hitpoints
increase=50
violate_max=1
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Rage Stone g:300 atks:+1 Melee"
[command]
[if]
[variable]
name=gold
greater_than=300
[/variable]
[then]
[gold]
amount=-300
side=$side_number
[/gold]
[object]
[effect]
apply_to=attack
range=short
increase_attacks=1
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option] 
message=_ "Sight Stone g:350 atks:+1 ranged"
[command]
[if]
[variable]
name=gold
greater_than=350
[/variable]
[then]
[gold]
amount=-350
side=$side_number
[/gold]
[object]
[effect]
apply_to=attack
range=long
increase_attacks=1
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Fire Scepter g:350 atks:8-1 ranged magical fire"
[command] 
[if]  
[variable]
name=gold
greater_than=350
[/variable]
[then]
[gold]
amount=-350
side=$side_number
[/gold]
[object]
[effect]
apply_to=new_attack
name=Fire Scepter
type=fire
special=magical
range=long
damage=8
number=1
[/effect]
[/object]
[/then]
[/if]
[/command]
[/option]
[option]
message=_ "Ice Scepter g:350 atks:8-1 ranged magical Ice"
[command]
[if]
[variable]
name=gold
greater_than=350
[/variable]
[then] 
[gold]
amount=-350
side=$side_number
[/gold]
[object]
[effect]
apply_to=new_attack
name=Ice Scepter
type=cold
special=magical
range=long
damage=8
 number=1
[/effect] 
[/object]  [/then]
[/if]  
[/command]
[/option]
##########################closing tags
[/message]
[/event]