• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior AAC] Quest System (beta)

Kask

Banned User
Joined
Jan 3, 2008
Messages
376
Reaction score
1
Hello everybody, iam newbie on .php and .sql fuctions and i will release a new code for OWN QUESTS, now it is beta, i will put a new features in a future.

What news in quest system?
- archive questsql.sql ^.-
- Only showing tables from DB (Level - Description - Rewards)
- Quest WITHOUT query SQL (Script by Zonet - Idea Chojrak)

What future features on quest system?
- Add/Delete/Edit in same archive
- What monsters will be on a "quest" (showing on tables with .gif)
- Try put a small image on "Rewards" from items.

Preview Photo:
heher.jpg


Copy codes:
go to xampp/htdocs/ and create a archive with this name quest.php and put this:
PHP:
<?php
/* Idea/Script make by Kargen, Little fixed on query for SHOW IT by Xampy (Thanks :*)*/	
$main_content .= '<br><table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr bgcolor='.$config['site']['vdarkborder'].'>
<td colspan="2"><b><center>Quests</center></b></td>
</tr></table>';
$main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="'.$config['site']['lightborder'].'"><td width="15%"><center><b>Level</b></center></td><td width="65%"><b><center>Description</center></b></td><td width="20%"><center><b>Rewards</b></center></td></tr>';
$show = $SQL->query("SELECT * FROM `z_quest_system` ORDER BY `lvl` ASC");
$qcolour = 0;
foreach($show as $qresult) {
                        if(is_int($qcolour / 2))
                    $bgcolor = $config['site']['darkborder'];
                else
                    $bgcolor = $config['site']['lightborder'];
        $qcolour++;
$main_content .= '<tr bgcolor="'.$bgcolor.'"><td><center><b><i>'.$qresult['lvl'].'</i></b></center></td><td>'.$qresult['descrip'].'</td><td>'.$qresult['rewards'].'</td></tr>';
}
$main_content.= '</table>';
$main_content.= '<div align="right"><small><b>Creator Code: <a href="http://otland.net/members/kargen/">Kargen</a></b></small></div><br />';
?>
and after you add in you htdocs the document, go to you http://xx.xx.xx.xx/phpmyadmin and add this SQL tables.
Code:
CREATE TABLE IF NOT EXISTS `z_quest_system` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lvl` varchar(32) DEFAULT NULL,
  `descrip` varchar(255) DEFAULT NULL,
  `rewards` varchar(255) DEFAULT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;

INSERT INTO z_quest_system VALUES (NULL, '50', 'Example Description',
  'Royal Helmet');
for add a new table for a quest insert only this SQL table
Code:
INSERT INTO z_quest_system VALUES (NULL, '50', 'Example Description',
  'Royal Helmet');

on index.php add:
PHP:
	 	case "questsystem";
  	        $topic = "Quest System";
 	        $subtopic = "questsystem";
 	        include("quest.php");
	break;
Script without sql querys:
PHP:
   <?php
/* Scrip by zonet */
$quests = array ( 
    1 => array ( "name" => "Demon Helmet", "level" => 100, "description" => "Write your description here", "reward" => "Demon Helmet, Demon Shield, Boots of haste"),
    2 => array ( "name" => "Annihilator", "level" => 100, "description" => "4 Peoples needed!", "reward" => "Magic Sword, Stonecutter Axe, Demon Armor, Present(choose 1)"),
    3 => array ( "name" => "Pits of Inferno", "level" => 100, "description" => "Very hard quest. You need a big team to do this quest, the quest is long too!", "reward" => "dont know xD")
);
        
                    

$main_content .= '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
            <tr bgcolor="'. $config['site']['vdarkborder'] .'" style="color: white;"><th width="5%">Level</th><th width="15%">Quest Name</th><th width="40%">Description</th><th width="20%">Reward</th></tr>';
$row = 1;
    foreach($quests as $quest) {
        $bgcolor = ($row % 2 ? $config['site']['lightborder'] : $config['site']['darkborder']);
        $row++;
        $main_content .= '<tr bgcolor="'. $bgcolor .'"><td>'. $quest['level'] .'</td><td> '. $quest['name'] .'</td><td>'. $quest['description'] .'</td><td> '. $quest['reward'] .' </td></tr>';

    }    
$main_content .= '</table><small><b>Script by <a href="http://otland.net/members/zonet" target="_blank">Zonet</a> Idea by <a href="http://otland.net/members/kargen">Kargen</a> and <a href="http://otland.net/members/chojrak">Chojrak</a></b></small>';
?>
Credits for this script:
Kargen (Idea and Creator of script/SQL)
Xampy (Little fixed on query :D)
Chojrak (Idea from Quest System without querys)
Zonet (Scripter from quest system without querys)

if you like my work, please dont dude and give me rep+, thanks.
 
Last edited:
Good work!

But why make it so hard? I mean, just edit the commands from Zonet?
 
Last edited:
i dont edit nothing =) i remake script with 0, only i read any tutorials and etc etc for create this code :D and xampyy help me with the query hehe (its beta remember) i dont finish script.
 
i dont edit nothing =) i remake script with 0, only i read any tutorials and etc etc for create this code :D and xampyy help me with the query hehe (its beta remember) i dont finish script.

I didn't said you edited, just said that you could made this a lot easier for both you and ppl, but as I said "Good work" :)
 
aaaa =) THANKS hehehe iam to need learning english xD

REP REP :p
 
Isn't simple array faster than MySQL Query? ;d

Code:
<?PHP
	$quests = array(
		1 => array("level" => 20, "name" => "Desert Quest", "description" => "Bla bla bla...")
	);

	foreach($quests as $quest)
		echo "<tr><td>{$quest['level']}</td><td>{$quest['name']}</td><td>{$quest['description']}</td></tr>";

?>
 
xD yap, but see future features =) i will put ADD/MODIFY/DELETE and put gifts and etc...
and too automatic detect and order by level, example:
20
30
40
50 :p

on code:
lol nice simple fastly code 0o
 
Last edited:
Chojrak: or even better use quest status shower array(some time ago moved to gesior config)it just need small edit(adding comments)
 
xD yap, but see future features =) i will put ADD/MODIFY/DELETE and put gifts and etc...
and too automatic detect and order by level, example:
20
30
40
50 :p

on code:
lol nice simple fastly code 0o

add/modify/delete, simple adding new array in main array? xd
 
add/modify/delete, simple adding new array in main array? xd

i dont expert (learn first post after reply please) i say iam newbie on php...

EDIT:

but... all users from otland.net or another users dont know .php and the easy fuctions, and i try to fix for easy and automatic code .php hehe

if you dont undestand me, i will use traductor xD
 
Last edited:
could also put a picture as a nanny which thumbnail and when you give the photo to take you where is located the big quest? o_O
 
Up:Error tranlation xDD
in a small box one picture...and when you give the photo to take you where is located the big .
 
Better version, no sql :p
PHP:
<?php
/* Scrip by zonet */
$quests = array ( 
	1 => array ( "name" => "Demon Helmet", "level" => 100, "description" => "Write your description here", "reward" => "Demon Helmet, Demon Shield, Boots of haste"),
	2 => array ( "name" => "Annihilator", "level" => 100, "description" => "4 Peoples needed!", "reward" => "Magic Sword, Stonecutter Axe, Demon Armor, Present(choose 1)"),
	3 => array ( "name" => "Pits of Inferno", "level" => 100, "description" => "Very hard quest. You need a big team to do this quest, the quest is long too!", "reward" => "dont know xD")
);
		
					

$main_content .= '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
            <tr bgcolor="'. $config['site']['vdarkborder'] .'" style="color: white;"><th width="5%">Level</th><th width="15%">Quest Name</th><th width="40%">Description</th><th width="20%">Reward</th></tr>';
$row = 1;
	foreach($quests as $quest) {
		$bgcolor = ($row % 2 ? $config['site']['lightborder'] : $config['site']['darkborder']);
		$row++;
		$main_content .= '<tr bgcolor="'. $bgcolor .'"><td>'. $quest['level'] .'</td><td> '. $quest['name'] .'</td><td>'. $quest['description'] .'</td><td> '. $quest['reward'] .' </td></tr>';

	}	
$main_content .= '</table><small><b>Script by <a href="http://otland.net/members/zonet" target="_blank">Zonet</a></b></small>';
?>
 
update on main thread.

*Added Zonet script, without sql querys.
 
Back
Top