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

Profesje od Vipa

Kamikaz

New Member
Joined
Nov 4, 2010
Messages
112
Reaction score
0
Location
Poland
Witam.

Mam mały dylemat, ponieważ chciałem stworzyć profesje tylko i wyłącznie dla graczy posiadających Vip.

Po użyciu Vipa, gracz dostaje Storage Value:
Code:
setPlayerStorageValue(cid,21444,1)

I czy dało by rade zrobić profesje właśnie na to Storage ?? Coś na zasadzie Questa, że profesje można zrobić na quescie, tzn możliwość jej stworzenia.

Wyjaśnie:

1. Gracz z Vipem, idzie na Vip Island
2. Wchodzi do Teleportu na Profesje
3. Przechodzi Questa
4. Otwiera skrzynke
5. Pojawia sie komunikat: Odblokowałeś klasę taka i taką
6. Gracz na Acc Makerze albo w inny sposób może stworzyć postać z tą klasą


Jeśli tak się da to prosze o podpowiedzi albo przykłady.

Pozdrawiam, Kamikaz
 
Dodaj kolumne do `account` i w niej zapisuj czy ma dostęp do VIP.
Jak chcesz więcej profesji to zrób tabelę `custom_vocations` i kolumny: account_id | vocation_id | access
i przy robieniu questa dodawaj rekord.
W account makerze dodaj po prostu warunek sprawdzający czy dane account_id ma rekord w tabeli custom_vocations odpowiadający wybranej profesji.
 
Czyli jak używam Nicawa, to w character_create.php mam daodac Warunek ten co napisaleś ??

To mój character_create.php

Code:
<?php
/*
    Copyright (C) 2007 - 2008  Nicaw

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include ("../include.inc.php");

//retrieve post data
$form = new Form('character');
//check if any data was submited
if ($form->exists()){
	//load account if loged in
	$account = new Account();
	($account->load($_SESSION['account'])) or die('You need to login first. '.$account->getError());
	//create new player object
	$form->attrs['name'] = ucfirst($form->attrs['name']);
	$newplayer = new Player();
	//check for correct parameters
	if ($cfg['temple'][$form->attrs['residence']]['enabled'] && $cfg['vocations'][(int)$form->attrs['vocation']]['enabled'] && ereg("^[01]$",$form->attrs['sex'])){
		//check character number
		if (count($account->players) < $cfg['maxchars']){
			//check for valid name
			if (AAC::ValidPlayerName($form->attrs['name'])){
				$newplayer->setAttr('name',(string)$form->attrs['name']);
				//player name must not exist
				if (!$newplayer->exists()){
					//set attributes for new player
					$newplayer->setAttr('vocation',(int)$form->attrs['vocation']);
					$newplayer->setAttr('account',(int)$_SESSION['account']);
					$newplayer->setAttr('sex',(int)$form->attrs['sex']);
					$newplayer->setAttr('city',(int)$form->attrs['residence']);
					//create character and add it to account
					if ($newplayer->create()){
						$account->logAction('Created character: '.$form->attrs['name']);
						//create new message
						$msg = new IOBox('message');
						$msg->addMsg('Your character was successfuly created.');
						$msg->addRefresh('Finish');
						$msg->show();
					}else{$error = 'Error. '.$newplayer->getError();}
				}else{$error = "This name is already taken.";}
			}else{$error = "<b>Not a valid name:</b><br/><ul><li>First letter capital</li><li>At least 4 characters, at most 25</li><li>No capital letters in midlle of word</li><li>Letters A-Z, -' and spaces</li><li>Monster names not allowed</li></ul>";}
		}else{$error = "You can't have more than $cfg[maxchars] characters on your account";}
	}else{$error = "Invalid parameters.";}
	if (!empty($error)){
		//create new message
		$msg = new IOBox('message');
		$msg->addMsg($error);
		$msg->addReload('<< Back');
		$msg->addClose('OK');
		$msg->show();
	}
}else{
	//make a list of valid vocations
	while ($vocation = current($cfg['vocations'])) {
		if (isset($vocation['enabled']) && $vocation['enabled'])
			$vocations[key($cfg['vocations'])] = $vocation['name'];
		next($cfg['vocations']);
	}
	//make a list of valid spawn places
	while ($spawn = current($cfg['temple'])) {
		if (isset($spawn['enabled']) && $spawn['enabled']){
			$spawns[key($cfg['temple'])] = $spawn['name'];
		}
	    next($cfg['temple']);
	}
	//create new form
	$form = new IOBox('character');
	$form->target = $_SERVER['PHP_SELF'];
	$form->addLabel('Create Character');
	$form->addInput('name');
	$form->addSelect('sex',array(1 => 'Male', 0 => 'Female'));
	$form->addSelect('vocation',$vocations);
	$form->addSelect('residence',$spawns);
	$form->addClose('Cancel');
	$form->addSubmit('Next >>');
	$form->show();
}
?>

Jak bys to dodał ??
 
Najłatwiej. Zrób dodatkową tabliczkę (acc_voc) w account i jak dotnie gość skrzynki pojawia się tam wartość 1.
Account marker ma mieć tak zrobione:
if acc_voc == 0 daje wybór 4 profesji
else wybór 4 + twoje dodatkowe
 
Back
Top