diff --git a/mojotrollz/api/char/charcreation.php b/mojotrollz/api/char/charcreation.php index ece1ffd..ca5206c 100644 --- a/mojotrollz/api/char/charcreation.php +++ b/mojotrollz/api/char/charcreation.php @@ -3,7 +3,7 @@ class charcreation { const DEFAULT_CHAR_NAME = 'Charactername'; const DEFAULT_CHAR_GENDER = 'default'; const DEFAULT_CHAR_RACE = 'default'; - const DEFAULT_CHAR_CLASS = 'default'; + const DEFAULT_CHAR_CLASS = 0; const MOJO_CC_SESSIONKEY = 'mojo_charcreation'; const DEFAULT_CHAR_APPEARANCE = 0; public static function data($json = NULL){ @@ -38,14 +38,14 @@ class charcreation { public static function checkClassRace($class,$race){ switch($race){ - case 'human': return in_array($class, array('warrior', 'rogue', 'priest', 'mage', 'warlock', 'paladin')); - case 'ork': return in_array($class, array('warrior', 'hunter', 'shaman', 'rogue', 'warlock')); - case 'dwarf': return in_array($class, array('warrior', 'hunter', 'rogue', 'priest', 'paladin')); - case 'undead': return in_array($class, array('warrior', 'rogue', 'priest', 'mage', 'warlock')); - case 'nightelf': return in_array($class, array('warrior', 'hunter', 'rogue', 'priest', 'druid')); - case 'tauren': return in_array($class, array('warrior', 'hunter', 'shaman', 'druid')); - case 'gnome': return in_array($class, array('warrior', 'rogue', 'mage', 'warlock')); - case 'troll': return in_array($class, array('warrior', 'hunter', 'shaman', 'rogue', 'priest', 'mage')); + case 'human': return in_array($class, array(player_classes::WARRIOR, player_classes::ROGUE, player_classes::PRIEST, player_classes::MAGE, player_classes::WARLOCK, player_classes::PALADIN)); + case 'ork': return in_array($class, array(player_classes::WARRIOR, player_classes::HUNTER, player_classes::SHAMAN, player_classes::ROGUE, player_classes::WARLOCK)); + case 'dwarf': return in_array($class, array(player_classes::WARRIOR, player_classes::HUNTER, player_classes::ROGUE, player_classes::PRIEST, player_classes::PALADIN)); + case 'undead': return in_array($class, array(player_classes::WARRIOR, player_classes::ROGUE, player_classes::PRIEST, player_classes::MAGE, player_classes::WARLOCK)); + case 'nightelf': return in_array($class,array(player_classes::WARRIOR, player_classes::HUNTER, player_classes::ROGUE, player_classes::PRIEST, player_classes::DRUID)); + case 'tauren': return in_array($class, array(player_classes::WARRIOR, player_classes::HUNTER, player_classes::SHAMAN, player_classes::DRUID)); + case 'gnome': return in_array($class, array(player_classes::WARRIOR, player_classes::ROGUE, player_classes::MAGE, player_classes::WARLOCK)); + case 'troll': return in_array($class, array(player_classes::WARRIOR, player_classes::HUNTER, player_classes::SHAMAN, player_classes::ROGUE, player_classes::PRIEST, player_classes::MAGE)); default: return false; } } diff --git a/mojotrollz/page/wizard_skills/css/wizard_skills.css b/mojotrollz/api/char/css/skilltree.css similarity index 85% rename from mojotrollz/page/wizard_skills/css/wizard_skills.css rename to mojotrollz/api/char/css/skilltree.css index 59a4e28..7a5461d 100644 --- a/mojotrollz/page/wizard_skills/css/wizard_skills.css +++ b/mojotrollz/api/char/css/skilltree.css @@ -1,13 +1,13 @@ -body{ - font-family: Verdana, Helvetica, Arial, sans-serif; - font-size: 12px; - background-color: #000000; - color: #FFFFFF; - margin: 0px; - padding: 0px; +.skilltree { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 12px; + background-color: #000000; + color: #FFFFFF; + margin: 0px; + padding: 0px; } -input +.skilltree input { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10px; @@ -19,7 +19,7 @@ input border-TOP: #6F6D67 1px solid; } -.stdText +.skilltree stdText { font-family:Verdana, Helvetica, Arial, sans-serif; color:#FFFFFF; @@ -27,7 +27,7 @@ input font-weight:normal; } -a:link +.skilltree a:link { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10px; @@ -36,7 +36,7 @@ a:link text-decoration: none; } -a:active +.skilltree a:active { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10px; @@ -45,7 +45,7 @@ a:active text-decoration: none; } -a:hover +.skilltree a:hover { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10px; @@ -54,7 +54,7 @@ a:hover text-decoration: underline; } -a:visited +.skilltree a:visited { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 10px; @@ -86,16 +86,16 @@ a:visited .icon_text_green{color: rgb(46, 255, 0);} .icon_text_yellow{color: rgb(255, 209, 0);} -.icon_arrow_gray_down{background-position: 0px 0px;} -.icon_arrow_gray_down_right{background-position: -65px 0px;} +.icon_arrow_grey_down{background-position: 0px 0px;} +.icon_arrow_grey_down_right{background-position: -65px 0px;} .icon_arrow_yellow_down{background-position: -130px 0px;} .icon_arrow_yellow_down_right{background-position: -195px 0px;} .icon_border_grey{background-position: 0px 0px;} -.icon_border_gray_inc_left{background-position: 0px -402px;} -.icon_border_gray_inc{background-position: 0px -268px;} -.icon_border_gray_down{background-position: 0px -201px;} -.icon_border_gray_down_right{background-position: 0px -469px;} +.icon_border_grey_inc_left{background-position: 0px -402px;} +.icon_border_grey_inc{background-position: 0px -268px;} +.icon_border_grey_down{background-position: 0px -201px;} +.icon_border_grey_down_right{background-position: 0px -469px;} .icon_border_green{background-position: -65px 0px;} .icon_border_green_right{background-position: -65px -134px;} @@ -145,7 +145,7 @@ a:visited .talentheader {width: 300px; border-bottom:0px solid #002B55;background-image: url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=skilltree&id=tableheader.png);} .talentheader div{padding-right:20px;background-repeat:no-repeat;background-position:bottom right;height:41px;width:209px;float:left;} .talentheader strong{font-weight:bold;display:block;padding-left:18px;padding-top:14px;vertical-align:bottom;} -.talentheader img {margin-top:11px; cursor:pointer; background-image:url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=skilltree&id=resetbutton.png);} +.talentheader img {height: 20px; width: 59px; margin-top:11px; cursor:pointer; background:url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=skilltree&id=resetbutton.png) no-repeat;} .outerbg{border:0px solid #002B55;background-color:#002B55; padding-left: 12px;} .talent_icon{ diff --git a/mojotrollz/api/char/js/skilltree.js b/mojotrollz/api/char/js/skilltree.js new file mode 100644 index 0000000..7908d15 --- /dev/null +++ b/mojotrollz/api/char/js/skilltree.js @@ -0,0 +1,114 @@ +var points_max = 51; +var points_spent_t1 = 0; +var points_spent_t2 = 0; +var points_spent_t3 = 0; + +function skilltree(){ + $('.icon').mousedown(function(event) { + event.preventDefault(); + var id = '#'+this.id; + var id_count = '#'+this.id +'c'; + var id_img = '#'+this.id +'i'; + switch (event.which) { + case 1: + if(!is_point_max() && !is_icon_max(id_count)){ + write_icon_cur(id_count,id_img,1);} + break; + case 2: + //alert('Middle Mouse button pressed.'); + break; + case 3: + if(!is_icon_min(id_count)){ + write_icon_cur(id_count,id_img,-1);} + break; + default: + //alert('You have a strange Mouse!'); + } + }); +} + +function is_point_max(){ + return points_max <= points_spent_t1 + points_spent_t2 +points_spent_t3;} +function is_icon_max(id){ + return $(id).attr('max') <= $(id).attr('cur');} +function is_icon_min(id){ + return 0 >= $(id).attr('cur');} +function write_icon_cur(id,id_img,amount){ + current = $(id).attr('cur'); + current = parseInt(current)+amount; + $(id).attr('cur',current); + $(id).html(current+'/'+$(id).attr('max')); + if(is_icon_max(id)){ + write_icon_yellow(id,id_img); + } else { + write_icon_green(id,id_img); + } +} +function write_icon_green(id,id_img){ + $(id).removeClass('icon_text_yellow'); + $(id).addClass('icon_text_green'); + + if( $(id).hasClass('icon_border_grey') || + $(id).hasClass('icon_border_yellow')){ + $(id_img).removeClass('icon_border_grey'); + $(id_img).removeClass('icon_border_yellow'); + $(id_img).addClass('icon_border_green');} + + if( $(id).hasClass('icon_border_grey_down') || + $(id).hasClass('icon_border_yellow_down')){ + $(id_img).removeClass('icon_border_grey_down'); + $(id_img).removeClass('icon_border_yellow_down'); + $(id_img).addClass('icon_border_green_down');} + + if( $(id).hasClass('icon_border_grey_down_right') || + $(id).hasClass('icon_border_yellow_down_right')){ + $(id_img).removeClass('icon_border_grey_down_right'); + $(id_img).removeClass('icon_border_yellow_down_right'); + $(id_img).addClass('icon_border_green_down_right');} + + if( $(id).hasClass('icon_border_grey_inc') || + $(id).hasClass('icon_border_yellow_inc')){ + $(id_img).removeClass('icon_border_grey_inc'); + $(id_img).removeClass('icon_border_yellow_inc'); + $(id_img).addClass('icon_border_green_inc');} + + if( $(id).hasClass('icon_border_grey_inc_left') || + $(id).hasClass('icon_border_yellow_inc_left')){ + $(id_img).removeClass('icon_border_grey_inc_left'); + $(id_img).removeClass('icon_border_yellow_inc_left'); + $(id_img).addClass('icon_border_green_inc_left');} +} +function write_icon_yellow(id,id_img){ + $(id).removeClass('icon_text_green'); + $(id).addClass('icon_text_yellow'); + + if( $(id).hasClass('icon_border_grey') || + $(id).hasClass('icon_border_green')){ + $(id_img).removeClass('icon_border_grey'); + $(id_img).removeClass('icon_border_green'); + $(id_img).addClass('icon_border_yellow');} + + if( $(id).hasClass('icon_border_grey_down') || + $(id).hasClass('icon_border_green_down')){ + $(id_img).removeClass('icon_border_grey_down'); + $(id_img).removeClass('icon_border_green_down'); + $(id_img).addClass('icon_border_yellow_down');} + + if( $(id).hasClass('icon_border_grey_down_right') || + $(id).hasClass('icon_border_green_down_right')){ + $(id_img).removeClass('icon_border_grey_down_right'); + $(id_img).removeClass('icon_border_green_down_right'); + $(id_img).addClass('icon_border_yellow_down_right');} + + if( $(id).hasClass('icon_border_grey_inc') || + $(id).hasClass('icon_border_green_inc')){ + $(id_img).removeClass('icon_border_grey_inc'); + $(id_img).removeClass('icon_border_green_inc'); + $(id_img).addClass('icon_border_yellow_inc');} + + if( $(id).hasClass('icon_border_grey_inc_left') || + $(id).hasClass('icon_border_green_inc_left')){ + $(id_img).removeClass('icon_border_grey_inc_left'); + $(id_img).removeClass('icon_border_green_inc_left'); + $(id_img).addClass('icon_border_yellow_inc_left');} +} \ No newline at end of file diff --git a/mojotrollz/api/char/skilltree.php b/mojotrollz/api/char/skilltree.php index 8e7fd16..54896cb 100644 --- a/mojotrollz/api/char/skilltree.php +++ b/mojotrollz/api/char/skilltree.php @@ -1,5 +1,5 @@ $id, @@ -29,7 +37,8 @@ class skilltree{ 'type' => $res[$count]['type'], 'border' => $res[$count]['border'], 'text_color' => $text_color, - 'max' => $max)); + 'max_text' => $max_text, + 'max' => $res[$count]['max'])); $count++; } else { @@ -40,7 +49,8 @@ class skilltree{ 'type' => 'talent_icon', 'border' => '', 'text_color' => '', - 'max' => '')); + 'max_text' => '', + 'max' => 0)); } if($c == 4){ @@ -48,7 +58,6 @@ class skilltree{ } } } - return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'char/tpl/skilltree.tpl'), $vars); } } diff --git a/mojotrollz/api/char/tpl/skilltree.tpl b/mojotrollz/api/char/tpl/skilltree.tpl index a405177..9187d4b 100644 --- a/mojotrollz/api/char/tpl/skilltree.tpl +++ b/mojotrollz/api/char/tpl/skilltree.tpl @@ -1,4 +1,4 @@ - +
- - - + + +
@@ -29,8 +29,8 @@
${tree1}${tree2}${tree3}${tree1}${tree2}${tree3}
\ No newline at end of file diff --git a/mojotrollz/api/char/tpl/skilltree_icon.tpl b/mojotrollz/api/char/tpl/skilltree_icon.tpl index 38e83c3..18255f8 100644 --- a/mojotrollz/api/char/tpl/skilltree_icon.tpl +++ b/mojotrollz/api/char/tpl/skilltree_icon.tpl @@ -1,4 +1,4 @@
- -
${max}
+ +
${max_text}
\ No newline at end of file diff --git a/mojotrollz/api/database/player_classes.php b/mojotrollz/api/database/player_classes.php new file mode 100644 index 0000000..3437d37 --- /dev/null +++ b/mojotrollz/api/database/player_classes.php @@ -0,0 +1,54 @@ +'. ''. ''. + ''. ''. - ''; + ''. + ''; } private function css (){ return ''. ''. ''. - ''; + ''; } public function html(){ diff --git a/mojotrollz/page/user_start/user_start.php b/mojotrollz/page/user_start/user_start.php index cd67e12..1c5fb7f 100644 --- a/mojotrollz/page/user_start/user_start.php +++ b/mojotrollz/page/user_start/user_start.php @@ -1,38 +1,11 @@ get_race($char['race']); - $vars['count'] = $char['count']; - $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/char_stats_realm.tpl'), $vars); - } + $chars = \DBD\CHAR_STATS::QA(); + $vars = array(); + $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/char_stats_realm.tpl'), $vars); return $result; } diff --git a/mojotrollz/page/wizard_details/details.tpl b/mojotrollz/page/wizard_details/details.tpl index f0e6d54..9ddfc2e 100644 --- a/mojotrollz/page/wizard_details/details.tpl +++ b/mojotrollz/page/wizard_details/details.tpl @@ -25,19 +25,19 @@
- - + +
- - + +
- - + +
- - + +
- +