Darknexz
New Member
Well if they aren't copying at all (they start at 10 to begin with) and you want them to start at the level of whatever character you have as a sample then follow this tutorial.
NOTE: This has nothing todo with triggers, quite the opposite actually, you don't want triggers in this. You are going to make skills copy from the characters, not make them from scratch.
Step 1. - Delete the trigger that copies skills...
a. Goto phpmyadmin
b. Goto query window
c. enter this:
PHP Code:
(make sure to fill in your database name)
Step 2. - Edit the account creation file...
Code:
a. Navigate to that URL, it should be similar if not the same than the one given)
b. Edit the file in notepad, and hit: Ctrl+f then enter
Code:
c. That should have brought you to this
Code:
d. Replace that with this:
Code:
NOTE: This has not been checked for bugs, but if you really need this I recommend it, for some reason the AAC won't delete the character. So disable the ability to delete characters, thats what I did... (get rid of the delete button, and action) But yeah I hope I helped someone.
ALL CREDITS TO FIRELORD OF ******
NOTE: This has nothing todo with triggers, quite the opposite actually, you don't want triggers in this. You are going to make skills copy from the characters, not make them from scratch.
Step 1. - Delete the trigger that copies skills...
a. Goto phpmyadmin
b. Goto query window
c. enter this:
PHP Code:
Code:
DROP TRIGGER IF EXISTS yourdatabasename.oncreate_players
Step 2. - Edit the account creation file...
Code:
Code:
C:\xampp\htdocs\accountmanagement.php
a. Navigate to that URL, it should be similar if not the same than the one given)
b. Edit the file in notepad, and hit: Ctrl+f then enter
Code:
Code:
$loaded_items_to_copy = $SQL->query
c. That should have brought you to this
Code:
Code:
if($player->isLoaded()) {
$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
foreach($loaded_items_to_copy as $save_item) {
$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
}
d. Replace that with this:
Code:
Code:
if($player->isLoaded()) {
$loaded_skills_to_copy = $SQL->query("SELECT * FROM player_skills WHERE player_id = ".$char_to_copy->getId()."");
foreach($loaded_skills_to_copy as $save_skills) {
$SQL->query("INSERT INTO `player_skills` (`player_id` ,`skillid` ,`value` ,`count`) VALUES ('".$player->getId()."', '".$save_skills['skillid']."', '".$save_skills['value']."', '".$save_skills['count']."');");
}
}
if($player->isLoaded()) {
$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
foreach($loaded_items_to_copy as $save_item) {
$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
}
NOTE: This has not been checked for bugs, but if you really need this I recommend it, for some reason the AAC won't delete the character. So disable the ability to delete characters, thats what I did... (get rid of the delete button, and action) But yeah I hope I helped someone.
ALL CREDITS TO FIRELORD OF ******