Difference between revisions of "A Shop Like Thing"
m (Reverted edit of GrabberBot, changed back to last version by Sapient) |
(Changed structure of page. Added comments and updated code where I could. Added see also. Kept links but it should all make sense now.) |
||
Line 1: | Line 1: | ||
+ | Please note that this code is a bit out of date. All references to "range" should be "melee" or "ranged" now instead of "short" and "long" (Have been fixed now). There may be other parts that are out of date, particularily in regards to adding specials. Check [[ReferenceWML]] on the tags just to check :) Happy coding. | ||
+ | |||
+ | == A Shop Like Thing == | ||
+ | |||
Just paste this code into your scenario: | Just paste this code into your scenario: | ||
The code inside each [option] tag are different items, their attributes can easily be changed. | The code inside each [option] tag are different items, their attributes can easily be changed. | ||
Line 23: | Line 27: | ||
message=_ "What items would you like to purchase?" | message=_ "What items would you like to purchase?" | ||
− | + | === Melee damage increase === | |
[option] | [option] | ||
message=_ "Sharpen Melee Weapon g:140 dmg:2" | message=_ "Sharpen Melee Weapon g:140 dmg:2" | ||
Line 40: | Line 44: | ||
[effect] | [effect] | ||
apply_to=attack | apply_to=attack | ||
− | range= | + | range=melee |
increase_damage=2 | increase_damage=2 | ||
[/effect] | [/effect] | ||
Line 49: | Line 53: | ||
[/option] | [/option] | ||
− | + | === Ranged damage increase === | |
[option] | [option] | ||
message=_ "Enchance Ranged Weapon g:150 dmg:2" | message=_ "Enchance Ranged Weapon g:150 dmg:2" | ||
Line 66: | Line 70: | ||
[effect] | [effect] | ||
apply_to=attack | apply_to=attack | ||
− | range= | + | range=ranged |
increase_damage=2 | increase_damage=2 | ||
[/effect] | [/effect] | ||
Line 75: | Line 79: | ||
[/option] | [/option] | ||
+ | === Extra damage and magical enhancement === | ||
+ | (May be partially out of date) | ||
[option] | [option] | ||
message=_ "Crystal Orb g:150 dmg:+2 Magical" | message=_ "Crystal Orb g:150 dmg:+2 Magical" | ||
Line 100: | Line 106: | ||
[/option] | [/option] | ||
+ | === Increase maximum HP === | ||
[option] | [option] | ||
message=_ "Toughness Increase Scroll g:250 hp:10" | message=_ "Toughness Increase Scroll g:250 hp:10" | ||
Line 124: | Line 131: | ||
[/option] | [/option] | ||
+ | === Set Movement to 10 === | ||
[option] | [option] | ||
message=_ "Flying Boots g:400 m:to 10" | message=_ "Flying Boots g:400 m:to 10" | ||
Line 148: | Line 156: | ||
[/option] | [/option] | ||
+ | === Add Extra Movement === | ||
[option] | [option] | ||
message=_ "Boot Upgrade g:400 m:+1" | message=_ "Boot Upgrade g:400 m:+1" | ||
Line 172: | Line 181: | ||
[/option] | [/option] | ||
+ | === Heal damage === | ||
+ | (May be partially out of date) | ||
[option] | [option] | ||
message=_ "Healing Fountain g:All hp:+50" | message=_ "Healing Fountain g:All hp:+50" | ||
Line 197: | Line 208: | ||
[/option] | [/option] | ||
+ | === Extra Melee attack === | ||
[option] | [option] | ||
message=_ "Rage Stone g:300 atks:+1 Melee" | message=_ "Rage Stone g:300 atks:+1 Melee" | ||
Line 213: | Line 225: | ||
[effect] | [effect] | ||
apply_to=attack | apply_to=attack | ||
− | range= | + | range=melee |
increase_attacks=1 | increase_attacks=1 | ||
[/effect] | [/effect] | ||
Line 222: | Line 234: | ||
[/option] | [/option] | ||
+ | === Extra ranged attack === | ||
[option] | [option] | ||
message=_ "Sight Stone g:350 atks:+1 ranged" | message=_ "Sight Stone g:350 atks:+1 ranged" | ||
Line 238: | Line 251: | ||
[effect] | [effect] | ||
apply_to=attack | apply_to=attack | ||
− | range= | + | range=ranged |
increase_attacks=1 | increase_attacks=1 | ||
[/effect] | [/effect] | ||
Line 247: | Line 260: | ||
[/option] | [/option] | ||
+ | === Add a weapon === | ||
+ | (May be partially out of date) | ||
[option] | [option] | ||
message=_ "Fire Scepter g:350 atks:8-1 ranged magical fire" | message=_ "Fire Scepter g:350 atks:8-1 ranged magical fire" | ||
Line 266: | Line 281: | ||
type=fire | type=fire | ||
special=magical | special=magical | ||
− | range= | + | range=ranged |
damage=8 | damage=8 | ||
number=1 | number=1 | ||
Line 276: | Line 291: | ||
[/option] | [/option] | ||
+ | === Add a weapon === | ||
+ | (May be partially out of date) | ||
[option] | [option] | ||
message=_ "Ice Scepter g:350 atks:8-1 ranged magical Ice" | message=_ "Ice Scepter g:350 atks:8-1 ranged magical Ice" | ||
Line 306: | Line 323: | ||
[/message] | [/message] | ||
[/event] | [/event] | ||
+ | |||
+ | == See Also == | ||
+ | * [[UsefulWMLFragments]] | ||
+ | * [[ReferenceWML]] | ||
+ | |||
+ | [[Category: UsefulWMLFragments]] |
Revision as of 14:27, 9 April 2007
Please note that this code is a bit out of date. All references to "range" should be "melee" or "ranged" now instead of "short" and "long" (Have been fixed now). There may be other parts that are out of date, particularily in regards to adding specials. Check ReferenceWML on the tags just to check :) Happy coding.
Contents
A Shop Like Thing
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?"
Melee damage increase
[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=melee increase_damage=2 [/effect] [/object] [/then] [/if] [/command] [/option]
Ranged damage increase
[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=ranged increase_damage=2 [/effect] [/object] [/then] [/if] [/command] [/option]
Extra damage and magical enhancement
(May be partially out of date)
[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]
Increase maximum HP
[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]
Set Movement to 10
[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]
Add Extra Movement
[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]
Heal damage
(May be partially out of date)
[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]
Extra Melee attack
[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=melee increase_attacks=1 [/effect] [/object] [/then] [/if] [/command] [/option]
Extra ranged attack
[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=ranged increase_attacks=1 [/effect] [/object] [/then] [/if] [/command] [/option]
Add a weapon
(May be partially out of date)
[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=ranged damage=8 number=1 [/effect] [/object] [/then] [/if] [/command] [/option]
Add a weapon
(May be partially out of date)
[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]