├── env.php ├── map.swf ├── .htaccess ├── mapmini.swf ├── images ├── cup.gif ├── logo.png ├── Thumbs.db ├── items │ ├── 1.gif │ ├── 1.png │ ├── 2.gif │ ├── 2.png │ ├── 3.gif │ ├── 3.png │ ├── 4.gif │ ├── 4.png │ ├── 5.png │ ├── Thumbs.db │ └── noimage.gif ├── r7_logo.png ├── sigtag.png ├── spacer.gif ├── bars_grey.gif ├── bars_red.gif ├── town_bank.png ├── town_buy.png ├── town_duel.png ├── town_hall.png ├── town_inn.png ├── town_maps.png ├── town_post.png ├── background.jpg ├── background1.jpg ├── background2.jpg ├── background3.jpg ├── background4.jpg ├── background5.jpg ├── bars_green.gif ├── bars_redend.gif ├── bars_yellow.gif ├── compass_01.png ├── compass_02.png ├── compass_03.png ├── compass_04.png ├── r7_copyright.png ├── sigbotback.png ├── town_gamble.png ├── town_guilds.png ├── users │ ├── Thumbs.db │ ├── nopicture.gif │ └── Jamin85462030.gif ├── bars_greenend.gif └── bars_yellowend.gif ├── templates ├── guild_disband.php ├── pvp_challenged.php ├── panels_right.php ├── town_enter.php ├── explore_quickheal.php ├── explore_drop_accept.php ├── pvp_decline.php ├── explore.php ├── pvp_declined.php ├── guild_members.php ├── pvp_challenge.php ├── users_verified.php ├── story_teleport.php ├── mailbox_sent.php ├── town_inn2.php ├── town_buy3.php ├── town_halloffame.php ├── town_map3.php ├── mailbox_listoutrow.php ├── mailbox_listrow.php ├── panels_middle.php ├── town_map1.php ├── town_map2.php ├── users_levelup2.php ├── guild_leave.php ├── pvp_mini.php ├── users_levelspell2.php ├── town_buy2_empty.php ├── story_monster.php ├── fight_new.php ├── guild_news.php ├── town_pvplist.php ├── pvp_new.php ├── town_bank2.php ├── town_buy_olditemrow.php ├── town_buy2_full.php ├── users_charlistnew.php ├── guild_remove.php ├── users_chardelete.php ├── explore_drop_itemrow.php ├── mailbox_letterout.php ├── users_charlistrow.php ├── mailbox_listout.php ├── users_levelspell1.php ├── town_inn1.php ├── town_buy1.php ├── guild_list.php ├── story_item.php ├── mailbox_list.php ├── botcheck.php ├── town_halloffamerow.php ├── login.php ├── guild_apply.php ├── pvp_win.php ├── pvp_wait.php ├── explore_drop.php ├── explore_verify.php ├── users_levelup1.php ├── statusbars.php ├── town_buy_itemrow.php ├── fight_level.php ├── fight_win.php ├── fight_monsteronly.php ├── pvp_turn.php ├── pvp_lose.php ├── mailbox_letter.php ├── panels_left.php ├── users_charedit.php ├── fight_levelup.php ├── fight_levelupspell.php ├── town_gamble1.php ├── users_charlist.php ├── primary_min.php ├── guild_homelow.php ├── fight_turn.php ├── town_bank1.php ├── fight_lose.php ├── misc_babblebox.php ├── guild_homehigh.php ├── mailbox_new.php ├── mailbox_reply.php ├── panels_bottom.php ├── users_settings.php ├── users_charnew.php ├── users_register1.php ├── primary.php ├── town.php ├── users_onlinechar.php ├── misc_showmap.php ├── guild_homemid.php ├── users_profile.php ├── guild_edit.php ├── guild_create.php └── primary_new.php ├── config.php ├── verify.php ├── LICENSE ├── css └── primary.css ├── scripts └── tooltip.js ├── cookies.php ├── login.php ├── globals.php ├── sigbot.php ├── mapmini.php ├── README.md ├── map.php ├── pvpmini.php ├── misc.php ├── index.php ├── lib2.php ├── fightmods.php ├── spells.php ├── panels.php ├── lib.php └── story.php /env.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /map.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/map.swf -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteRule ^sigbot/([0-9]+).png$ sigbot.php?id=$1 [L] -------------------------------------------------------------------------------- /mapmini.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/mapmini.swf -------------------------------------------------------------------------------- /images/cup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/cup.gif -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/logo.png -------------------------------------------------------------------------------- /images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/Thumbs.db -------------------------------------------------------------------------------- /images/items/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/1.gif -------------------------------------------------------------------------------- /images/items/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/1.png -------------------------------------------------------------------------------- /images/items/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/2.gif -------------------------------------------------------------------------------- /images/items/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/2.png -------------------------------------------------------------------------------- /images/items/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/3.gif -------------------------------------------------------------------------------- /images/items/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/3.png -------------------------------------------------------------------------------- /images/items/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/4.gif -------------------------------------------------------------------------------- /images/items/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/4.png -------------------------------------------------------------------------------- /images/items/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/5.png -------------------------------------------------------------------------------- /images/r7_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/r7_logo.png -------------------------------------------------------------------------------- /images/sigtag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/sigtag.png -------------------------------------------------------------------------------- /images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/spacer.gif -------------------------------------------------------------------------------- /images/bars_grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_grey.gif -------------------------------------------------------------------------------- /images/bars_red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_red.gif -------------------------------------------------------------------------------- /images/town_bank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_bank.png -------------------------------------------------------------------------------- /images/town_buy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_buy.png -------------------------------------------------------------------------------- /images/town_duel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_duel.png -------------------------------------------------------------------------------- /images/town_hall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_hall.png -------------------------------------------------------------------------------- /images/town_inn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_inn.png -------------------------------------------------------------------------------- /images/town_maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_maps.png -------------------------------------------------------------------------------- /images/town_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_post.png -------------------------------------------------------------------------------- /images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background.jpg -------------------------------------------------------------------------------- /images/background1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background1.jpg -------------------------------------------------------------------------------- /images/background2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background2.jpg -------------------------------------------------------------------------------- /images/background3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background3.jpg -------------------------------------------------------------------------------- /images/background4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background4.jpg -------------------------------------------------------------------------------- /images/background5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/background5.jpg -------------------------------------------------------------------------------- /images/bars_green.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_green.gif -------------------------------------------------------------------------------- /images/bars_redend.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_redend.gif -------------------------------------------------------------------------------- /images/bars_yellow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_yellow.gif -------------------------------------------------------------------------------- /images/compass_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/compass_01.png -------------------------------------------------------------------------------- /images/compass_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/compass_02.png -------------------------------------------------------------------------------- /images/compass_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/compass_03.png -------------------------------------------------------------------------------- /images/compass_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/compass_04.png -------------------------------------------------------------------------------- /images/items/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/Thumbs.db -------------------------------------------------------------------------------- /images/r7_copyright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/r7_copyright.png -------------------------------------------------------------------------------- /images/sigbotback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/sigbotback.png -------------------------------------------------------------------------------- /images/town_gamble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_gamble.png -------------------------------------------------------------------------------- /images/town_guilds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/town_guilds.png -------------------------------------------------------------------------------- /images/users/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/users/Thumbs.db -------------------------------------------------------------------------------- /images/bars_greenend.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_greenend.gif -------------------------------------------------------------------------------- /images/bars_yellowend.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/bars_yellowend.gif -------------------------------------------------------------------------------- /images/items/noimage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/items/noimage.gif -------------------------------------------------------------------------------- /images/users/nopicture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/users/nopicture.gif -------------------------------------------------------------------------------- /images/users/Jamin85462030.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renderse7en/dragon-scourge/HEAD/images/users/Jamin85462030.gif -------------------------------------------------------------------------------- /templates/guild_disband.php: -------------------------------------------------------------------------------- 1 |
5 |
6 | 7 |
8 | END; 9 | 10 | ?> -------------------------------------------------------------------------------- /templates/pvp_challenged.php: -------------------------------------------------------------------------------- 1 | 5 | You have been challenged to a duel by {{charname}} (Level {{level}}).
6 | Duels Won: {{pvpwins}}
7 | Duels Lost: {{pvplosses}}
8 | Highest Character Defeated: {{pvphighest}}

9 | Do you accept?

10 |
11 | 12 |
13 | END; 14 | 15 | ?> -------------------------------------------------------------------------------- /templates/panels_right.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/town_enter.php: -------------------------------------------------------------------------------- 1 | enter this town. 19 | END; 20 | 21 | ?> -------------------------------------------------------------------------------- /templates/explore_quickheal.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/explore_drop_accept.php: -------------------------------------------------------------------------------- 1 |
19 | You may now continue exploring. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/pvp_decline.php: -------------------------------------------------------------------------------- 1 |
19 | Click here to return to the game. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/explore.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/pvp_declined.php: -------------------------------------------------------------------------------- 1 |
19 | Click here to return to the game. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/guild_members.php: -------------------------------------------------------------------------------- 1 | {{name}} Members List

19 | {{guildmembers}} 20 |
21 | You may also return to town. 22 | END; 23 | 24 | ?> -------------------------------------------------------------------------------- /templates/pvp_challenge.php: -------------------------------------------------------------------------------- 1 |
19 | 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/users_verified.php: -------------------------------------------------------------------------------- 1 |
19 | Click here to continue to the Login screen. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/story_teleport.php: -------------------------------------------------------------------------------- 1 | 21 |
22 | 23 |
24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/mailbox_sent.php: -------------------------------------------------------------------------------- 1 |
19 | You may now go back to your Mailbox or return to Town. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/town_inn2.php: -------------------------------------------------------------------------------- 1 |
19 | You may return to town, or use the direction buttons on the left to continue exploring. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/town_buy3.php: -------------------------------------------------------------------------------- 1 |
19 | You may return to town, the item store, or use the direction buttons to continue exploring. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/town_halloffame.php: -------------------------------------------------------------------------------- 1 |
19 | {{halltable}} 20 | You may also return to town. 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /templates/town_map3.php: -------------------------------------------------------------------------------- 1 |
19 | You may return to town, the map store, or use the direction buttons to continue exploring. 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/mailbox_listoutrow.php: -------------------------------------------------------------------------------- 1 | 19 | {{title}} 20 | To: {{recipientname}} 21 | {{fpostdate}} 22 | 23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/mailbox_listrow.php: -------------------------------------------------------------------------------- 1 | 19 | {{new}}{{money}}{{title}} 20 | From: {{sendername}} 21 | {{fpostdate}} 22 | 23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/panels_middle.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | END; 27 | 28 | ?> -------------------------------------------------------------------------------- /templates/town_map1.php: -------------------------------------------------------------------------------- 1 |
19 | Click a town name to purchase its map.

20 | {{maptable}} 21 | If you've changed your mind, you may also return to town. 22 | END; 23 | 24 | ?> -------------------------------------------------------------------------------- /templates/town_map2.php: -------------------------------------------------------------------------------- 1 |
19 |
20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/users_levelup2.php: -------------------------------------------------------------------------------- 1 |
19 | You now have {{levelup}} points remaining to be used.

20 | You may now go back to your Extended Profile or continue playing the game. 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /templates/guild_leave.php: -------------------------------------------------------------------------------- 1 |
19 |
20 | 21 |
22 | END; 23 | 24 | ?> -------------------------------------------------------------------------------- /templates/pvp_mini.php: -------------------------------------------------------------------------------- 1 | 19 | {{metareload}} 20 | 21 | 24 | 25 | 26 | {{content}} 27 | 28 | 29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/users_levelspell2.php: -------------------------------------------------------------------------------- 1 |
19 | You now have {{levelspell}} points remaining to be used.

20 | You may now go back to your Extended Profile or continue playing the game. 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /templates/town_buy2_empty.php: -------------------------------------------------------------------------------- 1 |
19 |
20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/story_monster.php: -------------------------------------------------------------------------------- 1 | 20 |
21 | 22 |


23 | If you don't want to fight the monster yet, please continue exploring using the direction buttons or the Travel To menus. 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/fight_new.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.
19 | Monster's HP: {{monsterhp}}

20 | Command? 21 |
22 |
23 | {{spells}}
24 | 25 |
26 | END; 27 | 28 | ?> -------------------------------------------------------------------------------- /templates/guild_news.php: -------------------------------------------------------------------------------- 1 | 19 | Edit your Guild's news/info below.

20 |
21 | 22 | 23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/town_pvplist.php: -------------------------------------------------------------------------------- 1 |
19 | {{list}}
20 | If you've changed your mind, you may also return to town. 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /templates/pvp_new.php: -------------------------------------------------------------------------------- 1 | 19 | You are fighting {{charname}}.
20 | {{charname}}'s HP: {{currenthp}}

21 | Command? 22 |
23 |
24 | {{spells}}
25 | 26 |
27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /templates/town_bank2.php: -------------------------------------------------------------------------------- 1 |
19 | You are now storing {{formatbank}} gold in the bank, and you are carrying {{formatgold}} gold in your pocket.

20 | You may return to town, the bank, or use the direction buttons to continue exploring. 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /templates/town_buy_olditemrow.php: -------------------------------------------------------------------------------- 1 | 19 | {{image}} 20 | 21 | {{name}}
22 | {{attrtype}}: {{basevalue}}
23 | {{itemmods}} 24 | 25 | 26 | END; 27 | 28 | ?> -------------------------------------------------------------------------------- /templates/town_buy2_full.php: -------------------------------------------------------------------------------- 1 |
19 |
20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/users_charlistnew.php: -------------------------------------------------------------------------------- 1 |
19 | You have not made any characters yet.

20 | Click here to create your first character. 21 | END; 22 | 23 | ?> 24 | -------------------------------------------------------------------------------- /templates/guild_remove.php: -------------------------------------------------------------------------------- 1 |
19 |
20 | 21 | 22 |
23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/users_chardelete.php: -------------------------------------------------------------------------------- 1 | 19 | Deleting a character is permanent, and any data will be lost forever.

20 | Are you sure you want to delete this character?

21 | 22 | 23 | 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/explore_drop_itemrow.php: -------------------------------------------------------------------------------- 1 | 19 | {{image}} 20 | 21 | {{name}}
22 | {{attrtype}}: {{basevalue}}
23 | {{level}} 24 | {{strength}} 25 | {{dexterity}} 26 | {{energy}} 27 | {{itemmods}} 28 | 29 | 30 | END; 31 | 32 | ?> -------------------------------------------------------------------------------- /templates/mailbox_letterout.php: -------------------------------------------------------------------------------- 1 | {{recipientname}}
19 | Date: {{fpostdate}}
20 | Subject: {{title}}

21 | {{message}}

22 | New Letter | Inbox | Outbox

23 | You may also return to town. 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/users_charlistrow.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | {{avatar}} 21 | 22 | {{charname}} {{isdefault}}
23 | Level: {{level}}
24 | Exp: {{experience}}
25 | Birthday: {{fregdate}}
26 | {{sigboturl}} 27 | 28 | 29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/mailbox_listout.php: -------------------------------------------------------------------------------- 1 |
19 | {{messages}} 20 |
21 | New Letter | Inbox | Outbox

22 | You may also return to town. 23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/users_levelspell1.php: -------------------------------------------------------------------------------- 1 |
19 | You have {{levelspell}} point(s) to spend.

20 |
21 | {{spelldropdowns}} 22 | 23 |
24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/town_inn1.php: -------------------------------------------------------------------------------- 1 |
19 | A night's rest at this Inn will cost {{innprice}} gold. Is that ok?

20 |
21 | If you've changed your mind, you may also return to town. 22 | END; 23 | 24 | ?> -------------------------------------------------------------------------------- /templates/town_buy1.php: -------------------------------------------------------------------------------- 1 |
19 |
The stats for your current items are:
20 | {{olditems}}
21 |
The following items are available in this town:
22 | {{itemtable}} 23 |
24 | If you've changed your mind, you may also return to town. 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /templates/guild_list.php: -------------------------------------------------------------------------------- 1 | start your own or submit an application to join one of the Guilds listed below.

19 | If you are a member of a Guild, you can also continue to your Guild's Hall.

20 | {{guildlist}} 21 |
22 | If you've changed your mind, you may also return to town. 23 | END; 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/story_item.php: -------------------------------------------------------------------------------- 1 |
21 |
The stats for your current item are:
22 | {{olditems}}
23 |
The stats for the dropped item are:
24 | {{itemtable}}
25 |
26 | 27 |


28 | END; 29 | 30 | ?> -------------------------------------------------------------------------------- /templates/mailbox_list.php: -------------------------------------------------------------------------------- 1 |
19 | {{messages}} 20 | * = New Letter.
21 | $ = Letter contains a Money Transfer.

22 |
23 | New Letter | Inbox | Outbox

24 | You may also return to town. 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | "localhost", // MySQL server name. (Usually localhost.) 19 | "user" => "", // MySQL username. 20 | "pass" => "", // MySQL password. 21 | "name" => "", // MySQL database name. 22 | "prefix" => "sx", // Prefix for table names. 23 | "secretword" => ""); // Secret word used when hashing information for cookies. 24 | 25 | ?> -------------------------------------------------------------------------------- /templates/botcheck.php: -------------------------------------------------------------------------------- 1 | 20 | {{images}}
21 |
22 | 23 | 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/town_halloffamerow.php: -------------------------------------------------------------------------------- 1 | 19 | 20 |

{{number}}

21 | {{avatar}} 22 | 23 | {{newcharname}}
24 | Level: {{level}}
25 | Exp: {{experience}}
26 | Birthday: {{fregdate}}
27 | Duel Record: {{pvpwins}} Won / {{pvplosses}} Lost / Highest Won: {{pvphighest}} 28 | 29 | 30 | END; 31 | 32 | ?> -------------------------------------------------------------------------------- /templates/login.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 |
Username:
Password:
Remember Me? Yes.
25 | 26 | END; 27 | 28 | ?> -------------------------------------------------------------------------------- /verify.php: -------------------------------------------------------------------------------- 1 | > WHERE verifycode='$code' LIMIT 1"); 24 | if (mysql_num_rows($query) != 1) { 25 | die("Invalid account verification code."); 26 | } else { 27 | $update = doquery("UPDATE <> SET verifycode='1' WHERE verifycode='$code' LIMIT 1"); 28 | } 29 | display("Account Verification",gettemplate("users_verified"), false); 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/guild_apply.php: -------------------------------------------------------------------------------- 1 | 19 |
20 | Guild Statement for {{name}}:

21 | {{statement}} 22 |


23 | Applying for this Guild costs {{joincost}} gold. This is non-refundable. Are you sure you want to apply to this Guild?

24 |
25 | 26 |
27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /templates/pvp_win.php: -------------------------------------------------------------------------------- 1 | 19 | You are fighting {{monstername}}.

20 | {{message}} 21 | You attack {{monstername}} for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

22 | You have defeated {{monstername}}.
23 | You may now return to the game. 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/pvp_wait.php: -------------------------------------------------------------------------------- 1 | 19 | You are fighting {{charname}}.
20 | {{charname}}'s HP: {{currenthp}}

21 | {{message}} 22 | You attack {{charname}} for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

23 | 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/explore_drop.php: -------------------------------------------------------------------------------- 1 |
19 |
The stats for your current item are:
20 | {{olditems}}
21 |
The stats for the dropped item are:
22 | {{itemtable}} 23 |
24 |
25 | 26 |
27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Jamin Blount 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /templates/explore_verify.php: -------------------------------------------------------------------------------- 1 | 19 | In order to prevent macros and robots from abusing the game, you must verify that you are able to read the following image. Please enter the 6 character code you see in the image into the form box below to continue playing. Thank you.

20 | Human Verification

21 | Verification Code:
22 | 23 | 24 | END; 25 | 26 | ?> -------------------------------------------------------------------------------- /templates/users_levelup1.php: -------------------------------------------------------------------------------- 1 |
19 | Class: {{classname}}
20 | Damage Per Strength: {{damageperstrength}}
21 | Defense Per Dexterity: {{defenseperdex}}
22 | HP Per Life: {{hpperlife}}
23 | MP Per Energy: {{mpperenergy}}

24 | You have {{levelup}} point(s) to spend.

25 |
26 | {{dropdowns}} 27 | 28 |
29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/statusbars.php: -------------------------------------------------------------------------------- 1 | {{littlename}}: 19 |
 {{current}} / {{max}} 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /templates/town_buy_itemrow.php: -------------------------------------------------------------------------------- 1 | 19 | {{image}} 20 | 21 | {{name}}
22 | {{attrtype}}: {{basevalue}}
23 | Price: {{buycost}} Gold
24 | {{level}} 25 | {{strength}} 26 | {{dexterity}} 27 | {{energy}} 28 | {{itemmods}} 29 |
30 | 31 | 32 |
33 | 34 | 35 | END; 36 | 37 | ?> -------------------------------------------------------------------------------- /templates/fight_level.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.

19 | {{message}} 20 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

21 | You have defeated the {{monstername}}.
22 | You gain {{newexp}} Experience.
23 | You gain {{newgold}} Gold.

24 | You may now continue exploring. 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /templates/fight_win.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.

19 | {{message}} 20 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

21 | You have defeated the {{monstername}}.
22 | You gain {{newexp}} Experience.
23 | You gain {{newgold}} Gold.

24 | You may now continue exploring. 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /templates/fight_monsteronly.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.
19 | Monster's HP: {{monsterhp}}

20 | {{message}} 21 | The monster attacks you for ({{monsterphysdamage}}|{{monstermagicdamage}}|{{monsterfiredamage}}|{{monsterlightdamage}}) damage.

22 | Command? 23 |
24 |
25 | {{spells}}
26 | 27 |
28 | END; 29 | 30 | ?> -------------------------------------------------------------------------------- /templates/pvp_turn.php: -------------------------------------------------------------------------------- 1 | 19 | You are fighting {{charname}}.
20 | {{charname}}'s HP: {{currenthp}}

21 | {{message}} 22 | {{charname}} attacks you for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

23 | Command? 24 |
25 |
26 | {{spells}}
27 | 28 |
29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/pvp_lose.php: -------------------------------------------------------------------------------- 1 | 19 | You are fighting {{monstername}}.
20 | {{message}} 21 | {{monstername}} attacks you for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

22 | You have died.

23 | You have been sent to town given back a portion of your hit points to continue your journey.

24 | You may now continue playing, and you should probably hope that you fair better next time. 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /templates/mailbox_letter.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | {{senderavatar}} 21 | 22 | From: {{sendername}}
23 | Date: {{fpostdate}}
24 | Subject: {{title}}
25 | {{moneytransfer}} 26 |
27 | {{message}}

28 | Reply | Delete | New Letter | Inbox | Outbox

29 | You may also return to town. 30 | END; 31 | 32 | ?> -------------------------------------------------------------------------------- /templates/panels_left.php: -------------------------------------------------------------------------------- 1 | Location 19 | {{action}} {{townname}}
20 | Realm: {{worldname}}
21 | Latitude: {{latitude}}
22 | Longitude: {{longitude}}

23 |
24 | North
25 | WestEast
26 | South

27 | {{minimap}} 28 |
29 |
Travel To
30 | {{travelto}} 31 | 32 | END; 33 | 34 | ?> -------------------------------------------------------------------------------- /templates/users_charedit.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 |
Avatar:Upload an avatar:

Avatars must be 50x50 pixels & {{maxsize}}kb or smaller.
JPG, GIF, and PNG file types only.


    or    
23 | 24 | You may also continue playing the game or return to the main Characters screen 25 | END; 26 | 27 | ?> -------------------------------------------------------------------------------- /templates/fight_levelup.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.

19 | {{message}} 20 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

21 | You have defeated the {{monstername}}.
22 | You gain {{newexp}} Experience.
23 | You gain {{newgold}} Gold.

24 | You have gained a level! You have 5 Level Points to spend on your character
25 | Level points can be accessed in your Extended Profile.


26 | You may now continue exploring. 27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /templates/fight_levelupspell.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.

19 | {{message}} 20 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

21 | You have defeated the {{monstername}}.
22 | You gain {{newexp}} Experience.
23 | You gain {{newgold}} Gold.

24 | You have gained a level! You have 5 Level Points and 1 Spell Point to spend on your character
25 | Level points can be accessed in your Extended Profile.


26 | You may now continue exploring. 27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /templates/town_gamble1.php: -------------------------------------------------------------------------------- 1 |
Select a cup, enter a bet amount, and click the button to see if you win.

19 | Easy gambling gives 2-to-1 payouts. Hard gambling gives 10-to-1 payouts, but it's a lot harder to win.

20 |
21 | {{form}} 22 |
23 | Bet amount:

24 | 25 |
26 | If you've changed your mind, you can also return to town. 27 | END; 28 | 29 | ?> -------------------------------------------------------------------------------- /templates/users_charlist.php: -------------------------------------------------------------------------------- 1 |
19 | Your account currently has {{characters}} characters ({{remaining}} remaining).
20 | Your current default character is {{activecharname}}.
21 | {{newcharlink}}
22 |
23 | Select a new default character:
24 | 25 |
26 |
27 | Click on one of your characters from the list below to edit its avatar or delete it from your account.
28 | {{fullcharlist}} 29 |
30 | When you're done with your characters, you may continue playing the game. 31 | END; 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /templates/primary_min.php: -------------------------------------------------------------------------------- 1 | 19 | {{gamename}} :: {{pagetitle}} 20 | 36 | 37 | 38 | {{content}} 39 | 40 | 41 | END; 42 | 43 | ?> -------------------------------------------------------------------------------- /templates/guild_homelow.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 30 | 31 | 38 | 44 |
21 |
News
22 |
23 | {{news}}

24 | Edit 25 |
26 |
28 | {{babblebox}} 29 |
32 |
Bank
33 | Your Guild has {{bank}} gold.
34 |
35 | Deposit Gold 36 |
37 |
39 |
More Guild Functions
40 | 43 |


45 | You may also return to town or the Guild List. 46 | END; 47 | 48 | ?> -------------------------------------------------------------------------------- /templates/fight_turn.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.
19 | Monster's HP: {{monsterhp}}

20 | {{message}} 21 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

22 | The monster attacks you for ({{monsterphysdamage}}|{{monstermagicdamage}}|{{monsterfiredamage}}|{{monsterlightdamage}}) damage.

23 | Command? 24 |
25 |
26 | {{spells}}
27 | 28 |
29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/town_bank1.php: -------------------------------------------------------------------------------- 1 | 19 | function autopop(theValue) { 20 | document.bank.amount.value = theValue; 21 | } 22 | 23 | Storing money in the bank prevents you from losing it if you die in combat. However, your money in the bank cannot be used when purchasing of items or maps.

24 | You are currently storing {{formatbank}} gold in the bank, and you are carrying {{formatgold}} gold in your pocket.

25 |
26 | Enter an amount and then click the Deposit or Withdraw button:
27 |
28 | Deposit All | Withdraw All

29 |
30 | If you've changed your mind, you may also return to town. 31 | END; 32 | 33 | ?> -------------------------------------------------------------------------------- /css/primary.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 10px Verdana; 3 | padding: 0px; 4 | } 5 | 6 | table { 7 | font: 10px Verdana; 8 | } 9 | 10 | td { 11 | vertical-align: top; 12 | } 13 | 14 | input { 15 | font: 10px Verdana; 16 | } 17 | select { 18 | font: 10px Verdana; 19 | } 20 | 21 | img { 22 | border-style: none; 23 | } 24 | 25 | a { 26 | color: #996600; 27 | text-decoration: none; 28 | font-weight: bold; 29 | } 30 | 31 | a:hover { 32 | color: #663300; 33 | } 34 | 35 | .main { 36 | border: solid 1px black; 37 | } 38 | 39 | .grey { 40 | color: #999999; 41 | } 42 | 43 | .red { 44 | color: #ff0000; 45 | } 46 | 47 | .blue { 48 | color: #0000ff; 49 | } 50 | 51 | .big { 52 | font: 11px Verdana; 53 | background-color: #dddddd; 54 | border: solid 1px #aaaaaa; 55 | padding: 2px; 56 | margin-bottom: 3px; 57 | } 58 | 59 | .babble1 { 60 | background-color: #eeeeee; 61 | font: 10px Verdana; 62 | margin: 0px; 63 | padding: 2px; 64 | } 65 | 66 | .babble2 { 67 | background-color: #ffffff; 68 | font: 10px Verdana; 69 | margin: 0px; 70 | padding: 2px; 71 | } 72 | 73 | .tip { 74 | font: 10px/12px Arial,Helvetica,sans-serif; 75 | border: solid 1px #666666; 76 | width: 270px; 77 | padding: 1px; 78 | position: absolute; 79 | z-index: 100; 80 | visibility: hidden; 81 | color: #333333; 82 | top: 20px; 83 | left: 90px; 84 | background-color: #ffffcc; 85 | layer-background-color: #ffffcc; 86 | } -------------------------------------------------------------------------------- /templates/fight_lose.php: -------------------------------------------------------------------------------- 1 | {{monstername}}.
19 | Monster's HP: {{monsterhp}}

20 | {{message}} 21 | You attack the monster for ({{playerphysdamage}}|{{playermagicdamage}}|{{playerfiredamage}}|{{playerlightdamage}}) damage.

22 | The monster attacks you for ({{monsterphysdamage}}|{{monstermagicdamage}}|{{monsterfiredamage}}|{{monsterlightdamage}}) damage.

23 | You have died.

24 | As a consequence, you've lost half of your gold and {{deathpenalty}} percent of your experience. You have been sent to town given back a portion of your hit points to continue your journey.

25 | You may now continue playing, and you should probably hope that you fair better next time. 26 | END; 27 | 28 | ?> -------------------------------------------------------------------------------- /scripts/tooltip.js: -------------------------------------------------------------------------------- 1 | // Extended Tooltip Javascript 2 | // copyright 9th August 2002, 3rd July 2005 3 | // by Stephen Chapman, Felgall Pty Ltd 4 | 5 | // permission is granted to use this javascript provided that the below code is not altered 6 | var DH = 0;var an = 0;var al = 0;var ai = 0;if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi, wS) {if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); if (al) return wS ? document.all[oi].style: document.all[oi]; if (an) return document.layers[oi];} 7 | function pw() {return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;} 8 | function mouseX(evt) {if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return null;} 9 | function mouseY(evt) {if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return null;} 10 | function popUp(evt,oi) {if (DH) {var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; if (!an) {lv += 'px';tv += 'px';} ds.left = lv; ds.top = tv; ds.visibility = "visible";}}} -------------------------------------------------------------------------------- /templates/misc_babblebox.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | Babblebox 21 | 37 | 38 | 39 | {{shouts}} 40 |
41 |
42 | 43 |
44 |
45 | 46 | 47 | END; 48 | 49 | ?> -------------------------------------------------------------------------------- /templates/guild_homehigh.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | 16 | 17 | 25 | 32 | 33 | 40 | 48 |
7 |
News
8 |
9 | {{news}}

10 | Edit 11 |
12 |
14 | {{babblebox}} 15 |
18 |
Bank
19 | Your Guild has {{bank}} gold.
20 |
21 | Send Gold to {{memberselect}}
22 | Deposit Gold 23 |
24 |
26 |
Member Ranks
27 | Select a member to promote/demote.

28 |
29 | {{memberselect}}
30 |
31 |
34 |
Applications
35 | Select a user to approve/deny.

36 |
37 | {{appselect}} 38 |
39 |
41 |
More Guild Functions
42 | 47 |


49 | You may also return to town or the Guild List. 50 | END; 51 | 52 | ?> -------------------------------------------------------------------------------- /templates/mailbox_new.php: -------------------------------------------------------------------------------- 1 | * are required. 19 | The Send Gold field allows you to attach money to the letter, which will be given to the recipient when they read it.

20 | Note that there is a 5 Gold postage fee for sending all letters.

21 |
22 | 23 | 24 | 25 | 26 | 30 | 31 |
To:* (Character Name)
Subject:*
Send Gold:
27 | Message:
28 | 29 |
32 |
33 |
34 | New Letter | Inbox | Outbox

35 | You may also return to town. 36 | END; 37 | 38 | ?> -------------------------------------------------------------------------------- /templates/mailbox_reply.php: -------------------------------------------------------------------------------- 1 | * are required. 19 | The Send Gold field allows you to attach money to the letter, which will be given to the recipient when they read it.

20 | Note that there is a 5 Gold postage fee for sending all letters.

21 |
22 | 23 | 24 | 25 | 26 | 30 | 31 |
To:{{sendername}}
Subject:*
Send Gold:
27 | Message:
28 | 29 |
32 |

33 | Original Message:

34 | {{message}}

35 | New Letter | Inbox | Outbox

36 | You may also return to town. 37 | END; 38 | 39 | ?> -------------------------------------------------------------------------------- /templates/panels_bottom.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 |
Level: {{level}}
25 | Exp: {{experience}}
26 | Gold: {{gold}}
27 | Extended Profile 28 |
31 | 32 | {{levelup}}
33 | {{levelspell}}
34 | {{quickheal}} 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
Weapon:
Armor:
Helmet:
Shield:
{{weapon}}
{{armor}}
{{helmet}}
{{shield}}
43 | 44 | 45 | 46 | 47 | 48 |
{{hpbar}}
{{mpbar}}
{{tpbar}}
49 | 50 | 51 | 52 | END; 53 | 54 | ?> -------------------------------------------------------------------------------- /cookies.php: -------------------------------------------------------------------------------- 1 | > WHERE username='$theuser[1]' LIMIT 1")); 31 | if ($row == false) { err("Invalid cookie data (Error 1). Please clear cookies and log in again."); } 32 | if ($row["id"] != $theuser[0]) { err("Invalid cookie data (Error 2). Please clear cookies and log in again."); } 33 | if (md5($row["password"] . "--" . $dbsettings["secretword"]) !== $theuser[2]) { err("Invalid cookie data (Error 3). Please clear cookies and log in again."); } 34 | 35 | // If we've gotten this far, cookie should be valid, so write a new one. 36 | $newcookie = implode(" ",$theuser); 37 | if ($theuser[3] == 1) { $expiretime = time()+31536000; } else { $expiretime = 0; } 38 | setcookie ($controlrow["cookiename"], $newcookie, $expiretime, "/", $controlrow["cookiedomain"], 0); 39 | 40 | } 41 | 42 | return $row; 43 | 44 | } 45 | 46 | ?> -------------------------------------------------------------------------------- /templates/users_settings.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 27 | 28 | 29 | 30 |
Change Password: 21 | Leave these fields blank if you wish to keep your old password.

22 | Old Password:

23 | New Password:

24 | Verify New Password:



25 |
Email Address:
Image Format:
(Older versions of Internet Explorer may not be compatible with transparent PNG images. If you notice problems with item and monster images, please select GIF.)
Show Minimap:
(The maps in this game are Flash-based. Setting this option to 'No' may increase page download times if you have a slow internet connection.)
31 | 32 | When you're done with your account, you may continue playing the game. 33 | END; 34 | 35 | ?> -------------------------------------------------------------------------------- /templates/users_charnew.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
Character Name:
Character names must be 30 characters or less.


Avatar:Upload an avatar:

Avatars must be 50x50 pixels & {{maxsize}}kb or smaller.
JPG, GIF, and PNG file types only.


Character Class:
Hover over a class name for more information:
{{classdesc}}


Difficulty:
Default Character: Yes.
Place a check in the box if you want your new character to become the current default for your account.

27 | 28 | You may also continue playing the game or return to the main Characters screen. 29 | END; 30 | 31 | ?> -------------------------------------------------------------------------------- /templates/users_register1.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Username:
Usernames can contain letters, numbers, dashes and underscores.


Password:
Verify Password:


Email Address:
Verify Email Address:


Image Format:
(Older versions of Internet Explorer may not be compatible with transparent PNG images. If you notice problems with item and monster images, please select GIF.)
Show Minimap:
(The maps in this game are Flash-based. Setting this option to 'No' may increase page download times if you have a slow internet connection.)
29 | 30 | END; 31 | 32 | ?> -------------------------------------------------------------------------------- /templates/primary.php: -------------------------------------------------------------------------------- 1 | 19 | {{gamename}} :: {{pagetitle}} 20 | 21 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | 37 | 38 | 39 | 43 | 49 | 53 | 54 | 55 | 56 | 57 |
31 |
32 | {{gamename}} 33 | 34 | {{topnav}} 35 |
36 |
40 |
41 | {{leftnav}} 42 |
44 |
45 |
{{pagetitle}}
46 | {{content}} 47 |
48 |
50 |
51 | {{rightnav}} 52 |
{{bottomnav}}
58 | END; 59 | 60 | ?> -------------------------------------------------------------------------------- /templates/town.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
The Inn


Buy Items


Buy Maps


The Bank


The Post Office {{unread}}


The Gambling Hall


Duelling Grounds
The Guild Hall
Hall of Fame
36 |
37 | END; 38 | 39 | ?> -------------------------------------------------------------------------------- /templates/users_onlinechar.php: -------------------------------------------------------------------------------- 1 | 19 | 22 | 23 | 35 | 55 | 56 | 57 |
20 |
{{profcharpicture}}
{{newcharname}}
21 |
24 | Class: {{charclass}}
25 | Level: {{level}}

26 | 27 | Hit Points: {{maxhp}}
28 | Magic Points: {{maxmp}}

29 | 30 | Weapon: {{item1name}}
31 | Armor: {{item2name}}
32 | Shield: {{item4name}}
33 | Helmet: {{item3name}}
34 |
36 | Strength: {{strength}}
37 | Dexterity: {{dexterity}}
38 | Physical Damage: {{physattack}}
39 | Physical Defense: {{physdefense}}

40 | 41 | Energy: {{energy}}
42 | Magic Damage: {{magicattack}}
43 | Magic Defense: {{magicdefense}}

44 | 45 | Fire Damage: {{fireattack}}
46 | Fire Defense: {{firedefense}}

47 | 48 | Lightning Damage: {{lightattack}}
49 | Lightning Defense: {{lightdefense}}

50 | 51 | Duels Won: {{pvpwins}}
52 | Duels Lost: {{pvplosses}}
53 | Highest Character Defeated: {{pvphighest}}

54 |
Return to the game.
58 | END; 59 | 60 | ?> 61 | -------------------------------------------------------------------------------- /templates/misc_showmap.php: -------------------------------------------------------------------------------- 1 | 19 | Map 20 | 36 | 37 |
38 |
39 | 40 | 41 | 42 | 43 |
44 | Town | You | Player 45 |
46 | 47 | END; 48 | 49 | ?> -------------------------------------------------------------------------------- /templates/guild_homemid.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 30 | 31 | 39 | 46 | 47 | 54 | 62 |
21 |
News
22 |
23 | {{news}}

24 | Edit 25 |
26 |
28 | {{babblebox}} 29 |
32 |
Bank
33 | Your Guild has {{bank}} gold.
34 |
35 | Send Gold to {{memberselect}}
36 | Deposit Gold 37 |
38 |
40 |
Member Ranks
41 | Select a member to promote/demote.

42 |
43 | {{memberselect}}
44 |
45 |
48 |
Applications
49 | Select a user to approve/deny.

50 |
51 | {{appselect}} 52 |
53 |
55 |
More Guild Functions
56 | 61 |


63 | You may also return to town or the Guild List. 64 | END; 65 | 66 | ?> -------------------------------------------------------------------------------- /templates/users_profile.php: -------------------------------------------------------------------------------- 1 | 19 | 22 | 23 | 39 | 59 | 60 | 61 |
20 |
{{profcharpicture}}
{{newcharname}}
21 |
24 | Class: {{charclass}}
25 | Gold: {{formatgold}} {{goldbonus}}
26 | Level: {{level}}
27 | Experience: {{formatexperience}} {{expbonus}}
28 | Next Level: {{formatnextlvl}}

29 | 30 | Hit Points: {{currenthp}} / {{maxhp}}
31 | Magic Points: {{currentmp}} / {{maxmp}}
32 | Travel Points: {{currenttp}} / {{maxtp}}

33 | 34 | Weapon: {{item1name}}
35 | Armor: {{item2name}}
36 | Shield: {{item4name}}
37 | Helmet: {{item3name}}
38 |
40 | Strength: {{strength}}
41 | Dexterity: {{dexterity}}
42 | Physical Damage: {{physattack}}
43 | Physical Defense: {{physdefense}}

44 | 45 | Energy: {{energy}}
46 | Magic Damage: {{magicattack}}
47 | Magic Defense: {{magicdefense}}

48 | 49 | Fire Damage: {{fireattack}}
50 | Fire Defense: {{firedefense}}

51 | 52 | Lightning Damage: {{lightattack}}
53 | Lightning Defense: {{lightdefense}}

54 | 55 | Duels Won: {{pvpwins}}
56 | Duels Lost: {{pvplosses}}
57 | Highest Character Defeated: {{pvphighest}}

58 |
Return to the game.
62 | END; 63 | 64 | ?> 65 | -------------------------------------------------------------------------------- /templates/guild_edit.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Name:{{name}}


Tagline:{{tagline}}


Name Color:
HTML color code used to display the name of your Guild, and the names of each member.
(Click here for a list of color codes.)


Tagline Color:
HTML color code used to display your Guild's tagline.
(Click here for a list of color codes.)


Cost to Join:
How much gold it will cost for a member to join your guild.


Rank 1 Title:
Lowest ranking Guild member's title.


Rank 2 Title:
2nd ranking Guild member's title.


Rank 3 Title:
3rd ranking Guild member's title.


Rank 4 Title:
4th ranking Guild member's title. These are sub-leaders for your Guild.


Rank 5 Title:
Highest ranking Guild member's title. This will be your title, as well as any other member you promote to this rank.


Opening Statement
Your Guild's introduction statement or creed.
19 | 20 | END; 21 | 22 | ?> -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | > WHERE id='1' LIMIT 1")); 31 | 32 | if (isset($_POST["submit"])) { 33 | 34 | // Setup. 35 | include("config.php"); 36 | extract($_POST); 37 | $query = doquery("SELECT * FROM <> WHERE username='$username' LIMIT 1"); 38 | $row = dorow($query); 39 | 40 | // Errors. 41 | if ($row == false) { err("Invalid username. Please go back and try again.", false, false); } 42 | if ($row["password"] != md5($password)) { err("Invalid password. Please go back and try again.", false, false); } 43 | if ($row["verifycode"] != 1) { err("You have not yet verified your account. Please click the link found in your Account Verification email before continuing. If you never received the email, please check your spam filter settings or contact the game administrator for further assistance.", false, false); } 44 | 45 | // Finish. 46 | $newcookie = $row["id"] . " " . $username . " " . md5($row["password"] . "--" . $dbsettings["secretword"]); 47 | if (isset($remember)) { $expiretime = time()+31536000; $newcookie .= " 1"; } else { $expiretime = 0; $newcookie .= " 0"; } 48 | setcookie($controlrow["cookiename"], $newcookie, $expiretime, "/", $controlrow["cookiedomain"], 0); 49 | die(header("Location: index.php")); 50 | 51 | } else { 52 | 53 | display("Log In", gettemplate("login"), false); 54 | 55 | } 56 | 57 | } 58 | 59 | function logout() { 60 | 61 | include("globals.php"); 62 | setcookie($controlrow["cookiename"], "", (time()-3600), "/", $controlrow["cookiedomain"], 0); 63 | die(header("Location: login.php?do=login")); 64 | 65 | } 66 | 67 | ?> -------------------------------------------------------------------------------- /globals.php: -------------------------------------------------------------------------------- 1 | > WHERE id='1' LIMIT 1")); 23 | 24 | // Account row. 25 | include("cookies.php"); 26 | $acctrow = checkcookies(); 27 | if ($acctrow == false && substr($_SERVER["REQUEST_URI"], -21) != "users.php?do=register") { die(header("Location: login.php?do=login")); } 28 | if ($acctrow != false && $acctrow["characters"] == 0 && substr($_SERVER["REQUEST_URI"], -20) != "users.php?do=charnew") { die(header("Location: users.php?do=charnew")); } 29 | 30 | // User row. 31 | if (substr($_SERVER["REQUEST_URI"], -19) != "login.php?do=logout") { 32 | $online = doquery("UPDATE <> SET onlinetime=NOW() WHERE id='".$acctrow["activechar"]."' LIMIT 1"); 33 | } else { 34 | $online = doquery("UPDATE <> SET onlinetime = DATE_SUB(onlinetime, INTERVAL 11 MINUTE) WHERE id='".$acctrow["activechar"]."' LIMIT 1"); 35 | } 36 | $userrow = dorow(doquery("SELECT * FROM <> WHERE id='".$acctrow["activechar"]."' LIMIT 1")); 37 | if ($userrow != false) { $userrow = array_map("stripslashes", $userrow); } 38 | 39 | // World row. 40 | $worldrow = dorow(doquery("SELECT * FROM <> WHERE id='".$userrow["world"]."' LIMIT 1")); 41 | 42 | // Town row. 43 | if ($userrow["currentaction"] == "In Town") { 44 | $townrow = dorow(doquery("SELECT * FROM <> WHERE world='".$userrow["world"]."' AND longitude='".$userrow["longitude"]."' AND latitude='".$userrow["latitude"]."' LIMIT 1")); 45 | } else { 46 | $townrow = false; 47 | } 48 | 49 | // Spells. 50 | $spells = dorow(doquery("SELECT * FROM <> ORDER BY id", "spells"), "id"); 51 | 52 | // Global fightrow. 53 | $fightrow = array( 54 | "playerphysdamage"=>0, 55 | "playermagicdamage"=>0, 56 | "playerfiredamage"=>0, 57 | "playerlightdamage"=>0, 58 | "monsterphysdamage"=>0, 59 | "monstermagicdamage"=>0, 60 | "monsterfiredamage"=>0, 61 | "monsterlightdamage"=>0, 62 | "track"=>"", 63 | "message"=>""); 64 | 65 | ?> -------------------------------------------------------------------------------- /sigbot.php: -------------------------------------------------------------------------------- 1 | > WHERE id='$id' LIMIT 1")); 23 | if (!$userrow) { die(); } 24 | $class = dorow(doquery("SELECT * FROM <> WHERE id='".$userrow["charclass"]."' LIMIT 1")); 25 | $world = dorow(doquery("SELECT * FROM <> WHERE id='".$userrow["world"]."' LIMIT 1")); 26 | 27 | // Start our image. 28 | $img = imagecreatefrompng("images/sigbotback.png"); 29 | $textcolor = imagecolorallocate($img, 0, 0, 0); 30 | 31 | // Add the user's name. 32 | if ($userrow["guildtag"] != "") { 33 | $tagcolor = hexToRGB(ltrim($userrow["tagcolor"], "#")); 34 | $namecolor = hexToRGB(ltrim($userrow["namecolor"], "#")); 35 | $tagcolor = imagecolorallocate($img, $tagcolor[0], $tagcolor[1], $tagcolor[2]); 36 | $namecolor = imagecolorallocate($img, $namecolor[0], $namecolor[1], $namecolor[2]); 37 | imagestring($img, 3, 40, 5, "[" . $userrow["guildtag"] . "]", $tagcolor); 38 | imagestring($img, 3, 78, 5, $userrow["charname"], $namecolor); 39 | } else { 40 | imagestring($img, 3, 50, 5, $userrow["charname"], $textcolor); 41 | } 42 | 43 | // Add some other stats. 44 | imagestring($img, 2, 78, 20, "Level " . $userrow["level"] . " " . $class["name"], $textcolor); 45 | imagestring($img, 2, 78, 30, "In " . $world["name"], $textcolor); 46 | 47 | // Is online or not? 48 | if ($userrow["fonlinetime"] >= (mktime() - 600)) { 49 | imagestring($img, 2, 78, 40, "Currently: Online", $textcolor); 50 | } else { 51 | imagestring($img, 2, 78, 40, "Currently: Offline", $textcolor); 52 | } 53 | 54 | // Final output to browser. 55 | header("Content-type: image/png"); 56 | imagepng($img); 57 | imagedestroy($img); 58 | 59 | function hexToRGB($hexstr) { 60 | 61 | $hexstr = strtolower($hexstr); 62 | $replace = array("a"=>10, "b"=>11, "c"=>12, "d"=>13, "e"=>14, "f"=>15); 63 | $hex = array(); 64 | for ($i = 0; $i < 6; $i++) { 65 | if (isset($replace[$hexstr{$i}])) { $hex[$i] = $replace[$hexstr{$i}]; } else { $hex[$i] = $hexstr{$i}; } 66 | } 67 | 68 | $red = ($hex[0] * 16) + $hex[1]; 69 | $green = ($hex[2] * 16) + $hex[3]; 70 | $blue = ($hex[4] * 16) + $hex[5]; 71 | 72 | return array($red,$green,$blue); 73 | } 74 | 75 | ?> -------------------------------------------------------------------------------- /mapmini.php: -------------------------------------------------------------------------------- 1 | > WHERE world='".$worldrow["id"]."'")); 25 | $text .= "towns=".sizeof($towns)."&"; 26 | $count = 0; 27 | foreach($towns as $a=>$b) { 28 | $lat = $b["latitude"]; 29 | $lon = $b["longitude"]; 30 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); } 31 | if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 32 | $text .= "town".$count."_x=".$x."&"; 33 | $text .= "town".$count."_y=".$y."&"; 34 | $count++; 35 | } 36 | 37 | // Then do your character. 38 | $lat = $userrow["latitude"]; 39 | $lon = $userrow["longitude"]; 40 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); } 41 | if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 42 | $text .= "player_x=".$x."&"; 43 | $text .= "player_y=".$y."&"; 44 | 45 | // Then do everyone else. 46 | $users = dorow(doquery("SELECT * FROM <> WHERE world='".$worldrow["id"]."' AND UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' AND id != '".$userrow["id"]."'"), "id"); 47 | if ($users) { $text .= "users=".count($users)."&"; } else { $text .= "users=0&"; } 48 | $count = 0; 49 | if ($users != false) { 50 | foreach ($users as $a => $b) { 51 | $lat = $b["latitude"]; 52 | $lon = $b["longitude"]; 53 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); } 54 | if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 55 | $text .= "user".$count."_x=".$x."&"; 56 | $text .= "user".$count."_y=".$y."&"; 57 | $count++; 58 | } 59 | } 60 | 61 | // Then do quests. 62 | if ($userrow["story"] != "0" && $userrow["story"] != "9999") { 63 | 64 | $lat = $userrow["storylat"]; 65 | $lon = $userrow["storylon"]; 66 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); } 67 | if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 68 | 69 | $text .= "story=1&"; 70 | $text .= "story_x=".$x."&"; 71 | $text .= "story_y=".$y."&"; 72 | $text .= "story_name=Quest&"; 73 | 74 | } else { $text .= "story=0&"; } 75 | 76 | echo($text); 77 | 78 | ?> -------------------------------------------------------------------------------- /templates/guild_create.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
Name:
Your Guild's full name.


Tagline:
A short abbreviation or tagline for your Guild. For example, if your Guild name is "Lords of Carnage," your tagline might be "LoC." This will appear in brackets in front of each member's name.


Name Color:
HTML color code used to display the name of your Guild, and the names of each member.
(Click here for a list of color codes.)


Tagline Color:
HTML color code used to display your Guild's tagline.
(Click here for a list of color codes.)


Cost to Join:
How much gold it will cost for a member to join your guild.


Rank 1 Title:
Lowest ranking Guild member's title.


Rank 2 Title:
2nd ranking Guild member's title.


Rank 3 Title:
3rd ranking Guild member's title.


Rank 4 Title:
4th ranking Guild member's title. These are sub-leaders for your Guild.


Rank 5 Title:
Highest ranking Guild member's title. This will be your title, as well as any other member you promote to this rank.


Opening Statement
Your Guild's introduction statement or creed.
NOTES: The cost for creating a guild is {{guildstartup}} gold.

Ranks 1 through 3 are nominal only and are all treated identically in the game. Rank 4 members can distribute Guild funds, promote other members up to Rank 3, and demote/remove members. Rank 5 members are Guild Leaders, and can do all Rank 4 tasks as well as promote members to ranks 4 and 5, and disband the Guild.
20 | 21 | END; 22 | 23 | ?> -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dragon Scourge 2 | - See also: [Dragon Knight](https://github.com/renderse7en/dragon-knight) 3 | - [Live Demo](http://www.dragonscourge.com/play) 4 | 5 | Many years ago, when I was young and dumb, I wrote a [simple little game](https://github.com/renderse7en/dragon-knight) based on the game *Dragon Warrior* for the NES. It was fun, it helped me learn how to code, and a lot of people liked it. 6 | 7 | After that, I begin writing a sequel, of sorts, called Dragon Scourge. I never really finished that game. Life got in the way. Got married. Got a job. Had kids. All that. 8 | 9 | I'm now turning it over to the open source community. 10 | 11 | As with Dragon Knight before it, please keep some things in mind: 12 | - It's super old. It may not even work on modern versions of PHP. It may have security issues. I have no idea. 13 | - I have moved on with my life, and am no longer changing or doing anything with this game. 14 | - I am not providing help or support. You're on your own. 15 | - I am not accepting pull requests. If you fork this, you are welcome to do whatever you want, but no changes will be merged back into this. 16 | - Quite frankly, I don't really suggest that you use this as is. It's probably better as an inspiration for your own project. 17 | - Have fun with this. I gave it a lot of love a long time ago. I hope it inspires you to give something a lot of love as well. 18 | - This Git repo represents the final released version, Beta 5 Build 20, originally released 9/2/2007. 19 | 20 | # System Requirements 21 | - PHP (4.1 and higher) 22 | - MySQL 23 | - zlib compression enabled on your server (optional) 24 | 25 | # Installation Instructions 26 | 1. Clone this repo or download the zip. 27 | 2. Create a new database for Dragon Scourge to use, if you don't already have one set up. 28 | 3. Edit `config.php` to include the correct values for your database setup. 29 | 4. Upload the contents of the Dragon Scourge folder to your site. 30 | 5. Using a MySQL client such as HeidiSQL or PHPMyAdmin, run the contents of `install.sql` on the database you created. 31 | 7. Enjoy the game. 32 | 33 | # License 34 | MIT License 35 | 36 | Copyright (c) 2017 renderse7en 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy 39 | of this software and associated documentation files (the "Software"), to deal 40 | in the Software without restriction, including without limitation the rights 41 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42 | copies of the Software, and to permit persons to whom the Software is 43 | furnished to do so, subject to the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be included in all 46 | copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 54 | SOFTWARE. 55 | -------------------------------------------------------------------------------- /map.php: -------------------------------------------------------------------------------- 1 | > WHERE world='".$worldrow["id"]."'")); 25 | $text .= "towns=".sizeof($towns)."&"; 26 | $count = 0; 27 | foreach($towns as $a=>$b) { 28 | $lat = $b["latitude"]; 29 | $lon = $b["longitude"]; 30 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); } 31 | if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 32 | $text .= "town".$count."_x=".$x."&"; 33 | $text .= "town".$count."_y=".$y."&"; 34 | $text .= "town".$count."_name=".$b["name"]."&"; 35 | $count++; 36 | } 37 | 38 | // Then do your character. 39 | $lat = $userrow["latitude"]; 40 | $lon = $userrow["longitude"]; 41 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); } 42 | if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 43 | $text .= "player_x=".$x."&"; 44 | $text .= "player_y=".$y."&"; 45 | $text .= "player_name=".$userrow["charname"]."&"; 46 | 47 | // Then do everyone else. 48 | $users = dorow(doquery("SELECT * FROM <> WHERE world='".$worldrow["id"]."' AND UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' AND id != '".$userrow["id"]."'"), "id"); 49 | if ($users) { $text .= "users=".count($users)."&"; } else { $text .= "users=0&"; } 50 | $count = 0; 51 | if ($users != false) { 52 | foreach ($users as $a => $b) { 53 | $lat = $b["latitude"]; 54 | $lon = $b["longitude"]; 55 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); } 56 | if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 57 | $text .= "user".$count."_x=".$x."&"; 58 | $text .= "user".$count."_y=".$y."&"; 59 | $text .= "user".$count."_name=".$b["charname"]."&"; 60 | $count++; 61 | } 62 | } 63 | 64 | // Then do quests. 65 | if ($userrow["story"] != "0" && $userrow["story"] != "9999") { 66 | 67 | $lat = $userrow["storylat"]; 68 | $lon = $userrow["storylon"]; 69 | if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); } 70 | if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); } 71 | 72 | $text .= "story=1&"; 73 | $text .= "story_x=".$x."&"; 74 | $text .= "story_y=".$y."&"; 75 | $text .= "story_name=Quest&"; 76 | 77 | } else { $text .= "story=0&"; } 78 | 79 | echo($text); 80 | 81 | ?> -------------------------------------------------------------------------------- /templates/primary_new.php: -------------------------------------------------------------------------------- 1 | 19 | {{gamename}} :: {{pagetitle}} 20 | 40 | 41 |
42 | 43 | 44 | 45 | 51 | 52 | 53 | 56 | 62 | 65 | 66 | 67 | 68 | 69 | 70 | 75 | 76 |
46 | 47 | 48 | 49 |
{{topnav}}
50 |
54 | {{leftnav}} 55 |
57 |
58 |
{{pagetitle}}
59 | {{content}} 60 |
61 |
63 | {{rightnav}} 64 |
{{middlenav}}
71 |
72 | {{bottomnav}} 73 |
74 |
77 | 78 | 79 | 80 | 81 | 82 |
Version {{version}} / {{numqueries}} Queries / {{totaltime}} SecondsDragon Scourge © 2003-2005 by renderse7en
83 | 84 |
85 | 86 | END; 87 | 88 | ?> -------------------------------------------------------------------------------- /pvpmini.php: -------------------------------------------------------------------------------- 1 | > WHERE id='".$userrow["currentpvp"]."' LIMIT 1")); 22 | 23 | // Check for timeout. 24 | if ($row["fturntime"] < (time() - $controlrow["pvptimeout"])) { 25 | 26 | // If the PVP was accepted, whoever timed out loses. 27 | if ($row["accepted"] == 1) { 28 | $monsterrow = dorow(doquery("SELECT * FROM <> WHERE id='".$row["player2id"]."' LIMIT 1")); 29 | if ($monsterrow["level"] > $userrow["pvphighest"]) { $highest = ", pvphighest='".$monsterrow["level"]."'"; } else { $highest = ""; } 30 | doquery("UPDATE <> SET currentpvp='0', currentaction='In Town', pvpwins = pvpwins + 1 $highest WHERE id='".$row["player1id"]."' LIMIT 1"); 31 | doquery("UPDATE <> SET currentpvp='0', currentaction='In Town', pvplosses = pvplosses + 1 WHERE id='".$row["player2id"]."' LIMIT 1"); 32 | } else { 33 | doquery("UPDATE <> SET currentpvp='0', currentaction='In Town' WHERE id='".$row["player1id"]."' OR id='".$row["player2id"]."' LIMIT 2"); 34 | } 35 | 36 | $query2 = doquery("DELETE FROM <> WHERE id='".$row["id"]."'"); 37 | $pagerow["content"] = "The other player did not respond and this Duel has timed out. Thanks for playing.

This window will refresh to the main screen in ".$controlrow["pvprefresh"]." seconds."; 38 | $pagerow["target"] = "_top"; 39 | $pagerow["parentreload"] = "onload=\"setTimeout('top.location.href=\'index.php\'',".($controlrow["pvprefresh"] * 1000).")\""; 40 | $pagerow["metareload"] = ""; 41 | 42 | $page = parsetemplate(gettemplate("pvp_mini"),$pagerow); 43 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 44 | echo $page; 45 | die(); 46 | 47 | } 48 | 49 | // No timeout so check for whose turn it is. 50 | if ($row["playerturn"] == $userrow["id"]) { 51 | 52 | $pagerow["content"] = "Please hold while this window refreshes to the game screen..."; 53 | $pagerow["target"] = "_top"; 54 | $pagerow["metareload"] = ""; 55 | $pagerow["parentreload"] = "onload=\"setTimeout('top.location.href=\'pvp.php\'',".($controlrow["pvprefresh"] * 100).")\""; 56 | $pagerow["metareload"] = ""; 57 | 58 | $page = parsetemplate(gettemplate("pvp_mini"),$pagerow); 59 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 60 | echo $page; 61 | die(); 62 | 63 | } else { 64 | 65 | $pagerow["content"] = "Waiting for player to respond..."; 66 | $pagerow["target"] = "_self"; 67 | $pagerow["parentreload"] = ""; 68 | $pagerow["metareload"] = ""; 69 | 70 | $page = parsetemplate(gettemplate("pvp_mini"),$pagerow); 71 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 72 | echo $page; 73 | die(); 74 | 75 | } 76 | 77 | ?> -------------------------------------------------------------------------------- /misc.php: -------------------------------------------------------------------------------- 1 | > SET extra1='1' WHERE id='".$acctrow["id"]."' LIMIT 1"); 21 | $page = "\"Please don't take everything I say so seriously.\"
---Trent Reznor"; 22 | display("LMFAO!", $page); 23 | 24 | } 25 | 26 | function version() { 27 | 28 | global $controlrow, $version, $bname, $bdate, $bnumber; 29 | $year = date("Y"); 30 | if ($controlrow["moddedby"] != "") { 31 | $moddedby = "
" . $controlrow["moddedby"] . ""; 32 | } else { 33 | $moddedby = ""; 34 | } 35 | 36 | $page = << 38 | renderse7en

39 | Dragon Scourge
© 2003-$year by renderse7en


40 | 41 | 42 | 43 | 44 | 45 | 46 | $moddedby 47 |
Version Number:$version
Build Number:$bnumber
Build Name:$bname
Build Date:$bdate
View the Changelog
48 | 49 | END; 50 | 51 | display("Version Information",$page); 52 | 53 | } 54 | 55 | function babblebox2() { 56 | 57 | global $userrow, $controlrow; 58 | 59 | if (isset($_GET["g"])) { 60 | $guild = $userrow["guild"]; 61 | $g = "WHERE guild='$guild'"; 62 | $g2 = ", guild='$guild'"; 63 | $row["guild"] = "&g=yes"; 64 | } else { 65 | $g = "WHERE guild='0'"; 66 | $row["guild"] = ""; 67 | } 68 | 69 | if (isset($_POST["babble"])) { 70 | 71 | // Add new shout. 72 | if (trim($_POST["babble"]) != "") { 73 | $insert = doquery("INSERT INTO <> SET id='', posttime=NOW(), charid='".$userrow["id"]."', charname='".$userrow["charname"]."', content='".$_POST["babble"]."' $g2"); 74 | } 75 | 76 | // Only keep 20 shouts in DB at any one time. 77 | $check = doquery("SELECT * FROM <> $g"); 78 | if (mysql_num_rows($check) > 20) { 79 | $delete1 = dorow(doquery("SELECT id FROM <> $g ORDER BY id LIMIT 1")); 80 | $delete2 = doquery("DELETE FROM <> WHERE id='".$delete1["id"]."' LIMIT 1"); 81 | } 82 | 83 | // And we're done. 84 | die(header("Location: index.php?do=babblebox".$row["guild"])); 85 | 86 | } 87 | 88 | $shouts = dorow(doquery("SELECT * FROM <> $g ORDER BY id LIMIT 20"), "id"); 89 | $row["shouts"] = ""; 90 | $background = 1; 91 | if ($shouts != false) { 92 | foreach ($shouts as $a => $b) { 93 | $row["shouts"] .= "
[".$b["charname"]."] ".$b["content"]."
\n"; 94 | if ($background == 1) { $background = 2; } else { $background = 1; } 95 | } 96 | } else { 97 | $row["shouts"] = "
No shouts.
"; 98 | } 99 | 100 | $page = parsetemplate(gettemplate("misc_babblebox"),$row); 101 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 102 | echo $page; 103 | die(); 104 | 105 | } 106 | 107 | function showmap() { 108 | 109 | global $controlrow; 110 | 111 | $page = gettemplate("misc_showmap"); 112 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 113 | echo $page; 114 | die(); 115 | 116 | } 117 | 118 | 119 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib2.php: -------------------------------------------------------------------------------- 1 | $b) { 24 | $querystring .= "$a='$b',"; 25 | } 26 | $querystring = rtrim($querystring, ","); 27 | 28 | $query = doquery("UPDATE <> SET $querystring WHERE id='".$userrow["id"]."' LIMIT 1"); 29 | 30 | } 31 | 32 | function builditem($prefix, $baseitem, $suffix, $modrow) { // Copy of town.php's builditem(). 33 | 34 | global $controlrow, $acctrow, $userrow; 35 | 36 | // First setup the basic item attributes. 37 | $baseitem["baseid"] = $baseitem["id"]; 38 | $baseitem["fullid"] = $baseitem["id"]; 39 | $baseitem["attrtype"] = $modrow[$baseitem["basename"]]["prettyname"]; 40 | $baseitem["basevalue"] = $baseitem["baseattr"]; 41 | $baseitem["image"] = ""; 42 | 43 | // Next give pretty names to any item modifiers. 44 | $baseitem["itemmods"] = ""; 45 | for($j=1; $j<7; $j++) { 46 | if ($baseitem["mod".$j."name"] != "") { 47 | $baseitem["itemmods"] .= $modrow[$baseitem["mod".$j."name"]]["prettyname"] . ": +" . $baseitem["mod".$j."attr"]; 48 | if ($modrow[$baseitem["mod".$j."name"]]["percent"] == 1) { $baseitem["itemmods"] .= "%"; } 49 | $baseitem["itemmods"] .= "
\n"; 50 | } 51 | } 52 | 53 | // Add prefix mods if applicable. 54 | if ($prefix != false) { 55 | $baseitem["fullid"] = $prefix["id"] . "," . $baseitem["fullid"]; 56 | $baseitem["name"] = $prefix["name"] . " " . $baseitem["name"]; 57 | $baseitem["buycost"] += $prefix["buycost"]; 58 | $baseitem["sellcost"] += $prefix["sellcost"]; 59 | $baseitem["reqlevel"] = max($baseitem["reqlevel"], $prefix["reqlevel"]); 60 | $baseitem["reqstrength"] += $prefix["reqstrength"]; 61 | $baseitem["reqenergy"] += $prefix["reqenergy"]; 62 | $baseitem["reqdexterity"] += $prefix["reqdexterity"]; 63 | $baseitem["itemmods"] .= $modrow[$prefix["basename"]]["prettyname"] . ": +" . $prefix["baseattr"]; 64 | if ($modrow[$prefix["basename"]]["percent"] == 1) { $baseitem["itemmods"] .= "%"; } 65 | $baseitem["itemmods"] .= "
\n"; 66 | } else { $baseitem["fullid"] = "0," . $baseitem["fullid"]; } 67 | 68 | // Add suffix mods if applicable. 69 | if ($suffix != false) { 70 | $baseitem["fullid"] .= "," . $suffix["id"]; 71 | $baseitem["name"] .= " " . $suffix["name"]; 72 | $baseitem["buycost"] += $suffix["buycost"]; 73 | $baseitem["sellcost"] += $suffix["sellcost"]; 74 | $baseitem["reqlevel"] = max($baseitem["reqlevel"], $suffix["reqlevel"]); 75 | $baseitem["reqstrength"] += $suffix["reqstrength"]; 76 | $baseitem["reqenergy"] += $suffix["reqenergy"]; 77 | $baseitem["reqdexterity"] += $suffix["reqdexterity"]; 78 | $baseitem["itemmods"] .= $modrow[$suffix["basename"]]["prettyname"] . ": +" . $suffix["baseattr"]; 79 | if ($modrow[$suffix["basename"]]["percent"] == 1) { $baseitem["itemmods"] .= "%"; } 80 | $baseitem["itemmods"] .= "
\n"; 81 | } else { $baseitem["fullid"] .= ",0"; } 82 | 83 | // Check requirements. 84 | $baseitem["requirements"] = true; 85 | if ($baseitem["reqlevel"] == 1) { $baseitem["level"] = ""; } else { 86 | $baseitem["level"] = "Required Level: " . $baseitem["reqlevel"]; 87 | if ($baseitem["reqlevel"] > $userrow["level"]) { 88 | $baseitem["level"] = "".$baseitem["level"].""; 89 | $baseitem["requirements"] = false; 90 | } 91 | $baseitem["level"] .= "
\n"; 92 | } 93 | if ($baseitem["reqstrength"] == 0) { $baseitem["strength"] = ""; } else { 94 | $baseitem["strength"] = "Required Strength: " . $baseitem["reqstrength"]; 95 | if ($baseitem["reqstrength"] > $userrow["strength"]) { 96 | $baseitem["strength"] = "".$baseitem["strength"].""; 97 | $baseitem["requirements"] = false; 98 | } 99 | $baseitem["strength"] .= "
\n"; 100 | } 101 | if ($baseitem["reqdexterity"] == 0) { $baseitem["dexterity"] = ""; } else { 102 | $baseitem["dexterity"] = "Required Dexterity: " . $baseitem["reqdexterity"]; 103 | if ($baseitem["reqdexterity"] > $userrow["dexterity"]) { 104 | $baseitem["dexterity"] = "".$baseitem["dexterity"].""; 105 | $baseitem["requirements"] = false; 106 | } 107 | $baseitem["dexterity"] .= "
\n"; 108 | } 109 | if ($baseitem["reqenergy"] == 0) { $baseitem["energy"] = ""; } else { 110 | $baseitem["energy"] = "Required Energy: " . $baseitem["reqenergy"]; 111 | if ($baseitem["reqenergy"] > $userrow["energy"]) { 112 | $baseitem["energy"] = "".$baseitem["energy"].""; 113 | $baseitem["requirements"] = false; 114 | } 115 | $baseitem["energy"] .= "
\n"; 116 | } 117 | 118 | if ($controlrow["showitemimages"] == 1) { 119 | $baseitem["image"] = "\"".$baseitem["name"]."\""; 120 | } elseif ($controlrow["showitemimages"] == 2) { 121 | $baseitem["image"] = "\"".$baseitem["name"]."\""; 122 | } else { 123 | $baseitem["image"] = ""; 124 | } 125 | 126 | // And send it back. 127 | return $baseitem; 128 | 129 | } 130 | 131 | ?> -------------------------------------------------------------------------------- /fightmods.php: -------------------------------------------------------------------------------- 1 | $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } 29 | } else { 30 | $userrow["currentmonsterhp"] += floor(($fightrow["monsterphysdamage"]+$fightrow["monstermagicdamage"]+$fightrow["monsterfiredamage"]+$fightrow["monsterlightdamage"]) * ($monsterrow["hpleech"]/100)); 31 | if ($userrow["currentmonsterhp"] > ($monsterrow["maxhp"] * $userrow["difficulty"])) { $userrow["currentmonsterhp"] = ($monsterrow["maxhp"] * $userrow["difficulty"]); } 32 | } 33 | 34 | } 35 | 36 | function mpleech() { 37 | 38 | /*********** 39 | Description: A percentage of the final damage is given back to the player's MP. 40 | Occurs: Per Turn. 41 | Applies To: Player only. 42 | ***********/ 43 | 44 | global $userrow, $fightrow; 45 | $userrow["currentmp"] += floor(($fightrow["playerphysdamage"]+$fightrow["playermagicdamage"]+$fightrow["playerfiredamage"]+$fightrow["playerlightdamage"]) * ($userrow["mpleech"]/100)); 46 | if ($userrow["currentmp"] > $userrow["maxmp"]) { $userrow["currentmp"] = $userrow["maxmp"]; } 47 | 48 | } 49 | 50 | function hpgain() { 51 | 52 | /*********** 53 | Description: A fixed number is added to player's HP. 54 | Occurs: Per Kill. 55 | Applies To: Player only. 56 | ***********/ 57 | 58 | global $userrow, $fightrow; 59 | $userrow["currenthp"] += $userrow["hpgain"]; 60 | if ($userrow["currenthp"] > $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } 61 | 62 | } 63 | 64 | function mpgain() { 65 | 66 | /*********** 67 | Description: A fixed number is added to player's MP. 68 | Occurs: Per Kill. 69 | Applies To: Player only. 70 | ***********/ 71 | 72 | global $userrow, $fightrow; 73 | $userrow["currentmp"] += $userrow["mpgain"]; 74 | if ($userrow["currentmp"] > $userrow["maxmp"]) { $userrow["currentmp"] = $userrow["maxmp"]; } 75 | 76 | } 77 | 78 | function bonusattack() { 79 | 80 | /*********** 81 | Description: Chance to deal extra damage. 82 | Occurs: Per Turn. 83 | Applies To: Player only. 84 | Written By: Anman. 85 | ***********/ 86 | 87 | global $userrow, $fightrow; 88 | 89 | if ($userrow["bonusattack"] > 0) { 90 | 91 | $first = $userrow["bonusattack"] * 0.25; 92 | $sec = $userrow["bonusattack"] * 0.5; 93 | $third = $userrow["bonusattack"] * 0.75; 94 | $rand = rand(0,100); 95 | 96 | if ($rand <= $first) { $multiplier = 2; } 97 | elseif ($rand <= $sec) { $multiplier = 1.75; } 98 | elseif ($rand <= $third) { $multiplier = 1.5; } 99 | elseif ($rand <= $userrow["bonusattack"] && $rand > $third) { $multiplier = 1.25; } 100 | else { $multiplier = 1; } 101 | 102 | $fightrow["playerphysdamage"] = floor($fightrow["playerphysdamage"] * $multiplier); 103 | $fightrow["track"] .= "bonusattack - physdamage:".$fightrow["playerphysdamage"]."\n"; 104 | 105 | } 106 | 107 | } 108 | 109 | function bonusdefense() { 110 | 111 | /*********** 112 | Description: Chance to reduce incurred damage. 113 | Occurs: Per Turn. 114 | Applies To: Player only. 115 | Written By: Anman. 116 | ***********/ 117 | 118 | global $userrow, $fightrow; 119 | 120 | if ($userrow["bonusdefense"] > 0) { 121 | 122 | $first = $userrow["bonusdefense"] * 0.25; 123 | $sec = $userrow["bonusdefense"] * 0.5; 124 | $third = $userrow["bonusdefense"] * 0.75; 125 | $rand = rand(0,100); 126 | 127 | if ($rand <= $first) { $multiplier = 0; } 128 | elseif ($rand <= $sec) { $multiplier = 0.25; } 129 | elseif ($rand <= $third) { $multiplier = 0.5; } 130 | elseif ($rand <= $userrow["bonusdefense"] && $rand > $third) { $multiplier = 0.75; } 131 | else { $multiplier = 1; } 132 | 133 | $fightrow["monsterphysdamage"] = floor($fightrow["monsterphysdamage"] * $multiplier); 134 | $fightrow["monstermagicdamage"] = floor($fightrow["monstermagicdamage"] * $multiplier); 135 | $fightrow["monsterfiredamage"] = floor($fightrow["monsterfiredamage"] * $multiplier); 136 | $fightrow["monsterlightdamage"] = floor($fightrow["monsterlightdamage"] * $multiplier); 137 | 138 | } 139 | 140 | } 141 | 142 | function bonusdefense_pvp() { 143 | 144 | /*********** 145 | Description: Chance to reduce incurred damage - PVP version. 146 | Occurs: Per Turn. 147 | Applies To: Player only. 148 | Written By: Anman. 149 | ***********/ 150 | 151 | global $userrow, $monsterrow, $fightrow; 152 | 153 | if ($userrow["bonusdefense"] > 0) { 154 | 155 | $first = $monsterrow["bonusdefense"] * 0.25; 156 | $sec = $monsterrow["bonusdefense"] * 0.5; 157 | $third = $monsterrow["bonusdefense"] * 0.75; 158 | $rand = rand(0,100); 159 | 160 | if ($rand <= $first) { $multiplier = 0; } 161 | elseif ($rand <= $sec) { $multiplier = 0.25; } 162 | elseif ($rand <= $third) { $multiplier = 0.5; } 163 | elseif ($rand <= $monsterrow["bonusdefense"] && $rand > $third) { $multiplier = 0.75; } 164 | else { $multiplier = 1; } 165 | 166 | $fightrow["playerphysdamage"] = floor($fightrow["playerphysdamage"] * $multiplier); 167 | $fightrow["playermagicdamage"] = floor($fightrow["playermagicdamage"] * $multiplier); 168 | $fightrow["playerfiredamage"] = floor($fightrow["playerfiredamage"] * $multiplier); 169 | $fightrow["playerlightdamage"] = floor($fightrow["playerlightdamage"] * $multiplier); 170 | 171 | } 172 | 173 | } 174 | 175 | ?> -------------------------------------------------------------------------------- /spells.php: -------------------------------------------------------------------------------- 1 | Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 23 | 24 | if ($failed == 0) { 25 | $userrow["currenthp"] += $spells[$id]["value"]; 26 | $userrow["currentmp"] -= $spells[$id]["mp"]; 27 | if ($userrow["currenthp"] > $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } 28 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . " and gains " . $spells[$id]["value"] . " HP.
"; 29 | } 30 | 31 | return($return); 32 | 33 | } 34 | 35 | function hurt($id) { 36 | 37 | global $userrow, $monsterrow, $fightrow, $spells; 38 | 39 | $failed = 0; 40 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 41 | 42 | if ($failed == 0) { 43 | $userrow["currentmp"] -= $spells[$id]["mp"]; 44 | $magichit = ceil(rand($spells[$id]["value"]*.75, $spells[$id]["value"])); 45 | $magicblock = ceil(rand($monsterrow["magicdefense"]*.75, $monsterrow["magicdefense"]) / 5); 46 | $fightrow["playermagicdamage"] = max($magichit - $magicblock, 0); 47 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . " for " . $fightrow["playermagicdamage"] . " damage.
"; 48 | } 49 | 50 | return($return); 51 | 52 | } 53 | 54 | function fire($id) { 55 | 56 | global $userrow, $monsterrow, $fightrow, $spells; 57 | 58 | $failed = 0; 59 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 60 | 61 | if ($failed == 0) { 62 | $userrow["currentmp"] -= $spells[$id]["mp"]; 63 | $magichit = ceil(rand($spells[$id]["value"]*.75, $spells[$id]["value"])); 64 | $magicblock = ceil(rand($monsterrow["firedefense"]*.75, $monsterrow["firedefense"]) / 5); 65 | $fightrow["playerfiredamage"] = max($magichit - $magicblock, 0); 66 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . " for " . $fightrow["playerfiredamage"] . " damage.
"; 67 | } 68 | 69 | return($return); 70 | 71 | } 72 | 73 | function light($id) { 74 | 75 | global $userrow, $monsterrow, $fightrow, $spells; 76 | 77 | $failed = 0; 78 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 79 | 80 | if ($failed == 0) { 81 | $userrow["currentmp"] -= $spells[$id]["mp"]; 82 | $magichit = ceil(rand($spells[$id]["value"]*.75, $spells[$id]["value"])); 83 | $magicblock = ceil(rand($monsterrow["lightdefense"]*.75, $monsterrow["lightdefense"]) / 5); 84 | $fightrow["playerlightdamage"] = max($magichit - $magicblock, 0); 85 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . " for " . $fightrow["playerlightdamage"] . " damage.
"; 86 | } 87 | 88 | return($return); 89 | 90 | } 91 | 92 | function prism($id) { 93 | 94 | global $userrow, $monsterrow, $fightrow, $spells; 95 | 96 | $failed = 0; 97 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 98 | 99 | if ($failed == 0) { 100 | $userrow["currentmp"] -= $spells[$id]["mp"]; 101 | $magichit = ceil(rand($spells[$id]["value"]*.75, $spells[$id]["value"])); 102 | $magicblock = ceil(rand($monsterrow["lightdefense"]*.75, $monsterrow["lightdefense"]) / 5); 103 | $fightrow["playerlightdamage"] = max($magichit - $magicblock, 0); 104 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . " for " . $fightrow["playerlightdamage"] . " damage.
"; 105 | } 106 | 107 | return($return); 108 | 109 | } 110 | 111 | // Mad crazy ninja love to Anman for writing this spell. I've cleaned it up a bit to match the format of the rest of the code, but it's his spell. 112 | function blessedstrike($id) { 113 | 114 | global $userrow, $monsterrow, $fightrow, $spells; 115 | $failed = 0; 116 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 117 | 118 | if ($failed == 0) { 119 | 120 | //now define the power of the spell. you can stack these spells, but the more you try to stack it the harder it will be to get a decent number out of the stack. Now, this spell is more of a bonus to a player compared to the defence spell. So for this reason, the ratio of stacking has been decreased from 100 to 90 and the minimum % to take of the spell is now 10% instead of 20%. 121 | $userrow["currentmp"] -= $spells[$id]["mp"]; 122 | if ($userrow["bonusattack"] == 0) { 123 | $userrow["bonusattack"] = $spells[$id]["value"]; 124 | } else { 125 | //if a more powerful inc attack spell is cast, replace the old value with the new one 126 | if ($userrow["bonusattack"] < $spells[$id]["value"]) { 127 | $userrow["bonusattack"] = $spells[$id]["value"]; 128 | } else { 129 | //if the same or a weaker spell is cast, determine the maximum stack number and then apply.. 130 | $newattmax = ((90 - $userrow["bonusattack"])+1) / 90; 131 | if ($newattmax < 0.1) { $newattmax = 0.1;} 132 | $newattmax = $spells[$id]["value"] * $newattmax; 133 | $newattmax = floor($newattmax); 134 | if ($newattmax < 1) { $newattmax = 1;} 135 | if ($spells[$id]["value"] > $newattmax) {$spells[$id]["value"] = $newattmax;} 136 | $userrow["bonusattack"] = $userrow["bonusattack"] + $spells[$id]["value"]; 137 | } 138 | if ($userrow["bonusattack"] > 200) { $userrow["bonusattack"] = 200; } 139 | // *2 damage delt will never go above 50% chance. *1.75 damage will always be 50% 140 | } 141 | 142 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . ". Future attacks will be more powerful!
"; 143 | 144 | } 145 | 146 | return($return); 147 | 148 | } 149 | 150 | // Mad crazy ninja love to Anman for writing this spell. I've cleaned it up a bit to match the format of the rest of the code, but it's his spell. 151 | function stoneskin($id) { 152 | 153 | global $userrow, $monsterrow, $fightrow, $spells; 154 | $failed = 0; 155 | if ($userrow["currentmp"] < $spells[$id]["mp"]) { $return = "Spell Failed: You do not have enough MP to cast that spell.
"; $failed = 1; } 156 | 157 | if ($failed ==0 ) { 158 | 159 | //now define the power of the spell. you can stack these spells, but the more you try to stack it the harder it will be to get a decent number out of the stack. The max will always be 100. This is because the spell works with percentages and 100 will always be the highest. 160 | $userrow["currentmp"] -= $spells[$id]["mp"]; 161 | if ($userrow["bonusdefense"] == 0) { 162 | $userrow["bonusdefense"] = $spells[$id]["value"]; 163 | } else { 164 | //if a more powerful defense spell is cast, replace the old value with the new one 165 | if ($userrow["bonusdefense"] < $spells[$id]["value"]) { 166 | $userrow["bonusdefense"] = $spells[$id]["value"]; 167 | } else { 168 | //if the same or a weaker spell is cast, determine the maximum stack number and then apply.. 169 | $newdefmax = ((100 - $userrow["bonusdefense"])+1) / 100; 170 | if ($newdefmax < 0.2) { $newdefmax = 0.2;} 171 | $newdefmax = $spells[$id]["value"] * $newdefmax; 172 | $newdefmax = floor($newdefmax); 173 | if ($newdefmax < 1) { $newdefmax = 1;} 174 | if ($spells[$id]["value"] > $newdefmax) {$spells[$id]["value"] = $newdefmax;} 175 | $userrow["bonusdefense"] = $userrow["bonusdefense"] + $spells[$id]["value"]; 176 | } 177 | if ($userrow["bonusdefense"] > 200) { $userrow["bonusdefense"] = 200;} 178 | // all damage will never go above 50% chance. 0.25% damage will always be 50% 179 | } 180 | 181 | $return = $userrow["charname"] . " casts " . $spells[$id]["name"] . ". Damage taken will be reduced!
"; 182 | 183 | } 184 | return($return); 185 | } 186 | 187 | ?> -------------------------------------------------------------------------------- /panels.php: -------------------------------------------------------------------------------- 1 | View Map

"; 51 | 52 | } else { 53 | 54 | $row["minimap"] = << 56 | 57 | 58 | 59 | 60 | 61 | THEVERYENDOFYOU; 62 | 63 | } 64 | 65 | // Travel To handling. 66 | $row["travelto"] = ""; 67 | 68 | // First we build the query string. 69 | $townstring = "("; 70 | $townslist = explode(",",$userrow["townslist"]); 71 | foreach($townslist as $a=>$b) { 72 | $townstring .= "id='$b' OR "; 73 | } 74 | $townstring = rtrim($townstring, " OR "); 75 | $townstring .= ") AND world='".$userrow["world"]."'"; 76 | 77 | // Then we do the query. 78 | $traveltoquery = dorow(doquery("SELECT id,name FROM <> WHERE $townstring ORDER BY id"), "id"); 79 | 80 | // Finally we build the link list. 81 | foreach ($traveltoquery as $a => $b) { 82 | $row["travelto"] .= "".$b["name"]."
\n"; 83 | } 84 | 85 | // And then we're done with this panel. 86 | return parsetemplate(gettemplate("panels_left"), $row); 87 | 88 | } 89 | 90 | function panelright() { 91 | 92 | global $controlrow; 93 | $row["babblebox"] = ""; 94 | $row["whosonline"] = ""; 95 | 96 | // Babblebox. 97 | if ($controlrow["showshout"] == 1) { 98 | $row["babblebox"] = "
Babblebox
"; 99 | $row["babblebox"] .= "

"; 100 | } 101 | 102 | // Who's Online. 103 | if ($controlrow["showonline"] == 1) { 104 | $row["whosonline"] = "
Who's Online
"; 105 | $users = dorow(doquery("SELECT * FROM <> WHERE UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."'"), "id"); 106 | $number = count($users); 107 | $row["whosonline"] .= "There are $number user(s) online within the last 10 minutes: "; 108 | foreach ($users as $a => $b) { 109 | if ($b["guild"] != 0) { 110 | $charname = "[".$b["guildtag"]."]".$b["charname"].""; 111 | } else { 112 | $charname = $b["charname"]; 113 | } 114 | $row["whosonline"] .= "$charname, "; 115 | } 116 | $row["whosonline"] = rtrim($row["whosonline"], ", "); 117 | } 118 | 119 | // And then we're done with this panel. 120 | return parsetemplate(gettemplate("panels_right"), $row); 121 | 122 | } 123 | 124 | function paneltop($loggedin = true) { 125 | 126 | global $acctrow, $userrow; 127 | if ($loggedin == true || isset($acctrow)) { 128 | 129 | if ($userrow == false) { $userrow["charname"] = "No Characters Yet"; $userrow["guild"] = 0; } 130 | //if ($acctrow["authlevel"] == 255) { $admin = " (Admin)"; } else { $admin = ""; } 131 | $admin = ""; 132 | if ($userrow["guild"] != 0) { 133 | $charname = "[".$userrow["guildtag"]."]".$userrow["charname"].""; 134 | } else { 135 | $charname = $userrow["charname"]; 136 | } 137 | $top = "
\n
$charname$admin
\n"; 138 | $top .= "[ Log Out | Account | Characters | Help ]\n"; 139 | $top .= "
\n"; 140 | 141 | } else { 142 | 143 | $top = "
\n
Not Logged In
\n"; 144 | $top .= "[ Log In | Register | Help ]\n"; 145 | $top .= "
\n"; 146 | 147 | } 148 | 149 | return $top; 150 | 151 | } 152 | 153 | function panelbottom() { 154 | 155 | global $userrow, $spells; 156 | $row = array(); 157 | 158 | if ($userrow["charpicture"] != "") { 159 | $row["charpicture"] = $userrow["charpicture"]; 160 | } else { 161 | $row["charpicture"] = "images/users/nopicture.gif"; 162 | } 163 | 164 | // Do quickspell stuff. 165 | $quickhealid = 0; 166 | $quickhealvalue = 0; 167 | if ($userrow["currentaction"] == "Exploring") { 168 | for ($i=1; $i<11; $i++) { 169 | if ($userrow["spell".$i."id"] != 0) { 170 | if ($spells[$userrow["spell".$i."id"]]["fname"] == "heal") { 171 | if ($spells[$userrow["spell".$i."id"]]["value"] > $quickhealvalue) { 172 | $quickhealvalue = $spells[$userrow["spell".$i."id"]]["value"]; 173 | $quickhealid = $spells[$userrow["spell".$i."id"]]["id"]; 174 | } 175 | } 176 | } 177 | } 178 | } 179 | if ($quickhealid != 0) { 180 | $row["quickheal"] = "(Heal)"; 181 | } else { 182 | $row["quickheal"] = ""; 183 | } 184 | 185 | // Do the rest of it. 186 | $row["level"] = $userrow["level"]; 187 | if ($userrow["levelup"] > 0) { $row["levelup"] = "(".$userrow["levelup"]." LP)"; } else { $row["levelup"] = ""; } 188 | if ($userrow["levelspell"] > 0) { $row["levelspell"] = "(".$userrow["levelspell"]." SP)"; } else { $row["levelspell"] = ""; } 189 | $row["experience"] = number_format($userrow["experience"]); 190 | $row["gold"] = number_format($userrow["gold"]); 191 | $row["weapon"] = $userrow["item1name"]; 192 | $row["armor"] = $userrow["item2name"]; 193 | $row["helmet"] = $userrow["item3name"]; 194 | $row["shield"] = $userrow["item4name"]; 195 | $row["hpbar"] = statusbars("hp", $userrow["currenthp"], $userrow["maxhp"]); 196 | $row["mpbar"] = statusbars("mp", $userrow["currentmp"], $userrow["maxmp"]); 197 | $row["tpbar"] = statusbars("tp", $userrow["currenttp"], $userrow["maxtp"]); 198 | 199 | 200 | return parsetemplate(gettemplate("panels_bottom"),$row); 201 | 202 | } 203 | 204 | function panelmiddle() { 205 | 206 | global $userrow, $townrow, $worldrow; 207 | 208 | 209 | 210 | return gettemplate("panels_middle"); 211 | 212 | } 213 | 214 | function statusbars($stat, $current, $max) { 215 | 216 | $row = array(); 217 | switch ($stat) { 218 | case "hp": 219 | $row["bigname"] = "Hit Points"; 220 | $row["littlename"] = "HP"; 221 | break; 222 | case "mp": 223 | $row["bigname"] = "Magic Points"; 224 | $row["littlename"] = "MP"; 225 | break; 226 | case "tp": 227 | $row["bigname"] = "Travel Points"; 228 | $row["littlename"] = "TP"; 229 | break; 230 | case "exp": 231 | $row["bigname"] = "Experience"; 232 | $row["littlename"] = "Exp"; 233 | break; 234 | } 235 | 236 | $row["width"] = ceil(($current / $max) * 100); 237 | if ($row["width"] >= 66) { $row["color"] = "green"; } 238 | if ($row["width"] < 66 && $row["width"] >= 33) { $row["color"] = "yellow"; } 239 | if ($row["width"] < 33) { $row["color"] = "red"; } 240 | 241 | $row["current"] = $current; 242 | $row["max"] = $max; 243 | return parsetemplate(gettemplate("statusbars"),$row); 244 | 245 | } 246 | 247 | ?> -------------------------------------------------------------------------------- /lib.php: -------------------------------------------------------------------------------- 1 | install.php and install.sql files from your game directory before continuing."); } 21 | //if (file_exists("install.sql")) { die("Please remove the install.php file from your game directory before continuing."); } 22 | 23 | // Setup for superglobal stuff that can't go in globals.php. 24 | $starttime = getmicrotime(); 25 | $numqueries = 0; 26 | $link = opendb(); 27 | $version = "Beta 5"; 28 | $bnumber = "20"; 29 | $bname = "Consolation Prize Part Deux"; 30 | $bdate = "9.2.2007"; 31 | include("lib2.php"); 32 | 33 | // Handling for servers with magic_quotes turned on. 34 | if (get_magic_quotes_gpc()) { 35 | 36 | $_POST = array_map('uber_ss', $_POST); 37 | $_GET = array_map('uber_ss', $_GET); 38 | $_COOKIE = array_map('uber_ss', $_COOKIE); 39 | 40 | } 41 | $_POST = array_map('uber_mres', $_POST); 42 | $_POST = array_map('uber_hsc', $_POST); 43 | $_GET = array_map('uber_mres', $_GET); 44 | $_GET = array_map('uber_hsc', $_GET); 45 | $_COOKIE = array_map('uber_mres', $_COOKIE); 46 | $_COOKIE = array_map('uber_hsc', $_COOKIE); 47 | 48 | function uber_ss($value) { 49 | 50 | $value = is_array($value) ? 51 | array_map('uber_ss', $value) : 52 | stripslashes($value); 53 | return $value; 54 | 55 | } 56 | 57 | function uber_mres($value) { 58 | 59 | $value = is_array($value) ? 60 | array_map('uber_mres', $value) : 61 | mysql_real_escape_string($value); 62 | return $value; 63 | 64 | } 65 | 66 | function uber_hsc($value) { 67 | 68 | $value = is_array($value) ? 69 | array_map('uber_hsc', $value) : 70 | htmlspecialchars($value); 71 | return $value; 72 | 73 | } 74 | 75 | function opendb() { // Open database connection. 76 | 77 | include("config.php"); 78 | extract($dbsettings); 79 | $link = mysql_connect($server, $user, $pass) or err(mysql_error(),true); 80 | mysql_select_db($name) or err(mysql_error(),true); 81 | return $link; 82 | 83 | } 84 | 85 | function doquery($query) { // Something of a tiny little database abstraction layer. 86 | 87 | include('config.php'); 88 | global $numqueries, $controlrow; 89 | $sqlquery = mysql_query(preg_replace('/<<([a-zA-Z0-9_\-]+)>>/', $dbsettings["prefix"].'_$1', $query)); 90 | 91 | if ($sqlquery == false) { 92 | if ($controlrow["debug"] == 1) { die(mysql_error() . "

" . $query); } else { die("A MySQL query error occurred. Please contact the game administrator for more help."); } 93 | } 94 | 95 | $numqueries++; 96 | return $sqlquery; 97 | 98 | } 99 | 100 | function dorow($sqlquery, $force = "") { // Abstraction layer part deux. 101 | 102 | switch (mysql_num_rows($sqlquery)) { 103 | 104 | case 0: 105 | $row = false; 106 | break; 107 | case 1: 108 | if ($force == "") { 109 | $row = mysql_fetch_assoc($sqlquery); 110 | } else { 111 | $temprow = mysql_fetch_assoc($sqlquery); 112 | $row[$temprow[$force]] = $temprow; 113 | } 114 | break; 115 | default: 116 | if ($force == "") { 117 | while ($temprow = mysql_fetch_assoc($sqlquery)) { 118 | $row[] = $temprow; 119 | } 120 | } else { 121 | while ($temprow = mysql_fetch_assoc($sqlquery)) { 122 | $row[$temprow[$force]] = $temprow; 123 | } 124 | } 125 | break; 126 | 127 | } 128 | 129 | return $row; 130 | 131 | } 132 | 133 | function gettemplate($templatename) { // SQL query for the template. 134 | 135 | $filename = "templates/" . $templatename . ".php"; 136 | include("$filename"); 137 | return $template; 138 | 139 | } 140 | 141 | function parsetemplate($template, $array) { // Replace template with proper content. Also does languages. 142 | 143 | foreach($array as $a => $b) { 144 | $template = str_replace("{{{$a}}}", $b, $template); 145 | } 146 | return $template; 147 | 148 | } 149 | 150 | function getmicrotime() { // Used for timing script operations. 151 | 152 | list($usec, $sec) = explode(" ",microtime()); 153 | return ((float)$usec + (float)$sec); 154 | 155 | } 156 | 157 | function is_email($email) { // Thanks to "mail(at)philipp-louis.de" from php.net! 158 | 159 | return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); 160 | 161 | } 162 | 163 | function mymail($to, $title, $body, $from = '') { // thanks to arto dot PLEASE dot DO dot NOT dot SPAM at artoaaltonen dot fi. 164 | 165 | global $controlrow; 166 | extract($controlrow); 167 | 168 | 169 | $from = trim($from); 170 | 171 | if (!$from) { 172 | $from = "<$adminemail>"; 173 | } 174 | 175 | $rp = $adminemail; 176 | $org = "$gameurl"; 177 | $mailer = "PHP"; 178 | 179 | $head = ""; 180 | $head .= "Content-Type: text/plain \r\n"; 181 | $head .= "Date: ". date('r'). " \r\n"; 182 | $head .= "Return-Path: $rp \r\n"; 183 | $head .= "From: $from \r\n"; 184 | $head .= "Sender: $from \r\n"; 185 | $head .= "Reply-To: $from \r\n"; 186 | $head .= "Organization: $org \r\n"; 187 | $head .= "X-Sender: $from \r\n"; 188 | $head .= "X-Priority: 3 \r\n"; 189 | $head .= "X-Mailer: $mailer \r\n"; 190 | 191 | $body = str_replace("\r\n", "\n", $body); 192 | $body = str_replace("\n", "\r\n", $body); 193 | 194 | return mail($to, $title, $body, $head); 195 | 196 | } 197 | 198 | function err($error, $system = false, $panels = true) { // Basic little error handler. 199 | 200 | $errmsg = "One or more errors have occurred:

$error

Please go back and try again."; 201 | display("Error", $errmsg, $panels); 202 | 203 | } 204 | 205 | function display($title, $content, $panels = true) { // Finalize page and output to browser. 206 | 207 | include('config.php'); 208 | global $controlrow, $userrow, $worldrow, $numqueries, $starttime, $version, $build; 209 | 210 | if (!isset($controlrow)) { 211 | $controlrow = dorow(doquery("SELECT * FROM <> WHERE id='1' LIMIT 1")); 212 | } 213 | 214 | // Make page tags for XHTML validation. 215 | $page = "\n" 216 | . "\n" 217 | . "\n"; 218 | $page .= gettemplate("primary"); 219 | 220 | // Setup for primary page array indexes. 221 | $row = array(); 222 | $row["gamename"] = $controlrow["gamename"]; 223 | $row["pagetitle"] = $title; 224 | $row["background"] = "background" . $userrow["world"]; 225 | $row["version"] = $version; 226 | $row["content"] = $content; 227 | $row["moddedby"] = $controlrow["moddedby"]; 228 | if ($controlrow["forumurl"] != "") { $row["forumslink"] = "Support Forums"; } else { $row["forumslink"] = ""; } 229 | if ($controlrow["debug"] == 1) { $row["debug"] = "/ " . $numqueries . " Queries / " . round(getmicrotime()-$starttime,4) . " Seconds"; } else { $row["debug"] = ""; } 230 | if ($row["moddedby"] != "") { 231 | $row["info"] = $row["moddedby"]; 232 | } else { 233 | $row["info"] = "Version " . $row["version"] . " " . $row["debug"]; 234 | } 235 | 236 | // Setup for side panels. 237 | include("panels.php"); 238 | if ($panels == true) { 239 | $row["leftnav"] = panelleft(); 240 | $row["rightnav"] = panelright(); 241 | $row["topnav"] = paneltop(true); 242 | $row["bottomnav"] = panelbottom(); 243 | $row["middlenav"] = panelmiddle(); 244 | } else { 245 | $row["leftnav"] = ""; 246 | $row["rightnav"] = ""; 247 | $row["topnav"] = paneltop(false); 248 | $row["bottomnav"] = ""; 249 | } 250 | 251 | $page = rtrim($page, "<-!"); 252 | 253 | $page .= << 255 | 256 | 257 | {{info}} 258 | 259 | 260 | {{forumslink}} 261 | 262 | 263 | Dragon Scourge © by renderse7en. 264 | 265 | 266 | 267 | 268 | 269 | THEVERYENDOFYOU; 270 | 271 | // Finalize control array for output. 272 | $page = parsetemplate($page, $row); 273 | 274 | if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } 275 | echo $page; 276 | die(); 277 | } 278 | 279 | ?> -------------------------------------------------------------------------------- /story.php: -------------------------------------------------------------------------------- 1 | > WHERE id='".$userrow["story"]."' LIMIT 1")); 21 | 22 | // Decide which type of story to run. 23 | if ($story["targetmonster"] != "0") { storymonster(); } 24 | if ($story["targetitem"] != "") { storyitem(); } 25 | storyteleport(); 26 | 27 | function storyteleport() { // Sends to a new location, or just displays a chunk of the story with no associated action. 28 | 29 | global $userrow, $story; 30 | 31 | if (isset($_POST["submit"])) { 32 | 33 | if ($story["nextstory"] != "0") { 34 | $nextstory = dorow(doquery("SELECT * FROM <> WHERE id='".$story["nextstory"]."' LIMIT 1")); 35 | $userrow["story"] = $nextstory["id"]; 36 | $userrow["storylat"] = $nextstory["latitude"]; 37 | $userrow["storylon"] = $nextstory["longitude"]; 38 | } 39 | if ($story["targetworld"] != "0") { 40 | $userrow["world"] = $story["targetworld"]; 41 | $userrow["latitude"] = $story["targetlat"]; 42 | $userrow["longitude"] = $story["targetlon"]; 43 | // Get first town from new world. 44 | $newtown = dorow(doquery("SELECT * FROM <> WHERE world='".$userrow["world"]."' ORDER BY id LIMIT 1")); 45 | $towns = explode(",",$userrow["townslist"]); 46 | $towns[] = $newtown["id"]; 47 | $userrow["townslist"] = implode(",",$towns); 48 | 49 | } 50 | if ($story["targetaction"] != "") { 51 | $userrow["currentaction"] = $story["targetaction"]; 52 | } 53 | if ($story["rewardname"] != "") { 54 | $userrow[$story["rewardname"]] += $story["rewardattr"]; 55 | } 56 | 57 | updateuserrow(); 58 | die(header("Location: index.php")); 59 | 60 | } 61 | 62 | $story["reward"] = ""; 63 | if ($story["rewardname"] != "") { 64 | $premodrow = dorow(doquery("SELECT * FROM <> ORDER BY id")); 65 | foreach($premodrow as $a=>$b) { 66 | $modrow[$b["fieldname"]] = $b; 67 | } 68 | $story["reward"] .= "
You've gained a permanent reward from this quest:
"; 69 | $story["reward"] .= $modrow[$story["rewardname"]]["prettyname"] . ": +" . $story["rewardattr"]; 70 | if ($modrow[$story["rewardname"]]["percent"] == 1) { $story["reward"] .= "%"; } 71 | $story["reward"] .= "
This reward will be applied when you continue on your adventure."; 72 | } 73 | 74 | $story["story"] = nl2br($story["story"]); 75 | display($story["title"], parsetemplate(gettemplate("story_teleport"), $story)); 76 | 77 | } 78 | 79 | function storymonster() { 80 | 81 | global $userrow, $story; 82 | 83 | if (isset($_POST["submit"])) { 84 | 85 | $monster = dorow(doquery("SELECT * FROM <> WHERE id='".$story["targetmonster"]."' LIMIT 1")); 86 | $querystring = "currentmonsterid='".$monster["id"]."', currentmonsterhp='".(ceil(rand($monster["maxhp"] * .75, $monster["maxhp"]) * $userrow["difficulty"]))."', currentaction='Fighting'"; 87 | $update = doquery("UPDATE <> SET $querystring WHERE id='".$userrow["id"]."' LIMIT 1"); 88 | die(header("Location: fight.php")); 89 | 90 | } 91 | 92 | $story["story"] = nl2br($story["story"]); 93 | display($story["title"], parsetemplate(gettemplate("story_monster"), $story)); 94 | 95 | } 96 | 97 | function storyitem() { 98 | 99 | global $userrow, $story; 100 | 101 | $modrow = dorow(doquery("SELECT * FROM <> ORDER BY id"), "fieldname"); 102 | $thenewitem = explode(",",$story["targetitem"]); 103 | $newitem = dorow(doquery("SELECT * FROM <> WHERE id='".$thenewitem[1]."' LIMIT 1")); 104 | $newprefix = dorow(doquery("SELECT * FROM <> WHERE id='".$thenewitem[0]."' LIMIT 1")); 105 | $newsuffix = dorow(doquery("SELECT * FROM <> WHERE id='".$thenewitem[2]."' LIMIT 1")); 106 | $newfullitem = builditem($newprefix, $newitem, $newsuffix, $modrow); 107 | $story["itemtable"] = parsetemplate(gettemplate("explore_drop_itemrow"), $newfullitem); 108 | 109 | if ($userrow["item".$newitem["slotnumber"]."idstring"] != "0") { 110 | $theolditem = explode(",",$userrow["item".$newitem["slotnumber"]."idstring"]); 111 | $olditem = dorow(doquery("SELECT * FROM <> WHERE id='".$theolditem[1]."' LIMIT 1")); 112 | $oldprefix = dorow(doquery("SELECT * FROM <> WHERE id='".$theolditem[0]."' LIMIT 1")); 113 | $oldsuffix = dorow(doquery("SELECT * FROM <> WHERE id='".$theolditem[2]."' LIMIT 1")); 114 | $oldfullitem = builditem($oldprefix, $olditem, $oldsuffix, $modrow); 115 | $story["olditems"] = parsetemplate(gettemplate("town_buy_olditemrow"), $oldfullitem); 116 | } else { 117 | $oldfullitem = false; $oldprefix = false; $oldsuffix = false; 118 | $story["olditems"] = "You don't have any item in this slot."; 119 | } 120 | 121 | if (isset($_POST["takeitem"])) { 122 | 123 | // Requirements check. 124 | if ($newfullitem["requirements"] == false) { err("You do not meet one or more of the requirements for this item. Please go back and try again."); } 125 | 126 | // Now do stuff to userrow (new item only). 127 | $userrow["item" . $newfullitem["slotnumber"] . "idstring"] = $newfullitem["fullid"]; 128 | $userrow["item" . $newfullitem["slotnumber"] . "name"] = $newfullitem["name"]; 129 | $userrow[$newfullitem["basename"]] += $newfullitem["baseattr"]; 130 | for($j=1; $j<7; $j++) { 131 | if ($newfullitem["mod".$j."name"] != "") { 132 | $userrow[$newfullitem["mod".$j."name"]] += $newfullitem["mod".$j."attr"]; 133 | } 134 | } 135 | if ($newprefix != false) { 136 | $userrow[$newprefix["basename"]] += $newprefix["baseattr"]; 137 | } 138 | if ($newsuffix != false) { 139 | $userrow[$newsuffix["basename"]] += $newsuffix["baseattr"]; 140 | } 141 | 142 | // Do more stuff to userrow (old item only). 143 | if ($oldfullitem != false) { 144 | 145 | $userrow[$oldfullitem["basename"]] -= $oldfullitem["baseattr"]; 146 | for($j=1; $j<7; $j++) { 147 | if ($oldfullitem["mod".$j."name"] != "") { 148 | $userrow[$oldfullitem["mod".$j."name"]] -= $oldfullitem["mod".$j."attr"]; 149 | } 150 | } 151 | if ($oldprefix != false) { 152 | $userrow[$oldprefix["basename"]] -= $oldprefix["baseattr"]; 153 | } 154 | if ($oldsuffix != false) { 155 | $userrow[$oldsuffix["basename"]] -= $oldsuffix["baseattr"]; 156 | } 157 | 158 | } 159 | 160 | if ($story["nextstory"] != "0") { 161 | $nextstory = dorow(doquery("SELECT * FROM <> WHERE id='".$story["nextstory"]."' LIMIT 1")); 162 | $userrow["story"] = $nextstory["id"]; 163 | $userrow["storylat"] = $nextstory["latitude"]; 164 | $userrow["storylon"] = $nextstory["longitude"]; 165 | } 166 | if ($story["targetworld"] != "0") { 167 | $userrow["world"] = $story["targetworld"]; 168 | $userrow["latitude"] = $story["targetlat"]; 169 | $userrow["longitude"] = $story["targetlon"]; 170 | // Get first town from new world. 171 | $newtown = dorow(doquery("SELECT * FROM <> WHERE world='".$userrow["world"]."' ORDER BY id LIMIT 1")); 172 | $towns = explode(",",$userrow["townslist"]); 173 | $towns[] = $newtown["id"]; 174 | $userrow["townslist"] = implode(",",$towns); 175 | } 176 | if ($story["targetaction"] != "") { 177 | $userrow["currentaction"] = $story["targetaction"]; 178 | } 179 | if ($story["rewardname"] != "") { 180 | $userrow[$story["rewardname"]] += $story["rewardattr"]; 181 | } 182 | 183 | updateuserrow(); 184 | die(header("Location: index.php")); 185 | 186 | } 187 | 188 | if (isset($_POST["noitem"])) { 189 | 190 | if ($story["nextstory"] != "0") { 191 | $nextstory = dorow(doquery("SELECT * FROM <> WHERE id='".$story["nextstory"]."' LIMIT 1")); 192 | $userrow["story"] = $nextstory["id"]; 193 | $userrow["storylat"] = $nextstory["latitude"]; 194 | $userrow["storylon"] = $nextstory["longitude"]; 195 | } 196 | if ($story["targetworld"] != "0") { 197 | $userrow["world"] = $story["targetworld"]; 198 | $userrow["latitude"] = $story["targetlat"]; 199 | $userrow["longitude"] = $story["targetlon"]; 200 | // Get first town from new world. 201 | $newtown = dorow(doquery("SELECT * FROM <> WHERE world='".$userrow["world"]."' ORDER BY id LIMIT 1")); 202 | $towns = explode(",",$userrow["townslist"]); 203 | $towns[] = $newtown["id"]; 204 | $userrow["townslist"] = implode(",",$towns); 205 | } 206 | if ($story["targetaction"] != "") { 207 | $userrow["currentaction"] = $story["targetaction"]; 208 | } 209 | if ($story["rewardname"] != "") { 210 | $userrow[$story["rewardname"]] += $story["rewardattr"]; 211 | } 212 | 213 | updateuserrow(); 214 | die(header("Location: index.php")); 215 | 216 | } 217 | 218 | $story["reward"] = ""; 219 | if ($story["rewardname"] != "") { 220 | $premodrow = dorow(doquery("SELECT * FROM <> ORDER BY id")); 221 | foreach($premodrow as $a=>$b) { 222 | $modrow[$b["fieldname"]] = $b; 223 | } 224 | $story["reward"] .= "
You've gained a permanent reward from this quest:
"; 225 | $story["reward"] .= $modrow[$story["rewardname"]]["prettyname"] . ": +" . $story["rewardattr"]; 226 | if ($modrow[$story["rewardname"]]["percent"] == 1) { $story["reward"] .= "%"; } 227 | $story["reward"] .= "
This reward will be applied when you continue on your adventure."; 228 | } 229 | 230 | $story["story"] = nl2br($story["story"]); 231 | display($story["title"], parsetemplate(gettemplate("story_item"), $story)); 232 | 233 | } 234 | 235 | ?> --------------------------------------------------------------------------------