• 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!

[Website] Quest System on Multi Worlds

Kungenn

Veteran OT User
Joined
Jun 10, 2007
Messages
1,623
Reaction score
281
Location
USA California
Okay so this is my problem.


I use Gesior Acc and I've added the quest system thingie that shows if a player has completed a quest or not.

However since I use two worlds one being worldid 0 and the other worldid 1 my question is if its possible to make so that when a player gets looked up on the website

If hes from World 0 , it'll show quests from world 0 cause there I have real map quests.

and if hes from World 1 it'll show my custom quests.



This is how I fixed it for now

Code:
			//quest status by ballack13
			$id = $player->getCustomField("id");
			$number_of_quests = 0;
			$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Reign Quests</B></TD></TD align="right"></TD></TR>';		
                        [color=red]$quests = $config['site']['quests'];[/color]
                        foreach ($quests as $storage => $name) {
				if(is_int($number_of_quests / 2))
					$bgcolor = $config['site']['darkborder'];
				else
					$bgcolor = $config['site']['lightborder'];
				$number_of_quests++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=95%>'.$storage.'</TD>';
                        $quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch();
                           if($quest == false) {
			$main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR>';
                        }
			else
			{
			$main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR>';
			}
			}
			//quest status by ballack13
			$id = $player->getCustomField("id");
			$number_of_quests = 0;
			$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Nevila Quests</B></TD></TD align="right"></TD></TR>';		
                        [color=red]$quests = $config['site']['quests0'];[/color]
                        foreach ($quests as $storage => $name) {
				if(is_int($number_of_quests / 2))
					$bgcolor = $config['site']['darkborder'];
				else
					$bgcolor = $config['site']['lightborder'];
				$number_of_quests++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=95%>'.$storage.'</TD>';
                        $quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch();
                           if($quest == false) {
			$main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR>';
                        }
			else
			{
			$main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR>';
			}
			}

I highlighted the lines that is relevant in the code with RED



But then all quests is shown when you look up a character I would like it to only show the quests from the world which the player plays on.

Here is my config from gesior.
Code:
$config['site']['quests'] = array('Vampire Shield - Dragon Lance' => 6023,'Demon Helmet' => 6024,'Orc Fortress' => 6020,'Circle Room Quest' => 4002,'Deeper Fibula' => 6101,'Black Knight' => 2487,'Crusader Helmet' => 6027,'Desert Quest' => 9903,'Bright Sword' => 9901,'Fire Axe' => 6035,'Behemoth Quest' => 6105,'Darashia Life Ring' => 6352,'The Queen of the Banshees' => 6011,'The Postman Mission Quests' => 5001,'Mad Mage Room Quest' => 6133,'Demon Oak Quest' => 50090,'Annihilator' => 100,'The Inquisition Quest' => 50301,'Naginata Quest' => 6018,'Medusa Shield Quest' => 6030,'Pits of Inferno' => 5050,'Helmet of the Ancient Quest' => 431231,'Dwarven Armor Quest' => 6776,'Draconia Quest' => 6369); // list of quests, 'questname' => storage-id,


$config['site']['quests0'] = array('Merlin\'s Request Level 8' => 5001, 'Egwin\'s Treasure Level 30' => 30007); // list of quests, 'questname' => storage-id,

If Im not clear enough with what it is Im after please reply and I'll try to be more specific.

However I think that the code would be like this or so. Just dont know how to make it.


But
if player is from worldid="0" show quests
if player is from worldid="1" show quests0


Thanks in advance!
 
Back
Top