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

Level 500.. [REP++]

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Are there any why to do like this
if u come to lvl 500 a new class will be unlocked ?
Like Ninja so u can make a new char thats a ninja if u have a char that are over 500 or 500 .. :confused:
 
You have to make a new vocations then NPC who's changing vocation if player level is >= 500.

no i mean ..
i have a new char .. and if u go over 500 + whit 1 char
its unlock a new char on the acc (Geisor) so u can make a ninja and u still have yuor 500+ char
 
SQL Query:
Code:
ALTER TABLE `accounts` ADD `ninja` INT( 1 ) NOT NULL DEFAULT '0';

Creaturescript:
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if (skill == SKILL__LEVEL and oldLevel < newLevel and newLevel == 500) then
		db.executeQuery("UPDATE `accounts` SET `ninja` = 1 WHERE `name` = ".. getPlayerAccount(cid) ..";")
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New vocation avalible for your account.\nCheck Account Managment at our website.")
	end
	return true
end

accountmanagment.php under:
Code:
					foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
					{
						$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
						if($newchar_vocation == $char_vocation_key)
							$main_content .= 'checked="checked" ';
						$main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
					}

Add:
Code:
if ($account_logged->getCustomField("ninja") == 1)
	$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="ninja">Ninja</td></tr>';
 
When i try to do the class
This error come
The Following Errors Have Occurred:
Unknown vocation. Please fill in form again.

and + when u go over 500+ the broadcast not showing + the mysql dont change.. ? to 1+ Ninja.

<event type="advance" name="ninja" event="script" value="Ninja.lua"/>

Ninja.lua
function onAdvance(cid, skill, oldLevel, newLevel)
if (skill == SKILL__LEVEL and oldLevel < newLevel and newLevel == 500) then
db.executeQuery("UPDATE `accounts` SET `ninja` = 1 WHERE `name` = ".. getPlayerAccount(cid) ..";")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New vocation avalible for your account.\nCheck Account Managment at our website.")
end
return true
end

acc geisor file
$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
if($newchar_vocation == $char_vocation_key)
$main_content .= 'checked="checked" ';
$main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
}
if ($account_logged->getCustomField("ninja") == 1)
$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="ninja">Ninja</td></tr>';
$main_content .= '</table></table></td>';
}
 
Login.lua:
Code:
registerCreatureEvent(cid, "ninja")

And about error on acc, you have to re-write checking vocations 'Cause it's checking from config.
 
SQL Query:
Code:
ALTER TABLE `accounts` ADD `ninja` INT( 1 ) NOT NULL DEFAULT '0';

Creaturescript:
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if (skill == SKILL__LEVEL and oldLevel < newLevel and newLevel == 500) then
		db.executeQuery("UPDATE `accounts` SET `ninja` = 1 WHERE `name` = ".. getPlayerAccount(cid) ..";")
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New vocation avalible for your account.\nCheck Account Managment at our website.")
	end
	return true
end

accountmanagment.php under:
Code:
					foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
					{
						$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
						if($newchar_vocation == $char_vocation_key)
							$main_content .= 'checked="checked" ';
						$main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';
					}

Add:
Code:
if ($account_logged->getCustomField("ninja") == 1)
	$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="ninja">Ninja</td></tr>';

Code:
if ($account_logged->getCustomField("ninja") == 1)
	$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="ninja">Ninja</td></tr>';

Can i not change this to like vocation id 8 or smth..
Code:
if ($account_logged->getCustomField("ninja") == 1)
	$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="ninja">Ninja</td></tr>';
 
I think a better way to do this is the following:

  1. Have the ninja vocation done but dont make it available on Gesiors AAC nor in-game account manager (if you use it).

  2. When player gets lvl 500 he receives a storage value X and a message saying something like "Congratulations on reaching lvl 500! You can now go talk to NPC Ninja (lol) and ask him to make you a new character with the unlocked 'Ninja' class/vocation!"

  3. Player goes to "NPC Ninja", and in the script you make it so if the character doesnt have that "X storage" he says "Sorry bye you havent reached lvl 500 blabla whatever".

    If the player does have the storage value, you will keep up with the conversation with that NPC just like with an in-game account manager, it will be like a "manual character creation". So it would go like:

    Player: Hi
    NPC: Hi, say 'character' if you want me to make you a new Ninja character.
    Player: character
    NPC: Great! Please give me a name for the new character!
    Player: whatevername

    Then gender, etc. just like a normal in-game account manager but without the "vocation" part ofc.

  4. When all the stuff is done, just use a SQL query to put the char with all this info on the players account, but of course you need to add the respective "security checks" on the script like making sure the Name doesnt exist already, or that the name doesnt contain illegal characters etc.

  5. Then just "Done please log out and re-enter your account to see the changes" etc. And I would suggest putting a new Z storage value on the player after this last message, to prevent abuse (making several chars), so if he talks to the npc again with that lvl 500 char the npc would say some sort of "Hey! You already made your Ninja, you need to raise another char to lvl 500 to make another Ninja!". So it would be like only 1 new Ninja char per every lvl 500 char the player gets.

And thats it, I know it might sound complicated and confusing but I honestly think it would be a lot easier to do and I think it can all be done on 1 script.

I dont think I can script that out (I suck on NPC scripting), Im just saying the idea, but there's plenty of people here who are good on NPCs and more familiar to SQL queries and such, and this idea might be easier to make by them.

Or if someone tells me how to do the "security checks" mentioned on point 4, I might be able to script the rest!

Good luck.
 
Last edited:
Back
Top