diff options
Diffstat (limited to 'example')
17 files changed, 445 insertions, 21 deletions
diff --git a/example/clientdata/equip.xml b/example/clientdata/equip.xml index 0d1c1d3b..db7aeccc 100644 --- a/example/clientdata/equip.xml +++ b/example/clientdata/equip.xml @@ -1,12 +1,38 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Notes: + The id and name parameters must be unique. + The capacity parameter indicates the 'size' of the slot. + The visible parameter indicates whether the item is visible + on the map character. Hence, whether the server should send appearance + updates when making changes on it. +--> <equip-slots> - <slot name="hand" count="2" visible="true" /> - <slot name="torso" count="1" visible="true" /> - <slot name="arms" count="1" /> - <slot name="head" count="1" visible="true" /> - <slot name="legs" count="1" visible="true" /> - <slot name="ring" count="1" /> - <slot name="necklace" count="1" /> - <slot name="feet" count="1" /> - <slot name="ammo" count="1" /> + <slot id="1" name="Hand" capacity="2" visible="true" weapon="true"> + <box x="8" y="123" /> + <box x="129" y="123" /> + </slot> + <slot id="2" name="Torso" capacity="1" visible="true"> + <box x="50" y="40" /> + </slot> + <slot id="3" name="Arms" capacity="1"> + <box x="8" y="78" /> + </slot> + <slot id="4" name="Head" capacity="1" visible="true"> + <box x="70" y="0" /> + </slot> + <slot id="5" name="Legs" capacity="1" visible="true"> + <box x="50" y="208" /> + </slot> + <slot id="6" name="Ring" capacity="1"> + <box x="129" y="78" /> + </slot> + <slot id="7" name="Necklace" capacity="1"> + <box x="90" y="40" /> + </slot> + <slot id="8" name="Feet" capacity="1" visible="true"> + <box x="90" y="208" /> + </slot> + <slot id="9" name="Ammo" capacity="1" ammo="true"> + <box x="8" y="168" /> + </slot> </equip-slots> diff --git a/example/clientdata/graphics/items/equipment/feet/boots.png b/example/clientdata/graphics/items/equipment/feet/boots.png Binary files differnew file mode 100644 index 00000000..9f9913ff --- /dev/null +++ b/example/clientdata/graphics/items/equipment/feet/boots.png diff --git a/example/clientdata/graphics/items/equipment/legs/pants.png b/example/clientdata/graphics/items/equipment/legs/pants.png Binary files differnew file mode 100644 index 00000000..c50daf22 --- /dev/null +++ b/example/clientdata/graphics/items/equipment/legs/pants.png diff --git a/example/clientdata/graphics/items/equipment/weapons/weapon-dagger-dagger.png b/example/clientdata/graphics/items/equipment/weapons/weapon-dagger-dagger.png Binary files differnew file mode 100644 index 00000000..cdfc3708 --- /dev/null +++ b/example/clientdata/graphics/items/equipment/weapons/weapon-dagger-dagger.png diff --git a/example/clientdata/graphics/sprites/equipment/feet/boots-female.png b/example/clientdata/graphics/sprites/equipment/feet/boots-female.png Binary files differnew file mode 100644 index 00000000..ba984324 --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/feet/boots-female.png diff --git a/example/clientdata/graphics/sprites/equipment/feet/boots-female.xml b/example/clientdata/graphics/sprites/equipment/feet/boots-female.xml new file mode 100644 index 00000000..4bb2fffe --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/feet/boots-female.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<sprite name="player" action="stand"> + + <imageset name="base" src="graphics/sprites/equipment/feet/boots-female.png|W" width="64" height="64" /> + + <include file="equipment/feet/boots-male.xml"/> + +</sprite> diff --git a/example/clientdata/graphics/sprites/equipment/feet/boots-male.png b/example/clientdata/graphics/sprites/equipment/feet/boots-male.png Binary files differnew file mode 100644 index 00000000..f441c5b0 --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/feet/boots-male.png diff --git a/example/clientdata/graphics/sprites/equipment/feet/boots-male.xml b/example/clientdata/graphics/sprites/equipment/feet/boots-male.xml new file mode 100644 index 00000000..7edbcef6 --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/feet/boots-male.xml @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<sprite name="player" action="stand"> + + <imageset name="base" src="graphics/sprites/equipment/feet/boots-male.png|W" width="64" height="64" /> + + <action name="stand" imageset="base"> + <animation direction="down"> + <frame index="0" /> + </animation> + <animation direction="left"> + <frame index="18" /> + </animation> + <animation direction="up"> + <frame index="36" /> + </animation> + <animation direction="right"> + <frame index="54" /> + </animation> + </action> + + <action name="walk" imageset="base"> + <animation direction="down"> + <sequence start="1" end="6" delay="75" /> + </animation> + <animation direction="left"> + <sequence start="19" end="24" delay="75" /> + </animation> + <animation direction="up"> + <sequence start="37" end="42" delay="75" /> + </animation> + <animation direction="right"> + <sequence start="55" end="60" delay="75" /> + </animation> + </action> + + <action name="sit" imageset="base"> + <animation direction="down"> + <frame index="7" /> + </animation> + <animation direction="left"> + <frame index="25" /> + </animation> + <animation direction="up"> + <frame index="43" /> + </animation> + <animation direction="right"> + <frame index="61" /> + </animation> + </action> + + <action name="dead" imageset="base"> + <animation direction="down"> + <frame index="8" /> + </animation> + <animation direction="left"> + <frame index="26" /> + </animation> + <animation direction="up"> + <frame index="44" /> + </animation> + <animation direction="right"> + <frame index="62" /> + </animation> + </action> + + <action name="attack" imageset="base"> + <animation direction="down"> + <sequence start="9" end="12" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="27" end="30" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="45" end="48" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="63" end="66" delay="75" /> + <end /> + </animation> + </action> + + <action name="attack_bow" imageset="base"> + <animation direction="down"> + <sequence start="13" end="17" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="31" end="35" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="49" end="53" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="67" end="71" delay="75" /> + <end /> + </animation> + </action> + +</sprite> diff --git a/example/clientdata/graphics/sprites/equipment/legs/pants-female.png b/example/clientdata/graphics/sprites/equipment/legs/pants-female.png Binary files differnew file mode 100644 index 00000000..ad8c2e0e --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/legs/pants-female.png diff --git a/example/clientdata/graphics/sprites/equipment/legs/pants-female.xml b/example/clientdata/graphics/sprites/equipment/legs/pants-female.xml new file mode 100644 index 00000000..4f5dbcdf --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/legs/pants-female.xml @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<sprite name="player" action="stand"> + + <imageset name="base" src="graphics/sprites/equipment/legs/pants-female.png" width="64" height="64" /> + + <action name="stand" imageset="base"> + <animation direction="down"> + <frame index="0" /> + </animation> + <animation direction="left"> + <frame index="18" /> + </animation> + <animation direction="up"> + <frame index="36" /> + </animation> + <animation direction="right"> + <frame index="54" /> + </animation> + </action> + + <action name="walk" imageset="base"> + <animation direction="down"> + <sequence start="1" end="6" delay="75" /> + </animation> + <animation direction="left"> + <sequence start="19" end="24" delay="75" /> + </animation> + <animation direction="up"> + <sequence start="37" end="42" delay="75" /> + </animation> + <animation direction="right"> + <sequence start="55" end="60" delay="75" /> + </animation> + </action> + + <action name="sit" imageset="base"> + <animation direction="down"> + <frame index="7" /> + </animation> + <animation direction="left"> + <frame index="25" /> + </animation> + <animation direction="up"> + <frame index="43" /> + </animation> + <animation direction="right"> + <frame index="61" /> + </animation> + </action> + + <action name="dead" imageset="base"> + <animation direction="down"> + <frame index="8" /> + </animation> + <animation direction="left"> + <frame index="26" /> + </animation> + <animation direction="up"> + <frame index="44" /> + </animation> + <animation direction="right"> + <frame index="62" /> + </animation> + </action> + + <action name="attack" imageset="base"> + <animation direction="down"> + <sequence start="9" end="12" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="27" end="30" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="45" end="48" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="63" end="66" delay="75" /> + <end /> + </animation> + </action> + + <action name="attack_bow" imageset="base"> + <animation direction="down"> + <sequence start="13" end="17" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="31" end="35" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="49" end="53" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="67" end="71" delay="75" /> + <end /> + </animation> + </action> + +</sprite> diff --git a/example/clientdata/graphics/sprites/equipment/legs/pants-male.png b/example/clientdata/graphics/sprites/equipment/legs/pants-male.png Binary files differnew file mode 100644 index 00000000..f8415753 --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/legs/pants-male.png diff --git a/example/clientdata/graphics/sprites/equipment/legs/pants-male.xml b/example/clientdata/graphics/sprites/equipment/legs/pants-male.xml new file mode 100644 index 00000000..3a90c6aa --- /dev/null +++ b/example/clientdata/graphics/sprites/equipment/legs/pants-male.xml @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<sprite name="player" action="stand"> + + <imageset name="base" src="graphics/sprites/equipment/legs/pants-male.png" width="64" height="64" /> + + <action name="stand" imageset="base"> + <animation direction="down"> + <frame index="0" /> + </animation> + <animation direction="left"> + <frame index="18" /> + </animation> + <animation direction="up"> + <frame index="36" /> + </animation> + <animation direction="right"> + <frame index="54" /> + </animation> + </action> + + <action name="walk" imageset="base"> + <animation direction="down"> + <sequence start="1" end="6" delay="75" /> + </animation> + <animation direction="left"> + <sequence start="19" end="24" delay="75" /> + </animation> + <animation direction="up"> + <sequence start="37" end="42" delay="75" /> + </animation> + <animation direction="right"> + <sequence start="55" end="60" delay="75" /> + </animation> + </action> + + <action name="sit" imageset="base"> + <animation direction="down"> + <frame index="7" /> + </animation> + <animation direction="left"> + <frame index="25" /> + </animation> + <animation direction="up"> + <frame index="43" /> + </animation> + <animation direction="right"> + <frame index="61" /> + </animation> + </action> + + <action name="dead" imageset="base"> + <animation direction="down"> + <frame index="8" /> + </animation> + <animation direction="left"> + <frame index="26" /> + </animation> + <animation direction="up"> + <frame index="44" /> + </animation> + <animation direction="right"> + <frame index="62" /> + </animation> + </action> + + <action name="attack" imageset="base"> + <animation direction="down"> + <sequence start="9" end="12" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="27" end="30" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="45" end="48" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="63" end="66" delay="75" /> + <end /> + </animation> + </action> + + <action name="attack_bow" imageset="base"> + <animation direction="down"> + <sequence start="13" end="17" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="31" end="35" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="49" end="53" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="67" end="71" delay="75" /> + <end /> + </animation> + </action> + +</sprite> diff --git a/example/clientdata/graphics/sprites/weapons/weapon-dagger.xml b/example/clientdata/graphics/sprites/weapons/weapon-dagger.xml new file mode 100644 index 00000000..1909aff6 --- /dev/null +++ b/example/clientdata/graphics/sprites/weapons/weapon-dagger.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<sprite name="player" action="stand"> + <imageset name="dagger" src="graphics/sprites/weapons/weapon-sword.png" width="64" height="64" /> + + <action name="default" imageset="dagger"> + </action> + + <action name="attack_stab" imageset="dagger"> + <animation direction="down"> + <sequence start="0" end="3" delay="75" /> + <end /> + </animation> + <animation direction="left"> + <sequence start="4" end="7" delay="75" /> + <end /> + </animation> + <animation direction="up"> + <sequence start="8" end="11" delay="75" /> + <end /> + </animation> + <animation direction="right"> + <sequence start="12" end="15" delay="75" /> + <end /> + </animation> + </action> + +</sprite>
\ No newline at end of file diff --git a/example/clientdata/items.xml b/example/clientdata/items.xml index 6f72185b..13733cc4 100644 --- a/example/clientdata/items.xml +++ b/example/clientdata/items.xml @@ -76,7 +76,7 @@ description="A trinket with refreshing powers." image="usable/usable-regenerative-trinket.png" value="25"> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="hpr2" value="1.05" /> <modifier attribute="cap1" value="-50" /> </effect> @@ -90,7 +90,7 @@ <modifier attribute="hpr4" value="2.0" duration="30" /> <consumes /> </effect> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="cap1" value="-110" /> </effect> </item> @@ -102,7 +102,7 @@ <modifier attribute="mspd" value="1.3" duration="50" /> <cooldown value="150" /> </effect> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="cap1" value="-400" /> </effect> </item> @@ -119,7 +119,7 @@ <autoattack basespeed="166" range="2" base="50" skill="102" > <bonus attribute="0" value="1.0" /> </autoattack> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="cap1" value="-2000" /> </effect> </effect> @@ -136,12 +136,29 @@ <autoattack basespeed="166" range="5" base="50" skill="106" > <bonus attribute="0" value="1.5" /> </autoattack> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="cap1" value="-2000" /> </effect> </effect> <sprite>weapons/weapon-bow.xml</sprite> </item> + <item id="10" max-per-slot="3" name="Dagger" attack-action="attack_stab" + description="A simple dagger." + image="equipment/weapons/weapon-dagger-dagger.png" + value="20"> + <equip> + <slot type="hand" required="1" /> + </equip> + <effect trigger="equip"> + <autoattack basespeed="166" range="1" base="50" skill="100" > + <bonus attribute="0" value="1.5" /> + </autoattack> + <effect trigger="in-inventory"> + <modifier attribute="cap1" value="-2000" /> + </effect> + </effect> + <sprite>weapons/weapon-dagger.xml</sprite> + </item> <!-- Example of equippable items --> <item id="7" max-per-slot="1" name="Leather shirt" @@ -154,13 +171,45 @@ <effect trigger="equip"> <modifier attribute="def1" value="5" /> </effect> - <effect trigger="existence"> + <effect trigger="in-inventory"> <modifier attribute="cap1" value="-250" /> </effect> <sprite gender="male">equipment/chest/chest-leather-male.xml</sprite> <sprite gender="female">equipment/chest/chest-leather-female.xml</sprite> </item> - + <item id="11" max-per-slot="2" name="Pants" + description="Simple pants." + image="equipment/legs/pants.png" + value="50"> + <equip> + <slot type="legs" required="1" /> + </equip> + <effect trigger="equip"> + <modifier attribute="def1" value="5" /> + </effect> + <effect trigger="in-inventory"> + <modifier attribute="cap1" value="-250" /> + </effect> + <sprite gender="male">equipment/legs/pants-male.xml</sprite> + <sprite gender="female">equipment/legs/pants-female.xml</sprite> + </item> + <item id="12" max-per-slot="1" name="Boots" + description="Simple boots." + image="equipment/feet/boots.png|W:#4f2d29,c89078" + value="40"> + <equip> + <slot type="feet" required="1" /> + </equip> + <effect trigger="equip"> + <modifier attribute="def1" value="5" /> + </effect> + <effect trigger="in-inventory"> + <modifier attribute="cap1" value="-250" /> + </effect> + <sprite gender="male">equipment/feet/boots-male.xml|#4f2d29,c89078</sprite> + <sprite gender="female">equipment/feet/boots-female.xml|#4f2d29,c89078</sprite> + </item> + <!-- example crafting ingredients --> <item id="8" max-per-slot="99" name="Iron" description="Combine with one wood to create a sword" diff --git a/example/clientdata/specials.xml b/example/clientdata/specials.xml index d49f12b3..c234f667 100644 --- a/example/clientdata/specials.xml +++ b/example/clientdata/specials.xml @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <specials> <set name="Magic"> - <special id="1" name="Test Spell 1" /> - <special id="2" name="Test Spell 2" /> - <special id="3" name="Test Spell 3" /> + <special id="1" name="Test Spell 1" active="true" recharge="true" /> + <special id="2" name="Test Spell 2" active="true" recharge="true" /> + <special id="3" name="Test Spell 3" active="true" recharge="true" /> + <special id="4" name="Passive Special 1" active="false" /> </set> </specials> diff --git a/example/serverdata/permissions.xml b/example/serverdata/permissions.xml index c07bfae2..6ad941d6 100644 --- a/example/serverdata/permissions.xml +++ b/example/serverdata/permissions.xml @@ -22,6 +22,7 @@ <allow>@attribute</allow> <allow>@charwarp</allow> <allow>@killmonsters</allow> + <allow>@getpos</allow> </class> <class level="4"> <alias>gm</alias> diff --git a/example/serverdata/scripts/maps/desert.lua b/example/serverdata/scripts/maps/desert.lua index d11be2fb..728b5f05 100644 --- a/example/serverdata/scripts/maps/desert.lua +++ b/example/serverdata/scripts/maps/desert.lua @@ -28,12 +28,12 @@ atinit(function() create_npc("Banker", 8, 35 * TILESIZE + TILESIZE / 2, 24 * TILESIZE + TILESIZE / 2, Banker, nil) -- A simple merchant. - merchant_buy_table = { {"Candy", 10, 20}, {"Regenerative trinket", 10, 30}, {"Minor health potion", 10, 50} } + merchant_buy_table = { {"Candy", 10, 20}, {"Regenerative trinket", 10, 30}, {"Minor health potion", 10, 50}, {11, 10, 60}, {12, 10, 40} } merchant_sell_table = { {"Candy", 10, 19}, {"Sword", 10, 30}, {"Bow", 10, 200}, {"Leather shirt", 10, 300} } create_npc("Merchant", 3, 4 * TILESIZE + TILESIZE / 2, 16 * TILESIZE + TILESIZE / 2, npclib.talk(Merchant, merchant_buy_table, merchant_sell_table), nil) -- Another Merchant, selling some equipment, and buying everything... - smith_buy_table = { {"Sword", 10, 50}, {7, 10, 70} } + smith_buy_table = { {"Sword", 10, 50}, {7, 10, 70}, {10, 10, 20} } create_npc("Smith", 5, 15 * TILESIZE + TILESIZE / 2, 16 * TILESIZE + TILESIZE / 2, npclib.talk(Merchant, smith_buy_table), nil) -- The most simple NPC - Welcoming new ones around. |