
Well, what i am trying to do is a PHP SCRIPT, that when the player insert his account/password/player's name it will add some magics depending on the str/chr that the player has. It will add a "1" to the magic line depending if it has the str/chr needed to learn it...
In example, lets say i have a spell called CRITICAL-HEAL and i want only players that have 150str and 150chr be able to learn it...so when they put their info on the PHP it will add a "1" into the number of the magic is numbered as...lets say magic CRITICAL-HEAL on magic.cfg is Magic = 105 CRITICAL-HEAL so it will add on the spot #105 a "1"
Here i leave something that looks like it, but it does it with the int that a character has.
Code: Select all
$magicline = explode('=', $lines[$sline16]);
$char_magic = trim($magicline[1]);
for ( $i = 0; $i < 100; $i++ ) {
$magic[$i] = 0;
}
if ( $new_int >= 32 ) {
if ( substr($char_magic, 0, 1 ) == 1 ) { $magic[0] = 1; } // Magic-Missile
if ( substr($char_magic, 2, 1 ) == 1 ) { $magic[2] = 1; } // Create-Food
}
if ( $new_int >= 35 ) {
if ( substr($char_magic, 1, 1 ) == 1 ) { $magic[1] = 1; } // Heal
if ( substr($char_magic, 12, 1 ) == 1 ) { $magic[12] = 1; } // Recall
if ( substr($char_magic, 23, 1 ) == 1 ) { $magic[23] = 1; } // Staminar-Recovery
if ( substr($char_magic, 24, 1 ) == 1 ) { $magic[24] = 1; } // Protection-From-Arrow
}
if ( $new_int >= 39 ) {
if ( substr($char_magic, 11, 1 ) == 1 ) { $magic[11] = 1; } // Staminar-Drain
}
if ( $new_int >= 42 ) {
if ( substr($char_magic, 10, 1 ) == 1 ) { $magic[10] = 1; } // Energy-Bolt
}
if ( $new_int >= 44 ) {
if ( substr($char_magic, 14, 1 ) == 1 ) { $magic[14] = 1; } // Celebrating-Light
}
if ( $new_int >= 46 ) {
if ( substr($char_magic, 13, 1 ) == 1 ) { $magic[13] = 1; } // Defense-Shield
if ( substr($char_magic, 20, 1 ) == 1 ) { $magic[20] = 1; } // Fire-Ball
if ( substr($char_magic, 25, 1 ) == 1 ) { $magic[25] = 1; } // Hold-Person
if ( substr($char_magic, 26, 1 ) == 1 ) { $magic[26] = 1; } // Possession
}
if ( $new_int >= 49 ) {
if ( substr($char_magic, 21, 1 ) == 1 ) { $magic[21] = 1; } // Great-Heal
}
if ( $new_int >= 51 ) {
if ( substr($char_magic, 27, 1 ) == 1 ) { $magic[27] = 1; } // Poison
}
if ( $new_int >= 53 ) {
if ( substr($char_magic, 28, 1 ) == 1 ) { $magic[28] = 1; } // Great-Staminar-Recov.
if ( substr($char_magic, 32, 1 ) == 1 ) { $magic[32] = 1; } // Invisibility
if ( substr($char_magic, 34, 1 ) == 1 ) { $magic[34] = 1; } // Detect-Invisibility
}
if ( $new_int >= 56 ) {
if ( substr($char_magic, 33, 1 ) == 1 ) { $magic[33] = 1; } // Protection-From-Magic
}
if ( $new_int >= 58 ) {
if ( substr($char_magic, 38, 1 ) == 1 ) { $magic[38] = 1; } // Tremor
}
if ( $new_int >= 60 ) {
if ( substr($char_magic, 30, 1 ) == 1 ) { $magic[30] = 1; } // Fire-Strike
}
if ( $new_int >= 61 ) {
if ( substr($char_magic, 36, 1 ) == 1 ) { $magic[36] = 1; } // Cure
}
if ( $new_int >= 63 ) {
if ( substr($char_magic, 35, 1 ) == 1 ) { $magic[35] = 1; } // Paralyze
}
if ( $new_int >= 67 ) {
if ( substr($char_magic, 31, 1 ) == 1 ) { $magic[31] = 1; } // Summon-Creature
if ( substr($char_magic, 37, 1 ) == 1 ) { $magic[37] = 1; } // Lightning-Arrow
}
if ( $new_int >= 79 ) {
if ( substr($char_magic, 40, 1 ) == 1 ) { $magic[40] = 1; } // Fire-Wall
if ( substr($char_magic, 47, 1 ) == 1 ) { $magic[47] = 1; } // Triple-Energy-Bolt
}
if ( $new_int >= 81 ) {
if ( substr($char_magic, 44, 1 ) == 1 ) { $magic[44] = 1; } // Great-Defense-Shield
}
if ( $new_int >= 82 ) {
if ( substr($char_magic, 43, 1 ) == 1 ) { $magic[43] = 1; } // Lightning
}
if ( $new_int >= 84 ) {
if ( substr($char_magic, 41, 1 ) == 1 ) { $magic[41] = 1; } // Fire-Field
}
if ( $new_int >= 86 ) {
if ( substr($char_magic, 46, 1 ) == 1 ) { $magic[46] = 1; } // Poison-Cloud
}
if ( $new_int >= 88 ) {
if ( substr($char_magic, 45, 1 ) == 1 ) { $magic[45] = 1; } // Chill-Wind
}
if ( $new_int >= 91 ) {
if ( substr($char_magic, 53, 1 ) == 1 ) { $magic[53] = 1; } // Mass-Poison
}
if ( $new_int >= 93 ) {
if ( substr($char_magic, 56, 1 ) == 1 ) { $magic[56] = 1; } // Mass-Lightning-Arrow
}
if ( $new_int >= 98 ) {
if ( substr($char_magic, 54, 1 ) == 1 ) { $magic[54] = 1; } // Spike-Field
}
if ( $new_int >= 102 ) {
if ( substr($char_magic, 51, 1 ) == 1 ) { $magic[51] = 1; } // Lightning-Bolt
}
if ( $new_int >= 103 ) {
if ( substr($char_magic, 50, 1 ) == 1 ) { $magic[50] = 1; } // Berserk
if ( substr($char_magic, 55, 1 ) == 1 ) { $magic[55] = 1; } // Ice-Storm
}
if ( $new_int >= 105 ) {
if ( substr($char_magic, 57, 1 ) == 1 ) { $magic[57] = 1; } // Ice-Strike
}
if ( $new_int >= 117 ) {
if ( substr($char_magic, 60, 1 ) == 1 ) { $magic[60] = 1; } // Energy-Strike
}
if ( $new_int >= 149 ) {
if ( substr($char_magic, 61, 1 ) == 1 ) { $magic[61] = 1; } // Mass-Fire-Strike
}
if ( $new_int >= 156 ) {
if ( substr($char_magic, 42, 1 ) == 1 ) { $magic[42] = 1; } // Mass-Staminar-Recov.
}
if ( $new_int >= 163 ) {
if ( substr($char_magic, 63, 1 ) == 1 ) { $magic[63] = 1; } // Mass-Chill-Wind
}
if ( $new_int >= 170 ) {
if ( substr($char_magic, 64, 1 ) == 1 ) { $magic[64] = 1; } // Earthworm-Strike
if ( substr($char_magic, 66, 1 ) == 1 ) { $magic[66] = 1; } // Armor-Break
}
if ( $new_int >= 184 ) {
if ( substr($char_magic, 70, 1 ) == 1 ) { $magic[70] = 1; } // Bloody-Shock-Wave
}
if ( $new_int >= 196 ) {
if ( substr($char_magic, 62, 1 ) == 1 ) { $magic[62] = 1; } // Mass-Heal
}
if ( $new_int >= 321 ) {
if ( substr($char_magic, 65, 1 ) == 1 ) { $magic[65] = 1; } // Absolute-magic-Protect.
}
if ( $new_int >= 210 ) {
if ( substr($char_magic, 73, 1 ) == 1 ) { $magic[73] = 1; } // Cloud-Kill
}
if ( $new_int >= 215 ) {
if ( substr($char_magic, 74, 1 ) == 1 ) { $magic[74] = 1; } // Lightning-Strike
}
if ( $new_int >= 228 ) {
if ( substr($char_magic, 71, 1 ) == 1 ) { $magic[71] = 1; } // Mass-Confusion
}
if ( $new_int >= 233 ) {
if ( substr($char_magic, 72, 1 ) == 1 ) { $magic[72] = 1; } // Mass-Ice-Strike
}
if ( $new_int >= 341 ) {
if ( substr($char_magic, 76, 1 ) == 1 ) { $magic[76] = 1; } // Cancellation
}
if ( $new_int >= 257 ) {
if ( substr($char_magic, 77, 1 ) == 1 ) { $magic[77] = 1; } // Great-Berserk
}
if ( $new_int >= 263 ) {
if ( substr($char_magic, 80, 1 ) == 1 ) { $magic[80] = 1; } // Illusion
}
if ( $new_int >= 350 ) {
if ( substr($char_magic, 81, 1 ) == 1 ) { $magic[81] = 1; } // Armageddon
}
if ( $new_int >= 315 ) {
if ( substr($char_magic, 83, 1 ) == 1 ) { $magic[83] = 1; } // Inhibition-Casting
if ( substr($char_magic, 90, 1 ) == 1 ) { $magic[90] = 1; } // Mass-Illusion
}
if ( $new_int >= 324 ) {
if ( substr($char_magic, 82, 1 ) == 1 ) { $magic[82] = 1; } // Mass-Magic-Missile
}
if ( $new_int >= 341 ) {
if ( substr($char_magic, 91, 1 ) == 1 ) { $magic[91] = 1; } // Blizzard
if ( substr($char_magic, 95, 1 ) == 1 ) { $magic[95] = 1; } // Mass-Illusion-Movement
}
if ( $new_int >= 350 ) {
if ( substr($char_magic, 96, 1 ) == 1 ) { $magic[96] = 1; } // Earth-Shock-Wave
if ( substr($char_magic, 97, 1 ) == 1 ) { $magic[97] = 1; } // Absolute-Physical-Prot.
}
$char_magic = 'magic-mastery = ';
foreach ( $magic as $val ) {
$char_magic .= $val;
}
$char_magic .= '
';
$lines[$sline16] = $char_magic;
P.D: Wait answers.